I\'m running protractor, it runs successfully and load my angular app. The very first test I wrote is to get the sign-up button. Although I can see the sign-up button in my view
Updated some syntax and removed async/awaits from page object function.
As I mentioned your failure is likely due to an async issue. Can you try changing your code to disable the promise_manager in the conf and use the async/await syntax and see if that helps you?
a previous answer of mine on the subject of the async/await & the promise manager
Every action that interacts with the browser will need an await before it and every function that contains an await will need to be labeled async
Conf.js
exports.config = {
framework: 'jasmine',
specs: ['./app.js'],
// specs: ['./app.js','./app.1.js'],
seleniumAddress: 'http://localhost:4444/wd/hub',
SELENIUM_PROMISE_MANAGER: false
}
Page Object
getButtonText() {
return element(by.css('a[data-e2e="nav-signup"]')).getText();
}
navigateTo() {
return browser.get('/');
}
Spec File
it('should get the text of sign up button', async () => {
await page.navigateTo();
expect(await page.getButtonText()).toEqual('Sign up');
});