Skip to content

Commit df1e539

Browse files
committed
Update e2e selectors to use getByLabel with disambiguation
Use getByLabel('Name').first() to avoid strict mode violation when both Name and Username fields are present with basic auth.
1 parent 8e88e60 commit df1e539

22 files changed

Lines changed: 124 additions & 2242 deletions

e2e/constants/AuthFile.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

e2e/package-lock.json

Lines changed: 85 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "playwright-foundry",
33
"version": "1.0.0",
4-
"description": "Playwright e2e tests to ensure app installs and renders properly",
4+
"description": "Playwright E2E tests for foundry-sample-functions-python",
55
"scripts": {
66
"test": "npx playwright test",
77
"test:ui": "npx playwright test --ui",
@@ -15,11 +15,9 @@
1515
"node": ">=22.0.0"
1616
},
1717
"dependencies": {
18-
"@dotenvx/dotenvx": "1.52.0",
19-
"otpauth": "9.5.0"
18+
"@crowdstrike/foundry-playwright": "file:/Users/mraible/dev/foundry-playwright/crowdstrike-foundry-playwright-0.5.0.tgz"
2019
},
2120
"devDependencies": {
22-
"@playwright/test": "1.57.0",
23-
"@types/node": "25.1.0"
21+
"@types/node": "25.6.0"
2422
}
2523
}

e2e/playwright.config.ts

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,5 @@
1-
import { defineConfig, devices } from '@playwright/test';
2-
import { AuthFile } from './constants/AuthFile';
3-
import dotenv from 'dotenv';
1+
import { defineFoundryConfig } from '@crowdstrike/foundry-playwright';
42

5-
if (!process.env.CI) {
6-
dotenv.config({ path: ".env", quiet: true });
7-
}
8-
9-
export default defineConfig({
10-
testDir: './tests',
11-
fullyParallel: true,
12-
forbidOnly: !!process.env.CI,
13-
retries: process.env.CI ? 2 : 0,
14-
timeout: process.env.CI ? 60 * 1000 : 45 * 1000,
15-
expect: {
16-
timeout: process.env.CI ? 10 * 1000 : 8 * 1000,
17-
},
18-
reporter: 'list',
19-
use: {
20-
testIdAttribute: 'data-test-selector',
21-
trace: 'on-first-retry',
22-
screenshot: 'only-on-failure',
23-
video: process.env.CI ? 'off' : 'retain-on-failure',
24-
actionTimeout: process.env.CI ? 15 * 1000 : 10 * 1000,
25-
navigationTimeout: process.env.CI ? 30 * 1000 : 20 * 1000,
26-
},
27-
28-
projects: [
29-
{
30-
name: 'setup',
31-
testMatch: /authenticate.setup.ts/,
32-
},
33-
{
34-
name: 'app-install',
35-
testMatch: /app-install.setup.ts/,
36-
use: {
37-
...devices['Desktop Chrome'],
38-
storageState: AuthFile
39-
},
40-
dependencies: ["setup"]
41-
},
42-
{
43-
name: 'chromium',
44-
use: {
45-
...devices['Desktop Chrome'],
46-
storageState: AuthFile
47-
},
48-
dependencies: ["setup", "app-install"]
49-
},
50-
{
51-
name: 'app-uninstall',
52-
testMatch: /app-uninstall.teardown.ts/,
53-
use: {
54-
...devices['Desktop Chrome'],
55-
storageState: AuthFile
56-
},
57-
dependencies: ["chromium"]
58-
},
59-
],
3+
export default defineFoundryConfig({
4+
appInstallDir: './tests',
605
});

0 commit comments

Comments
 (0)