Skip to content

Commit 02846e9

Browse files
committed
chore: fixing an e2e test
1 parent 2038cc1 commit 02846e9

37 files changed

+10342
-20
lines changed

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,15 @@ node_modules
33
dist
44
dist-ssr
55
*.local
6-
.eslintcache
6+
.eslintcache
7+
# Yarn
8+
.pnp.*
9+
.yarn/*
10+
!.yarn/patches
11+
!.yarn/plugins
12+
!.yarn/releases
13+
!.yarn/sdks
14+
!.yarn/versions
15+
16+
# Playwright
17+
test-results/

.yarn/releases/yarn-4.9.1.cjs

Lines changed: 948 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
yarnPath: .yarn/releases/yarn-4.9.1.cjs
2+
nodeLinker: node-modules

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
"server:build": "tsc --project tsconfig.server.json --noEmit && node bundle/server/build.js",
1616
"build": "yarn clean && yarn server:build && yarn client:build",
1717
"test:playwright": "playwright test",
18-
"start": "node dist/server.js"
18+
"start": "node dist/server.js",
19+
"prepack": "yarn build"
1920
},
2021
"devDependencies": {
2122
"@babel/core": "^7.26.10",
2223
"@es-exec/esbuild-plugin-start": "^0.0.5",
24+
"@playwright/test": "^1.51.1",
2325
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
2426
"@types/ejs": "^3.1.5",
2527
"@types/express": "^4.17.13",
@@ -46,7 +48,6 @@
4648
"http-proxy-middleware": "^2.0.1",
4749
"lint-staged": "^13.3.0",
4850
"npm-run-all": "^4.1.5",
49-
"playwright": "^1.51.1",
5051
"prettier": "^3.5.3",
5152
"progress-bar-webpack-plugin": "^2.1.0",
5253
"style-loader": "^4.0.0",
@@ -64,8 +65,8 @@
6465
"webpack-merge": "^6.0.1"
6566
},
6667
"dependencies": {
67-
"@1fe/server": "workspace:*",
68-
"@1fe/shell": "workspace:*",
68+
"@1fe/server": "git+ssh://git@github.com:docusign/1fe.git#head=main&workspace=@1fe/server",
69+
"@1fe/shell": "git+ssh://git@github.com:docusign/1fe.git#head=main&workspace=@1fe/shell",
6970
"@emotion/react": "^11.14.0",
7071
"@emotion/styled": "11.14.0",
7172
"core-js": "^3.40.0",
@@ -79,7 +80,8 @@
7980
"react-refresh": "^0.16.0",
8081
"react-router-dom": "6.30.0",
8182
"serve-favicon": "^2.5.0",
82-
"systemjs": "^6.15.1"
83+
"systemjs": "^6.15.1",
84+
"zod": "^3.25.36"
8385
},
8486
"browserslist": [
8587
"ios >= 13",
@@ -110,5 +112,6 @@
110112
"not dead",
111113
"not ie > 0",
112114
"not edge < 19"
113-
]
115+
],
116+
"packageManager": "yarn@4.9.1"
114117
}

playwright.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from '@playwright/test';
22

33
export default defineConfig({
4+
reporter: process.env.CI ? 'github' : 'list',
45
webServer: {
56
command: 'yarn dev',
67
url: 'http://localhost:3001',
@@ -9,5 +10,9 @@ export default defineConfig({
910
stderr: 'pipe',
1011
timeout: 30 * 1000,
1112
},
13+
use: {
14+
testIdAttribute: 'data-qa',
15+
},
1216
testDir: './src/__tests__/tests',
17+
testMatch: '**/*.playwright.ts',
1318
});

src/__tests__/tests/platform-utils/appLoadTime.spec.ts renamed to src/__tests__/tests/platform-utils/appLoadTime.playwright.ts

File renamed without changes.

src/__tests__/tests/platform-utils/context.spec.ts renamed to src/__tests__/tests/platform-utils/context.playwright.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ test('Context functions in @internal/generic-child-widget', async ({
66
// Navigate to the app
77
await page.goto('http://localhost:3001/app1/utils');
88

9-
await page.click('button[data-qa="utils.context.get.btn"]');
9+
const resultElement = page.getByTestId('wsk.context.result.container');
1010

11-
const resultElement = page.locator(
12-
'div[data-qa="wsk.context.result.container"]',
13-
);
11+
await expect(resultElement).toHaveText('');
1412

15-
await expect(await resultElement).toHaveText('');
13+
await page.getByTestId('utils.context.self.btn').click();
1614

17-
await page.click('button[data-qa="utils.context.self.btn"]');
1815
await page.waitForTimeout(100);
1916

2017
const selfContent = JSON.parse((await resultElement.textContent()) || '{}');

src/__tests__/tests/platform-utils/eventbus.spec.ts renamed to src/__tests__/tests/platform-utils/eventbus.playwright.ts

File renamed without changes.

src/__tests__/tests/platform-utils/experience.spec.ts renamed to src/__tests__/tests/platform-utils/experience.playwright.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ test('utils.experience.title.set', async ({ page }) => {
1212

1313
title = await page.title();
1414

15-
const expectedTitle = 'hello world';
16-
expect(title).toBe(expectedTitle);
15+
const expectedTitle = /hello world/i;
16+
expect(title).toMatch(expectedTitle);
1717
});
1818

1919
test('utils.experience.title.get', async ({ page }) => {

src/__tests__/tests/platform-utils/localStorage.spec.ts renamed to src/__tests__/tests/platform-utils/localStorage.playwright.ts

File renamed without changes.

0 commit comments

Comments
 (0)