@@ -18,12 +18,11 @@ import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
18
18
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS' ;
19
19
import { DriverHelper } from '../../utils/DriverHelper' ;
20
20
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader' ;
21
- import { Locators , ModalDialog } from 'monaco-page-objects' ;
21
+ import { By , Locators , ModalDialog } from 'monaco-page-objects' ;
22
22
import { expect } from 'chai' ;
23
23
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor' ;
24
24
import { ShellExecutor } from '../../utils/ShellExecutor' ;
25
25
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil' ;
26
- import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil' ;
27
26
28
27
suite ( '"Check workspace idle timeout" test' , function ( ) : void {
29
28
const workspaceHandlingTests : WorkspaceHandlingTests = e2eContainer . get ( CLASSES . WorkspaceHandlingTests ) ;
@@ -39,12 +38,15 @@ suite('"Check workspace idle timeout" test', function (): void {
39
38
) ;
40
39
const shellExecutor : ShellExecutor = e2eContainer . get ( CLASSES . ShellExecutor ) ;
41
40
const testWorkspaceUtil : ITestWorkspaceUtil = e2eContainer . get ( TYPES . WorkspaceUtil ) ;
42
- const browserTabsUtil : BrowserTabsUtil = e2eContainer . get ( CLASSES . BrowserTabsUtil ) ;
43
41
44
42
const stackName : string = 'Empty Workspace' ;
45
43
const cheClusterName : string = 'devspaces' ;
46
44
let stopWorkspaceTimeout : number = 0 ;
47
45
46
+ async function checkDialogButton ( buttonName : string ) : Promise < void > {
47
+ await driverHelper . waitVisibility ( By . xpath ( `//div[@class='dialog-buttons']//a[text()='${ buttonName } ']` ) ) ;
48
+ }
49
+
48
50
suiteSetup ( function ( ) : void {
49
51
kubernetesCommandLineToolsExecutor . loginToOcp ( ) ;
50
52
shellExecutor . executeCommand ( 'oc project openshift-devspaces' ) ;
@@ -84,21 +86,18 @@ suite('"Check workspace idle timeout" test', function (): void {
84
86
await projectAndFileTests . performTrustAuthorDialog ( ) ;
85
87
} ) ;
86
88
87
- test ( 'Wait idle timeout dialog and click on "Return to Dashboard" button ' , async function ( ) : Promise < void > {
89
+ test ( 'Wait idle timeout dialog and check Dialog buttons ' , async function ( ) : Promise < void > {
88
90
await driverHelper . waitVisibility ( webCheCodeLocators . Dialog . details , TIMEOUT_CONSTANTS . TS_SELENIUM_START_WORKSPACE_TIMEOUT ) ;
89
91
const dialog : ModalDialog = new ModalDialog ( ) ;
90
92
expect ( await dialog . getDetails ( ) ) . includes ( 'Your workspace has stopped due to inactivity.' ) ;
91
- await dialog . pushButton ( 'Return to dashboard' ) ;
93
+ await checkDialogButton ( 'Cancel' ) ;
94
+ await checkDialogButton ( 'Return to dashboard' ) ;
95
+ await checkDialogButton ( 'Restart your workspace' ) ;
92
96
} ) ;
93
97
94
98
test ( 'Check that the workspace has Stopped state' , async function ( ) : Promise < void > {
95
- await dashboard . waitPage ( ) ;
96
- await workspaces . waitWorkspaceWithStoppedStatus ( WorkspaceHandlingTests . getWorkspaceName ( ) ) ;
97
- } ) ;
98
-
99
- suiteTeardown ( 'Open dashboard and close all other tabs' , async function ( ) : Promise < void > {
100
99
await dashboard . openDashboard ( ) ;
101
- await browserTabsUtil . closeAllTabsExceptCurrent ( ) ;
100
+ await workspaces . waitWorkspaceWithStoppedStatus ( WorkspaceHandlingTests . getWorkspaceName ( ) ) ;
102
101
} ) ;
103
102
104
103
suiteTeardown ( 'Stop and delete the workspace by API' , async function ( ) : Promise < void > {
0 commit comments