mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
refactor(e2e): test urls can have trailing slashes (#58283)
This commit is contained in:
committed by
GitHub
parent
4eef3854c7
commit
8a852719f1
@@ -3,6 +3,7 @@ import { test, expect, type Page } from '@playwright/test';
|
||||
import { addGrowthbookCookie } from './utils/add-growthbook-cookie';
|
||||
|
||||
import { clearEditor, focusEditor } from './utils/editor';
|
||||
import { allowTrailingSlash } from './utils/url';
|
||||
|
||||
const slowExpect = expect.configure({ timeout: 25000 });
|
||||
|
||||
@@ -22,7 +23,9 @@ const completeFrontEndCert = async (page: Page, number?: number) => {
|
||||
const loopNumber = number || projects.length;
|
||||
for (let i = 0; i < loopNumber; i++) {
|
||||
await page.waitForURL(
|
||||
`/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-${projects[i]}`
|
||||
allowTrailingSlash(
|
||||
`/learn/front-end-development-libraries/front-end-development-libraries-projects/build-a-${projects[i]}`
|
||||
)
|
||||
);
|
||||
await page
|
||||
.getByRole('textbox', { name: 'solution' })
|
||||
@@ -92,7 +95,7 @@ const completeChallenges = async ({
|
||||
}) => {
|
||||
await page.goto(challenges[0].url);
|
||||
for (const challenge of challenges.slice(0, number)) {
|
||||
await page.waitForURL(challenge.url);
|
||||
await page.waitForURL(allowTrailingSlash(challenge.url));
|
||||
await focusEditor({ page, isMobile });
|
||||
await clearEditor({ page, browserName });
|
||||
await page.evaluate(
|
||||
|
||||
Reference in New Issue
Block a user