Skip to content

Commit

Permalink
test as
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoLC committed May 3, 2024
1 parent cf30dfd commit fb793c1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/frontend/apps/e2e/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
test-results/
report/
blob-report/
playwright/.auth/
playwright/.cache/
6 changes: 1 addition & 5 deletions src/frontend/apps/e2e/__tests__/app-impress/404.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { expect, test } from '@playwright/test';

import { signIn } from './common';

test.beforeEach(async ({ page, browserName }) => {
await page.goto('/');
await signIn(page, browserName);
test.beforeEach(async ({ page }) => {
await page.goto('unknown-page404');
});

Expand Down
11 changes: 11 additions & 0 deletions src/frontend/apps/e2e/__tests__/app-impress/auth.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { test as setup } from '@playwright/test';

import { signIn } from './common';

const authFile = 'playwright/.auth/user.json';

setup('authenticate', async ({ page, browserName }) => {
await page.goto('/');
await signIn(page, browserName);
await page.context().storageState({ path: authFile });
});
5 changes: 1 addition & 4 deletions src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { expect, test } from '@playwright/test';

import { signIn } from './common';

test.beforeEach(async ({ page, browserName }) => {
test.beforeEach(async ({ page }) => {
await page.goto('/');
await signIn(page, browserName);
});

test.describe('Header', () => {
Expand Down
5 changes: 1 addition & 4 deletions src/frontend/apps/e2e/__tests__/app-impress/language.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { expect, test } from '@playwright/test';

import { signIn } from './common';

test.beforeEach(async ({ page, browserName }) => {
test.beforeEach(async ({ page }) => {
await page.goto('/');
await signIn(page, browserName);
});

test.describe('Language', () => {
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/apps/e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,26 @@ export default defineConfig({

/* Configure projects for major browsers */
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
locale: 'en-US',
ignoreHTTPSErrors: true,
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
locale: 'en-US',
ignoreHTTPSErrors: true,
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
],
});

0 comments on commit fb793c1

Please sign in to comment.