@eclipse-che/che-e2e
Advanced tools
Comparing version 7.95.0-next-4787042 to 7.95.0-next-8898b7d
@@ -34,5 +34,7 @@ "use strict"; | ||
const inversify_config_1 = require("../../configs/inversify.config"); | ||
const BrowserTabsUtil_1 = require("../../utils/BrowserTabsUtil"); | ||
let OcpMainPage = OcpMainPage_1 = class OcpMainPage { | ||
constructor(driverHelper) { | ||
constructor(driverHelper, browserTabsUtil) { | ||
this.driverHelper = driverHelper; | ||
this.browserTabsUtil = browserTabsUtil; | ||
} | ||
@@ -75,2 +77,9 @@ async waitOpenMainPage() { | ||
} | ||
async clickOnAppLauncherAndDevSpaceItem() { | ||
Logger_1.Logger.debug('click on app launcher menu'); | ||
const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle(); | ||
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.css('nav[data-test-id="application-launcher"]')); | ||
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.xpath('//span[contains(.,"Red Hat OpenShift Dev Spaces")]')); | ||
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT); | ||
} | ||
getRoleLocator(role) { | ||
@@ -107,5 +116,7 @@ return selenium_webdriver_1.By.xpath(`//a//*[text()="${role}"]`); | ||
__param(0, (0, inversify_1.inject)(inversify_types_1.CLASSES.DriverHelper)), | ||
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper]) | ||
__param(1, (0, inversify_1.inject)(inversify_types_1.CLASSES.BrowserTabsUtil)), | ||
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper, | ||
BrowserTabsUtil_1.BrowserTabsUtil]) | ||
], OcpMainPage); | ||
exports.OcpMainPage = OcpMainPage; | ||
//# sourceMappingURL=OcpMainPage.js.map |
@@ -20,5 +20,7 @@ "use strict"; | ||
const TIMEOUT_CONSTANTS_1 = require("../../constants/TIMEOUT_CONSTANTS"); | ||
const Logger_1 = require("../../utils/Logger"); | ||
suite(`DevConsole Integration ${BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function () { | ||
let ocpImportPage; | ||
let ocpApplicationPage; | ||
let parentGUID = ''; | ||
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests); | ||
@@ -28,2 +30,3 @@ const dashboard = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Dashboard); | ||
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests); | ||
const shellExecutor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ShellExecutor); | ||
const browserTabsUtil = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.BrowserTabsUtil); | ||
@@ -39,2 +42,7 @@ const ocpMainPage = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.OcpMainPage); | ||
kubernetesCommandLineToolsExecutor.loginToOcp(); | ||
// delete the test project on a cluster if it has not been deleted properly in the previous run | ||
const expectedProject = shellExecutor.executeCommand(`oc get project ${projectName}`); | ||
if (expectedProject.stderr.length === 0) { | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
} | ||
kubernetesCommandLineToolsExecutor.createProject(projectName); | ||
@@ -44,2 +52,3 @@ }); | ||
test('Select test project and Developer role on DevConsole', async function () { | ||
parentGUID = await browserTabsUtil.getCurrentWindowHandle(); | ||
await ocpMainPage.selectDeveloperRole(); | ||
@@ -83,5 +92,8 @@ await ocpMainPage.selectProject(projectName); | ||
}); | ||
suiteTeardown('Open dashboard and close all other tabs', async function () { | ||
await dashboard.openDashboard(); | ||
test('Check redirection to DevSpaces from App launcher', async function () { | ||
await browserTabsUtil.switchToWindow(parentGUID); | ||
await browserTabsUtil.closeAllTabsExceptCurrent(); | ||
await ocpMainPage.clickOnAppLauncherAndDevSpaceItem(); | ||
await loginTests.loginIntoChe(); | ||
await dashboard.waitPage(); | ||
}); | ||
@@ -91,4 +103,14 @@ suiteTeardown('Delete project using ocp', function () { | ||
WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() !== '' ? WorkspaceHandlingTests_1.WorkspaceHandlingTests.getWorkspaceName() : 'spring-music'; | ||
kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
try { | ||
kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | ||
} | ||
catch (err) { | ||
Logger_1.Logger.error(`Error while deleting workspace: ${err}`); | ||
} | ||
try { | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
} | ||
catch (err) { | ||
Logger_1.Logger.error(`Cannot delete the project: ${err}`); | ||
} | ||
}); | ||
@@ -95,0 +117,0 @@ suiteTeardown('Unregister running workspace', function () { |
{ | ||
"name": "@eclipse-che/che-e2e", | ||
"version": "7.95.0-next-4787042", | ||
"version": "7.95.0-next-8898b7d", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -19,2 +19,3 @@ /** ******************************************************************* | ||
import { e2eContainer } from '../../configs/inversify.config'; | ||
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; | ||
@@ -33,3 +34,5 @@ @injectable() | ||
@inject(CLASSES.DriverHelper) | ||
private readonly driverHelper: DriverHelper | ||
private readonly driverHelper: DriverHelper, | ||
@inject(CLASSES.BrowserTabsUtil) | ||
private readonly browserTabsUtil: BrowserTabsUtil | ||
) {} | ||
@@ -87,2 +90,10 @@ | ||
async clickOnAppLauncherAndDevSpaceItem(): Promise<void> { | ||
Logger.debug('click on app launcher menu'); | ||
const parentGUID: string = await this.browserTabsUtil.getCurrentWindowHandle(); | ||
await this.driverHelper.waitAndClick(By.css('nav[data-test-id="application-launcher"]')); | ||
await this.driverHelper.waitAndClick(By.xpath('//span[contains(.,"Red Hat OpenShift Dev Spaces")]')); | ||
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, TIMEOUT_CONSTANTS.TS_SELENIUM_LOAD_PAGE_TIMEOUT); | ||
} | ||
private getRoleLocator(role: string): By { | ||
@@ -101,3 +112,2 @@ return By.xpath(`//a//*[text()="${role}"]`); | ||
} | ||
private async tryToSkipWebTour(): Promise<void> { | ||
@@ -104,0 +114,0 @@ Logger.debug(); |
@@ -28,2 +28,5 @@ /** ******************************************************************* | ||
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; | ||
import { Logger } from '../../utils/Logger'; | ||
import { ShellExecutor } from '../../utils/ShellExecutor'; | ||
import { ShellString } from 'shelljs'; | ||
@@ -33,3 +36,3 @@ suite(`DevConsole Integration ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, function (): void { | ||
let ocpApplicationPage: OcpApplicationPage; | ||
let parentGUID: string = ''; | ||
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); | ||
@@ -39,2 +42,3 @@ const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); | ||
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); | ||
const shellExecutor: ShellExecutor = e2eContainer.get(CLASSES.ShellExecutor); | ||
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); | ||
@@ -53,2 +57,7 @@ const ocpMainPage: OcpMainPage = e2eContainer.get(CLASSES.OcpMainPage); | ||
kubernetesCommandLineToolsExecutor.loginToOcp(); | ||
// delete the test project on a cluster if it has not been deleted properly in the previous run | ||
const expectedProject: ShellString = shellExecutor.executeCommand(`oc get project ${projectName}`); | ||
if (expectedProject.stderr.length === 0) { | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
} | ||
kubernetesCommandLineToolsExecutor.createProject(projectName); | ||
@@ -60,2 +69,3 @@ }); | ||
test('Select test project and Developer role on DevConsole', async function (): Promise<void> { | ||
parentGUID = await browserTabsUtil.getCurrentWindowHandle(); | ||
await ocpMainPage.selectDeveloperRole(); | ||
@@ -114,5 +124,8 @@ await ocpMainPage.selectProject(projectName); | ||
suiteTeardown('Open dashboard and close all other tabs', async function (): Promise<void> { | ||
await dashboard.openDashboard(); | ||
test('Check redirection to DevSpaces from App launcher', async function (): Promise<void> { | ||
await browserTabsUtil.switchToWindow(parentGUID); | ||
await browserTabsUtil.closeAllTabsExceptCurrent(); | ||
await ocpMainPage.clickOnAppLauncherAndDevSpaceItem(); | ||
await loginTests.loginIntoChe(); | ||
await dashboard.waitPage(); | ||
}); | ||
@@ -123,4 +136,12 @@ | ||
WorkspaceHandlingTests.getWorkspaceName() !== '' ? WorkspaceHandlingTests.getWorkspaceName() : 'spring-music'; | ||
kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
try { | ||
kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | ||
} catch (err) { | ||
Logger.error(`Error while deleting workspace: ${err}`); | ||
} | ||
try { | ||
kubernetesCommandLineToolsExecutor.deleteProject(projectName); | ||
} catch (err) { | ||
Logger.error(`Cannot delete the project: ${err}`); | ||
} | ||
}); | ||
@@ -127,0 +148,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances in 1 package
1218490
17622