Skip to content

Commit 0b31ddb

Browse files
tkoscielnregexowl
authored andcommitted
tests/paywright: Update Azure test to new layout
Azure as a target is not a standalone step anymore, adjust the PW test accordingly.
1 parent c2672dd commit 0b31ddb

4 files changed

Lines changed: 25 additions & 16 deletions

File tree

playwright/Customizations/OpenSCAP.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import * as path from 'path';
44
import { expect } from '@playwright/test';
55
import { v4 as uuidv4 } from 'uuid';
66

7-
import { selectDistro } from '../BootTests/helpers/targetChooser';
87
import { test } from '../fixtures/cleanup';
98
import { isHosted } from '../helpers/helpers';
109
import { ensureAuthenticated } from '../helpers/login';
1110
import { ibFrame, navigateToLandingPage } from '../helpers/navHelpers';
11+
import { selectDistro } from '../helpers/targetChooser';
1212
import {
1313
createBlueprint,
1414
deleteBlueprint,

playwright/Customizations/TargetEnvironments/Azure.spec.ts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { expect } from '@playwright/test';
2+
import { selectTarget } from 'playwright/helpers/targetChooser';
23
import { v4 as uuidv4 } from 'uuid';
34

45
import { test } from '../../fixtures/customizations';
56
import { isHosted } from '../../helpers/helpers';
67
import { ensureAuthenticated } from '../../helpers/login';
7-
import {
8-
fillInImageOutput,
9-
ibFrame,
10-
navigateToLandingPage,
11-
} from '../../helpers/navHelpers';
8+
import { ibFrame, navigateToLandingPage } from '../../helpers/navHelpers';
129
import {
1310
createBlueprint,
1411
deleteBlueprint,
@@ -31,7 +28,9 @@ test('Create a blueprint with Azure target', async ({ page, cleanup }) => {
3128
const frame = ibFrame(page);
3229

3330
await test.step('Select Azure target and verify field behavior', async () => {
34-
await fillInImageOutput(frame, 'azure');
31+
await page.getByRole('button', { name: 'Create image blueprint' }).click();
32+
33+
await selectTarget(frame, 'azure');
3534

3635
const nextButton = frame.getByRole('button', { name: 'Next' });
3736
await expect(nextButton).toBeDisabled();
@@ -82,7 +81,10 @@ test('Create a blueprint with Azure target', async ({ page, cleanup }) => {
8281

8382
await test.step('Edit blueprint and verify Azure config persisted', async () => {
8483
await frame.getByRole('button', { name: 'Edit blueprint' }).click();
85-
await frame.getByRole('button', { name: 'Azure', exact: true }).click();
84+
await frame
85+
.getByLabel('Wizard steps')
86+
.getByRole('button', { name: 'Image output' })
87+
.click();
8688

8789
const tenantInput = frame.getByRole('textbox', {
8890
name: /azure tenant guid/i,
@@ -120,7 +122,10 @@ test('Create a blueprint with Azure target', async ({ page, cleanup }) => {
120122

121123
await test.step('Re-edit and verify V1 persisted', async () => {
122124
await frame.getByRole('button', { name: 'Edit blueprint' }).click();
123-
await frame.getByRole('button', { name: 'Azure', exact: true }).click();
125+
await frame
126+
.getByLabel('Wizard steps')
127+
.getByRole('button', { name: 'Image output' })
128+
.click();
124129

125130
await expect(
126131
frame.getByRole('button', { name: /Generation 1/i }),
@@ -148,7 +153,9 @@ test('Deselecting Azure removes its config from the blueprint', async ({
148153
const frame = ibFrame(page);
149154

150155
await test.step('Select Azure and fill in fields', async () => {
151-
await fillInImageOutput(frame, 'azure');
156+
await page.getByRole('button', { name: 'Create image blueprint' }).click();
157+
158+
await selectTarget(frame, 'azure');
152159

153160
await frame
154161
.getByRole('textbox', { name: /azure tenant guid/i })
@@ -159,18 +166,21 @@ test('Deselecting Azure removes its config from the blueprint', async ({
159166
await frame
160167
.getByRole('textbox', { name: /resource group/i })
161168
.fill(RESOURCE_GROUP);
169+
170+
await frame.getByRole('button', { name: 'Next' }).click();
162171
});
163172

164173
await test.step('Go back and deselect Azure', async () => {
165174
await frame
166-
.getByRole('button', { name: 'Image output', exact: true })
175+
.getByLabel('Wizard steps')
176+
.getByRole('button', { name: 'Image output' })
167177
.click();
168178

169-
await frame.getByRole('checkbox', { name: /Microsoft Azure/ }).click();
179+
await selectTarget(frame, 'azure');
170180

171181
await expect(
172-
frame.getByRole('button', { name: 'Azure', exact: true }),
173-
).toBeHidden();
182+
frame.getByRole('checkbox', { name: 'Microsoft Azure' }),
183+
).not.toBeChecked();
174184
});
175185

176186
await test.step('Select Guest Image and continue', async () => {

playwright/helpers/navHelpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ import {
77
sleep,
88
togglePreview,
99
} from './helpers';
10-
1110
import {
1211
type ImageTarget,
1312
selectArch,
1413
selectDistro,
1514
selectTarget,
16-
} from '../BootTests/helpers/targetChooser';
15+
} from './targetChooser';
1716

1817
/**
1918
* Opens the wizard, fills out the "Image Output" step according to the parameters, and navigates to the optional steps
File renamed without changes.

0 commit comments

Comments
 (0)