@@ -4,9 +4,9 @@ import { machinePoolConfigResponse } from '@/cypress/e2e/blueprints/manager/mach
44import ClusterManagerListPagePo from '@/cypress/e2e/po/pages/cluster-manager/cluster-manager-list.po' ;
55import ClusterManagerEditGenericPagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/edit/cluster-edit-generic.po' ;
66import ClusterManagerCreateRke2AzurePagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create-rke2-azure.po' ;
7- import CloudCredentialsCreatePagePo from '@/cypress/e2e/po/pages/cluster-manager/cloud-credentials-create .po' ;
7+ import CloudCredentialsPagePo from '@/cypress/e2e/po/pages/cluster-manager/cloud-credentials.po' ;
88import ClusterManagerCreatePagePo from '@/cypress/e2e/po/edit/provisioning.cattle.io.cluster/create/cluster-create.po' ;
9- import CloudCredentialsCreateAWSPagePo from '@/cypress/e2e/po/pages/cluster-manager/cloud-credentials-create-aws .po' ;
9+ import LoadingPo from '@/cypress/e2e/po/components/loading .po' ;
1010
1111describe ( 'Cloud Credential' , { testIsolation : 'off' } , ( ) => {
1212 const clusterList = new ClusterManagerListPagePo ( ) ;
@@ -235,24 +235,26 @@ describe('Cloud Credential', { testIsolation: 'off' }, () => {
235235 const secret = 'secret' ;
236236 const errorMessage = 'Authentication test failed, please check your credentials' ;
237237
238- CloudCredentialsCreatePagePo . goTo ( ) ;
239- const createCredentialsPo = new CloudCredentialsCreatePagePo ( ) ;
238+ const cloudCredentialsPage = new CloudCredentialsPagePo ( ) ;
240239
241- createCredentialsPo . waitForPageWithExactUrl ( ) ;
240+ cloudCredentialsPage . goTo ( ) ;
241+ cloudCredentialsPage . waitForPage ( ) ;
242+ cloudCredentialsPage . create ( ) ;
243+ cloudCredentialsPage . createEditCloudCreds ( ) . waitForPage ( ) ;
244+ cloudCredentialsPage . createEditCloudCreds ( ) . cloudServiceOptions ( ) . selectSubTypeByIndex ( 0 ) . click ( ) ;
245+ cloudCredentialsPage . createEditCloudCreds ( ) . waitForPage ( 'type=aws' ) ;
242246
243- const createCredentialsAwsPo = createCredentialsPo . selectAws ( ) ;
247+ cloudCredentialsPage . createEditCloudCreds ( ) . accessKey ( ) . set ( access ) ;
248+ cloudCredentialsPage . createEditCloudCreds ( ) . secretKey ( ) . set ( secret ) ;
249+ cloudCredentialsPage . createEditCloudCreds ( ) . nameNsDescription ( ) . name ( ) . set ( name ) ;
244250
245- createCredentialsAwsPo . waitForPageWithExactUrl ( ) ;
251+ cloudCredentialsPage . createEditCloudCreds ( ) . nameNsDescription ( ) . name ( ) . value ( )
252+ . should ( 'eq' , name ) ;
246253
247- createCredentialsAwsPo . accessKeyInput ( ) . set ( access ) ;
248- createCredentialsAwsPo . secretKeyInput ( ) . set ( secret ) ;
249- createCredentialsAwsPo . credentialNameInput ( ) . set ( name ) ;
250-
251- createCredentialsAwsPo . credentialNameInput ( ) . value ( ) . should ( 'eq' , name ) ;
252-
253- createCredentialsAwsPo . clickCreate ( ) ;
254+ cloudCredentialsPage . createEditCloudCreds ( ) . saveCreateForm ( ) . cruResource ( ) . saveOrCreate ( )
255+ . click ( ) ;
254256 // In the previous bug this text would get truncated to the first letter
255- createCredentialsAwsPo . errorBanner ( ) . should ( 'contain.text' , errorMessage ) ;
257+ cloudCredentialsPage . resourceDetail ( ) . createEditView ( ) . errorBanner ( ) . should ( 'contain.text' , errorMessage ) ;
256258 } ) ;
257259
258260 it ( 'Ensure we validate credentials and show an error when invalid when creating a credential from the create cluster page' , { tags : [ '@manager' , '@adminUser' ] } , ( ) => {
@@ -263,23 +265,28 @@ describe('Cloud Credential', { testIsolation: 'off' }, () => {
263265 const errorMessage = 'Authentication test failed, please check your credentials' ;
264266
265267 const clusterCreate = new ClusterManagerCreatePagePo ( ) ;
268+ const loadingPo = new LoadingPo ( '.loading-indicator' ) ;
266269
267270 clusterCreate . goTo ( ) ;
268271 clusterCreate . waitForPage ( ) ;
269272 clusterCreate . selectCreate ( 0 ) ;
273+ loadingPo . checkNotExists ( ) ;
270274 clusterCreate . rke2PageTitle ( ) . should ( 'include' , 'Create Amazon EC2' ) ;
275+ clusterCreate . waitForPage ( 'type=amazonec2&rkeType=rke2' ) ;
271276
272- const createCredentialsAwsPo = new CloudCredentialsCreateAWSPagePo ( ) ;
277+ const cloudCredentialsPage = new CloudCredentialsPagePo ( ) ;
273278
274- createCredentialsAwsPo . accessKeyInput ( ) . set ( access ) ;
275- createCredentialsAwsPo . secretKeyInput ( ) . set ( secret ) ;
276- createCredentialsAwsPo . credentialNameInput ( ) . set ( name ) ;
279+ cloudCredentialsPage . createEditCloudCreds ( ) . accessKey ( ) . set ( access ) ;
280+ cloudCredentialsPage . createEditCloudCreds ( ) . secretKey ( ) . set ( secret ) ;
281+ cloudCredentialsPage . createEditCloudCreds ( ) . nameNsDescription ( ) . name ( ) . set ( name ) ;
277282
278- createCredentialsAwsPo . credentialNameInput ( ) . value ( ) . should ( 'eq' , name ) ;
283+ cloudCredentialsPage . createEditCloudCreds ( ) . nameNsDescription ( ) . name ( ) . value ( )
284+ . should ( 'eq' , name ) ;
279285
280- createCredentialsAwsPo . clickCreate ( ) ;
286+ cloudCredentialsPage . createEditCloudCreds ( ) . saveCreateForm ( ) . cruResource ( ) . saveOrCreate ( )
287+ . click ( ) ;
281288 // In the previous bug this text would get truncated to the first letter
282- createCredentialsAwsPo . errorBanner ( ) . should ( 'contain.text' , errorMessage ) ;
289+ cloudCredentialsPage . resourceDetail ( ) . createEditView ( ) . errorBanner ( ) . should ( 'contain.text' , errorMessage ) ;
283290 } ) ;
284291
285292 after ( ( ) => {
0 commit comments