-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e862bb5
commit 09ff112
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
tests/e2e/specs/miscellaneous/WorkspaceIdleTimeout.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** ******************************************************************* | ||
* copyright (c) 2020-2023 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
import { e2eContainer } from '../../configs/inversify.config'; | ||
import { CLASSES } from '../../configs/inversify.types'; | ||
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; | ||
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests'; | ||
import { LoginTests } from '../../tests-library/LoginTests'; | ||
import { registerRunningWorkspace } from '../MochaHooks'; | ||
import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; | ||
import { Workspaces } from '../../pageobjects/dashboard/Workspaces'; | ||
import { By } from 'selenium-webdriver'; | ||
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; | ||
import { DriverHelper } from '../../utils/DriverHelper'; | ||
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader'; | ||
import { Locators } from 'monaco-page-objects'; | ||
|
||
const stackName: string = 'Empty Workspace'; | ||
|
||
suite('"Check workspace idle timeout" test', function (): void { | ||
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); | ||
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); | ||
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); | ||
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); | ||
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces); | ||
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); | ||
const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader); | ||
const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators; | ||
|
||
loginTests.loginIntoChe(); | ||
|
||
test(`Create and open new workspace, stack:${stackName}`, async function (): Promise<void> { | ||
await workspaceHandlingTests.createAndOpenWorkspace(stackName); | ||
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage(); | ||
}); | ||
|
||
test('Wait workspace readiness', async function (): Promise<void> { | ||
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName()); | ||
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor(); | ||
await projectAndFileTests.performTrustAuthorDialog(); | ||
}); | ||
|
||
test('Wait idle timeout dialog and click on "Return to Dashboard" button', async function (): Promise<void> { | ||
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message, TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT); | ||
if (await driverHelper.isVisible((webCheCodeLocators.Dialog as any).returnToDashboardButton)) { | ||
await driverHelper.waitAndClick((webCheCodeLocators.Dialog as any).returnToDashboardButton); | ||
} | ||
}); | ||
|
||
test('Check that the workskpace has Stopped state', async function (): Promise<void> { | ||
await dashboard.waitPage(); | ||
await workspaces.waitWorkspaceWithStoppedStatus(WorkspaceHandlingTests.getWorkspaceName()); | ||
}); | ||
|
||
test('Delete the workspace', async function (): Promise<void> { | ||
await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); | ||
}); | ||
|
||
loginTests.logoutFromChe(); | ||
}); |