1- import { switchPerspective } from '@console/dev-console/integration-tests/support/constants' ;
21import { formPO } from '@console/dev-console/integration-tests/support/pageObjects' ;
32import { webTerminalPO } from '@console/dev-console/integration-tests/support/pageObjects/webterminal-po' ;
4- import {
5- app ,
6- perspective ,
7- projectNameSpace ,
8- } from '@console/dev-console/integration-tests/support/pages/app' ;
9- import { searchResource } from '@console/dev-console/integration-tests/support/pages/search-resources/search-page' ;
10- import { webTerminalPage } from './webTerminal-page' ;
3+ import { app } from '@console/dev-console/integration-tests/support/pages/app' ;
114
125export const initTerminalPage = {
136 clickOnProjectDropDown : ( ) => {
@@ -25,26 +18,8 @@ export const initTerminalPage = {
2518
2619 clickStartButton : ( ) => {
2720 cy . get ( formPO . create ) . should ( 'be.enabled' ) . click ( { force : true } ) ;
28- cy . get ( 'body' ) . then ( ( $body ) => {
29- cy . wait ( 5000 ) ;
30- // Due to initialization issue if multiple operators present OCPBUGS-44891
31- if ( $body . find ( '[data-test="loading-box-body"]' ) . length === 0 ) {
32- cy . log ( 'loading did not go through' ) ;
33- cy . wait ( 10000 ) ;
34- cy . get ( webTerminalPO . terminalCloseWindowBtn ) . click ( ) ;
35- cy . reload ( ) ;
36- app . waitForDocumentLoad ( ) ;
37- perspective . switchTo ( switchPerspective . Administrator ) ;
38- cy . byLegacyTestID ( 'topology-header' ) . should ( 'exist' ) . click ( { force : true } ) ;
39- projectNameSpace . selectProject ( 'openshift-terminal' ) ;
40- webTerminalPage . clickOpenCloudShellBtn ( ) ;
41- searchResource . searchResourceByNameAsAdmin ( 'DevWorkspace' ) ;
42- searchResource . selectSearchedItem ( 'terminal' ) ;
43- // cy.get('[data-test="loading-indicator"]').should('not.exist', { timeout: 210000 });
44- } else {
45- cy . wait ( 5000 ) ;
46- }
47- } ) ;
21+ cy . get ( '[data-test="loading-box-body"]' ) . should ( 'exist' , { timeout : 5000 } ) ; // wait for "loading..." appears
22+ cy . get ( '[data-test="loading-box-body"]' ) . should ( 'not.exist' , { timeout : 90000 } ) ; // wait for terminal loading
4823 } ,
4924
5025 selectProject : ( projectName : string ) => {
0 commit comments