-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fixes/3540 undhandled promises for wait commands #3570
Conversation
if (this.shouldRejectNodePromise(err, node)) { | ||
node.reject(err); | ||
} else { | ||
this.currentNode.resolve(err); | ||
node.resolve(err); | ||
} | ||
|
||
if (this.shouldRejectParentNodePromise(err)) { | ||
if (this.shouldRejectParentNodePromise(err, node)) { | ||
parent.reject(err); | ||
} | ||
} else { | ||
node.resolveValue = result; | ||
this.resolveNode(this.currentNode, result); | ||
this.resolveNode(node, result); |
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 abortOnFailure currentNode
is shifted to rootNode
), I've changed it node
which is stored in the context while executing this function.
@@ -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 comment
The 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.
Nightwatch-Test: https://github.com/nightwatchjs/nightwatch/tree/main/test/apidemos/expect-global/expect.js
Changes
runChildNode
in asynctree.jsImpacts