chore: set default login state playwright (#57277)

This commit is contained in:
Sem Bauke
2024-11-22 19:52:01 +01:00
committed by GitHub
parent 6d5aeefbfa
commit f1b2a08691
60 changed files with 70 additions and 150 deletions

View File

@@ -1,6 +1,5 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const checkAnswerButtonText = translations.buttons['check-answer'];
const askForHelpButtonText = translations.buttons['ask-for-help'];
const trophyButtonText = translations.buttons['verify-trophy'];

View File

@@ -2,7 +2,6 @@ import { execSync } from 'child_process';
import { expect, test } from '@playwright/test';
test.describe('Public profile certifications', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('Should show claimed certifications if the username has all lowercase characters', async ({
page
}) => {

View File

@@ -3,8 +3,6 @@ import { test, expect, Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import { alertToBeVisible } from './utils/alerts';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Certification page - Non Microsoft', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/certification/certifieduser/responsive-web-design');
@@ -148,7 +146,6 @@ test.describe('Invalid certification page', () => {
}
};
test.describe('for authenticated user', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test(
'it should redirect to / and display an error message',
testInvalidCertification

View File

@@ -97,61 +97,68 @@ test('User can reset challenge', async ({ page, isMobile, browserName }) => {
).not.toBeVisible();
});
test('User can reset classic challenge', async ({ page, isMobile }) => {
await page.goto(
'/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code'
);
test.describe('When the user is not logged in', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('User can reset classic challenge', async ({ page, isMobile }) => {
await page.goto(
'/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code'
);
const challengeSolution = '// This is in-line comment';
await focusEditor({ page, isMobile });
await getEditors(page).fill(challengeSolution);
const challengeSolution = '// This is in-line comment';
await focusEditor({ page, isMobile });
await getEditors(page).fill(challengeSolution);
const submitButton = page.getByRole('button', {
name: isMobile ? translations.buttons.run : translations.buttons['run-test']
});
await submitButton.click();
const submitButton = page.getByRole('button', {
name: isMobile
? translations.buttons.run
: translations.buttons['run-test']
});
await submitButton.click();
await expect(
page.locator('.view-lines').getByText(challengeSolution)
).toBeVisible();
await expect(
page.locator('.view-lines').getByText(challengeSolution)
).toBeVisible();
if (isMobile) {
await page
.getByText(translations.learn['editor-tabs'].instructions)
.click();
}
await expect(
page.getByLabel(translations.icons.passed).locator('circle')
).toBeVisible();
if (isMobile) {
await page
.getByText(translations.learn['editor-tabs'].instructions)
.getByRole('button', {
name: !isMobile
? translations.buttons['reset-lesson']
: translations.buttons.reset
})
.click();
}
await expect(
page.getByLabel(translations.icons.passed).locator('circle')
).toBeVisible();
await page
.getByRole('button', { name: translations.buttons['reset-lesson'] })
.click();
await page
.getByRole('button', {
name: !isMobile
? translations.buttons['reset-lesson']
: translations.buttons.reset
})
.click();
await expect(
page.locator('.view-lines').getByText(challengeSolution)
).not.toBeVisible();
await expect(
page.getByLabel(translations.icons.passed).locator('circle')
).not.toBeVisible();
await expect(
page.getByText(translations.learn['tests-completed'])
).not.toBeVisible();
await page
.getByRole('button', { name: translations.buttons['reset-lesson'] })
.click();
if (isMobile) {
await page.getByText(translations.learn['editor-tabs'].console).click();
}
await expect(
page.locator('.view-lines').getByText(challengeSolution)
).not.toBeVisible();
await expect(
page.getByLabel(translations.icons.passed).locator('circle')
).not.toBeVisible();
await expect(
page.getByText(translations.learn['tests-completed'])
).not.toBeVisible();
if (isMobile) {
await page.getByText(translations.learn['editor-tabs'].console).click();
}
await expect(page.getByText(translations.learn['test-output'])).toBeVisible();
await expect(
page.getByText(translations.learn['test-output'])
).toBeVisible();
});
});
test('should close when the user clicks the close button', async ({ page }) => {

View File

@@ -74,8 +74,6 @@ test.describe('Challenge Title Component (signed out)', () => {
});
test.describe('Challenge Title Component (signed in)', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should display GreenPass after challenge completion', async ({
page
}) => {

View File

@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';
import { getEditors } from './utils/editor';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Challenge with editor', function () {
test.skip(({ isMobile }) => isMobile);
test('the shortcut "Ctrl + S" saves the code', async ({ page }) => {

View File

@@ -23,8 +23,6 @@ test.describe('Before completing the project', () => {
});
test.describe('After completing the project', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');
});

View File

@@ -16,6 +16,7 @@ test.beforeEach(async ({ page }) => {
});
test.describe('Challenge Completion Modal Tests (Signed Out)', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('should render the modal correctly', async ({ page }) => {
await expect(page.getByRole('heading')).toBeVisible();
await expect(page.getByRole('button', { name: 'close' })).toBeVisible();
@@ -83,8 +84,6 @@ test.describe('Challenge Completion Modal Tests (Signed Out)', () => {
});
test.describe('Challenge Completion Modal Tests (Signed In)', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should render the modal correctly', async ({ page }) => {
await expect(page.getByRole('heading')).toBeVisible();
await expect(page.getByRole('button', { name: 'close' })).toBeVisible();

View File

@@ -8,8 +8,6 @@ import { alertToBeVisible } from './utils/alerts';
const execP = promisify(exec);
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});

View File

@@ -1,7 +1,5 @@
import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Classic challenge - 3 pane desktop layout component', () => {
test.skip(
({ isMobile }) => isMobile === true,

View File

@@ -1,8 +1,6 @@
import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const pageElements = {
mainHeading: 'main-head',
donateText1: 'donate-text-1',

View File

@@ -117,8 +117,6 @@ test.describe('Donation modal display', () => {
await addGrowthbookCookie({ context, variation: 'A' });
});
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should display the content correctly and disable close when the animation is not complete', async ({
page,
browserName,
@@ -292,7 +290,6 @@ test.describe('Donation modal appearance logic - New user', () => {
});
test.describe('Donation modal appearance logic - Certified user', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ context }) => {
await addGrowthbookCookie({ context, variation: 'A' });
});
@@ -333,8 +330,6 @@ test.describe('Donation modal appearance logic - Certified user', () => {
});
test.describe('Donation modal appearance logic - Donor user', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeAll(() => {
execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-true isDonating'

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/certifieduser');

View File

@@ -64,8 +64,6 @@ test.describe('Editor theme if the system theme is dark', () => {
test.use({ colorScheme: 'dark' });
test.describe('If the user is signed in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should respect the user settings', async ({ page, request }) => {
const editor = page.locator("div[role='code'].monaco-editor");
@@ -96,8 +94,6 @@ test.describe('Editor theme if the system theme is light', () => {
test.use({ colorScheme: 'light' });
test.describe('If the user is signed in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should respect the user settings', async ({ page, request }) => {
const editor = page.locator("div[role='code'].monaco-editor");

View File

@@ -15,8 +15,6 @@ const settingsPageElement = {
const originalEmail = 'foo@bar.com';
const newEmail = 'foo-update@bar.com';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/settings');

View File

@@ -1,7 +1,5 @@
import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Exam results modal', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/settings');

View File

@@ -3,8 +3,6 @@ import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import intro from '../client/i18n/locales/english/intro.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';

View File

@@ -4,7 +4,7 @@ import translations from '../client/i18n/locales/english/translations.json';
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
test.use({ storageState: { cookies: [], origins: [] } });
test.beforeEach(async ({ page }) => {
await page.goto(examUrl);
});

View File

@@ -2,8 +2,6 @@ import { test, expect } from '@playwright/test';
import intro from '../client/i18n/locales/english/intro.json';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';

View File

@@ -2,8 +2,6 @@ import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
import intro from '../client/i18n/locales/english/intro.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';

View File

@@ -3,7 +3,6 @@ import { test, expect } from '@playwright/test';
const url =
'/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.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');
execSync('node tools/scripts/seed/seed-surveys.js delete-only');

View File

@@ -3,8 +3,6 @@
// import { test, expect } from '@playwright/test';
// test.use({ storageState: 'playwright/.auth/certified-user.json' });
// test.beforeEach(async ({ page }) => {
// await page.goto('/settings');
// });

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
const cancelExamUrl =

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const examUrl =
'/learn/foundational-c-sharp-with-microsoft/foundational-c-sharp-with-microsoft-certification-exam/foundational-c-sharp-with-microsoft-certification-exam';
const QUESTION_COUNT = 5;

View File

@@ -1,7 +1,6 @@
import { test, expect, type Page } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Test form with only solution link', () => {
test.beforeEach(async ({ page }) => {
await page.goto(

View File

@@ -3,6 +3,12 @@ import { execSync } from 'child_process';
import { test as setup } from '@playwright/test';
setup.describe('certifieduser', () => {
setup.use({ storageState: { cookies: [], origins: [] } });
setup.beforeAll(() => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user ');
});
setup('can sign in', async ({ request }) => {
await request.get(process.env.API_LOCATION + '/signin');
await request.storageState({
@@ -12,6 +18,10 @@ setup.describe('certifieduser', () => {
});
setup.describe('developmentuser', () => {
// We need to make sure the development user does not have any cookies from the certified user.
// Ass the certified user now has the default storage state.
setup.use({ storageState: { cookies: [], origins: [] } });
// 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.
setup.beforeAll(() => {

View File

@@ -276,8 +276,6 @@ test.describe('Header', () => {
});
test.describe('Exam Header', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('Renders exam nav for Foundational C# with Microsoft exam', async ({
page
}) => {

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/foundational-c-sharp-with-microsoft/write-your-first-code-using-c-sharp/write-your-first-c-sharp-code'

View File

@@ -46,8 +46,6 @@ const waitUntilHydrated = async (page: Page, pageId: PageId) => {
await waitUntilListening(page);
};
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeAll(async ({ request }) => {
await authedRequest({
request,

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
test.describe('Picture input field', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/certifieduser');

View File

@@ -12,8 +12,6 @@ const settingsPageElement = {
internetPresenceForm: 'internet-presence'
} as const;
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
// Reset input values
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');

View File

@@ -74,8 +74,6 @@ test.describe('Learn - Unauthenticated user', () => {
});
test.describe('Learn - Authenticated user)', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('the page should render correctly', async ({ page }) => {
await page.goto('/learn');

View File

@@ -11,6 +11,7 @@ test.beforeEach(async ({ page }) => {
});
test.describe('Link MS user component (signed-out user)', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('should display the page content with a signin CTA', async ({
page
}) => {
@@ -44,7 +45,6 @@ test.describe('Link MS user component (signed-in user)', () => {
test.afterEach(() => {
execSync('node ./tools/scripts/seed/seed-ms-username');
});
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test("should recognize the user's MS account", async ({ page }) => {
await expect(

View File

@@ -2,8 +2,6 @@ import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Classic challenge - 5 tabs mobile layout component', () => {
test.skip(
({ isMobile }) => isMobile === false,

View File

@@ -3,7 +3,7 @@ import translations from '../client/i18n/locales/english/translations.json';
const verifyTrophyButtonText = translations.buttons['verify-trophy'];
const askForHelpButtonText = translations.buttons['ask-for-help'];
test.use({ storageState: { cookies: [], origins: [] } });
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/foundational-c-sharp-with-microsoft/write-your-first-code-using-c-sharp/trophy-write-your-first-code-using-c-sharp'

View File

@@ -1,7 +1,6 @@
import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import { clearEditor, focusEditor } from './utils/editor';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('multifileCertProjects', () => {
test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');

View File

@@ -22,7 +22,6 @@ const rwdChallenge = {
nextUrl:
'/learn/2022/responsive-web-design/#build-a-personal-portfolio-webpage-project'
};
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Navigation from the middle or end (URL solution)', () => {
test('In the middle of a block should take you to the next challenge', async ({
page

View File

@@ -83,7 +83,6 @@ const legacyCerts = [
test.describe('Profile component', () => {
test.describe('when viewing my own profile', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/certifieduser');
@@ -207,8 +206,6 @@ test.describe('Profile component', () => {
});
test.describe('while logged in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('displays the public username', async ({ page }) => {
await expect(
page.getByRole('heading', { name: '@publicuser' })

View File

@@ -1,8 +1,6 @@
import { expect, test } from '@playwright/test';
import { clearEditor, focusEditor } from './utils/editor';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Progress bar component', () => {
test('Should appear with the correct content after the user has submitted their code', async ({
page,

View File

@@ -5,8 +5,6 @@ import translations from '../client/i18n/locales/english/translations.json';
const execP = promisify(exec);
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/settings');
});

View File

@@ -92,8 +92,6 @@ test.describe('Email sign-up page when user is not signed in', () => {
});
test.describe('Email sign-up page when user is signed in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
// 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

View File

@@ -6,8 +6,6 @@ test.describe('Quiz challenge', () => {
'The FSD superblock is not available if SHOW_UPCOMING_CHANGES is false'
);
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto(
'/learn/full-stack-developer/quiz-basic-html/quiz-basic-html'

View File

@@ -5,7 +5,6 @@ import {
getFirstEmail,
getSubject
} from './utils/mailhog';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async () => {
await deleteAllEmails();

View File

@@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Editor scrollbar width', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/settings');

View File

@@ -47,8 +47,6 @@ const legacyCertifications = [
];
test.describe('Settings - Certified User', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
execSync('node ./tools/scripts/seed/seed-demo-user --certified-user');
await page.goto('/settings');
@@ -262,8 +260,6 @@ test.describe('Settings - Certified User', () => {
// Instead of simulating 6 cert claim flows,
// we use the data of Certified User but remove the Full Stack cert.
test.describe('Settings - Certified User without Full Stack Certification', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert'

View File

@@ -7,8 +7,6 @@ import { getEditors } from './utils/editor';
const course =
'/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
const enableKeyboardShortcuts = async (request: APIRequestContext) => {
const res = await authedRequest({
request,

View File

@@ -32,8 +32,6 @@ test.describe('When the user HAS NOT claimed their cert', () => {
});
test.describe('When the user HAS claimed their cert', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/learn/front-end-development-libraries');
});

View File

@@ -2,6 +2,7 @@ import { test, expect, type Page } from '@playwright/test';
test.describe('Show certification else', () => {
let page: Page;
test.use({ storageState: { cookies: [], origins: [] } });
test.beforeAll(async ({ browser }) => {
page = await browser.newPage();

View File

@@ -1,7 +1,5 @@
import { test, expect, type Page } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Show certification own', () => {
let page: Page;

View File

@@ -40,8 +40,6 @@ test.describe('Odin challenges', () => {
});
test.describe('When the user is signed in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should render the content correctly', async ({ page }) => {
await expect(page).toHaveTitle(
'Write Your First Code Using C# - Write Your First C# Code | Learn | freeCodeCamp.org'

View File

@@ -1,6 +1,7 @@
import { test, expect } from '@playwright/test';
test.describe('signing in', () => {
test.use({ storageState: { cookies: [], origins: [] } });
test('welcomes the user', async ({ page }) => {
const welcomeText = 'Welcome back, Full Stack User.';
await page.goto('/learn');

View File

@@ -1,8 +1,6 @@
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/');
});

View File

@@ -1,7 +1,5 @@
import { test, expect } from '@playwright/test';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.describe('Solution Viewer component', () => {
test('renders the modal correctly', async ({ page }) => {
await page.goto(

View File

@@ -5,7 +5,6 @@ import stripeJson from './fixtures/donation/stripe.json';
import { alertToBeVisible } from './utils/alerts';
test.describe('third-party donation tests', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/donate');
});

View File

@@ -2,8 +2,6 @@ import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
execSync(
'node ./tools/scripts/seed/seed-demo-user --certified-user --set-false isFullStackCert'

View File

@@ -2,8 +2,6 @@ import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.describe('The update-email page when the user is signed in', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.beforeEach(async ({ page }) => {
await page.goto('/update-email');
});

View File

@@ -2,7 +2,6 @@ import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.describe('Update Card Page for Non-Donor Authenticated User', () => {
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test('should render correctly', async ({ page }) => {
await page.goto('/update-stripe-card');
await expect(page).toHaveTitle(

View File

@@ -1,7 +1,6 @@
import { execSync } from 'child_process';
import { test, expect } from '@playwright/test';
import translations from '../client/i18n/locales/english/translations.json';
test.use({ storageState: 'playwright/.auth/certified-user.json' });
test.afterAll(() => {
// change the name back to the original

View File

@@ -33,7 +33,7 @@ export default defineConfig({
baseURL: process.env.HOME_LOCATION || 'http://127.0.0.1:8000',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
storageState: 'playwright/.auth/certified-user.json',
/* Use custom test attribute */
testIdAttribute: 'data-playwright-test-label'
},