@@ -26,7 +26,7 @@ import { CreateClusterBasePage } from './cluster-creation-base-page';
26
26
export class CreateKindClusterPage extends CreateClusterBasePage {
27
27
readonly clusterNameField : Locator ;
28
28
readonly controllerCheckbox : Locator ;
29
- readonly providerTypeCombobox : Locator ;
29
+ readonly providerType : Locator ;
30
30
readonly httpPort : Locator ;
31
31
readonly httpsPort : Locator ;
32
32
readonly containerImage : Locator ;
@@ -40,7 +40,7 @@ export class CreateKindClusterPage extends CreateClusterBasePage {
40
40
name : 'Setup an ingress controller' ,
41
41
} )
42
42
. locator ( '..' ) ;
43
- this . providerTypeCombobox = this . clusterPropertiesInformation . getByLabel ( 'Provider Type' ) ;
43
+ this . providerType = this . clusterPropertiesInformation . getByLabel ( 'Provider Type' ) ;
44
44
this . httpPort = this . clusterPropertiesInformation . getByLabel ( 'HTTP Port' ) ;
45
45
this . httpsPort = this . clusterPropertiesInformation . getByLabel ( 'HTTPS Port' ) ;
46
46
this . containerImage = this . clusterPropertiesInformation . getByPlaceholder ( 'Leave empty for using latest.' ) ;
@@ -49,7 +49,7 @@ export class CreateKindClusterPage extends CreateClusterBasePage {
49
49
public async createClusterDefault ( clusterName : string = 'kind-cluster' , timeout ?: number ) : Promise < void > {
50
50
return test . step ( 'Create default cluster' , async ( ) => {
51
51
await fillTextbox ( this . clusterNameField , clusterName ) ;
52
- await playExpect ( this . providerTypeCombobox ) . toContainText ( 'podman' ) ;
52
+ await playExpect ( this . providerType ) . toHaveText ( 'podman' ) ;
53
53
await playExpect ( this . httpPort ) . toHaveValue ( '9090' ) ;
54
54
await playExpect ( this . httpsPort ) . toHaveValue ( '9443' ) ;
55
55
await playExpect ( this . controllerCheckbox ) . toBeChecked ( ) ;
@@ -67,21 +67,30 @@ export class CreateKindClusterPage extends CreateClusterBasePage {
67
67
await fillTextbox ( this . clusterNameField , clusterName ) ;
68
68
69
69
if ( providerType ) {
70
- await playExpect ( this . providerTypeCombobox ) . toBeVisible ( ) ;
71
- const providerTypeOptions = await this . providerTypeCombobox . locator ( 'option' ) . allInnerTexts ( ) ;
72
- if ( providerTypeOptions . includes ( providerType ) ) {
73
- await this . providerTypeCombobox . selectOption ( { value : providerType } ) ;
74
- await playExpect ( this . providerTypeCombobox ) . toHaveValue ( providerType ) ;
75
- } else {
76
- throw new Error ( `${ providerType } doesn't exist` ) ;
70
+ try {
71
+ await playExpect ( this . providerType ) . toBeVisible ( ) ;
72
+ if ( providerType !== 'podman' ) {
73
+ await this . providerType . click ( ) ;
74
+ const providerTypeButton = this . clusterPropertiesInformation . getByRole ( 'button' , {
75
+ name : providerType ,
76
+ exact : true ,
77
+ } ) ;
78
+ await playExpect ( providerTypeButton ) . toBeEnabled ( ) ;
79
+ await providerTypeButton . click ( ) ;
80
+ }
81
+ await playExpect ( this . providerType ) . toHaveText ( providerType ) ;
82
+ } catch {
83
+ throw new Error ( `Provider type '${ providerType } ' doesn't exist` ) ;
77
84
}
78
85
}
79
86
80
87
if ( httpPort ) {
81
88
await fillTextbox ( this . httpPort , httpPort ) ;
89
+ await playExpect ( this . httpPort ) . toHaveText ( httpPort ) ;
82
90
}
83
91
if ( httpsPort ) {
84
92
await fillTextbox ( this . httpsPort , httpsPort ) ;
93
+ await playExpect ( this . httpsPort ) . toHaveText ( httpsPort ) ;
85
94
}
86
95
87
96
await playExpect ( this . controllerCheckbox ) . toBeEnabled ( ) ;
@@ -95,6 +104,7 @@ export class CreateKindClusterPage extends CreateClusterBasePage {
95
104
96
105
if ( containerImage ) {
97
106
await fillTextbox ( this . containerImage , containerImage ) ;
107
+ await playExpect ( this . containerImage ) . toHaveText ( containerImage ) ;
98
108
}
99
109
await this . createCluster ( timeout ) ;
100
110
} ) ;
0 commit comments