refactor: move playwright config into e2e folder (#64741)

This commit is contained in:
Oliver Eyton-Williams
2026-01-05 16:00:02 +01:00
committed by GitHub
parent eff230799e
commit 15c98b0db9
38 changed files with 74 additions and 88 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ jobs:
run: pnpm run seed:certified-user run: pnpm run seed:certified-user
- name: Run playwright tests - name: Run playwright tests
run: npx playwright test --project=${{ matrix.browsers }} --grep-invert 'third-party-donation.spec.ts' run: pnpm run playwright:run --project=${{ matrix.browsers }} --grep-invert 'third-party-donation.spec.ts'
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
+1 -1
View File
@@ -151,7 +151,7 @@ jobs:
run: pnpm run seed:certified-user run: pnpm run seed:certified-user
- name: Run playwright tests - name: Run playwright tests
run: npx playwright test third-party-donation.spec.ts --project=${{ matrix.browsers }} run: pnpm run playwright:run third-party-donation.spec.ts --project=${{ matrix.browsers }}
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
-4
View File
@@ -1,4 +0,0 @@
/* eslint-disable filenames-simple/naming-convention */
import { createLintStagedConfig } from '@freecodecamp/eslint-config/lintstaged';
export default createLintStagedConfig(import.meta.dirname);
+1
View File
@@ -0,0 +1 @@
playwright/
+2 -2
View File
@@ -7,11 +7,11 @@ test.describe('When the user has not accepted the Academic Honesty Policy', () =
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('they should be able to accept it', async ({ page }) => { test('they should be able to accept it', async ({ page }) => {
+1 -1
View File
@@ -52,6 +52,6 @@ test.describe('Public profile certifications', () => {
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
}); });
+2 -2
View File
@@ -12,11 +12,11 @@ import {
test.describe('Claim a certification - almost certified user', () => { test.describe('Claim a certification - almost certified user', () => {
test.beforeEach(async () => { test.beforeEach(async () => {
await deleteAllEmails(); await deleteAllEmails();
execSync('node ./tools/scripts/seed/seed-demo-user --unclaimed-user'); execSync('node ../tools/scripts/seed/seed-demo-user --unclaimed-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.use({ storageState: 'playwright/.auth/certified-user.json' }); test.use({ storageState: 'playwright/.auth/certified-user.json' });
+2 -2
View File
@@ -228,11 +228,11 @@ test.describe('Signed in user', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterEach(() => { test.afterEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('User can reset on a multi-file project after reloading and saving', async ({ test('User can reset on a multi-file project after reloading and saving', async ({
+2 -2
View File
@@ -5,7 +5,7 @@ test.describe('Before completing the project', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --set-true isDonating'); execSync('node ../tools/scripts/seed/seed-demo-user --set-true isDonating');
}); });
test('should not allow you to submit a URL', async ({ page }) => { test('should not allow you to submit a URL', async ({ page }) => {
@@ -24,7 +24,7 @@ test.describe('Before completing the project', () => {
test.describe('After completing the project', () => { test.describe('After completing the project', () => {
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should allow you to submit a URL', async ({ page }) => { test('should allow you to submit a URL', async ({ page }) => {
+1 -1
View File
@@ -39,7 +39,7 @@ test.describe('Completed project preview', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(async ({ request }) => { test.beforeEach(async ({ request }) => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
await authedRequest({ await authedRequest({
request, request,
+1 -1
View File
@@ -9,7 +9,7 @@ const nextChallengeURL =
'/learn/data-analysis-with-python/data-analysis-with-python-projects/demographic-data-analyzer'; '/learn/data-analysis-with-python/data-analysis-with-python-projects/demographic-data-analyzer';
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
+3 -3
View File
@@ -14,9 +14,9 @@ test.beforeEach(async ({ page }) => {
test.afterAll( test.afterAll(
async () => async () =>
await Promise.all([ await Promise.all([
execP('node ./tools/scripts/seed/seed-demo-user --certified-user'), execP('node ../tools/scripts/seed/seed-demo-user --certified-user'),
execP('node ./tools/scripts/seed/seed-surveys'), execP('node ../tools/scripts/seed/seed-surveys'),
execP('node ./tools/scripts/seed/seed-ms-username') execP('node ../tools/scripts/seed/seed-ms-username')
]) ])
); );
+2 -2
View File
@@ -5,12 +5,12 @@ test.describe('Donate page', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --set-true isDonating'); execSync('node ../tools/scripts/seed/seed-demo-user --set-true isDonating');
await page.goto('/donate'); await page.goto('/donate');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should render the donate page correctly', async ({ page }) => { test('should render the donate page correctly', async ({ page }) => {
+10 -6
View File
@@ -205,11 +205,11 @@ test.describe('Donation modal appearance logic - New user', () => {
}); });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should not appear if the user has less than 10 completed challenges in total and has just completed 3 challenges', async ({ test('should not appear if the user has less than 10 completed challenges in total and has just completed 3 challenges', async ({
@@ -278,7 +278,9 @@ test.describe('Donation modal appearance logic - New user', () => {
test.describe('Donation modal appearance logic - Certified user claiming a new block', () => { test.describe('Donation modal appearance logic - Certified user claiming a new block', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' }); test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(() => test.beforeEach(() =>
execSync('node ./tools/scripts/seed/seed-demo-user --almost-certified-user') execSync(
'node ../tools/scripts/seed/seed-demo-user --almost-certified-user'
)
); );
test('should appear if the user has just completed a new block, and should not appear if the user re-submits the projects of the block', async ({ test('should appear if the user has just completed a new block, and should not appear if the user re-submits the projects of the block', async ({
@@ -349,7 +351,9 @@ test.describe('Donation modal appearance logic - Certified user claiming a new b
test.describe('Donation modal appearance logic - Certified user claiming a new module', () => { test.describe('Donation modal appearance logic - Certified user claiming a new module', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' }); test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(() => test.beforeEach(() =>
execSync('node ./tools/scripts/seed/seed-demo-user --almost-certified-user') execSync(
'node ../tools/scripts/seed/seed-demo-user --almost-certified-user'
)
); );
test('should appear if the user has just completed a new module', async ({ test('should appear if the user has just completed a new module', async ({
@@ -442,12 +446,12 @@ test.describe('Donation modal appearance logic - Certified user', () => {
test.describe('Donation modal appearance logic - Donor user', () => { test.describe('Donation modal appearance logic - Donor user', () => {
test.beforeAll(() => { test.beforeAll(() => {
execSync( execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-true isDonating' 'node ../tools/scripts/seed/seed-demo-user --certified-user --set-true isDonating'
); );
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should not appear', async ({ test('should not appear', async ({
+1 -1
View File
@@ -16,7 +16,7 @@ const originalEmail = 'foo@bar.com';
const newEmail = 'foo-update@bar.com'; const newEmail = 'foo-update@bar.com';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/settings'); await page.goto('/settings');
}); });
+3 -3
View File
@@ -29,7 +29,7 @@ test.describe('Email sign-up page when user is signed in', () => {
// It's necessary to seed with a user that has not accepted the privacy // It's necessary to seed with a user that has not accepted the privacy
// terms, otherwise the user will be redirected away from the email sign-up // terms, otherwise the user will be redirected away from the email sign-up
// page. // page.
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/learn'); await page.goto('/learn');
}); });
@@ -111,7 +111,7 @@ test.describe('Email sign-up page when the user is new', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
await page.goto('/learn'); await page.goto('/learn');
}); });
@@ -134,7 +134,7 @@ test.describe('Email sign-up page when the user has made a selection', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync( execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false sendQuincyEmail' 'node ../tools/scripts/seed/seed-demo-user --certified-user --set-false sendQuincyEmail'
); );
await page.goto('/learn'); await page.goto('/learn');
}); });
+2 -2
View File
@@ -4,8 +4,8 @@ const url =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam'; '/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
test.describe('Exam Survey', () => { test.describe('Exam Survey', () => {
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
execSync('node tools/scripts/seed/seed-surveys.js delete-only'); execSync('node ../tools/scripts/seed/seed-surveys.js delete-only');
}); });
test('Should show the survey alert and be able to complete the survey', async ({ test('Should show the survey alert and be able to complete the survey', async ({
+2 -2
View File
@@ -21,11 +21,11 @@ function getCompletedIds(completedChallenges: { id: string }[]): string[] {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('failed update flushing', () => { test.describe('failed update flushing', () => {
+3 -3
View File
@@ -6,7 +6,7 @@ setup.describe('certifieduser', () => {
setup.use({ storageState: { cookies: [], origins: [] } }); setup.use({ storageState: { cookies: [], origins: [] } });
setup.beforeAll(() => { setup.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user '); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user ');
}); });
setup('can sign in', async ({ request }) => { setup('can sign in', async ({ request }) => {
@@ -25,11 +25,11 @@ setup.describe('developmentuser', () => {
// We can only sign in as a single user (one with email: 'foo@bar.com'), so // We can only sign in as a single user (one with email: 'foo@bar.com'), so
// changing users means changing the record with that email in the database. // changing users means changing the record with that email in the database.
setup.beforeAll(() => { setup.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
setup.afterAll(() => { setup.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
setup('can sign in', async ({ request }) => { setup('can sign in', async ({ request }) => {
+2 -2
View File
@@ -29,11 +29,11 @@ test.describe('Header', () => {
}); });
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('Has link for skip content', async ({ page }) => { test('Has link for skip content', async ({ page }) => {
+1 -1
View File
@@ -15,7 +15,7 @@ const settingsPageElement = {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
// Reset input values // Reset input values
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/certifieduser'); await page.goto('/certifieduser');
+1 -1
View File
@@ -43,7 +43,7 @@ test.describe('Link MS user component (signed-out user)', () => {
test.describe('Link MS user component (signed-in user)', () => { test.describe('Link MS user component (signed-in user)', () => {
test.afterEach(() => { test.afterEach(() => {
execSync('node ./tools/scripts/seed/seed-ms-username'); execSync('node ../tools/scripts/seed/seed-ms-username');
}); });
test("should recognize the user's MS account", async ({ page }) => { test("should recognize the user's MS account", async ({ page }) => {
+1 -1
View File
@@ -3,7 +3,7 @@ import { test, expect } from '@playwright/test';
import { clearEditor, focusEditor } from './utils/editor'; import { clearEditor, focusEditor } from './utils/editor';
test.describe('multifileCertProjects', () => { test.describe('multifileCertProjects', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto( await page.goto(
'learn/2022/responsive-web-design/build-a-tribute-page-project/build-a-tribute-page' 'learn/2022/responsive-web-design/build-a-tribute-page-project/build-a-tribute-page'
); );
+3 -1
View File
@@ -2,7 +2,9 @@
"name": "@freecodecamp/e2e", "name": "@freecodecamp/e2e",
"version": "1.0.0", "version": "1.0.0",
"scripts": { "scripts": {
"lint": "eslint --max-warnings 0" "lint": "eslint --max-warnings 0",
"playwright:watch": "playwright test --ui-port=0",
"playwright:run": "playwright test"
}, },
"author": "freeCodeCamp <team@freecodecamp.org>", "author": "freeCodeCamp <team@freecodecamp.org>",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
@@ -6,13 +6,13 @@ import { defineConfig, devices } from '@playwright/test';
* Read environment variables from file. * Read environment variables from file.
* https://github.com/motdotla/dotenv * https://github.com/motdotla/dotenv
*/ */
const envPath = path.resolve(__dirname, '.env'); const envPath = path.resolve(__dirname, '..', '.env');
dotenvConfig({ path: envPath }); dotenvConfig({ path: envPath });
/** /**
* See https://playwright.dev/docs/test-configuration. * See https://playwright.dev/docs/test-configuration.
*/ */
export default defineConfig({ export default defineConfig({
testDir: 'e2e', testDir: '.',
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: false, fullyParallel: false,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */
+2 -2
View File
@@ -5,11 +5,11 @@ import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('Add Portfolio Item', () => { test.describe('Add Portfolio Item', () => {
+1 -1
View File
@@ -10,7 +10,7 @@ test.beforeEach(async ({ page }) => {
}); });
test.afterEach(async () => { test.afterEach(async () => {
await execP('node ./tools/scripts/seed/seed-demo-user --certified-user'); await execP('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('Progress reset modal', () => { test.describe('Progress reset modal', () => {
+2 -2
View File
@@ -74,11 +74,11 @@ const pasteContent = async (page: Page) => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('Projects', () => { test.describe('Projects', () => {
+2 -2
View File
@@ -11,7 +11,7 @@ test.describe('Email sign-up page when user is not signed in', () => {
test.use({ storageState: { cookies: [], origins: [] } }); test.use({ storageState: { cookies: [], origins: [] } });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/email-sign-up'); await page.goto('/email-sign-up');
}); });
@@ -71,7 +71,7 @@ test.describe('Email sign-up page when user is not signed in', () => {
test.describe('Email sign-up page when user is signed in', () => { test.describe('Email sign-up page when user is signed in', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
// It's necessary to seed with a user that has not selected an email newsletter option. // It's necessary to seed with a user that has not selected an email newsletter option.
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/email-sign-up'); await page.goto('/email-sign-up');
}); });
+5 -5
View File
@@ -52,7 +52,7 @@ const legacyCertifications = [
test.describe('Settings - Certified User', () => { test.describe('Settings - Certified User', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/settings'); await page.goto('/settings');
}); });
@@ -257,13 +257,13 @@ test.describe('Settings - Certified User', () => {
test.describe('Settings - Certified User without Full Stack Certification', () => { test.describe('Settings - Certified User without Full Stack Certification', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync( execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert' 'node ../tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert'
); );
await page.goto('/settings'); await page.goto('/settings');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should allow claiming Full Stack cert if the user has completed all requirements', async ({ test('should allow claiming Full Stack cert if the user has completed all requirements', async ({
@@ -297,12 +297,12 @@ test.describe('Settings - New User', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
await page.goto('/settings'); await page.goto('/settings');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('should not allow claiming Full Stack cert if the user has not completed all the required certs', async ({ test('should not allow claiming Full Stack cert if the user has not completed all the required certs', async ({
+2 -2
View File
@@ -5,7 +5,7 @@ test.describe('When the user HAS NOT claimed their cert', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeAll(() => { test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
@@ -27,7 +27,7 @@ test.describe('When the user HAS NOT claimed their cert', () => {
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
}); });
+2 -2
View File
@@ -5,11 +5,11 @@ test.describe('Super Block Page - Authenticated User', () => {
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('Super Block in List View', () => { test.describe('Super Block in List View', () => {
+2 -2
View File
@@ -4,7 +4,7 @@ import translations from '../client/i18n/locales/english/translations.json';
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync( execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert' 'node ../tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert'
); );
await page.goto('/certifieduser'); await page.goto('/certifieduser');
@@ -17,7 +17,7 @@ test.beforeEach(async ({ page }) => {
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test('Should allow empty string in any field in about settings', async ({ test('Should allow empty string in any field in about settings', async ({
+2 -2
View File
@@ -7,11 +7,11 @@ import { alertToBeVisible } from './utils/alerts';
test.use({ storageState: 'playwright/.auth/development-user.json' }); test.use({ storageState: 'playwright/.auth/development-user.json' });
test.beforeEach(() => { test.beforeEach(() => {
execSync('node ./tools/scripts/seed/seed-demo-user'); execSync('node ../tools/scripts/seed/seed-demo-user');
}); });
test.afterAll(() => { test.afterAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
test.describe('Initially', () => { test.describe('Initially', () => {
+2 -2
View File
@@ -4,7 +4,7 @@ import translations from '../client/i18n/locales/english/translations.json';
test.afterAll(() => { test.afterAll(() => {
// change the name back to the original // change the name back to the original
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
}); });
const settingsObject = { const settingsObject = {
@@ -23,7 +23,7 @@ const settingsObject = {
test.describe('Username Settings Validation', () => { test.describe('Username Settings Validation', () => {
test.beforeEach(async ({ page }) => { test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user'); execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
await page.goto(`/certifieduser`); await page.goto(`/certifieduser`);
if (!process.env.CI) { if (!process.env.CI) {
-15
View File
@@ -1,15 +0,0 @@
import { configTypeChecked } from '@freecodecamp/eslint-config/base';
import { defineConfig, globalIgnores } from 'eslint/config';
export default defineConfig(
// include all in root dir, but not subdirs:
globalIgnores(['**/*', '!*.js', '!*.ts', '!*.mjs']),
{
extends: [configTypeChecked],
rules: {
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off'
}
}
);
+2 -3
View File
@@ -52,7 +52,6 @@
"knip:all": "npx -y knip@5 ", "knip:all": "npx -y knip@5 ",
"lint-root": "pnpm npm-run-all lint:*", "lint-root": "pnpm npm-run-all lint:*",
"lint": "turbo lint && turbo lint-root", "lint": "turbo lint && turbo lint-root",
"lint:eslint": "eslint --max-warnings 0",
"lint:challenges": "cd ./curriculum && pnpm run lint-challenges", "lint:challenges": "cd ./curriculum && pnpm run lint-challenges",
"lint:ts": "tsc && tsc -p shared && tsc -p api && tsc -p client && tsc -p curriculum && tsc -p e2e && tsc -p tools/challenge-helper-scripts", "lint:ts": "tsc && tsc -p shared && tsc -p api && tsc -p client && tsc -p curriculum && tsc -p e2e && tsc -p tools/challenge-helper-scripts",
"lint:prettier": "prettier --list-different .", "lint:prettier": "prettier --list-different .",
@@ -80,8 +79,8 @@
"test:shared": "cd ./shared && pnpm vitest run", "test:shared": "cd ./shared && pnpm vitest run",
"test:client": "cd ./client && pnpm test run", "test:client": "cd ./client && pnpm test run",
"prepare": "husky", "prepare": "husky",
"playwright:run": "playwright test", "playwright:run": "pnpm -F e2e run playwright:run",
"playwright:watch": "playwright test --ui-port=0" "playwright:watch": "pnpm -F e2e run playwright:watch"
}, },
"dependencies": { "dependencies": {
"dotenv": "16.4.5", "dotenv": "16.4.5",
-1
View File
@@ -1,6 +1,5 @@
{ {
"include": [ "include": [
"*.ts",
"curriculum/*.test.ts", "curriculum/*.test.ts",
"tools/challenge-editor/**/*", "tools/challenge-editor/**/*",
"tools/scripts/**/*.ts", "tools/scripts/**/*.ts",