-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: skip unloaded iframes for all apis #752
Changes from 5 commits
73b55c3
ea13036
5e3e8fb
c40c2e3
84ee840
f25fc61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -850,6 +850,40 @@ describe('@axe-core/webdriverio', () => { | |
normalResults.testEngine.name = legacyResults.testEngine.name; | ||
assert.deepEqual(normalResults, legacyResults); | ||
}); | ||
|
||
it('handles unloaded iframes (e.g. loading=lazy)', async () => { | ||
await client.url(`${addr}/lazy-loaded-iframe.html`); | ||
const title = await client.getTitle(); | ||
|
||
const results = await new AxeBuilder({client}) | ||
.options({ runOnly: ['label', 'frame-tested'] }) | ||
.analyze(); | ||
|
||
assert.notEqual(title, 'Error'); | ||
assert.equal(results.incomplete[0].id, 'frame-tested'); | ||
assert.lengthOf(results.incomplete[0].nodes, 1); | ||
assert.deepEqual(results.incomplete[0].nodes[0].target, ['#ifr-lazy', '#lazy-iframe']); | ||
assert.equal(results.violations[0].id, 'label'); | ||
assert.lengthOf(results.violations[0].nodes, 1); | ||
assert.deepEqual(results.violations[0].nodes[0].target, [ | ||
'#ifr-lazy', | ||
'#lazy-baz', | ||
'input' | ||
]); | ||
}); | ||
|
||
it('resets pageLoad timeout to user setting', async () => { | ||
await client.url(`${addr}/lazy-loaded-iframe.html`); | ||
client.setTimeout({ pageLoad: 500 }) | ||
const title = await client.getTitle(); | ||
|
||
const results = await new AxeBuilder({client}) | ||
.options({ runOnly: ['label', 'frame-tested'] }) | ||
.analyze(); | ||
|
||
const timeout = await client.getTimeouts(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to reset this in an after call? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I shouldn't need to as the driver is recreated each test. |
||
assert.equal(timeout.pageLoad, 500); | ||
}); | ||
}); | ||
|
||
describe('logOrRethrowError', () => { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't part of the point of making these changes that we do not throw an exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided that the quickest way to resolve the bug was to return these iframes as
frame-tested
issues. This timeout / throw behavior is already being handled by the code to returnframe-tested
results and actually lets the code complete now.Here's how each driver handled unloaded iframes previously: