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.79k stars 1.31k forks source link

waitUntil() not working when a textbox value gets auto generated depending upon another textbox value #3072

Open sourav-ghosh-ip opened 2 years ago

sourav-ghosh-ip commented 2 years ago

Describe the bug

I have two textboxes in a page and both the textboxs are initially blank. When I enter value to a textbox then the other one automatically populates one value .So I want to wait until the auto generated textbox field contains a non blank value and I want to use wait until feature from night watch 2.0.

The second function in the wait until method is kept as a parameter to execute method and I am not able to push any other nightwatch method like getText or getValue instead of execute method as nightwatch says this.getValue is not a function. Please help in this regard.

Include a sample test which reproduces the problem you're experiencing. If possible, the test should be against a public url.

Please add the test and other info inline, not as attachments or screenshots.

sampleTest.js ```js module.exports = { sampleTest: function(browser) { browser .url('https://nightwatchjs.org) .waitUntil(async function() { const title = await this.getValue(element, function(result) { return result.value; }); return title === 'Nightwatch.js'; }, 1000); } } ```

Run with command

$ nightwatch test/sampleTest.js --your-other-arguments-here

Verbose output

debug.log

```txt ```

Configuration

nightwatch.json

```js { "your": { "config": "here" } } ```

Your Environment

Executable Version
nightwatch --version VERSION
npm --version VERSION
yarn --version VERSION
node --version VERSION
Browser driver Version
NAME VERSION
OS Version
NAME VERSION
irealsourav commented 2 years ago

help required ASAP