-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix:isVisible command added to the new API #4052
fix:isVisible command added to the new API #4052
Conversation
Running CI, will review when tests are complete. If there are failures please look into them |
* export default { | ||
* demoTest(browser: NightwatchAPI): void { | ||
* const result = browser.element('#main').isVisible(); | ||
* .assert.equals(true); | ||
* }, | ||
* | ||
* async demoTestAsync(browser: NightwatchAPI): Promise<void> { | ||
* const result = await browser.element('#main').isVisible(); | ||
* browser.assert.equal(result,true) | ||
* } | ||
* } |
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 example won't work (due to an obvious mistake). You should always try to run the examples yourself before putting them here.
it('test .element().isVisible() Visible', async function() { | ||
MockServer.addMock({ | ||
url: '/session/13521-10219-202/element/0/Visible', | ||
method: 'GET', | ||
response: JSON.stringify({ | ||
value: true | ||
}) | ||
}, true); | ||
|
||
this.client.api.element('#search').isVisible(function (result) { | ||
this.assert.equal(result.value, true); | ||
}); | ||
}); |
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.
These tests are wrong:
- '/session/13521-10219-202/element/0/Visible' endpoint does not exist.
isVisible()
command does not accept a callback.
The only reason this test is passing is because no assertion is being run in actual, because all the assertions are present in the callback which is never called.
It seems to me that you've just blindly copied the tests from some other PR and didn't care to understand what it is doing or ask questions.
Closing this since there has been no activity on this and moreover the code seems to be copied from some other PR. |
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.
fix - #4037
features/my-new-feature
orissue/123-my-bugfix
);