tests: fix flaky test with hardcoded ID #13796
Annotations
5 errors, 2 warnings, and 1 notice
tests/utils/scenario.ts#L29
1) [chromium] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
TypeError: Cannot read properties of undefined (reading 'id')
at utils/scenario.ts:29
27 | // Create a new scenario with a unique name
28 | const scenario = await postApiRequest(
> 29 | `/api/projects/${project.id}/studies/${study.id}/scenarios/`,
| ^
30 | {
31 | ...scenarioData,
32 | name: `${scenarioData.name} ${uuidv4()}`,
at setupScenario (/app/tests/utils/scenario.ts:29:50)
at /app/tests/004-scenario-management.spec.ts:17:35
|
tests/pages/home-page-model.ts#L79
2) [firefox] › 001-home-page.spec.ts:22:7 › Home page OSRD › should display links in the home page
Error: expect(locator).toHaveText(expected)
Locator: locator('h5')
- Expected - 5
+ Received + 5
Array [
- "Études d'exploitation",
- "Sillons de dernière minute",
- "Éditeur d'infrastructure",
- "Éditeur de matériel roulant",
- "Cartographie",
+ "operationalStudies",
+ "stdcm",
+ "editor",
+ "rollingStockEditor",
+ "map",
]
Call log:
- expect.toHaveText with timeout 10000ms
- waiting for locator('h5')
- locator resolved to 5 elements
- locator resolved to 5 elements
at pages/home-page-model.ts:79
77 | // Assert that the expected links are displayed on the page
78 | async getDisplayLinks() {
> 79 | expect(this.getLinks).toHaveText([
| ^
80 | this.getTranslations('operationalStudies'),
81 | this.getTranslations('stdcm'),
82 | this.getTranslations('editor'),
at HomePage.getDisplayLinks (/app/tests/pages/home-page-model.ts:79:27)
at /app/tests/001-home-page.spec.ts:23:20
|
tests/utils/scenario.ts#L29
3) [firefox] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
TypeError: Cannot read properties of undefined (reading 'id')
at utils/scenario.ts:29
27 | // Create a new scenario with a unique name
28 | const scenario = await postApiRequest(
> 29 | `/api/projects/${project.id}/studies/${study.id}/scenarios/`,
| ^
30 | {
31 | ...scenarioData,
32 | name: `${scenarioData.name} ${uuidv4()}`,
at setupScenario (/app/tests/utils/scenario.ts:29:50)
at /app/tests/004-scenario-management.spec.ts:17:35
|
tests/utils/scenario.ts#L29
4) [webkit] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
TypeError: Cannot read properties of undefined (reading 'id')
at utils/scenario.ts:29
27 | // Create a new scenario with a unique name
28 | const scenario = await postApiRequest(
> 29 | `/api/projects/${project.id}/studies/${study.id}/scenarios/`,
| ^
30 | {
31 | ...scenarioData,
32 | name: `${scenarioData.name} ${uuidv4()}`,
at setupScenario (/app/tests/utils/scenario.ts:29:50)
at /app/tests/004-scenario-management.spec.ts:17:35
|
tests/utils/scenario.ts#L29
4) [webkit] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
Retry #1 ───────────────────────────────────────────────────────────────────────────────────────
TypeError: Cannot read properties of undefined (reading 'id')
at utils/scenario.ts:29
27 | // Create a new scenario with a unique name
28 | const scenario = await postApiRequest(
> 29 | `/api/projects/${project.id}/studies/${study.id}/scenarios/`,
| ^
30 | {
31 | ...scenarioData,
32 | name: `${scenarioData.name} ${uuidv4()}`,
at setupScenario (/app/tests/utils/scenario.ts:29:50)
at /app/tests/004-scenario-management.spec.ts:17:35
|
The following actions use a deprecated Node.js version and will be forced to run on node20: codecov/codecov-action@v3. For more info: https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/
|
[chromium] › 009-rollingstock-editor.spec.ts#L1
[chromium] › 009-rollingstock-editor.spec.ts took 31.7s
|
4 flaky
[chromium] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
[firefox] › 001-home-page.spec.ts:22:7 › Home page OSRD › should display links in the home page
[firefox] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
[webkit] › 004-scenario-management.spec.ts:21:7 › Test if scenario creation workflow is working properly › Create a new scenario
7 skipped
93 passed (7.8m)
|
The logs for this run have expired and are no longer available.
Loading