Skip to content

Commit e3b69fc

Browse files
committed
Update e2e tests with fix for occupied ports
1 parent d24da3b commit e3b69fc

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

browser/e2e/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
},
1414
"devDependencies": {
1515
"@playwright/test": "^1.48.1",
16-
"@types/kill-port": "^2.0.3"
16+
"@types/kill-port": "^2.0.3",
17+
"@axe-core/playwright": "^4.10.1",
18+
"kill-port": "^2.0.1"
1719
},
1820
"scripts": {
1921
"playwright-install": "playwright install chromium",
@@ -24,8 +26,5 @@
2426
"test-new": "playwright codegen http://localhost:5173",
2527
"test-query": "PWDEBUG=1 DELETE_PREVIOUS_TEST_DRIVES=false playwright test \"e2e.spec.ts\" \"tables.spec.ts\" \"documents.spec.ts\" \"ontology.spec.ts\" \"search.spec.ts\" -g"
2628
},
27-
"dependencies": {
28-
"@axe-core/playwright": "^4.10.1",
29-
"kill-port": "^2.0.1"
30-
}
29+
"dependencies": {}
3130
}

browser/e2e/tests/template.spec.ts

+14-6
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ const waitForServer = (
7474
childProcess.stdout?.on('data', data => {
7575
const message = data.toString();
7676

77-
log(message);
78-
7977
const match = message.match(/http:\/\/localhost:\d+/);
8078

8179
if (match) {
@@ -160,6 +158,13 @@ test.describe('Create Next.js Template', () => {
160158
await expect(page.locator('body')).not.toContainText('coffee');
161159
} finally {
162160
child.kill();
161+
kill(3000)
162+
.then(() => {
163+
log('Next.js server shut down successfully');
164+
})
165+
.catch(err => {
166+
console.error('Failed to shut down Next.js server:', err);
167+
});
163168
}
164169
});
165170

@@ -176,8 +181,6 @@ test.describe('Create Next.js Template', () => {
176181
} catch (error) {
177182
console.error(`Failed to delete ${TEMPLATE_DIR_NAME}:`, error);
178183
}
179-
180-
await kill(3000);
181184
});
182185
});
183186

@@ -240,6 +243,13 @@ test.describe('Create SvelteKit Template', () => {
240243
await expect(page.locator('body')).not.toContainText('coffee');
241244
} finally {
242245
child.kill();
246+
kill(4174)
247+
.then(() => {
248+
log('SvelteKit server shut down successfully');
249+
})
250+
.catch(err => {
251+
console.error('Failed to shut down SvelteKit server:', err);
252+
});
243253
}
244254
});
245255

@@ -256,7 +266,5 @@ test.describe('Create SvelteKit Template', () => {
256266
} catch (error) {
257267
console.error(`Failed to delete ${TEMPLATE_DIR_NAME}:`, error);
258268
}
259-
260-
await kill(4173);
261269
});
262270
});

browser/pnpm-lock.yaml

+19-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)