Skip to content

Commit

Permalink
Removed duplicate cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWhittington committed Jan 6, 2025
1 parent b49f2e8 commit 22d8789
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ export async function authorise(context: BrowserContext) {
export async function startJourney(page: Page, context: BrowserContext) {
await authorise(context);
await page.goto("/", {waitUntil: 'domcontentloaded'});
await context.addCookies([
{
name: 'auth-secret',
value: process.env.AUTH_SECRET,
path: '/',
domain: process.env.DOMAIN
}
]);
await page.goto("/", { waitUntil: 'domcontentloaded'});
await page.waitForFunction(() => document.title === "Start - Check an Early Years qualification")
//expect(await page.title()).toBe("Start - Check an Early Years qualification");
await expect(page.locator("#start-now-button")).toBeVisible();
Expand Down Expand Up @@ -69,19 +60,6 @@ export function checkHeaderValue(response: APIResponse, headerName: string, head

export function checkHeaderExists(response: APIResponse, headerName: string, shouldExist: boolean) {
expect(response.headers()[headerName]).toBeUndefined();
import {BrowserContext, Page, expect, APIResponse} from "@playwright/test";
export const cookiePreferencesCookieName = "cookies_preferences_set";
export const journeyCookieName = 'user_journey';

export async function authorise(context: BrowserContext) {
await setCookie(context, process.env.AUTH_SECRET, 'auth-secret');
}
export function checkText(page: any, locator: string, expectedText: string, contain: boolean = false) {
if (contain) {
expect(page.locator(locator)).toContainText(expectedText);
} else {
expect(page.locator(locator)).toHaveText(expectedText);
}
}

export async function whereWasTheQualificationAwarded(page: any, location: string) {
Expand Down

0 comments on commit 22d8789

Please sign in to comment.