nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.85k stars 1.34k forks source link

fix: frame command overlapping with subsequent NW commands. #4276

Closed garg3133 closed 1 month ago

garg3133 commented 1 month ago

When the .frame() command is used with await (as shown below), the command promise resolves early before the command can even find the target frame element. Due to this, the subsequent Nightwatch commands start running parallelly with the .frame() command.

await browser.frame('frame_a_simple_iframe');
await browser.waitForElementVisible('.example');

This PR solves this issue by ensuring that the frame() command promise is only resolved once the command has completed its execution so that the subsequent commands only run after that.

github-actions[bot] commented 1 month ago

Status