As a relatively new guy in nightwatch.js and in test automation using javascript i am facing many problems which i solved somehow, but now i am faced with one problem that i am not yet able to fix it.
The thing is next, nightwatch is able to locate the element as visible but it's not able to click on it. And this is only happening on MacBook, also i have to mention that on windows environment everything is working as expected.
The things i have tried so far are:
The first solution:
//expand hover menu
.waitForElementVisible('@hoverMenu', 1000)
.click('@hoverMenu')
//wait one second and click on logout button
.api.pause(1000)
.assert.visible('@logoutBtn')
.click('@logoutBtn')
The second solution:
//expand hover menu
.waitForElementVisible('@hoverMenu', 1000)
.click('@hoverMenu')
//wait one second and click on logout button
.click('@logoutBtn',function(){
this.waitForElementVisible('@logoutBtn',10000);
this.click('@logoutBtn');
})And here is the error code i am getting
✔ Element <#app > div > div > aside > div.header__rightbarHeader___nXVZ2 > div.radialMenu__radialMenu___2Xy3S.header__mediaMenu___3aHzZ > span> was visible after 45 milliseconds.
✖ Testing if element <@logoutBtn> is visible. Element could not be located. - expected "true" but got: "null"
The problem is that assert is always passing and when it has to trigger the click event it will always fail. Also strange thing is that in error message in passed test i am getting full path reported and on the failed one only '@logoutBtn' which is part of page object abstraction.
I am using selenium-server-standalone-3.0.1.jar and the latest version of chromedriveravailable. And the site i am working on is made in ReactJS.
Thanks in advance guys ;)