Skip to content

Commit 1e1b6ec

Browse files
committed
disable parallel tests
1 parent 55e2dd1 commit 1e1b6ec

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

‎otoroshi/javascript/playwright.config.js‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@ import { defineConfig, devices } from '@playwright/test';
22

33
export default defineConfig({
44
testDir: './tests',
5-
// Tests across files AND inside a file may run in parallel. Each test
6-
// must (a) generate unique entity names (use `uniqueName()` from the
7-
// helpers) and (b) clean up everything it creates in a try/finally —
8-
// shared `wipeLeftovers` runs only in `beforeAll` (once per worker)
9-
// and uses file-scoped prefixes that never overlap between specs.
10-
fullyParallel: true,
11-
// CI runners are much slower than a dev laptop: a 5s per-test budget there
12-
// makes tests time out, which tears down the browser context and cascades
13-
// "Target page/context/browser has been closed" into every following test
14-
// on the same worker. Give CI a realistic budget.
5+
fullyParallel: false,
156
timeout: process.env.CI ? 60_000 : 15_000,
167
expect: { timeout: process.env.CI ? 15_000 : 5_000 },
178
forbidOnly: !!process.env.CI,

‎otoroshi/javascript/tests/spec/entity-location/admin.spec.js‎

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
// Entity-location defaults — ADMIN user variant.
22
// Logs in as admin@otoroshi.io (super-admin), so the default location should
3-
// resolve to "Default organization" + "Default team".
3+
// resolve to the default organization + default team.
44
// See tester.spec.js for the constrained-rights variant.
55
import { test, expect } from '@playwright/test';
66

77
let context;
8+
// The default org/team name+description differ between a fresh instance and
9+
// an older datastore (two divergent seed paths in Env.scala). Don't hardcode
10+
// them — fetch the real entities and build the expected "<name> - <desc>"
11+
// strings the Location component renders.
12+
let expectedOrgText;
13+
let expectedTeamText;
814

915
test.beforeAll(async ({ browser }) => {
1016
context = await browser.newContext({ storageState: 'tests/playwright/.auth/admin.json' });
17+
18+
const page = await context.newPage();
19+
const tenant = await (await page.request.get('/bo/api/proxy/api/tenants/default')).json();
20+
const team = await (await page.request.get('/bo/api/proxy/api/teams/default')).json();
21+
expectedOrgText = `${tenant.name} - ${tenant.description}`;
22+
expectedTeamText = `${team.name} - ${team.description}`;
23+
await page.close();
1124
});
1225

1326
test.afterAll(async () => {
@@ -20,8 +33,8 @@ async function shouldDefaultTeamsAndTenant(path, action = 'add item') {
2033

2134
await page.getByRole('button', { name: action, exact: false }).click();
2235

23-
await expect(page.locator('#content-scroll-container')).toContainText('Default organization - The default organization');
24-
await expect(page.locator('#content-scroll-container')).toContainText('Default Team - The default Team of the default organization');
36+
await expect(page.locator('#content-scroll-container')).toContainText(expectedOrgText);
37+
await expect(page.locator('#content-scroll-container')).toContainText(expectedTeamText);
2538
}
2639

2740
async function shouldDefaultTenantOnTeam() {
@@ -30,7 +43,7 @@ async function shouldDefaultTenantOnTeam() {
3043

3144
await page.getByRole('button', { name: 'add item', exact: false }).click();
3245

33-
await expect(page.locator('#content-scroll-container')).toContainText('Default organization - The default organization');
46+
await expect(page.locator('#content-scroll-container')).toContainText(expectedOrgText);
3447
}
3548

3649
async function shouldDefaultTeamsAndTenantOnRoutes() {
@@ -40,8 +53,8 @@ async function shouldDefaultTeamsAndTenantOnRoutes() {
4053
await page.getByRole('link', { name: /Create new route/ }).click();
4154
await page.locator('div').filter({ hasText: /^Location$/ }).nth(1).click();
4255

43-
await expect(page.locator('#content-scroll-container')).toContainText('Default organization - The default organization');
44-
await expect(page.locator('#content-scroll-container')).toContainText('Default Team - The default Team of the default organization');
56+
await expect(page.locator('#content-scroll-container')).toContainText(expectedOrgText);
57+
await expect(page.locator('#content-scroll-container')).toContainText(expectedTeamText);
4558
}
4659

4760
test('[admin] New Routes got the right entity location', async () => shouldDefaultTeamsAndTenantOnRoutes());

0 commit comments

Comments
 (0)