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
Fixes/3540 undhandled promises for wait commands #3570
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const {Given, Then} = require('@cucumber/cucumber'); | ||
|
||
Given('I navigate to localhost', function() { | ||
|
||
return browser.url('http://localhost'); | ||
}); | ||
|
||
Then('I check if badElement is present', async function() { | ||
|
||
await browser.customWaitForPresent('#badElement'); | ||
await browser.click('#webdriver'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = class CustomWaitForPresent { | ||
async command(selector) { | ||
await this.api.waitForElementPresent(selector); | ||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ describe('expect(element.<command>) - passed', function() { | |
const testsPath = path.join(__dirname, '../../../apidemos/expect-global/expect.js'); | ||
|
||
Mocks.elementNotSelected(); | ||
Mocks.elementProperty('0', 'className', {value: ['div-container']}); | ||
Mocks.elementProperty('0', 'className', {value: ['container']}); | ||
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. This change is fixing a test which not reported earlier. The Nightwatch-test running inside this test has two expect out of which one should fail but without this change there would be two failures. |
||
|
||
const globals = { | ||
waitForConditionPollInterval: 50, | ||
|
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.
Instead of using
this.currentNode
which might have changed during execution (When there are events like abortOnFailurecurrentNode
is shifted torootNode
), I've changed itnode
which is stored in the context while executing this function.