@eclipse-che/che-e2e 7.64.0-dev-db63138 → 7.64.0-dev-0ce9be3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configs/inversify.types.ts +2 -2
- package/configs/mocharc.ts +2 -2
- package/constants/TestConstants.ts +2 -2
- package/constants/TimeoutConstants.ts +1 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +2 -2
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/TestConstants.js.map +1 -1
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +5 -5
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +49 -0
- package/dist/specs/SmokeTest.spec.js.map +1 -0
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +13 -1
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/CheReporter.js +5 -2
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/vsc/GitUtil.js +1 -6
- package/dist/utils/vsc/GitUtil.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +2 -2
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +6 -6
- package/pageobjects/dashboard/Dashboard.ts +15 -19
- package/pageobjects/dashboard/Workspaces.ts +20 -20
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +16 -16
- package/pageobjects/git-providers/OauthPage.ts +12 -12
- package/pageobjects/ide/CheCodeLocatorLoader.ts +1 -1
- package/pageobjects/login/OcpUserLoginPage.ts +1 -1
- package/pageobjects/login/RedHatLoginPage.ts +6 -6
- package/pageobjects/login/RegularUserOcpCheLoginPage.ts +1 -1
- package/pageobjects/openshift/CheLoginPage.ts +3 -3
- package/pageobjects/openshift/OcpLoginPage.ts +8 -8
- package/specs/MochaHooks.ts +7 -7
- package/specs/SmokeTest.spec.ts +50 -0
- package/specs/devfiles/Quarkus.spec.ts +6 -6
- package/specs/factory/Factory.spec.ts +17 -17
- package/specs/factory/NoSetupRepoFactory.spec.ts +21 -21
- package/specs/factory/RefusedOAuthFactory.spec.ts +21 -21
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +5 -5
- package/tests-library/WorkspaceHandlingTests.ts +14 -1
- package/tslint.json +4 -4
- package/utils/BrowserTabsUtil.ts +7 -7
- package/utils/CheReporter.ts +12 -8
- package/utils/DriverHelper.ts +31 -31
- package/utils/Logger.ts +8 -8
- package/utils/ScreenCatcher.ts +8 -7
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +2 -1
- package/utils/vsc/GitUtil.ts +1 -4
- package/utils/workspace/ApiUrlResolver.ts +3 -2
- package/utils/workspace/TestWorkspaceUtil.ts +22 -22
|
@@ -28,7 +28,7 @@ export class RegularUserOcpCheLoginPage implements ICheLoginPage {
|
|
|
28
28
|
@inject(CLASSES.OcpLoginPage) private readonly ocpLogin: OcpLoginPage,
|
|
29
29
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
30
30
|
|
|
31
|
-
async login() {
|
|
31
|
+
async login(): Promise<void> {
|
|
32
32
|
Logger.debug('RegularUserOcpCheLoginPage.login');
|
|
33
33
|
|
|
34
34
|
Logger.debug('RegularUserOcpCheLoginPage.login wait for LogInWithOpenShift page and click button');
|
|
@@ -22,19 +22,19 @@ export class CheLoginPage {
|
|
|
22
22
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
async waitEclipseCheLoginFormPage() {
|
|
25
|
+
async waitEclipseCheLoginFormPage(): Promise<void> {
|
|
26
26
|
Logger.debug('CheLoginPage.waitEclipseCheLoginFormPage');
|
|
27
27
|
|
|
28
28
|
await this.driverHelper.waitVisibility(By.id('login'), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
async inputUserNameEclipseCheLoginPage(userName: string) {
|
|
31
|
+
async inputUserNameEclipseCheLoginPage(userName: string): Promise<void> {
|
|
32
32
|
Logger.debug(`CheLoginPage.inputUserNameEclipseCheLoginPage username: "${userName}"`);
|
|
33
33
|
|
|
34
34
|
await this.driverHelper.enterValue(By.id('login'), userName);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
async clickEclipseCheLoginButton() {
|
|
37
|
+
async clickEclipseCheLoginButton(): Promise<void> {
|
|
38
38
|
Logger.debug('CheLoginPage.clickEclipseCheLoginButton');
|
|
39
39
|
|
|
40
40
|
await this.driverHelper.waitAndClick(By.id('submit-login'));
|
|
@@ -24,13 +24,13 @@ export class OcpLoginPage {
|
|
|
24
24
|
constructor(
|
|
25
25
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
26
26
|
|
|
27
|
-
async waitOpenShiftLoginWelcomePage() {
|
|
27
|
+
async waitOpenShiftLoginWelcomePage(): Promise<void> {
|
|
28
28
|
Logger.debug('OcpLoginPage.waitOpenShiftLoginWelcomePage');
|
|
29
29
|
|
|
30
30
|
await this.driverHelper.waitVisibility(By.xpath(OcpLoginPage.LOGIN_PAGE_OPENSHIFT_XPATH), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
async clickOnLoginProviderTitle() {
|
|
33
|
+
async clickOnLoginProviderTitle(): Promise<void> {
|
|
34
34
|
Logger.debug('OcpLoginPage.clickOnLoginProviderTitle');
|
|
35
35
|
|
|
36
36
|
const loginProviderTitleLocator: By = By.xpath(`//a[text()=\'${TestConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}\']`);
|
|
@@ -51,40 +51,40 @@ export class OcpLoginPage {
|
|
|
51
51
|
return await this.driverHelper.isVisible(authorizeOpenshiftIdentityProviderPageLocator);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
async waitAuthorizeOpenShiftIdentityProviderPage() {
|
|
54
|
+
async waitAuthorizeOpenShiftIdentityProviderPage(): Promise<void> {
|
|
55
55
|
Logger.debug('OcpLoginPage.waitAuthorizeOpenShiftIdentityProviderPage');
|
|
56
56
|
|
|
57
57
|
const authorizeOpenshiftIdentityProviderPageLocator: By = By.xpath('//h1[text()=\'Authorize Access\']');
|
|
58
58
|
await this.driverHelper.waitVisibility(authorizeOpenshiftIdentityProviderPageLocator, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async clickOnApproveAuthorizeAccessButton() {
|
|
61
|
+
async clickOnApproveAuthorizeAccessButton(): Promise<void> {
|
|
62
62
|
Logger.debug('OcpLoginPage.clickOnApproveAuthorizeAccessOpenshift');
|
|
63
63
|
|
|
64
64
|
const approveAuthorizeAccessOcpLocator: By = By.css('input[name=\'approve\']');
|
|
65
65
|
await this.driverHelper.waitAndClick(approveAuthorizeAccessOcpLocator);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
async enterUserNameOpenShift(userName: string) {
|
|
68
|
+
async enterUserNameOpenShift(userName: string): Promise<void> {
|
|
69
69
|
Logger.debug(`OcpLoginPage.enterUserNameOpenShift "${userName}"`);
|
|
70
70
|
|
|
71
71
|
await this.driverHelper.enterValue(By.id('inputUsername'), userName);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
async enterPasswordOpenShift(passw: string) {
|
|
74
|
+
async enterPasswordOpenShift(passw: string): Promise<void> {
|
|
75
75
|
Logger.debug(`OcpLoginPage.enterPasswordOpenShift"`);
|
|
76
76
|
|
|
77
77
|
await this.driverHelper.enterValue(By.id('inputPassword'), passw);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
async clickOnLoginButton() {
|
|
80
|
+
async clickOnLoginButton(): Promise<void> {
|
|
81
81
|
Logger.debug('OcpLoginPage.clickOnLoginButton');
|
|
82
82
|
|
|
83
83
|
const loginButtonlocator: By = By.css('button[type=submit]');
|
|
84
84
|
await this.driverHelper.waitAndClick(loginButtonlocator);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
async waitDisappearanceOpenShiftLoginWelcomePage() {
|
|
87
|
+
async waitDisappearanceOpenShiftLoginWelcomePage(): Promise<void> {
|
|
88
88
|
Logger.debug('OcpLoginPage.waitDisappearanceOpenShiftLoginWelcomePage');
|
|
89
89
|
|
|
90
90
|
await this.driverHelper.waitDisappearance(By.xpath(OcpLoginPage.LOGIN_PAGE_OPENSHIFT_XPATH));
|
package/specs/MochaHooks.ts
CHANGED
|
@@ -25,31 +25,31 @@ const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUt
|
|
|
25
25
|
|
|
26
26
|
let latestWorkspace: string = '';
|
|
27
27
|
|
|
28
|
-
export function registerRunningWorkspace(workspaceName: string) {
|
|
28
|
+
export function registerRunningWorkspace(workspaceName: string): void {
|
|
29
29
|
Logger.debug(`MochaHooks.registerRunningWorkspace with workspaceName:${workspaceName}`);
|
|
30
30
|
latestWorkspace = workspaceName;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
exports.mochaHooks = {
|
|
34
34
|
beforeAll: [
|
|
35
|
-
async function enableRequestInterceptor() {
|
|
35
|
+
async function enableRequestInterceptor(): Promise<void> {
|
|
36
36
|
if (TestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
|
|
37
37
|
CheApiRequestHandler.enableRequestInterceptor();
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
async function enableResponseInterceptor() {
|
|
40
|
+
async function enableResponseInterceptor(): Promise<void> {
|
|
41
41
|
if (TestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
|
|
42
42
|
CheApiRequestHandler.enableResponseInterceptor();
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
async function initMonacoPageObjects() {
|
|
45
|
+
async function initMonacoPageObjects(): Promise<void> {
|
|
46
46
|
// init vscode-extension-tester monaco-page-objects
|
|
47
47
|
monacoPageObjects.initPageObjects(TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driverHelper.getDriver(), 'google-chrome');
|
|
48
48
|
},
|
|
49
|
-
async function prolongTimeoutConstantsInDebugMode() {
|
|
49
|
+
async function prolongTimeoutConstantsInDebugMode(): Promise<void> {
|
|
50
50
|
if (TestConstants.TS_DEBUG_MODE) {
|
|
51
51
|
for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
|
|
52
|
-
Object.defineProperty(TimeoutConstants, timeout, {value: seconds * 100});
|
|
52
|
+
Object.defineProperty(TimeoutConstants, timeout, {value: seconds as number * 100});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
},
|
|
@@ -62,7 +62,7 @@ exports.mochaHooks = {
|
|
|
62
62
|
testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
|
-
async function stopTheDriver() {
|
|
65
|
+
async function stopTheDriver(): Promise<void> {
|
|
66
66
|
if (!TestConstants.TS_DEBUG_MODE) {
|
|
67
67
|
await driverHelper.getDriver().quit();
|
|
68
68
|
Logger.info('Chrome driver session stopped.');
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import { SideBarView, ViewSection } from 'monaco-page-objects';
|
|
11
|
+
import { ProjectAndFileTests } from '../tests-library/ProjectAndFileTests';
|
|
12
|
+
import { CLASSES } from '../configs/inversify.types';
|
|
13
|
+
import { e2eContainer } from '../configs/inversify.config';
|
|
14
|
+
import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests';
|
|
15
|
+
import { registerRunningWorkspace } from './MochaHooks';
|
|
16
|
+
import { Logger } from '../utils/Logger';
|
|
17
|
+
import { LoginTests } from '../tests-library/LoginTests';
|
|
18
|
+
|
|
19
|
+
const factoryUrl: string = 'https://github.com/che-incubator/quarkus-api-example.git';
|
|
20
|
+
const projectName: string = 'quarkus-api-example';
|
|
21
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
22
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
23
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
24
|
+
|
|
25
|
+
suite(`The SmokeTest userstory`, async function (): Promise<void> {
|
|
26
|
+
let projectSection: ViewSection;
|
|
27
|
+
suite(`Create workspace from factory:${factoryUrl}`, async function (): Promise<void> {
|
|
28
|
+
loginTests.loginIntoChe();
|
|
29
|
+
workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
|
|
30
|
+
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
31
|
+
test('Register running workspace', async () => {
|
|
32
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
33
|
+
});
|
|
34
|
+
test('Wait workspace readiness', async function (): Promise<void> {
|
|
35
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
36
|
+
});
|
|
37
|
+
test('Check a project folder has been created', async function (): Promise<void> {
|
|
38
|
+
projectSection = await new SideBarView().getContent().getSection(projectName);
|
|
39
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
|
|
40
|
+
});
|
|
41
|
+
test('Check the project files was imported', async function (): Promise<void> {
|
|
42
|
+
const label: string = 'devfile.yaml';
|
|
43
|
+
await projectSection.findItem(label);
|
|
44
|
+
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
45
|
+
});
|
|
46
|
+
test('Stopping and deleting the workspace', async function (): Promise<void> {
|
|
47
|
+
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -23,28 +23,28 @@ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.Projec
|
|
|
23
23
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
24
24
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
25
25
|
|
|
26
|
-
suite(`The ${stackName} userstory`, async function () {
|
|
26
|
+
suite(`The ${stackName} userstory`, async function (): Promise<void> {
|
|
27
27
|
let projectSection: ViewSection;
|
|
28
|
-
suite(`Create workspace from ${stackName} simple`, async function () {
|
|
28
|
+
suite(`Create workspace from ${stackName} simple`, async function (): Promise<void> {
|
|
29
29
|
loginTests.loginIntoChe();
|
|
30
30
|
workspaceHandlingTests.createAndOpenWorkspace(stackName);
|
|
31
31
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
32
32
|
test('Register running workspace', async () => {
|
|
33
33
|
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
34
34
|
});
|
|
35
|
-
test('Wait workspace readiness', async function () {
|
|
35
|
+
test('Wait workspace readiness', async function (): Promise<void> {
|
|
36
36
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
37
37
|
});
|
|
38
|
-
test('Check a project folder has been created', async function () {
|
|
38
|
+
test('Check a project folder has been created', async function (): Promise<void> {
|
|
39
39
|
projectSection = await new SideBarView().getContent().getSection(projectName);
|
|
40
40
|
Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
|
|
41
41
|
});
|
|
42
|
-
test('Check the project files was imported', async function () {
|
|
42
|
+
test('Check the project files was imported', async function (): Promise<void> {
|
|
43
43
|
const label: string = 'devfile.yaml';
|
|
44
44
|
await projectSection.findItem(label);
|
|
45
45
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
46
46
|
});
|
|
47
|
-
test('Stopping and deleting the workspace', async function () {
|
|
47
|
+
test('Stopping and deleting the workspace', async function (): Promise<void> {
|
|
48
48
|
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
49
49
|
});
|
|
50
50
|
loginTests.logoutFromChe();
|
|
@@ -47,7 +47,7 @@ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
|
47
47
|
|
|
48
48
|
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
49
49
|
|
|
50
|
-
suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`, async function () {
|
|
50
|
+
suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`, async function (): Promise<void> {
|
|
51
51
|
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
52
52
|
|
|
53
53
|
let projectSection: ViewSection;
|
|
@@ -66,12 +66,12 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
66
66
|
const testRepoProjectName: string = gitUtilCheCode.getProjectNameFromGitUrl(TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
67
67
|
|
|
68
68
|
loginTests.loginIntoChe();
|
|
69
|
-
test(`Navigate to the factory URL`, async function () {
|
|
69
|
+
test(`Navigate to the factory URL`, async function (): Promise<void> {
|
|
70
70
|
await browserTabsUtil.navigateTo(TestConstants.TS_SELENIUM_FACTORY_URL());
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
if (TestConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
74
|
-
test(`Authorize with a ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function () {
|
|
74
|
+
test(`Authorize with a ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function (): Promise<void> {
|
|
75
75
|
await oauthPage.login();
|
|
76
76
|
await oauthPage.waitOauthPage();
|
|
77
77
|
await oauthPage.confirmAccess();
|
|
@@ -80,27 +80,27 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
80
80
|
|
|
81
81
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
82
82
|
|
|
83
|
-
test('Registering the running workspace', async function () {
|
|
83
|
+
test('Registering the running workspace', async function (): Promise<void> {
|
|
84
84
|
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
test('Wait the workspace readiness', async function () {
|
|
87
|
+
test('Wait the workspace readiness', async function (): Promise<void> {
|
|
88
88
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
test('Check if a project folder has been created', async function () {
|
|
91
|
+
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
92
92
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
93
93
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName as unknown as string);
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
test('Check if the project files were imported', async function () {
|
|
96
|
+
test('Check if the project files were imported', async function (): Promise<void> {
|
|
97
97
|
const label: string = TestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
98
98
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
99
99
|
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
100
100
|
expect(isFileImported).not.eqls(undefined);
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
test('Accept the project as a trusted one', async function () {
|
|
103
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
104
104
|
const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
|
|
105
105
|
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
106
106
|
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button);
|
|
@@ -108,7 +108,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
108
108
|
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
test('Make changes to the file', async function () {
|
|
111
|
+
test('Make changes to the file', async function (): Promise<void> {
|
|
112
112
|
Logger.debug(`projectSection.openItem: "${fileToChange}"`);
|
|
113
113
|
await projectSection.openItem(fileToChange);
|
|
114
114
|
const editor: TextEditor = await new EditorView().openEditor(fileToChange) as TextEditor;
|
|
@@ -119,7 +119,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
119
119
|
await editor.typeTextAt(1, 1, changesToCommit);
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
test('Open a source control manager', async function () {
|
|
122
|
+
test('Open a source control manager', async function (): Promise<void> {
|
|
123
123
|
const viewSourceControl: string = `Source Control`;
|
|
124
124
|
const sourceControl: ViewControl = await new ActivityBar().getViewControl(viewSourceControl) as ViewControl;
|
|
125
125
|
Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
|
|
@@ -130,7 +130,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
130
130
|
Logger.debug(`scmView.getProviders: "${scmProvider}, ${scmProvider}"`);
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
test('Check if the changes is displayed in the source control manager', async function () {
|
|
133
|
+
test('Check if the changes is displayed in the source control manager', async function (): Promise<void> {
|
|
134
134
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
135
135
|
await driverHelper.wait(timeToRefresh);
|
|
136
136
|
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
@@ -142,7 +142,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
142
142
|
expect(changes).eql(1);
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
test('Stage the changes', async function () {
|
|
145
|
+
test('Stage the changes', async function (): Promise<void> {
|
|
146
146
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
147
147
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
148
148
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -151,7 +151,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
151
151
|
await scmContextMenu.select('Changes', 'Stage All Changes');
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
test('Commit the changes', async function () {
|
|
154
|
+
test('Commit the changes', async function (): Promise<void> {
|
|
155
155
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
|
|
156
156
|
Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
|
|
157
157
|
await scmProvider.commitChanges('Commit ' + changesToCommit);
|
|
@@ -166,7 +166,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
166
166
|
expect(changes).eql(0);
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
-
test('Push the changes', async function () {
|
|
169
|
+
test('Push the changes', async function (): Promise<void> {
|
|
170
170
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
171
171
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
172
172
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
@@ -176,7 +176,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
176
176
|
await scmContextMenu.select(pushItemLabel);
|
|
177
177
|
});
|
|
178
178
|
|
|
179
|
-
test('Check if the changes were pushed', async function () {
|
|
179
|
+
test('Check if the changes were pushed', async function (): Promise<void> {
|
|
180
180
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
181
181
|
await driverHelper.wait(timeToRefresh);
|
|
182
182
|
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
@@ -185,13 +185,13 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
185
185
|
expect(isCommitButtonDisabled).eql('true');
|
|
186
186
|
});
|
|
187
187
|
|
|
188
|
-
test(`Stop and remove the workspace`, async function () {
|
|
188
|
+
test(`Stop and remove the workspace`, async function (): Promise<void> {
|
|
189
189
|
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
190
190
|
});
|
|
191
191
|
|
|
192
192
|
loginTests.logoutFromChe();
|
|
193
193
|
|
|
194
|
-
suiteTeardown('Close the browser', async function () {
|
|
194
|
+
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
195
195
|
if (!TestConstants.TS_DEBUG_MODE) {
|
|
196
196
|
await driverHelper.getDriver().close();
|
|
197
197
|
}
|
|
@@ -52,7 +52,7 @@ const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
|
52
52
|
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
|
|
53
53
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
54
54
|
|
|
55
|
-
suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`, async function () {
|
|
55
|
+
suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`, async function (): Promise<void> {
|
|
56
56
|
|
|
57
57
|
let projectSection: ViewSection;
|
|
58
58
|
let scmProvider: SingleScmProvider;
|
|
@@ -74,26 +74,26 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
74
74
|
|
|
75
75
|
loginTests.loginIntoChe();
|
|
76
76
|
|
|
77
|
-
test('Get number of previously created workspaces', async function () {
|
|
77
|
+
test('Get number of previously created workspaces', async function (): Promise<void> {
|
|
78
78
|
await dashboard.clickWorkspacesButton();
|
|
79
79
|
await workspaces.waitPage();
|
|
80
80
|
numberOfCreatedWorkspaces = (await workspaces.getAllCreatedWorkspacesNames()).length;
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function () {
|
|
83
|
+
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
84
84
|
await browserTabsUtil.navigateTo(TestConstants.TS_SELENIUM_FACTORY_URL());
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
if (TestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
88
88
|
|
|
89
|
-
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function () {
|
|
89
|
+
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
90
90
|
await dashboard.waitLoader();
|
|
91
91
|
const loaderAlert: string = await dashboard.getLoaderAlert();
|
|
92
92
|
expect(loaderAlert).contains('Failed to create the workspace')
|
|
93
93
|
.and.contains('Cause: Unsupported OAuth provider ');
|
|
94
94
|
});
|
|
95
95
|
|
|
96
|
-
test(`Check that workspace was not created`, async function () {
|
|
96
|
+
test(`Check that workspace was not created`, async function (): Promise<void> {
|
|
97
97
|
await dashboard.openDashboard();
|
|
98
98
|
await dashboard.clickWorkspacesButton();
|
|
99
99
|
await workspaces.waitPage();
|
|
@@ -106,20 +106,20 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
106
106
|
} else {
|
|
107
107
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
108
108
|
|
|
109
|
-
test('Registering the running workspace', async function () {
|
|
109
|
+
test('Registering the running workspace', async function (): Promise<void> {
|
|
110
110
|
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
test('Wait the workspace readiness', async function () {
|
|
113
|
+
test('Wait the workspace readiness', async function (): Promise<void> {
|
|
114
114
|
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
test('Check if a project folder has been created', async function () {
|
|
117
|
+
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
118
118
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
119
119
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName as unknown as string);
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
-
test('Accept the project as a trusted one', async function () {
|
|
122
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
123
123
|
// click somewhere to trigger "Welcome Content" dialog
|
|
124
124
|
try {
|
|
125
125
|
await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
|
|
@@ -142,14 +142,14 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
142
142
|
}
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
test('Check if the project files were imported', async function () {
|
|
145
|
+
test('Check if the project files were imported', async function (): Promise<void> {
|
|
146
146
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
147
147
|
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
148
148
|
// projectSection.findItem(label) can return undefined but test will goes on
|
|
149
149
|
expect(isFileImported).not.eqls(undefined);
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
test('Make changes to the file', async function () {
|
|
152
|
+
test('Make changes to the file', async function (): Promise<void> {
|
|
153
153
|
Logger.debug(`projectSection.openItem: "${fileToChange}"`);
|
|
154
154
|
await projectSection.openItem(fileToChange);
|
|
155
155
|
const editor: TextEditor = await new EditorView().openEditor(fileToChange) as TextEditor;
|
|
@@ -160,7 +160,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
160
160
|
await editor.typeTextAt(1, 1, changesToCommit);
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
-
test('Open a source control manager', async function () {
|
|
163
|
+
test('Open a source control manager', async function (): Promise<void> {
|
|
164
164
|
const viewSourceControl: string = `Source Control`;
|
|
165
165
|
const sourceControl: ViewControl = await new ActivityBar().getViewControl(viewSourceControl) as ViewControl;
|
|
166
166
|
Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
|
|
@@ -171,7 +171,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
171
171
|
Logger.debug(`scmView.getProviders: "${scmProvider}, ${scmProvider}"`);
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
test('Check if the changes is displayed in the source control manager', async function () {
|
|
174
|
+
test('Check if the changes is displayed in the source control manager', async function (): Promise<void> {
|
|
175
175
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
176
176
|
await driverHelper.wait(timeToRefresh);
|
|
177
177
|
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
@@ -183,7 +183,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
183
183
|
expect(changes).eql(1);
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
test('Stage the changes', async function () {
|
|
186
|
+
test('Stage the changes', async function (): Promise<void> {
|
|
187
187
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
188
188
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
189
189
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -192,7 +192,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
192
192
|
await scmContextMenu.select('Changes', 'Stage All Changes');
|
|
193
193
|
});
|
|
194
194
|
|
|
195
|
-
test('Commit the changes', async function () {
|
|
195
|
+
test('Commit the changes', async function (): Promise<void> {
|
|
196
196
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
|
|
197
197
|
Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
|
|
198
198
|
await scmProvider.commitChanges('Commit ' + changesToCommit);
|
|
@@ -207,7 +207,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
207
207
|
expect(changes).eql(0);
|
|
208
208
|
});
|
|
209
209
|
|
|
210
|
-
test('Push the changes', async function () {
|
|
210
|
+
test('Push the changes', async function (): Promise<void> {
|
|
211
211
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
212
212
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
213
213
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
@@ -218,14 +218,14 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
218
218
|
});
|
|
219
219
|
|
|
220
220
|
if (TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITHUB) {
|
|
221
|
-
test('Decline GitHub Extension', async function () {
|
|
221
|
+
test('Decline GitHub Extension', async function (): Promise<void> {
|
|
222
222
|
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.details);
|
|
223
223
|
const gitHaExtensionDialog: ModalDialog = new ModalDialog();
|
|
224
224
|
await gitHaExtensionDialog.pushButton('Cancel');
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
test('Insert git credentials which were asked after push', async function () {
|
|
228
|
+
test('Insert git credentials which were asked after push', async function (): Promise<void> {
|
|
229
229
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
230
230
|
|
|
231
231
|
try {
|
|
@@ -244,7 +244,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
244
244
|
await driverHelper.wait(timeToRefresh);
|
|
245
245
|
});
|
|
246
246
|
|
|
247
|
-
test('Check if the changes were pushed', async function () {
|
|
247
|
+
test('Check if the changes were pushed', async function (): Promise<void> {
|
|
248
248
|
try {
|
|
249
249
|
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
250
250
|
await scmProvider.takeAction(refreshButtonLabel);
|
|
@@ -257,14 +257,14 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
257
257
|
expect(isCommitButtonDisabled).eql('true');
|
|
258
258
|
});
|
|
259
259
|
|
|
260
|
-
test(`Stop and remove the workspace`, async function () {
|
|
260
|
+
test(`Stop and remove the workspace`, async function (): Promise<void> {
|
|
261
261
|
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
262
262
|
});
|
|
263
263
|
|
|
264
264
|
loginTests.logoutFromChe();
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
suiteTeardown('Close the browser', async function () {
|
|
267
|
+
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
268
268
|
if (!TestConstants.TS_DEBUG_MODE) {
|
|
269
269
|
await driverHelper.getDriver().close();
|
|
270
270
|
}
|