Passing in page object selectors to a page object command #3025
Unanswered
Topperfalkon
asked this question in
Help Needed
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Possibly having a bit of a brainfart, but the docs don't really explain, or at least haven't helped me understand, how you can use page object selectors as an input to a page command.
I'm using Nightwatch 1.7.x and I'm building up a page object to manage interaction with a map page, and due to general Google Maps nonsense I need to carry out an API command to move to an element (a map pin) and force a click on it, to bypass Selenium/Webdriver's interactibility logic.
So my command looks like this
(it's then referenced in the exported object)
And I'm accessing it in the test using something like
mapPage.clickMap('@mapMarker')(where mapPage is the initialised page object, and @mapmarker is the reference to the selector in that page object). When I run this command I get an error that the selector is invalid. Am I doing something stupid?Beta Was this translation helpful? Give feedback.
All reactions