Skip to content

Commit

Permalink
Updated LoginPage.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaushikgtm authored Nov 29, 2024
1 parent 1a3b7b9 commit 896a92e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ class LoginPage {
}

ensurePageLoaded() {
cy.get("body").should("contain", "Login");
+ cy.get(this.submitButtonSelector).should("be.visible");
+ cy.get(this.languageSelector).should("be.visible");
+ cy.get("input[id='username']").should("be.visible");
+ cy.get("input[id='password']").should("be.visible");
}

clickContributeOnGitHub() {
Expand All @@ -63,10 +66,15 @@ class LoginPage {
}) {
Object.entries(languageMappings).forEach(([languageCode, expectedText]) => {
this.selectLanguage(languageCode);
+ cy.get(this.submitButtonSelector, { timeout: 10000 })
+ .should("be.visible")
+ .and("have.text", expectedText);
+ cy.get(this.languageSelector)
+ .find(`option[value="${languageCode}"]`)
+ .should('exist')
+ .then(() => {
+ cy.get(this.submitButtonSelector, { timeout: 10000 })
+ .should("be.visible")
+ .should("have.text", expectedText);
});
});
}

selectSidebarLanguage(languageCode: string) {
Expand Down

0 comments on commit 896a92e

Please sign in to comment.