nightwatch: Add missing `isVisible` command in new Element API

Description of the bug/issue

The isVisible command is currently missing from the new Element API. To support this command, a new file named isVisible.js needs to be added inside lib/api/web-element/commands directory, whose content should be similar to the get* command files present in the same directory.

The argument passed to this.runQueuedCommandScoped in these files is the name of the corresponding method to be called from the lib/transport/selenium-webdriver/method-mappings.js file.

Moreover, we’d also need to have isDisplayed() as an alias to the isVisible() command.

Steps to reproduce

Go to any test file and try to add const result = await browser.element('<selector>').isVisible() and then run the test. This would result in an error right now, while if you replace isVisible() with getText(), it should work fine.

After adding the command implementation, the .isVisible() command should work fine and return a boolean promise.

TODO

  • Add missing command
  • Add isDisplayed as an alias to isVisible() command
  • Fix JSDoc of the command
  • Add tests for the new command
  • Add types for the new command

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

hey @garg3133 can I get assigned for this issue?