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
2 changes: 1 addition & 1 deletion functional-tests/fixtures/baseTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const defaultLocalForcedFeatureFlags: FeatureFlagName[] = [
"AutomaticRemovalCsatSurvey",
"AdditionalRemovalStatuses",
"DataBrokerRemovalTimeEstimateLabel",
"LandingPageRedesign",
"DataBrokerRemovalAttempts",
"SidebarNavigationRedesign",
"EditScanProfileDetails",
"SubPlat3",
"FreeOnly",
];

const test = baseTest.extend<{
Expand Down
4 changes: 2 additions & 2 deletions functional-tests/tests/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ test.describe(`Verify authentication [${process.env.E2E_TEST_ENV}]`, () => {
async ({ page }, testInfo) => {
if (testInfo.project.use.countryCode === "us") {
// shows the onboarding flow
const heading = page.locator("h1", {
hasText: "Welcome to ⁨Monitor⁩. Let’s find your exposed information.",
const heading = page.locator("h2", {
hasText: "View all sites where your info is exposed",
});
expect(heading).toBeVisible();
} else {
Expand Down
9 changes: 4 additions & 5 deletions functional-tests/tests/landing.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ test.describe(`Verify landing page [${process.env.E2E_TEST_ENV}]`, () => {

test("landing page loads", async ({ page }, testInfo) => {
if (
process.env.E2E_TEST_ENV !== "local" &&
testInfo.project.use.countryCode === "nl"
) {
const heading = page.locator("h1", {
hasText: "Ontdek waar uw privégegevens zijn gelekt – en neem ze terug",
const heading = page.getByRole("heading", {
name: "Ontdek waar uw privégegevens zijn gelekt – en neem ze terug",
});
await expect(heading).toBeVisible();
} else {
const heading = page.locator("h2", {
hasText: "Find where your personal info is exposed — and take it back",
const heading = page.getByRole("heading", {
name: "Find where your private info is exposed — and take it back",
});
await expect(heading).toBeVisible();
}
Expand Down
68 changes: 0 additions & 68 deletions functional-tests/tests/subscriptions.spec.ts

This file was deleted.

12 changes: 0 additions & 12 deletions functional-tests/utils/fxa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,12 @@ async function goToFxA(
page: Page,
{
countryCode,
isMobile,
}: {
countryCode?: string;
isMobile?: boolean;
},
) {
await page.goto(`${getBaseTestEnvUrl()}/`);
if (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The US-specific landing page had a menu on mobile, the hitherto-ROW version doesn't.

isMobile &&
(process.env.E2E_TEST_ENV === "local" || countryCode === "us")
) {
const mobileMenuButtonLabel =
countryCode === "nl" ? "Menu uitvouwen" : "Expand menu";
const mobileMenuButton = page.getByRole("button", {
name: mobileMenuButtonLabel,
});
await mobileMenuButton.click();
}

const signInButtonLabel = countryCode === "nl" ? "Aanmelden" : "Sign In";
await page.getByRole("button", { name: signInButtonLabel }).first().click();
Expand Down
4 changes: 3 additions & 1 deletion src/app/components/client/SignInButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import { signIn, useSession } from "next-auth/react";
import { useL10n } from "../../hooks/l10n";
import { Button, ButtonProps } from "./Button";
import { useTelemetry } from "../../hooks/useTelemetry";
import { useHasRenderedClientSide } from "../../hooks/useHasRenderedClientSide";

export const SignInButton = (props: ButtonProps) => {
const l10n = useL10n();
const session = useSession();
const recordTelemetry = useTelemetry();
const hasRenderedClientSide = useHasRenderedClientSide();

if (typeof session.data?.user.email === "string") {
if (typeof session.data?.user.email === "string" || !hasRenderedClientSide) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is actually a change in behaviour, but when the page loads, client-side JS needs to execute to activate React and attach the signIn event handler. Clicking the button beforehand triggered the Next-Auth error page, which happened often locally.

(Another "fix" was for Playwright to wait before networkidle to click the Sign In button, but that is discouraged by the Playwright docs, and actual users can run into this error case as well if they click the button too fast. Thus, I'm now just hiding the button until it's functional.)

return null;
}

Expand Down
Loading