Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
5d21741
Begin to update personal page so language agnostic
clarissarichard Feb 2, 2026
1e76b53
Update rest of personal page tests
clarissarichard Feb 2, 2026
82ed42d
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 2, 2026
9047985
Merge branch 'SWIS-317/language-agnostic-personal' of https://github.…
clarissarichard Feb 2, 2026
6c55c43
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 3, 2026
79ac2cd
Merge tests
clarissarichard Feb 3, 2026
872d568
Merge branch 'SWIS-317/language-agnostic-personal' of https://github.…
clarissarichard Feb 3, 2026
0c1fe54
Update address page to be language agnostic
clarissarichard Feb 4, 2026
87a3a27
Update e2e tests
clarissarichard Feb 4, 2026
25de907
Remove error messages
clarissarichard Feb 4, 2026
727ac27
Remove error messages
clarissarichard Feb 4, 2026
f57bd6d
Add string back to error message locators
clarissarichard Feb 4, 2026
7582b78
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 4, 2026
2deb32c
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 4, 2026
8ff4591
Combine small tests
clarissarichard Feb 5, 2026
a6f00ef
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 5, 2026
55a9f49
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 5, 2026
52d385d
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 6, 2026
31d0e33
Update new Trans component
clarissarichard Feb 6, 2026
62b05da
Add missing chained locator
clarissarichard Feb 6, 2026
3e47473
Add chained locators
clarissarichard Feb 9, 2026
ad7ecee
Merge branch 'main' into SWIS-321/language-agnostic-alt
clarissarichard Feb 9, 2026
2230df8
Fix brackets
clarissarichard Feb 9, 2026
35bcb5a
Resolve conflicts
clarissarichard Feb 9, 2026
ed9e103
Resolve conflicts
clarissarichard Feb 9, 2026
da83990
Resolve conflicts
clarissarichard Feb 9, 2026
fd04116
Update alternate address tests
clarissarichard Feb 9, 2026
4ead112
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 9, 2026
742e203
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 9, 2026
8268664
Update to strings
clarissarichard Feb 9, 2026
0bf2369
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 9, 2026
a3f5464
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 9, 2026
5df5979
Update test name
clarissarichard Feb 10, 2026
ad6d215
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 10, 2026
6a77d8a
Resolve conflicts
clarissarichard Feb 10, 2026
f196829
Add spinner checks
clarissarichard Feb 10, 2026
0afb930
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 10, 2026
3273e4a
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 10, 2026
9a62b4e
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 10, 2026
ba023fd
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 10, 2026
baa8b91
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 10, 2026
792cc6e
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 10, 2026
07ad404
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 10, 2026
9457afa
Update address verification tests
clarissarichard Feb 11, 2026
b0d7f22
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 12, 2026
3b23762
Fix import
clarissarichard Feb 12, 2026
dca402b
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 12, 2026
5f9e6ca
Reorder imports
clarissarichard Feb 12, 2026
5270e42
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 12, 2026
97c7303
Merge branch 'SWIS-321/language-agnostic-alt' into SWIS-303/language-…
clarissarichard Feb 12, 2026
9d9004b
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 13, 2026
4eef429
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Feb 13, 2026
a16e0cd
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 13, 2026
117088a
Update locator
clarissarichard Feb 13, 2026
fd4f819
Merge branch 'SWIS-321/language-agnostic-alt' into SWIS-303/language-…
clarissarichard Feb 13, 2026
5b2d407
Resolve conflicts
clarissarichard Feb 23, 2026
df5e3f1
Resolve conflicts
clarissarichard Feb 23, 2026
db82eb5
Resolve conflicts
clarissarichard Feb 24, 2026
8b3c361
Resolve conflicts
clarissarichard Feb 24, 2026
fc5a15a
Update translations
clarissarichard Feb 25, 2026
facb5dc
Update translations
clarissarichard Feb 25, 2026
e762883
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Feb 25, 2026
0bc3a9c
Merge branch 'SWIS-321/language-agnostic-alt' into SWIS-303/language-…
clarissarichard Feb 25, 2026
c140069
Update locators
clarissarichard Feb 25, 2026
b3192e3
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 27, 2026
93f2dc7
Fix tests
clarissarichard Feb 27, 2026
4c9f724
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Feb 27, 2026
19777d1
Merge branch 'SWIS-317/language-agnostic-personal' into SWIS-318/lang…
clarissarichard Mar 3, 2026
bf0f51b
Lint
clarissarichard Mar 3, 2026
943bb12
Merge branch 'SWIS-318/language-agnostic-address' into SWIS-321/langu…
clarissarichard Mar 3, 2026
3c5b372
Merge branch 'SWIS-321/language-agnostic-alt' into SWIS-303/language-…
clarissarichard Mar 3, 2026
147e8f9
Merge branch 'SWIS-303/language-agnostic-verif' into SWIS-333/languag…
clarissarichard Mar 3, 2026
dfc99a5
Lint
clarissarichard Mar 3, 2026
5031115
Fix link
clarissarichard Mar 3, 2026
f356ec2
Update e2e tests
clarissarichard Mar 3, 2026
47ac36b
Resolve conflicts
clarissarichard Mar 4, 2026
21e7558
Uncomment personal tests
clarissarichard Mar 4, 2026
48d8ed0
Resolve conflicts
clarissarichard Mar 4, 2026
4c6f28a
Merge branch 'SWIS-300/language-agnostic-landing' into SWIS-317/langu…
clarissarichard Mar 4, 2026
62d8c1f
Resolve conflicts
clarissarichard Mar 4, 2026
0074d5f
Resolve conflicts
clarissarichard Mar 4, 2026
2f0d170
Resolve conflicts
clarissarichard Mar 4, 2026
e43f503
Resolve conflicts
clarissarichard Mar 4, 2026
6155447
Add status to mock username API and refactor
clarissarichard Mar 5, 2026
1c80ae6
Resolve some conflicts
clarissarichard Mar 16, 2026
0a19b9b
Resolve remaining conflicts
clarissarichard Mar 16, 2026
9405fba
Restore error messages
clarissarichard Mar 16, 2026
a6917b2
Separate banner text
clarissarichard Mar 16, 2026
59e0fec
Resolve conflicts
clarissarichard Mar 17, 2026
b93baf2
Uncomment alternate address in NY tests
clarissarichard Mar 17, 2026
ff9d7bf
Merge branch 'SWIS-321/language-agnostic-alt' into SWIS-303/language-…
clarissarichard Mar 17, 2026
e29bae9
Resolve conflicts
clarissarichard Mar 17, 2026
4940ab3
Resolve conflicts
clarissarichard Mar 27, 2026
3eed85d
Remove provideAddress
clarissarichard Mar 27, 2026
626f619
Update link and username message locators
clarissarichard Apr 1, 2026
f197fcc
Pass in lang
clarissarichard Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 75 additions & 31 deletions playwright/pageobjects/account.page.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Page, Locator } from "@playwright/test";
import { ERROR_MESSAGES } from "../utils/constants";
import { apiTranslations } from "../../src/data/apiMessageTranslations";
import { apiErrorTranslations } from "../../src/data/apiErrorMessageTranslations";

export class AccountPage {
readonly page: Page;
Expand Down Expand Up @@ -29,78 +30,121 @@ export class AccountPage {
readonly nextButton: Locator;
readonly previousButton: Locator;

constructor(page: Page) {
constructor(page: Page, appContent?: any, lang?: string) {
this.page = page;

const required = appContent?.required || "required";
const withRequired = (label: string) => `${label} (${required})`;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!


this.mainHeading = page.getByRole("heading", {
name: "Apply for a Library Card Online",
name: appContent?.banner?.title || "Apply for a Library Card Online",
level: 1,
});
this.stepHeading = page.getByRole("heading", {
name: "Step 4 of 5: Customize your account",
name: appContent?.account?.title || "Step 4 of 5: Customize your account",
level: 2,
});
this.usernameInput = page.getByRole("textbox", {
name: "Username (required)",
name: withRequired(appContent?.account?.username?.label || "Username"),
exact: true,
});
this.usernameError = page.getByText(ERROR_MESSAGES.USERNAME_INVALID);
this.usernameError = page.getByText(
appContent?.account?.errorMessage?.username ||
"There was a problem. Username must be between 5-25 alphanumeric characters."
);
this.availableUsernameButton = page.getByRole("button", {
name: "Check if username is available",
name:
appContent?.account?.username?.checkButton ||
"Check if username is available",
exact: true,
});
this.availableUsernameMessage = page.getByText(
ERROR_MESSAGES.USERNAME_AVAILABLE
apiTranslations["This username is available."][lang] ||
"This username is available."
);
this.unavailableUsernameMessage = page.getByText(
ERROR_MESSAGES.USERNAME_UNAVAILABLE
apiErrorTranslations["This username is unavailable. Please try another."][
lang
] || "This username is unavailable. Please try another."
);
Comment on lines 61 to 69
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Toxiapo simpler than I thought it would be!

this.passwordInput = page.getByRole("textbox", {
name: "Password (required)",
name: withRequired(appContent?.account?.password?.label || "Password"),
exact: true,
});
this.passwordError = page.getByText(ERROR_MESSAGES.PASSWORD_INVALID);
this.passwordError = page.getByText(
appContent?.account?.errorMessage?.password ||
"There was a problem. Your password must be at least 8 characters, include a mixture of both uppercase and lowercase letters, include a mixture of letters and numbers, and have at least one special character except period (.)"
);
this.verifyPasswordInput = page.getByRole("textbox", {
name: "Verify password (required)",
name: withRequired(
appContent?.account?.verifyPassword?.label || "Verify password"
),
exact: true,
});
this.verifyPasswordError = page.getByText(
ERROR_MESSAGES.VERIFY_PASSWORD_INVALID
appContent?.account?.errorMessage?.verifyPassword ||
"There was a problem. The two passwords don't match."
);
this.showPasswordCheckbox = page.getByRole("checkbox", {
name: "Show password",
});
this.showPasswordCheckboxLabel = page.getByText("Show password", {
exact: true,
name: appContent?.account?.showPassword || "Show password",
});
this.showPasswordCheckboxLabel = page.getByText(
appContent?.account?.showPassword || "Show password",
{
exact: true,
}
);
this.homeLibraryHeading = page.getByRole("heading", {
name: "Home library",
name: appContent?.account?.library?.title || "Home library",
level: 3,
exact: true,
});
this.nyplLocationLink = page.getByRole("link", {
name: "NYPL location",
name:
appContent?.account?.library?.description?.nyplLocation ||
"NYPL location",
});
this.selectHomeLibrary = page.getByLabel("Select a home library:");
this.homeLibraryError = page.getByText(ERROR_MESSAGES.HOME_LIBRARY_ERROR);
this.selectHomeLibrary = page.getByLabel(
appContent?.account?.library?.selectLibrary || "Select a home library:"
);
this.homeLibraryError = page.getByText(
appContent?.account?.errorMessage?.homeLibraryCode ||
"There was a problem. Please select a home library."
);
this.cardholderTerms = page.getByRole("link", {
name: "Cardholder Terms and Conditions",
name:
appContent?.account?.termsAndCondition?.termsConditions ||
"Cardholder Terms and Conditions",
});
this.rulesRegulations = page.getByRole("link", {
name: "Rules and Regulations",
name:
appContent?.account?.termsAndCondition?.rulesRegulations ||
"Rules and Regulations",
});
this.privacyPolicy = page.locator("#mainContent").getByRole("link", {
name:
appContent?.account?.termsAndCondition?.privacyPolicy ||
"Privacy Policy",
});
this.privacyPolicy = page
.locator("#mainContent")
.getByRole("link", { name: "Privacy Policy" });
this.acceptTermsCheckbox = page.getByRole("checkbox", {
name: "Yes, I accept the terms and conditions.",
name:
appContent?.account?.termsAndCondition?.label ||
"Yes, I accept the terms and conditions.",
});
this.acceptTermsCheckboxLabel = page.getByText(
"Yes, I accept the terms and conditions."
appContent?.account?.termsAndCondition?.label ||
"Yes, I accept the terms and conditions."
);
this.acceptTermsError = page.getByText(ERROR_MESSAGES.ACCEPT_TERMS_ERROR);
this.nextButton = page.getByRole("button", { name: "Next", exact: true });
this.acceptTermsError = page.getByText(
appContent?.account?.errorMessage?.acceptTerms ||
"There was a problem. The Terms and Conditions must be checked."
);
this.nextButton = page.getByRole("button", {
name: appContent?.button?.next || "Next",
exact: true,
});
this.previousButton = page.getByRole("link", {
name: "Previous",
name: appContent?.button?.previous || "Previous",
exact: true,
});
}
Expand Down
3 changes: 2 additions & 1 deletion playwright/pageobjects/page-manager.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class PageManager {
}

get accountPage(): AccountPage {
return new AccountPage(this.page);
return new AccountPage(this.page, this.appContent);
}

get reviewPage(): ReviewPage {
Expand All @@ -49,6 +49,7 @@ export class PageManager {
get congratsPage(): CongratsPage {
return new CongratsPage(this.page);
}

get globalComponents(): GlobalComponentsPage {
return new GlobalComponentsPage(this.page);
}
Expand Down
86 changes: 43 additions & 43 deletions playwright/tests/e2e-tests/backward-navigation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { test, expect } from "@playwright/test";
import { PageManager } from "../../pageobjects/page-manager.page";
import {
// fillAccountInfo,
fillAccountInfo,
fillAddress,
fillPersonalInfo,
} from "../../utils/form-helper";
import {
PAGE_ROUTES,
SPINNER_TIMEOUT,
SUPPORTED_LANGUAGES,
// TEST_ACCOUNT,
TEST_ACCOUNT,
TEST_NYC_ADDRESS,
TEST_OOS_ADDRESS,
TEST_PATRON,
Expand All @@ -25,42 +25,42 @@ for (const { lang, name } of SUPPORTED_LANGUAGES) {
pageManager = new PageManager(page, appContent);
});

// test("navigates backward to landing without entering info", async ({
// page,
// }) => {
// await test.step("begins at account page", async () => {
// await page.goto(PAGE_ROUTES.ACCOUNT(lang));
// await expect(pageManager.accountPage.stepHeading).toBeVisible();
// await expect(pageManager.accountPage.previousButton).toBeVisible();
// await pageManager.accountPage.previousButton.click();
// });

// await test.step("navigates back to address verification page", async () => {
// await expect(
// pageManager.addressVerificationPage.stepHeading
// ).toBeVisible();
// await expect(
// pageManager.addressVerificationPage.previousButton
// ).toBeVisible();
// await pageManager.addressVerificationPage.previousButton.click();
// });

// await test.step("navigates back to address page", async () => {
// await expect(pageManager.addressPage.stepHeading).toBeVisible();
// await expect(pageManager.addressPage.previousButton).toBeVisible();
// await pageManager.addressPage.previousButton.click();
// });

// await test.step("navigates back to personal information page", async () => {
// await expect(pageManager.personalPage.stepHeading).toBeVisible();
// await expect(pageManager.personalPage.previousButton).toBeVisible();
// await pageManager.personalPage.previousButton.click();
// });

// await test.step("navigates back to landing page", async () => {
// await expect(pageManager.landingPage.applyHeading).toBeVisible();
// });
// });
test("navigates backward to landing without entering info", async ({
page,
}) => {
await test.step("begins at account page", async () => {
await page.goto(PAGE_ROUTES.ACCOUNT(lang));
await expect(pageManager.accountPage.stepHeading).toBeVisible();
await expect(pageManager.accountPage.previousButton).toBeVisible();
await pageManager.accountPage.previousButton.click();
});

await test.step("navigates back to address verification page", async () => {
await expect(
pageManager.addressVerificationPage.stepHeading
).toBeVisible();
await expect(
pageManager.addressVerificationPage.previousButton
).toBeVisible();
await pageManager.addressVerificationPage.previousButton.click();
});

await test.step("navigates back to address page", async () => {
await expect(pageManager.addressPage.stepHeading).toBeVisible();
await expect(pageManager.addressPage.previousButton).toBeVisible();
await pageManager.addressPage.previousButton.click();
});

await test.step("navigates back to personal information page", async () => {
await expect(pageManager.personalPage.stepHeading).toBeVisible();
await expect(pageManager.personalPage.previousButton).toBeVisible();
await pageManager.personalPage.previousButton.click();
});

await test.step("navigates back to landing page", async () => {
await expect(pageManager.landingPage.applyHeading).toBeVisible();
});
});

test("retains user-entered info when navigating backward", async ({
page,
Expand Down Expand Up @@ -112,11 +112,11 @@ for (const { lang, name } of SUPPORTED_LANGUAGES) {
).not.toBeVisible({ timeout: SPINNER_TIMEOUT });
});

// await test.step("enters account information", async () => {
// await expect(pageManager.accountPage.stepHeading).toBeVisible();
// await fillAccountInfo(pageManager.accountPage, TEST_ACCOUNT);
// await pageManager.accountPage.nextButton.click();
// });
await test.step("enters account information", async () => {
await expect(pageManager.accountPage.stepHeading).toBeVisible();
await fillAccountInfo(pageManager.accountPage, TEST_ACCOUNT);
await pageManager.accountPage.nextButton.click();
});

// await test.step("displays review page and navigates back to account page", async () => {
// await expect(pageManager.reviewPage.stepHeading).toBeVisible();
Expand Down
14 changes: 7 additions & 7 deletions playwright/tests/e2e-tests/e2e-edited.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { test, expect } from "@playwright/test";
import { PageManager } from "../../pageobjects/page-manager.page";
import {
// fillAccountInfo,
fillAccountInfo,
fillAddress,
fillPersonalInfo,
} from "../../utils/form-helper";
import {
PAGE_ROUTES,
SPINNER_TIMEOUT,
SUPPORTED_LANGUAGES,
// TEST_ACCOUNT,
TEST_ACCOUNT,
// TEST_EDITED_PATRON,
TEST_OOS_ADDRESS,
TEST_PATRON,
Expand Down Expand Up @@ -88,11 +88,11 @@ for (const { lang, name } of SUPPORTED_LANGUAGES) {
});
});

// await test.step("enters account information", async () => {
// await expect(pageManager.accountPage.stepHeading).toBeVisible();
// await fillAccountInfo(pageManager.accountPage, TEST_ACCOUNT);
// await pageManager.accountPage.nextButton.click();
// });
await test.step("enters account information", async () => {
await expect(pageManager.accountPage.stepHeading).toBeVisible();
await fillAccountInfo(pageManager.accountPage, TEST_ACCOUNT);
await pageManager.accountPage.nextButton.click();
});

// await test.step("edits personal info on review page", async () => {
// await expect(pageManager.reviewPage.stepHeading).toBeVisible();
Expand Down
Loading
Loading