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

Add a way to scan for invalid page object aliases #4010

Open
reallymello opened this issue Jan 30, 2024 · 1 comment
Open

Add a way to scan for invalid page object aliases #4010

reallymello opened this issue Jan 30, 2024 · 1 comment

Comments

@reallymello
Copy link
Contributor

reallymello commented Jan 30, 2024

Description

Since page object aliases are passed in as strings in the tests we can't leverage type safety to verify before runtime if someone made a typo or if an update to a page object broke an alias being used in a test. This causes nasty crashes that are expensive to find and fix in the test code such as Issue 4009

myPage.expect.element('@busnessName').is.present; // Case of a typo
myPage.expect.element('@oldSelector').is.present; // Case of test referencing an old selector not present in page object 

Presently if you run a test like this Nightwatch does provide helpful errors stating the alias does not exist and lists which ones do exist as a part of the element collection in the page object, but this isn't caught until you run the test.

Suggested solution

Provide some sort of light-weight/fast dry run check that let's you run the test without executing browser commands to quickly scan for references to page object aliases to ensure they exist in their respective page object element collections or some sort of linting capability in that regard.

Alternatives / Workarounds

No response

Additional Information

No response

Copy link

Thank you for setting this as an enhancement. One of the product folk will triage this again to help see when we can fit this in an upcoming sprint.

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

No branches or pull requests

1 participant