Skip to content

Commit

Permalink
Update LoginPage.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaushikgtm authored Dec 12, 2024
1 parent 73dacda commit 1fb91d0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cypress/pageobject/Login/LoginPage.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand Down Expand Up @@ -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}"]`)
Expand All @@ -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}"]`)
Expand Down

0 comments on commit 1fb91d0

Please sign in to comment.