Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/helper/Puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ class Puppeteer extends Helper {
const els = await this._locate(locator)
const array = []
for (let index = 0; index < els.length; index++) {
const a = await this._evaluateHandeInContext((el, attr) => el[attr] || el.getAttribute(attr), els[index], attr)
const a = await this._evaluateHandeInContext((el, attr) => (attr === 'style' ? el.getAttribute(attr) : el[attr] || el.getAttribute(attr)), els[index], attr)
array.push(a)
}
return array
Expand Down
6 changes: 6 additions & 0 deletions test/helper/webapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1469,6 +1469,12 @@ export function tests() {
assert.equal(val, 'oldfag')
})

it('should grab full style attribute', async () => {
await I.amOnPage('/form/example1')
const style = await I.grabAttributeFrom('#LoginForm_username_em_', 'style')
assert.equal(style, 'display:none')
})

it('should grab attribute from element', async () => {
await I.amOnPage('/search')
const val = await I.grabAttributeFrom(
Expand Down
Loading