Repository navigation
Conformance suite: run the Nightwatch adapter, and the bug it found #432
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
07b6df2
fix(nightwatch): carry a failed protocol action's error on its row
vishnuv688 46f3a19
test(conformance): stop assuming every adapter is shaped like Selenium
vishnuv688 0e21d24
test(conformance): run the Nightwatch adapter through the suite
vishnuv688 effc11e
fix(conformance): read a fill's text from its trailing argument
vishnuv688 bc020f0
fix(conformance): excuse only the run controls a gap declares absent
vishnuv688 e7ae4a8
fix(conformance): show a comparison's stale gaps in the report
vishnuv688 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@wdio/nightwatch-devtools': patch | ||
| --- | ||
|
|
||
| A command that failed at the protocol level, such as a navigation the browser refused, now carries its error on its row, so it shows red in the actions list and in the Errors tab. Nightwatch reports that failure as `{status: -1, value: null, error}`, and the row was read from `value`, so it rendered as a success with no result. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/conformance/scenarios/nightwatch/nightwatch.conf.cjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Nightwatch config for the conformance scenario: the harness supplies the fake | ||
| // WebDriver and reaches the recording backend through the reuse handshake. | ||
| const path = require('node:path') | ||
| const nightwatchDevtools = require('@wdio/nightwatch-devtools').default | ||
|
|
||
| const webdriver = process.env.CONFORMANCE_WEBDRIVER | ||
| if (!webdriver) { | ||
| throw new Error( | ||
| 'CONFORMANCE_WEBDRIVER is not set; run this through the conformance harness' | ||
| ) | ||
| } | ||
| const { hostname, port } = new URL(webdriver) | ||
|
|
||
| module.exports = { | ||
| src_folders: [path.resolve(__dirname, 'specs')], | ||
| output_folder: false, | ||
| webdriver: { start_process: false, host: hostname, port: Number(port) }, | ||
| test_settings: { | ||
| default: { | ||
| skip_testcases_on_fail: false, | ||
| desiredCapabilities: { browserName: 'chrome', webSocketUrl: true }, | ||
| globals: nightwatchDevtools({ mode: 'live', bidi: true }) | ||
| } | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
packages/conformance/scenarios/nightwatch/specs/scenario.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // The conformance scenario, driven through @wdio/nightwatch-devtools: the same | ||
| // steps as every other adapter's scenario, in Nightwatch's own idiom. | ||
| const env = (name) => { | ||
| const value = process.env[name] | ||
| if (!value) { | ||
| throw new Error( | ||
| `${name} is not set; run this through the conformance harness` | ||
| ) | ||
| } | ||
| return value | ||
| } | ||
|
|
||
| describe('conformance', function () { | ||
| it('drives the fake pages', async function (browser) { | ||
| await browser.url(env('CONFORMANCE_LOGIN_URL')) | ||
| await browser.setValue('#username', 'tom') | ||
| await browser.setValue('#password', 'secret') | ||
| await browser.click('button[type="submit"]') | ||
| await browser.click('#logout') | ||
| try { | ||
| await browser.url(env('CONFORMANCE_BROKEN_URL')) | ||
| } catch { | ||
| // The failed navigation is part of the scenario. | ||
| } | ||
| }) | ||
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.