My code is located in test.page.js, where I have defined elements on the page. Specifically, I am trying to locate the Add button using the following code:
import Page from './page';
class TestPage extends Page {
get addButton() {
return browser.element('#add-button > a');
}
getAddButton() {
return this.addButton.getText();
}
Based on the documentation, I expected the example below to work, but unfortunately it returns a pending promise:
import Page from './page';
class LoginPage extends Page {
get username() { return browser.element('#username'); }
In my test.spec.js file, I am using chai as a promise extension to assert this element:
import testPage from '../pageobjects/test.page';
it('should validate if Add button exists', (done) => {
testPage.getAddButton().should.eventually.be.equal('Create a new thing').notify(done);
});
This assertion passes in Chrome but fails in Firefox or Safari. I suspect there may be an issue with how I am locating the elements compared to the documentation. Can anyone provide assistance?