Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions tests/donations.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test, expect } from "@playwright/test";
import { randomEmailAddress } from "./utils";
import { clickMyAccountMenuItem, randomEmailAddress } from "./utils";

const getPageInIframe = (page) =>
page.frameLocator('iframe[name="newspack_modal_checkout_iframe"]');
Expand Down Expand Up @@ -58,11 +58,11 @@ test("Donations", {
* Go to "My Account" page – it's now available as the reader account has been created.
*/
await page.getByRole("link", { name: "My Account" }).click();
await page.waitForURL(/my-account/);
await expect(page.locator("#newspack_account_email")).toHaveValue(
emailAddress
);
await page.getByRole("link", { name: "My Subscription" }).click();

await clickMyAccountMenuItem(page, "Subscription");
await expect(page.getByText("Visa card ending in 4242")).toBeVisible();
await expect(
page.getByRole("cell", { name: "$15.00 / month" }).first()
Expand Down
3 changes: 1 addition & 2 deletions tests/reader-registration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test("Register on the site", {
* Now the user is authenticated via the magic link, they can update their name.
*/
await page.getByRole("link", { name: "My Account" }).click();
await clickMyAccountMenuItem(page, "Account settings");
await page.waitForURL(/my-account/);
await page.getByPlaceholder("Your First Name").click();
await page.getByPlaceholder("Your First Name").fill("John");
await page.getByPlaceholder("Your Last Name").click();
Expand Down Expand Up @@ -119,7 +119,6 @@ test("Register on the site", {
* Reader updates their email address.
*/
const newEmailAddress = randomEmailAddress();
await clickMyAccountMenuItem(page, "Account settings");
await page.locator("#newspack_account_email").fill(newEmailAddress);
await page.getByRole("button", { name: "Update profile" }).click();
const expectedNotification = `A verification email has been sent to ${newEmailAddress}. Please verify to complete the change.`;
Expand Down