action #134690
closedcoordination #121855: [epic] Agama web interactive installation
Enable logs upload for agama playwright tests
Description
After unifying the agama playwright tests, we cannot use hardcoded log name paths in order to upload trace.zip logs. We can add a command that will find and move the trace.zip file to a specifically named folder, se that we can upload it using the same command for all tests.
Previously we used:
upload_logs('./test-results/lvm-The-main-page-Use-logical-volume-management-LVM-as-storage-device-for-installation-chromium/trace.zip');
Now we would like to rename first and then use generic file path:
assert_script_run('find ./test-results -name 'trace.zip' -exec mv -t /tmp/ {} +');
upload_logs('./tmp/trace.zip');
Additionally, investigate the possibility of playwright creating more than one log file and make sure that all files will be uploaded.
Updated by JERiveraMoya over 1 year ago
- Related to action #132989: Unify interactive installations in tests/yam/agama and its respective schedules added
Updated by lmanfredi over 1 year ago
- Status changed from Workable to In Progress
- Assignee set to lmanfredi
Updated by lmanfredi over 1 year ago
After doing some local tests, it seems that Playwright will create a zip file for each test always with the name trace.zip
but inside separated folders.
The name of these folders are build by using:
- the name of ts file without the suffix
.spec.ts
- the title of the test with spaces replaced with hyphens and special chars removed
- the name of project (chromium in our case)
E.g. a file test-3.spec.ts
with the content:
import { test, expect } from '@playwright/test';
test.describe('The main page', () => {
test.beforeEach(async ({ page }) => {
await ...
});
test('has title', async ({ page }) => {
...
});
test('get started: /home Link', async ({ page }) => {
...
});
test('API link', async ({ page }) => {
...
await test.step("inside step", async () => {
...
});
});
});
by running the test with playwright test --project chromium --trace on tests/test-3.spec.ts
will be created these files:
./test-results/test-3-The-main-page-has-title-chromium/trace.zip
./test-results/test-3-The-main-page-API-link-chromium/trace.zip
./test-results/test-3-The-main-page-get-started-home-Link-chromium/trace.zip
Updated by lmanfredi about 1 year ago
- Status changed from In Progress to Resolved