Skip to content

Commit b52136a

Browse files
authored
Migrate e2e tests to @crowdstrike/foundry-playwright (#124)
Migrate e2e tests to @crowdstrike/foundry-playwright
1 parent 6427d68 commit b52136a

24 files changed

Lines changed: 228 additions & 2415 deletions

e2e/constants/AuthFile.ts

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

e2e/package-lock.json

Lines changed: 127 additions & 54 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 & 7 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",
@@ -14,12 +14,8 @@
1414
"engines": {
1515
"node": ">=22.0.0"
1616
},
17-
"dependencies": {
18-
"@dotenvx/dotenvx": "1.52.0",
19-
"otpauth": "9.5.0"
20-
},
2117
"devDependencies": {
22-
"@playwright/test": "1.57.0",
23-
"@types/node": "25.1.0"
18+
"@crowdstrike/foundry-playwright": "0.5.0",
19+
"@types/node": "25.6.0"
2420
}
2521
}

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
});

e2e/src/authenticate.cjs

Lines changed: 0 additions & 106 deletions
This file was deleted.

e2e/src/config/TestConfig.ts

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)