Using Nighwatch's POM below is a page function to click a button, page needs to be refreshed and validate if element present.
using this.api.refresh() to refresh the page. But waitForElementPresent fails:
checkfile: function () {
return this
.click('@confirmButton')
.waitForElementVisible('@notification', 45000)
.pause(1000)
.api.refresh()
.pause(10000)
.waitForElementPresent('@dashboardButton', 30000)
.end();
}
The .waitForElementPresent('@dashboardButton', 30000) returns error:
Error while running .locateMultipleElements() protocol action: invalid selector: An invalid or illegal selector was specified
Timed out while waiting for element <@dashboardButton> to be present for 30000 milliseconds. - expected "found" but got: "not found"