Skip to content
Advertisement

Upgrading the night-watch from 1.3.2 to 1.3.4 breaks the existing test specially in page object

I was using night-watch version 1.3.2. All the tests were working fine till I update the night-watch to its latest version 1.3.4. The test breaks specially in the page object. I’ve checked the release notes for night-watch 1.3.4 and it has the new feature to support page object with async/await - https://github.com/nightwatchjs/nightwatch/releases.

I believe the error message i am getting is pointing out to wrap the page object with async await. I would like to know how can i update my existing page object with async/await. an e.g- page object with async await will be really helpful to refer. I have listed my sample test with page object and error message below, which was working fine before updating the night-watch to its latest version. any ideas or help will be grateful.

JavaScript
JavaScript

Problem solved my wrapping the function with async await

JavaScript

Advertisement

Answer

I was able to figure out this issue. I have solved this problem by upgrading the page object command function into async function with await. please find the example in the main post.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement