11import { expect } from '@playwright/test' ;
2+ import { selectTarget } from 'playwright/helpers/targetChooser' ;
23import { v4 as uuidv4 } from 'uuid' ;
34
45import { test } from '../../fixtures/customizations' ;
56import { isHosted } from '../../helpers/helpers' ;
67import { ensureAuthenticated } from '../../helpers/login' ;
7- import {
8- fillInImageOutput ,
9- ibFrame ,
10- navigateToLandingPage ,
11- } from '../../helpers/navHelpers' ;
8+ import { ibFrame , navigateToLandingPage } from '../../helpers/navHelpers' ;
129import {
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 : / a z u r e t e n a n t g u i d / 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 : / G e n e r a t i o n 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 : / a z u r e t e n a n t g u i d / i } )
@@ -159,18 +166,21 @@ test('Deselecting Azure removes its config from the blueprint', async ({
159166 await frame
160167 . getByRole ( 'textbox' , { name : / r e s o u r c e g r o u p / 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 : / M i c r o s o f t A z u r e / } ) . 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 ( ) => {
0 commit comments