Skip to content

Commit 45c5cea

Browse files
committed
test: refactor generated tests using playwright-cli 🎭
1 parent 0a23eac commit 45c5cea

33 files changed

+1126
-2988
lines changed

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ obj/
88
*.cache
99
packages/
1010
.vs/
11-
TestResults/
1211
CoverageReport/
1312

1413
# Angular
@@ -23,6 +22,10 @@ yarn-error.log
2322
# Vitest
2423
__screenshots__/
2524

25+
# Playwright
26+
test-results/
27+
.playwright-cli/
28+
2629
# IDE
2730
# JetBrains
2831
.idea/

‎Sandbox.AngularWorkspace/projects/sandbox-app/src/styles.css‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');
12
@import 'tailwindcss';
23

34
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
45

56
@theme {
6-
/* Professional Font Stack */
7-
--font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
7+
--font-family-sans:
8+
'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
89

910
--color-primary-50: #f8fafc;
1011
--color-primary-100: #f1f5f9;

‎Sandbox.EndToEndTests/playwright.config.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,27 @@ export default defineConfig({
3737
teardown: 'teardown',
3838
},
3939
{
40-
name: 'chromium',
40+
name: 'chromium-authenticated',
41+
testIgnore: '**/*unauthenticated*.test.ts',
4142
use: { ...devices['Desktop Chrome'], storageState: '.state/auth-state.json' },
4243
dependencies: ['setup'],
4344
},
4445
{
45-
name: 'firefox',
46+
name: 'firefox-authenticated',
47+
testIgnore: '**/*unauthenticated*.test.ts',
4648
use: { ...devices['Desktop Firefox'], storageState: '.state/auth-state.json' },
4749
dependencies: ['setup'],
4850
},
51+
{
52+
name: 'chromium-unauthenticated',
53+
testMatch: '**/*unauthenticated*.test.ts',
54+
use: { ...devices['Desktop Chrome'] },
55+
},
56+
{
57+
name: 'firefox-unauthenticated',
58+
testMatch: '**/*unauthenticated*.test.ts',
59+
use: { ...devices['Desktop Firefox'] },
60+
},
4961
{
5062
name: 'teardown',
5163
testDir: './setup',

‎Sandbox.EndToEndTests/setup/auth.setup.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ test('authenticate user', async ({ page }) => {
2424
await passwordInput.fill(config.password);
2525
await passwordInput.press('Enter');
2626

27-
await expect(page.getByText(new RegExp(`👋 ${config.username}`, 'i'))).toBeVisible();
27+
await expect(page.getByText(new RegExp(`${config.username}`, 'i'))).toBeVisible();
2828
await page.context().storageState({ path: storageState });
2929
});
3030

0 commit comments

Comments
 (0)