playwright: fix cockpit cloud provider test

The test was a bit flaky, move the worker file check to the end of
the test since it appears that we might be trying to read the file
before it has been created.
This commit is contained in:
Gianluca Zuccarelli 2025-07-22 16:23:13 +01:00 committed by Klara Simickova
parent a6eadbffac
commit 690b71636a

View file

@ -221,13 +221,6 @@ test.describe.serial('test', () => {
).toBeVisible();
}
const config = readFileSync('/etc/osbuild-worker/osbuild-worker.toml');
// this is for testing, the field `aws` should exist
// eslint-disable-next-line
const parsed = TOML.parse(config) as any;
expect(parsed.aws?.bucket).toBe(bucket);
expect(parsed.aws?.credentials).toBe(credentials);
await frame
.getByRole('button', { name: 'Configure Cloud Providers' })
.click();
@ -236,9 +229,16 @@ test.describe.serial('test', () => {
await expect(frame.getByPlaceholder('AWS bucket')).toHaveValue(bucket);
await expect(frame.getByPlaceholder('Path to AWS credentials')).toHaveValue(
credentials
credentials,
);
await frame.getByRole('button', { name: 'Cancel' }).click();
const config = readFileSync('/etc/osbuild-worker/osbuild-worker.toml');
// this is for testing, the field `aws` should exist
// eslint-disable-next-line
const parsed = TOML.parse(config) as any;
expect(parsed.aws?.bucket).toBe(bucket);
expect(parsed.aws?.credentials).toBe(credentials);
});
test('cockpit cloud upload', async ({ page }) => {