Recently, I've been diving into the world of e2e testing. So far, everything has been going smoothly with my tests on the first page - checking the title, h1 tag text, and number of cards. The issue arises when I try to navigate to a second page using buttons on the cards. Even though I successfully rotate to the second page as intended, I encounter a timeout error when trying to test the h1 text on the second page. Can anyone spot where I may be going wrong? Here's a snippet of my code:
app-e2e-spec.ts;
it('should go to measures page', ()=>{
expect(page.goToMeasuresPage()).toEqual("Measures");
});
app.po.ts;
goToMeasuresPage() {
this.clickShowMoreButton(); //a function to expand card for show buttons
let button = element(by.buttonText("Measures"));
button.click();
let headline = element(by.css(".container .header h1")).getText();
return headline;
}
second page's html;
<div class="container">
<div class="header">
<app-back-button></app-back-button>
<h1>{{ 'MEASURES' | translate }}</h1> //this pipe returns "Measures" text
</div>
</div>