Skip to content
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 static assertions / node assertion messages #4307

Open
4 tasks
garg3133 opened this issue Nov 18, 2024 · 3 comments
Open
4 tasks

Fix static assertions / node assertion messages #4307

garg3133 opened this issue Nov 18, 2024 · 3 comments

Comments

@garg3133
Copy link
Member

garg3133 commented Nov 18, 2024

Description of the bug/issue

The pass/fail messages emitted by the node assertions (referred to as static assertions in Nigtwatch) are not ideal and should be fixed.

This is essential to get the correct assertion messages in the new Element API assertions.

Let's take the example of .ok() assertion:

  • await browser.assert.ok(true) -- seems okayish but could be improved
    image
  • await browser.assert.ok(false) -- needs to be improved. Instead of the whole block inside (), something simple could be used like: "Testing the value to be truthy". Also, instead of expected "true", this could be expected "a truthy value".
    image
  • await browser.assert.not.ok(false) -- needs to be improved. Instead of the whole block inside (), something simple could be used like: "Testing the value to be not truthy".
    image
  • browser.assert.not.ok(true) -- MOST IMPORTANT - the message should show the correct expected and actual values instead of "null".
    image

Additional information

The code for the static assertions is present in lib/_loaders/static.js file.

All available Node Assertions in Nightwatch can be found here:

export interface NightwatchNodeAssertions<ReturnType> {

@ansh7432
Copy link

Can i work on this issue ? could you please assign me..

@garg3133
Copy link
Member Author

Sure @ansh7432, go ahead! I'll assign this issue to you once you come up with some solution to this problem.

@ansh7432
Copy link

okay !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants