From 896a92ea9454dcd3ca8635fbcd199d667ac2e6e9 Mon Sep 17 00:00:00 2001 From: Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com> Date: Fri, 29 Nov 2024 22:56:31 +0530 Subject: [PATCH] Updated LoginPage.ts --- cypress/pageobject/Login/LoginPage.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cypress/pageobject/Login/LoginPage.ts b/cypress/pageobject/Login/LoginPage.ts index b1e758bcb0d..2e98b004c8b 100644 --- a/cypress/pageobject/Login/LoginPage.ts +++ b/cypress/pageobject/Login/LoginPage.ts @@ -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() { @@ -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) {