diff --git a/cypress/pageobject/Login/LoginPage.ts b/cypress/pageobject/Login/LoginPage.ts index 41edcb14cfd..3f0fb8d6086 100644 --- a/cypress/pageobject/Login/LoginPage.ts +++ b/cypress/pageobject/Login/LoginPage.ts @@ -1,7 +1,17 @@ // LoginPage.ts +interface LanguageMapping { + [key: string]: { + login: string; + care: string; + goal: string; + footer_body: string; + }; +} + class LoginPage { languageSelector = "#language-selector"; + submitButtonSelector: string = "#login-button"; // Update the selector as appropriate loginAsDisctrictAdmin(): void { cy.loginByApi("devdistrictadmin", "Coronasafe@123"); @@ -51,17 +61,8 @@ class LoginPage { clickThirdPartyLicense() { cy.get('a[href="/licenses"]').scrollIntoView().click(); } - - interface LanguageMapping { - [key: string]: { - login: string; - care: string; - goal: string; - footer_body: string; - }; -} -switchLanguageAndVerifyButtonText(languageMappings: LanguageMapping) { + switchLanguageAndVerifyButtonText(languageMappings: LanguageMapping) { Object.entries(languageMappings).forEach(([languageCode, texts]) => { cy.get(this.languageSelector) .find(`option[value="${languageCode}"]`) @@ -84,7 +85,7 @@ switchLanguageAndVerifyButtonText(languageMappings: LanguageMapping) { .and("have.text", expectedText); } -switchLanguageAndVerifySidebars(languageMappings: LanguageMapping) { + switchLanguageAndVerifySidebars(languageMappings: LanguageMapping) { Object.entries(languageMappings).forEach(([languageCode, texts]) => { cy.get(this.languageSelector) .find(`option[value="${languageCode}"]`)