New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@eclipse-che/che-e2e

Package Overview
Dependencies
Maintainers
5
Versions
367
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eclipse-che/che-e2e - npm Package Compare versions

Comparing version 7.44.0 to 7.44.1-dev-bc873f3

8

dist/driver/CheReporter.js

@@ -36,3 +36,3 @@ "use strict";

const TestConstants_1 = require("../TestConstants");
const PreferencesHandler_1 = require("../utils/PreferencesHandler");
// import { PreferencesHandler } from '../utils/PreferencesHandler';
const CheApiRequestHandler_1 = require("../utils/requestHandlers/CheApiRequestHandler");

@@ -49,3 +49,3 @@ const TimeoutConstants_1 = require("../TimeoutConstants");

let testWorkspaceUtil = e2eContainer.get(__2.TYPES.WorkspaceUtil);
let preferencesHandler = e2eContainer.get(__2.CLASSES.PreferencesHandler);
// let preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
class CheReporter extends mocha.reporters.Spec {

@@ -89,4 +89,4 @@ constructor(runner, options) {

}
await preferencesHandler.setConfirmExit(PreferencesHandler_1.AskForConfirmationType.never);
await preferencesHandler.setTerminalType(PreferencesHandler_1.TerminalRendererType.dom);
// await preferencesHandler.setConfirmExit(AskForConfirmationType.never);
// await preferencesHandler.setTerminalType(TerminalRendererType.dom);
});

@@ -93,0 +93,0 @@ runner.on('test', async function (test) {

@@ -36,3 +36,2 @@ "use strict";

__exportStar(require("./utils/DriverHelper"), exports);
__exportStar(require("./utils/KeycloackUrlHandler"), exports);
__exportStar(require("./utils/Logger"), exports);

@@ -67,2 +66,3 @@ __exportStar(require("./utils/PreferencesHandler"), exports);

__exportStar(require("./pageobjects/ide/OpenDialogWidget"), exports);
__exportStar(require("./pageobjects/ide/OpenEditors"), exports);
__exportStar(require("./pageobjects/ide/OpenWorkspaceWidget"), exports);

@@ -69,0 +69,0 @@ __exportStar(require("./pageobjects/ide/plugins/GitHubPullRequestPlugin"), exports);

@@ -98,2 +98,6 @@ "use strict";

}
async getRecentWorkspaceName(timeout = TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT) {
Logger_1.Logger.debug(`Dashboard.recentWorkspaceName`);
return await this.driverHelper.waitAndGetText(selenium_webdriver_1.By.css('[data-testid="recent-workspace-item"]'), timeout);
}
};

@@ -100,0 +104,0 @@ Dashboard.WORKSPACES_BUTTON_XPATH = `//div[@id='page-sidebar']//a[contains(text(), 'Workspaces (')]`;

@@ -79,3 +79,3 @@ "use strict";

await this.clickOnOpenButton(timeout);
await this.driverHelper.waitVisibility(selenium_webdriver_1.By.css(Ide_1.Ide.ACTIVATED_IDE_IFRAME_CSS), TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
await this.driverHelper.waitVisibility(selenium_webdriver_1.By.css(Ide_1.Ide.THEIA_EDITOR_CSS), TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
await this.testWorkspaceUtil.waitWorkspaceStatus(namespace, workspaceName, WorkspaceStatus_1.WorkspaceStatus.STARTING);

@@ -82,0 +82,0 @@ }

@@ -50,2 +50,6 @@ "use strict";

}
/**
* @deprecated Method deprecated. Iframe is not available, Replace it with waitForEditor() or waitIde() method incase for conditional wait
* @see Ide.waitForEditor()
*/
async waitAndSwitchToIdeFrame(timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {

@@ -58,10 +62,20 @@ Logger_1.Logger.debug('Ide.waitAndSwitchToIdeFrame');

if (err instanceof selenium_webdriver_1.error.StaleElementReferenceError) {
Logger_1.Logger.warn('StaleElementException occured during waiting for IDE. Sleeping for 2 secs and retrying.');
Logger_1.Logger.warn('StaleElementException occurred during waiting for IDE. Sleeping for 2 secs and retrying.');
this.driverHelper.wait(2000);
await this.driverHelper.waitAndSwitchToFrame(selenium_webdriver_1.By.css(Ide_1.IDE_IFRAME_CSS), timeout);
try {
await this.driverHelper.waitAndSwitchToFrame(selenium_webdriver_1.By.css(Ide_1.IDE_IFRAME_CSS), timeout);
}
catch (err) {
if (err instanceof selenium_webdriver_1.error.TimeoutError) {
Logger_1.Logger.warn(`Iframe is not available even after ${timeout} milliseconds, checking for visibility of #theia-main-content-panel.`);
await this.driverHelper.isVisible(selenium_webdriver_1.By.css('#theia-main-content-panel'));
return;
}
throw err;
}
return;
}
if (err instanceof selenium_webdriver_1.error.TimeoutError) {
Logger_1.Logger.error(`Switching to IDE frame failed after ${timeout} timeout.`);
throw err;
Logger_1.Logger.warn(`Iframe is not available even after ${timeout} milliseconds, checking for visibility of #theia-main-content-panel.`);
await this.driverHelper.isVisible(selenium_webdriver_1.By.css('#theia-main-content-panel'));
}

@@ -72,2 +86,12 @@ Logger_1.Logger.error(`Switching to IDE frame failed.`);

}
async waitForEditor(timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {
Logger_1.Logger.debug('Ide.waitForEditor');
try {
await this.driverHelper.waitVisibility(selenium_webdriver_1.By.css(Ide_1.THEIA_EDITOR_CSS), timeout);
}
catch (err) {
Logger_1.Logger.warn(`Editor is not displayed even after ${timeout} milliseconds.`);
throw err;
}
}
async waitNotification(notificationText, timeout = TimeoutConstants_1.TimeoutConstants.TS_NOTIFICATION_CENTER_TIMEOUT) {

@@ -142,6 +166,6 @@ Logger_1.Logger.debug(`Ide.waitNotification "${notificationText}"`);

Logger_1.Logger.debug('Ide.waitWorkspaceAndIde');
await this.waitAndSwitchToIdeFrame(timeout);
await this.waitForEditor(timeout);
await this.waitIde(timeout);
}
async waitIde(timeout = TimeoutConstants_1.TimeoutConstants.TS_IDE_LOAD_TIMEOUT) {
async waitIde(timeout = TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {
Logger_1.Logger.debug('Ide.waitIde');

@@ -302,3 +326,3 @@ const mainIdeParts = [selenium_webdriver_1.By.css(Ide_1.TOP_MENU_PANEL_CSS), selenium_webdriver_1.By.css(Ide_1.LEFT_CONTENT_PANEL_CSS), selenium_webdriver_1.By.id(Ide_1.EXPLORER_BUTTON_ID)];

Ide.SELECTED_EXPLORER_BUTTON_CSS = 'li#shell-tab-explorer-view-container.theia-mod-active';
Ide.ACTIVATED_IDE_IFRAME_CSS = '#ide-iframe-window[aria-hidden=\'false\']';
Ide.THEIA_EDITOR_CSS = '#theia-main-content-panel';
Ide.SELECTED_GIT_BUTTON_XPATH = '(//ul[@class=\'p-TabBar-content\']//li[@title=\'Git\' and contains(@class, \'p-mod-current\')])[1]';

@@ -305,0 +329,0 @@ Ide.TOP_MENU_PANEL_CSS = '#theia-app-shell #theia-top-panel .p-MenuBar-content';

@@ -76,2 +76,5 @@ "use strict";

}
/**
* @deprecated Method deprecated. Iframe is not available anymore
*/
async waitAndSwitchToWidgetFrame() {

@@ -91,4 +94,2 @@ Logger_1.Logger.debug('PreviewWidget.waitAndSwitchToWidgetFrame');

if (isApplicationTitleVisible) {
await this.driverHelper.getDriver().switchTo().defaultContent();
await this.ide.waitAndSwitchToIdeFrame();
return true;

@@ -111,2 +112,5 @@ }

}
/**
* @deprecated Method deprecated. Iframe is not available.
*/
async switchBackToIdeFrame() {

@@ -113,0 +117,0 @@ Logger_1.Logger.debug('PreviewWidget.switchBackToIdeFrame');

@@ -36,7 +36,9 @@ "use strict";

const TimeoutConstants_1 = require("../../TimeoutConstants");
const BrowserTabsUtil_1 = require("../../utils/BrowserTabsUtil");
let ProjectTree = ProjectTree_1 = class ProjectTree {
constructor(driverHelper, ide, editor) {
constructor(driverHelper, ide, editor, browserTabsUtil) {
this.driverHelper = driverHelper;
this.ide = ide;
this.editor = editor;
this.browserTabsUtil = browserTabsUtil;
}

@@ -193,5 +195,4 @@ async clickCollapseAllButton() {

Logger_1.Logger.trace(`ProjectTree.waitProjectImported project not located, reloading page.`);
await this.driverHelper.reloadPage();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.browserTabsUtil.refreshPage();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();

@@ -207,5 +208,4 @@ continue;

Logger_1.Logger.trace(`ProjectTree.waitProjectImported sub-items not found, reloading page.`);
await this.driverHelper.reloadPage();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.browserTabsUtil.refreshPage();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();

@@ -225,6 +225,5 @@ continue;

Logger_1.Logger.trace(`ProjectTree.waitProjectImportedNoSubfolder project not located, reloading page.`);
await this.driverHelper.reloadPage();
await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(triesPolling);
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();

@@ -274,7 +273,9 @@ continue;

__param(2, inversify_1.inject(inversify_types_1.CLASSES.Editor)),
__param(3, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper,
Ide_1.Ide,
Editor_1.Editor])
Editor_1.Editor,
BrowserTabsUtil_1.BrowserTabsUtil])
], ProjectTree);
exports.ProjectTree = ProjectTree;
//# sourceMappingURL=ProjectTree.js.map

@@ -30,3 +30,3 @@ "use strict";

// const codeNavigationClassName: string = '[metadata] Console.cs';
const stack = '.NET Core';
const stack = 'ASP.NET Core Web Application';
const updateDependenciesTaskName = 'update dependencies';

@@ -33,0 +33,0 @@ const buildTaskName = 'build';

@@ -27,9 +27,9 @@ "use strict";

const workspaceStack = 'Go';
const workspaceSampleName = 'example';
const workspaceSubfolderName = 'outyet';
const workspaceSampleName = 'golang-example';
const workspaceSubfolderName = 'template';
const fileFolderPath = `${workspaceSampleName}/${workspaceSubfolderName}`;
const fileName = `main.go`;
const taskRunServer = '1.1 Run outyet';
const taskStopServer = '1.2 Stop outyet';
const taskTestOutyet = '1.3 Test outyet';
const taskRunServer = 'run-outyet';
const taskStopServer = 'stop-outyet';
const taskTestOutyet = 'test-outyet';
const notificationText = 'Process 8080-tcp is now listening on port 8080. Open it ?';

@@ -39,6 +39,2 @@ let workspaceName;

suite(`Create ${workspaceStack} workspace`, async () => {
test('Workaround for issue #16113', async () => {
Logger_1.Logger.warn(`Manually setting a preference for golang devfile LS based on issue: https://github.com/eclipse/che/issues/16113`);
await preferencesHandler.setUseGoLanaguageServer();
});
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);

@@ -50,2 +46,6 @@ test('Register running workspace', async () => {

projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceSubfolderName, false);
test('Workaround for issue #16113', async () => {
Logger_1.Logger.warn(`Manually setting a preference for golang devFile LS based on issue: https://github.com/eclipse/che/issues/16113`);
await preferencesHandler.setPreferenceUsingUI('go.useLanguageServer', true);
});
});

@@ -57,3 +57,3 @@ suite('Test opening file', async () => {

suite('Test golang example', async () => {
codeExecutionTests.runTask(taskTestOutyet, 60000);
codeExecutionTests.runTask(taskTestOutyet, 80000);
codeExecutionTests.closeTerminal(taskTestOutyet);

@@ -63,12 +63,12 @@ });

codeExecutionTests.runTaskWithNotification(taskRunServer, notificationText, 40000);
codeExecutionTests.runTask(taskStopServer, 5000);
codeExecutionTests.runTask(taskStopServer, 8000);
});
suite(`'Language server validation'`, async () => {
commonLanguageServerTests.suggestionInvoking(fileName, 42, 10, 'Parse');
commonLanguageServerTests.autocomplete(fileName, 42, 10, 'Parse');
commonLanguageServerTests.errorHighlighting(fileName, 'error;\n', 42);
commonLanguageServerTests.suggestionInvoking(fileName, 41, 49, 'Parse');
commonLanguageServerTests.autocomplete(fileName, 41, 49, 'Parse');
commonLanguageServerTests.errorHighlighting(fileName, 'error;\n', 41);
// commonLanguageServerTests.goToImplementations(fileName, 42, 10, 'flag.go'); // codenavigation is inconsistent https://github.com/eclipse/che/issues/16929
});
suite('Stop and remove workspace', async () => {
test(`Stop and remowe workspace`, async () => {
test(`Stop and remove workspace`, async () => {
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);

@@ -75,0 +75,0 @@ });

@@ -114,3 +114,2 @@ "use strict";

await browserTabsUtil.refreshPage();
await ide.waitAndSwitchToIdeFrame();
await ide.waitIde();

@@ -127,3 +126,3 @@ await editor.waitErrorInLine(30, javaFileName, TimeoutConstants_1.TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);

});
test('Codenavigation', async () => {
test('CodeNavigation', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 17);

@@ -258,9 +257,11 @@ await editor.performKeyCombination(javaFileName, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.CONTROL, selenium_webdriver_1.Key.F12));

catch (error) {
if (error.message === 'timeout of 1000ms exceeded') {
console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
if (error instanceof Error) {
if (error.message === 'timeout of 1000ms exceeded') {
console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
}
else {
const { data } = await httpClient.get(urlToApp);
console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>' + data);
}
}
else {
const { data } = await httpClient.get(urlToApp);
console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>' + data);
}
}

@@ -267,0 +268,0 @@ }

"use strict";
// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -19,6 +19,6 @@ // * This program and the accompanying materials are made

const CheReporter_1 = __importDefault(require("../../../driver/CheReporter"));
const preferencesHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.PreferencesHandler);
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
const browserTabsUtil = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.BrowserTabsUtil);
const workspaceNameHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils = inversify_config_1.e2eContainer.get(inversify_types_1.TYPES.WorkspaceUtil);
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/master/src`;

@@ -30,4 +30,3 @@ const workspaceSampleName = 'console-java-simple';

const tabTitle = 'HelloWorld.java';
let workspaceName;
// the suite expect user to be logged in
let workspaceName = 'console-java-simple';
suite('Workspace creation via factory url', async () => {

@@ -40,3 +39,7 @@ suite('Open factory URL', async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -50,5 +53,3 @@ suite('Check imported project', async () => {

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -55,0 +56,0 @@ });

"use strict";
// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -19,6 +19,6 @@ // * This program and the accompanying materials are made

const CheReporter_1 = __importDefault(require("../../../driver/CheReporter"));
const preferencesHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.PreferencesHandler);
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
const browserTabsUtil = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.BrowserTabsUtil);
const workspaceNameHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils = inversify_config_1.e2eContainer.get(inversify_types_1.TYPES.WorkspaceUtil);
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple`;

@@ -29,4 +29,3 @@ const workspaceSampleName = 'console-java-simple';

const tabTitle = 'HelloWorld.java';
let workspaceName;
// the suite expect user to be logged in
let workspaceName = 'console-java-simple';
suite('Workspace creation via factory url', async () => {

@@ -39,3 +38,7 @@ suite('Open factory URL', async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -48,5 +51,3 @@ suite('Check imported project', async () => {

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -53,0 +54,0 @@ });

"use strict";
// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -19,14 +19,13 @@ // * This program and the accompanying materials are made

const CheReporter_1 = __importDefault(require("../../../driver/CheReporter"));
const preferencesHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.PreferencesHandler);
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
const browserTabsUtil = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.BrowserTabsUtil);
const workspaceNameHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils = inversify_config_1.e2eContainer.get(inversify_types_1.TYPES.WorkspaceUtil);
let workspaceName;
// the suite expect user to be logged in
let factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
const workspaceSampleName = 'console-java-simple';
const workspaceRootFolderName = 'src';
const fileFolderPath = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
const tabTitle = 'HelloWorld.java';
let workspaceName = 'console-java-simple';
suite('Workspace creation via factory url', async () => {
let factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
const workspaceSampleName = 'console-java-simple';
const workspaceRootFolderName = 'src';
const fileFolderPath = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
const tabTitle = 'HelloWorld.java';
suite('Open factory URL', async () => {

@@ -38,3 +37,7 @@ test(`Navigating to factory URL`, async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -47,5 +50,3 @@ suite('Check imported project', async () => {

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -52,0 +53,0 @@ });

@@ -53,3 +53,3 @@ "use strict";

}
}
},
],

@@ -60,3 +60,3 @@ wsConfig.components = [

'type': 'chePlugin'
}
},
];

@@ -63,0 +63,0 @@ await browserTabsUtil.navigateTo(TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL);

@@ -21,3 +21,2 @@ "use strict";

const Logger_1 = require("../../utils/Logger");
const KeycloackUrlHandler_1 = require("../../utils/KeycloackUrlHandler");
const CheReporter_1 = __importDefault(require("../../driver/CheReporter"));

@@ -43,2 +42,4 @@ const selenium_webdriver_1 = require("selenium-webdriver");

const changedFile = 'README.md';
// added call back url, but needs to be re-verified
const identityCallbackUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/api/oauth/callback`;
const currentDate = Date.now().toString();

@@ -58,3 +59,3 @@ let workspaceName;

await gitOauthAppsSettings.typeHomePageUrl(TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL);
await gitOauthAppsSettings.typeCallbackUrl(KeycloackUrlHandler_1.KeycloackUrlHandler.getIdentityCallbackUrl());
await gitOauthAppsSettings.typeCallbackUrl(identityCallbackUrl);
await gitOauthAppsSettings.clickUpdateApplicationButton();

@@ -61,0 +62,0 @@ });

@@ -6,2 +6,11 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/*********************************************************************
* Copyright (c) 2021 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
**********************************************************************/
require("reflect-metadata");

@@ -19,13 +28,12 @@ const inversify_config_1 = require("../../inversify.config");

const ide = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Ide);
const projectTree = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectTree);
const editor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Editor);
const workspaceNameHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceNameHandler);
const devfileUrl = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/Java11PluginTest.yaml';
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const preferencesHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.PreferencesHandler);
const devFileUrl = 'https://github.com/che-samples/java-guestbook/tree/devfilev2';
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
const codeNavigationClassName = 'String.class';
const sampleName = 'console-java-simple';
const subRootFolder = 'src';
const fileFolderPath = `${sampleName}/src/main/java/org/eclipse/che/examples`;
const tabTitle = 'HelloWorld.java';
let workspaceName;
const projectName = 'java-guestbook';
const subRootFolder = 'backend';
const fileFolderPath = `${projectName}/backend/src/main/java/cloudcode/guestbook/backend`;
const tabTitle = 'GuestBookEntry.java';
let workspaceName = 'java-guestbook';
suite(`The 'JavaPlugin' test`, async () => {

@@ -36,10 +44,6 @@ suite('Create workspace', async () => {

});
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
test('Wait until created workspace is started', async () => {
await ide.waitAndSwitchToIdeFrame();
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await ide.waitIde(TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60000);
await projectTree.openProjectTreeContainer();
await projectTree.waitProjectImported(sampleName, subRootFolder);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

@@ -52,3 +56,3 @@ });

suite('Language server validation', async () => {
test('Wait until Java LS is initialised', async () => {
test('Wait until Java LS is initialized', async () => {
await ide.checkLsInitializationStart('Activating');

@@ -58,16 +62,16 @@ await ide.waitStatusBarTextAbsence('Activating', 900000);

test('Autocomplete', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 10, 20);
await editor.moveCursorToLineAndChar(tabTitle, 15, 1);
await editor.pressControlSpaceCombination(tabTitle);
await editor.waitSuggestionContainer();
await editor.waitSuggestion(tabTitle, 'close() : void');
await editor.waitSuggestion(tabTitle, 'clone() : Object');
});
test('Error highlighting', async () => {
const textForErrorDisplaying = '$';
await editor.type(tabTitle, textForErrorDisplaying, 10);
await editor.waitErrorInLine(10, tabTitle, TimeoutConstants_1.TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
await editor.type(tabTitle, textForErrorDisplaying, 15);
await editor.waitErrorInLine(15, tabTitle, TimeoutConstants_1.TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
await editor.performKeyCombination(tabTitle, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.BACK_SPACE));
await editor.waitErrorInLineDisappearance(10, tabTitle);
await editor.waitErrorInLineDisappearance(15, tabTitle);
});
test('Codenavigation', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 9, 12);
test('CodeNavigation', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 9, 14);
await editor.performKeyCombination(tabTitle, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.CONTROL, selenium_webdriver_1.Key.F12));

@@ -74,0 +78,0 @@ await editor.waitEditorAvailable(codeNavigationClassName, 60000);

@@ -23,15 +23,15 @@ "use strict";

const CheReporter_1 = __importDefault(require("../../driver/CheReporter"));
const projectAndFileTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectAndFileTests);
const workspaceHandlingTests = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceHandlingTests);
const browserTabsUtil = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.BrowserTabsUtil);
const ide = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Ide);
const projectTree = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.ProjectTree);
const editor = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.Editor);
const workspaceNameHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.WorkspaceNameHandler);
const devfileUrl = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/PythonPluginTest.yaml';
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const sampleName = 'python-hello-world';
const subRootFile = 'README.md';
const fileFolderPath = `${sampleName}`;
const preferencesHandler = inversify_config_1.e2eContainer.get(inversify_types_1.CLASSES.PreferencesHandler);
const devFileUrl = 'https://github.com/che-samples/python-hello-world/tree/devfilev2';
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
const projectName = 'python-hello-world';
const subRootFolder = '.vscode';
const fileFolderPath = `${projectName}`;
const tabTitle = 'hello-world.py';
let workspaceName;
let workspaceName = 'python-hello-world';
suite(`The 'PythonPlugin' test`, async () => {

@@ -42,10 +42,6 @@ suite('Create workspace', async () => {

});
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
test('Wait until created workspace is started', async () => {
await ide.waitAndSwitchToIdeFrame();
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter_1.default.registerRunningWorkspace(workspaceName);
await ide.waitIde(TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60000);
await projectTree.openProjectTreeContainer();
await projectTree.waitProjectImported(sampleName, subRootFile);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

@@ -52,0 +48,0 @@ });

@@ -152,4 +152,3 @@ "use strict";

Logger_1.Logger.warn(`CodeExecutionTests.verifyRunningApplication application not located, probably blocked by preloader or content not available. Retrying.`);
await this.driverHelper.getDriver().switchTo().defaultContent();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.previewWidget.refreshPage();

@@ -156,0 +155,0 @@ await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);

@@ -36,5 +36,4 @@ "use strict";

const BrowserTabsUtil_1 = require("../utils/BrowserTabsUtil");
const DriverHelper_1 = require("../utils/DriverHelper");
let LanguageServerTests = class LanguageServerTests {
constructor(editor, ide, topMenu, debugView, browserTabsUtil, driverHelper) {
constructor(editor, ide, topMenu, debugView, browserTabsUtil) {
this.editor = editor;

@@ -45,3 +44,2 @@ this.ide = ide;

this.browserTabsUtil = browserTabsUtil;
this.driverHelper = driverHelper;
}

@@ -83,2 +81,3 @@ errorHighlighting(openedTab, textToWrite, line) {

await this.editor.waitSuggestionWithScrolling(openedTab, expectedText);
await this.editor.waitTabWithSavedStatus(openedTab);
});

@@ -182,5 +181,3 @@ }

await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(TimeoutConstants_1.TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
await this.ide.waitAndSwitchToIdeFrame();
await this.driverHelper.wait(TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
await this.ide.waitIde();
await this.debugView.clickOnRunDebugButton();

@@ -205,5 +202,3 @@ }

await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(TimeoutConstants_1.TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
await this.ide.waitAndSwitchToIdeFrame();
await this.driverHelper.wait(TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
await this.ide.waitIde();
await this.debugView.clickOnDebugConfigurationDropDown();

@@ -233,3 +228,2 @@ await this.debugView.clickOnDebugConfigurationItem(configurationName);

__param(4, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__param(5, inversify_1.inject(inversify_types_1.CLASSES.DriverHelper)),
__metadata("design:paramtypes", [Editor_1.Editor,

@@ -239,6 +233,5 @@ Ide_1.Ide,

DebugView_1.DebugView,
BrowserTabsUtil_1.BrowserTabsUtil,
DriverHelper_1.DriverHelper])
BrowserTabsUtil_1.BrowserTabsUtil])
], LanguageServerTests);
exports.LanguageServerTests = LanguageServerTests;
//# sourceMappingURL=LanguageServerTests.js.map

@@ -58,3 +58,2 @@ "use strict";

test('Wait for workspace readiness', async () => {
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde(TimeoutConstants_1.TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);

@@ -61,0 +60,0 @@ if (checkNotification) {

@@ -32,9 +32,10 @@ "use strict";

const Workspaces_1 = require("../pageobjects/dashboard/Workspaces");
const WorkspaceNameHandler_1 = require("../utils/WorkspaceNameHandler");
const BrowserTabsUtil_1 = require("../utils/BrowserTabsUtil");
const __1 = require("..");
let WorkspaceHandlingTests = WorkspaceHandlingTests_1 = class WorkspaceHandlingTests {
constructor(dashboard, createWorkspace, workspaces, workspaceNameHandler) {
constructor(dashboard, createWorkspace, workspaces, browserTabsUtil) {
this.dashboard = dashboard;
this.createWorkspace = createWorkspace;
this.workspaces = workspaces;
this.workspaceNameHandler = workspaceNameHandler;
this.browserTabsUtil = browserTabsUtil;
}

@@ -49,5 +50,8 @@ static getWorkspaceName() {

await this.createWorkspace.waitPage();
const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
await this.createWorkspace.clickOnSample(stack);
await this.dashboard.waitWorkspaceStartingPage();
WorkspaceHandlingTests_1.workspaceName = await this.workspaceNameHandler.getNameFromUrl();
await this.browserTabsUtil.switchToWindow(parentGUID);
WorkspaceHandlingTests_1.workspaceName = await this.dashboard.getRecentWorkspaceName(10000);
__1.Logger.debug(`Workspace Name is: ${WorkspaceHandlingTests_1.workspaceName}`);
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, 10000);
});

@@ -82,9 +86,9 @@ }

__param(2, inversify_1.inject(inversify_types_1.CLASSES.Workspaces)),
__param(3, inversify_1.inject(inversify_types_1.CLASSES.WorkspaceNameHandler)),
__param(3, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__metadata("design:paramtypes", [Dashboard_1.Dashboard,
CreateWorkspace_1.CreateWorkspace,
Workspaces_1.Workspaces,
WorkspaceNameHandler_1.WorkspaceNameHandler])
BrowserTabsUtil_1.BrowserTabsUtil])
], WorkspaceHandlingTests);
exports.WorkspaceHandlingTests = WorkspaceHandlingTests;
//# sourceMappingURL=WorkspaceHandlingTests.js.map

@@ -8,27 +8,15 @@ "use strict";

};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CheMultiuserAuthorizationHeaderHandler = void 0;
const inversify_types_1 = require("../../../inversify.types");
const inversify_1 = require("inversify");
let CheMultiuserAuthorizationHeaderHandler = class CheMultiuserAuthorizationHeaderHandler {
constructor(tokenHandler) {
this.tokenHandler = tokenHandler;
}
async get() {
const token = await this.tokenHandler.get();
return { headers: { 'Authorization': `Bearer ${token}` } };
// to-do : Fetch the cookies from user api and pass it here
return { headers: { 'cookie': `` } };
}
};
CheMultiuserAuthorizationHeaderHandler = __decorate([
inversify_1.injectable(),
__param(0, inversify_1.inject(inversify_types_1.TYPES.ITokenHandler)),
__metadata("design:paramtypes", [Object])
inversify_1.injectable()
], CheMultiuserAuthorizationHeaderHandler);
exports.CheMultiuserAuthorizationHeaderHandler = CheMultiuserAuthorizationHeaderHandler;
//# sourceMappingURL=CheMultiuserAuthorizationHeaderHandler.js.map

@@ -26,6 +26,6 @@ "use strict";

const TestConstants_1 = require("../../../TestConstants");
const KeycloackUrlHandler_1 = require("../../KeycloackUrlHandler");
let CheMultiuserTokenHandler = class CheMultiuserTokenHandler {
async get() {
const keycloakUrl = KeycloackUrlHandler_1.KeycloackUrlHandler.getTokenEndpointUrl();
// to-do: Login to the che-dashboard and fetch the authorization related info
const keycloakUrl = '';
const params = {

@@ -35,3 +35,3 @@ client_id: 'che-public',

password: TestConstants_1.TestConstants.TS_SELENIUM_PASSWORD,
grant_type: 'password'
grant_type: 'password',
};

@@ -38,0 +38,0 @@ try {

@@ -21,3 +21,3 @@ /*********************************************************************

import { ITestWorkspaceUtil } from '../utils/workspace/ITestWorkspaceUtil';
import { PreferencesHandler, AskForConfirmationType, TerminalRendererType } from '../utils/PreferencesHandler';
// import { PreferencesHandler } from '../utils/PreferencesHandler';
import { CheApiRequestHandler } from '../utils/requestHandlers/CheApiRequestHandler';

@@ -36,3 +36,3 @@ import { TimeoutConstants } from '../TimeoutConstants';

let testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
let preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
// let preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);

@@ -91,4 +91,4 @@ class CheReporter extends mocha.reporters.Spec {

}
await preferencesHandler.setConfirmExit(AskForConfirmationType.never);
await preferencesHandler.setTerminalType(TerminalRendererType.dom);
// await preferencesHandler.setConfirmExit(AskForConfirmationType.never);
// await preferencesHandler.setTerminalType(TerminalRendererType.dom);
});

@@ -95,0 +95,0 @@

@@ -12,3 +12,2 @@ import * as inversifyConfig from './inversify.config';

export * from './utils/DriverHelper';
export * from './utils/KeycloackUrlHandler';
export * from './utils/Logger';

@@ -43,2 +42,3 @@ export * from './utils/PreferencesHandler';

export * from './pageobjects/ide/OpenDialogWidget';
export * from './pageobjects/ide/OpenEditors';
export * from './pageobjects/ide/OpenWorkspaceWidget';

@@ -45,0 +45,0 @@ export * from './pageobjects/ide/plugins/GitHubPullRequestPlugin';

@@ -10,4 +10,5 @@ {

"dist/tests/login/Login.spec.js",
"dist/tests/e2e/factories/*.spec.js"
"dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js",
"dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js"
]
}
{
"name": "@eclipse-che/che-e2e",
"version": "7.44.0",
"version": "7.44.1-dev-bc873f3",
"description": "",

@@ -42,3 +42,3 @@ "main": "dist/index.js",

"chai": "4.2.0",
"chromedriver": "97.0.0",
"chromedriver": "^99.0.0",
"mocha": "^9.1.3",

@@ -45,0 +45,0 @@ "rimraf": "2.6.2",

@@ -63,3 +63,2 @@ /*********************************************************************

Logger.debug('Dashboard.openDashboard');
await this.driverHelper.getDriver().navigate().to(TestConstants.TS_SELENIUM_BASE_URL);

@@ -113,2 +112,8 @@ await this.waitPage();

async getRecentWorkspaceName(timeout: number = TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT) {
Logger.debug(`Dashboard.recentWorkspaceName`);
return await this.driverHelper.waitAndGetText(By.css('[data-testid="recent-workspace-item"]'), timeout);
}
}

@@ -88,3 +88,3 @@ /*********************************************************************

await this.clickOnOpenButton(timeout);
await this.driverHelper.waitVisibility(By.css(Ide.ACTIVATED_IDE_IFRAME_CSS), TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
await this.driverHelper.waitVisibility(By.css(Ide.THEIA_EDITOR_CSS), TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
await this.testWorkspaceUtil.waitWorkspaceStatus(namespace, workspaceName, WorkspaceStatus.STARTING);

@@ -91,0 +91,0 @@ }

@@ -32,3 +32,3 @@ /*********************************************************************

public static readonly SELECTED_EXPLORER_BUTTON_CSS: string = 'li#shell-tab-explorer-view-container.theia-mod-active';
public static readonly ACTIVATED_IDE_IFRAME_CSS: string = '#ide-iframe-window[aria-hidden=\'false\']';
public static readonly THEIA_EDITOR_CSS: string = '#theia-main-content-panel';
public static readonly SELECTED_GIT_BUTTON_XPATH: string = '(//ul[@class=\'p-TabBar-content\']//li[@title=\'Git\' and contains(@class, \'p-mod-current\')])[1]';

@@ -45,2 +45,6 @@ private static readonly TOP_MENU_PANEL_CSS: string = '#theia-app-shell #theia-top-panel .p-MenuBar-content';

/**
* @deprecated Method deprecated. Iframe is not available, Replace it with waitForEditor() or waitIde() method incase for conditional wait
* @see Ide.waitForEditor()
*/
async waitAndSwitchToIdeFrame(timeout: number = TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {

@@ -52,5 +56,14 @@ Logger.debug('Ide.waitAndSwitchToIdeFrame');

if (err instanceof error.StaleElementReferenceError) {
Logger.warn('StaleElementException occured during waiting for IDE. Sleeping for 2 secs and retrying.');
Logger.warn('StaleElementException occurred during waiting for IDE. Sleeping for 2 secs and retrying.');
this.driverHelper.wait(2000);
await this.driverHelper.waitAndSwitchToFrame(By.css(Ide.IDE_IFRAME_CSS), timeout);
try {
await this.driverHelper.waitAndSwitchToFrame(By.css(Ide.IDE_IFRAME_CSS), timeout);
} catch (err) {
if (err instanceof error.TimeoutError) {
Logger.warn(`Iframe is not available even after ${timeout} milliseconds, checking for visibility of #theia-main-content-panel.`);
await this.driverHelper.isVisible(By.css('#theia-main-content-panel'));
return;
}
throw err;
}
return;

@@ -60,4 +73,4 @@ }

if (err instanceof error.TimeoutError) {
Logger.error(`Switching to IDE frame failed after ${timeout} timeout.`);
throw err;
Logger.warn(`Iframe is not available even after ${timeout} milliseconds, checking for visibility of #theia-main-content-panel.`);
await this.driverHelper.isVisible(By.css('#theia-main-content-panel'));
}

@@ -70,2 +83,12 @@

async waitForEditor(timeout: number = TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {
Logger.debug('Ide.waitForEditor');
try {
await this.driverHelper.waitVisibility(By.css(Ide.THEIA_EDITOR_CSS), timeout);
} catch (err) {
Logger.warn(`Editor is not displayed even after ${timeout} milliseconds.`);
throw err;
}
}
async waitNotification(notificationText: string, timeout: number = TimeoutConstants.TS_NOTIFICATION_CENTER_TIMEOUT) {

@@ -165,7 +188,7 @@ Logger.debug(`Ide.waitNotification "${notificationText}"`);

await this.waitAndSwitchToIdeFrame(timeout);
await this.waitForEditor(timeout);
await this.waitIde(timeout);
}
async waitIde(timeout: number = TimeoutConstants.TS_IDE_LOAD_TIMEOUT) {
async waitIde(timeout: number = TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT) {
Logger.debug('Ide.waitIde');

@@ -172,0 +195,0 @@

@@ -79,2 +79,5 @@ /*********************************************************************

/**
* @deprecated Method deprecated. Iframe is not available anymore
*/
async waitAndSwitchToWidgetFrame() {

@@ -102,4 +105,2 @@ Logger.debug('PreviewWidget.waitAndSwitchToWidgetFrame');

if (isApplicationTitleVisible) {
await this.driverHelper.getDriver().switchTo().defaultContent();
await this.ide.waitAndSwitchToIdeFrame();
return true;

@@ -130,2 +131,5 @@ }

/**
* @deprecated Method deprecated. Iframe is not available.
*/
async switchBackToIdeFrame() {

@@ -132,0 +136,0 @@ Logger.debug('PreviewWidget.switchBackToIdeFrame');

@@ -21,2 +21,3 @@ /*********************************************************************

import { TimeoutConstants } from '../../TimeoutConstants';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';

@@ -30,3 +31,4 @@ @injectable()

@inject(CLASSES.Ide) private readonly ide: Ide,
@inject(CLASSES.Editor) private readonly editor: Editor) { }
@inject(CLASSES.Editor) private readonly editor: Editor,
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) { }

@@ -242,5 +244,4 @@ async clickCollapseAllButton() {

Logger.trace(`ProjectTree.waitProjectImported project not located, reloading page.`);
await this.driverHelper.reloadPage();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.browserTabsUtil.refreshPage();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();

@@ -259,9 +260,7 @@ continue;

Logger.trace(`ProjectTree.waitProjectImported sub-items not found, reloading page.`);
await this.driverHelper.reloadPage();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.browserTabsUtil.refreshPage();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();
continue;
}
return;

@@ -288,6 +287,5 @@ }

Logger.trace(`ProjectTree.waitProjectImportedNoSubfolder project not located, reloading page.`);
await this.driverHelper.reloadPage();
await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(triesPolling);
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.ide.waitWorkspaceAndIde();
await this.openProjectTreeContainer();

@@ -294,0 +292,0 @@ continue;

@@ -76,3 +76,3 @@

## Plugins tests launching for the Che wit oauth authentication
## Plugins tests launching for the Che with oauth authentication

@@ -90,1 +90,16 @@ **Setup next environment variables:**

- npm run test-plugin
## Launching the DevWorkspaceHappyPath spec file using Che with oauth authentication
**Setup next environment variables:**
- export TS_SELENIUM_BASE_URL=\<Che-URL\>
- export TS_SELENIUM_OCP_USERNAME=\<cluster-username\>
- export TS_SELENIUM_OCP_PASSWORD=\<cluster-password\>
- export TS_SELENIUM_VALUE_OPENSHIFT_OAUTH="true"
- export TS_OCP_LOGIN_PAGE_PROVIDER_TITLE=\<login-provide-title\>
- export TS_SELENIUM_DEVWORKSPACE_URL=\<devworkspace-url\>
**Execute the npm command:**
- npm run test-devworkspace-happy-path

@@ -30,3 +30,3 @@ /*********************************************************************

// const codeNavigationClassName: string = '[metadata] Console.cs';
const stack : string = '.NET Core';
const stack : string = 'ASP.NET Core Web Application';
const updateDependenciesTaskName: string = 'update dependencies';

@@ -33,0 +33,0 @@ const buildTaskName: string = 'build';

@@ -28,10 +28,10 @@ /*********************************************************************

const workspaceStack: string = 'Go';
const workspaceSampleName: string = 'example';
const workspaceSubfolderName: string = 'outyet';
const workspaceSampleName: string = 'golang-example';
const workspaceSubfolderName: string = 'template';
const fileFolderPath: string = `${workspaceSampleName}/${workspaceSubfolderName}`;
const fileName: string = `main.go`;
const taskRunServer: string = '1.1 Run outyet';
const taskStopServer: string = '1.2 Stop outyet';
const taskTestOutyet: string = '1.3 Test outyet';
const taskRunServer: string = 'run-outyet';
const taskStopServer: string = 'stop-outyet';
const taskTestOutyet: string = 'test-outyet';
const notificationText: string = 'Process 8080-tcp is now listening on port 8080. Open it ?';

@@ -43,8 +43,3 @@ let workspaceName: string;

suite(`Create ${workspaceStack} workspace`, async () => {
test('Workaround for issue #16113', async () => {
Logger.warn(`Manually setting a preference for golang devfile LS based on issue: https://github.com/eclipse/che/issues/16113`);
await preferencesHandler.setUseGoLanaguageServer();
});
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);
test('Register running workspace', async () => {

@@ -54,4 +49,7 @@ workspaceName = WorkspaceHandlingTests.getWorkspaceName();

});
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceSubfolderName, false);
test('Workaround for issue #16113', async () => {
Logger.warn(`Manually setting a preference for golang devFile LS based on issue: https://github.com/eclipse/che/issues/16113`);
await preferencesHandler.setPreferenceUsingUI('go.useLanguageServer', true);
});
});

@@ -65,3 +63,3 @@

suite('Test golang example', async () => {
codeExecutionTests.runTask(taskTestOutyet, 60_000);
codeExecutionTests.runTask(taskTestOutyet, 80_000);
codeExecutionTests.closeTerminal(taskTestOutyet);

@@ -72,9 +70,9 @@ });

codeExecutionTests.runTaskWithNotification(taskRunServer, notificationText, 40_000);
codeExecutionTests.runTask(taskStopServer, 5_000);
codeExecutionTests.runTask(taskStopServer, 8_000);
});
suite(`'Language server validation'`, async () => {
commonLanguageServerTests.suggestionInvoking(fileName, 42, 10, 'Parse');
commonLanguageServerTests.autocomplete(fileName, 42, 10, 'Parse');
commonLanguageServerTests.errorHighlighting(fileName, 'error;\n', 42);
commonLanguageServerTests.suggestionInvoking(fileName, 41, 49, 'Parse');
commonLanguageServerTests.autocomplete(fileName, 41, 49, 'Parse');
commonLanguageServerTests.errorHighlighting(fileName, 'error;\n', 41);
// commonLanguageServerTests.goToImplementations(fileName, 42, 10, 'flag.go'); // codenavigation is inconsistent https://github.com/eclipse/che/issues/16929

@@ -84,3 +82,3 @@ });

suite('Stop and remove workspace', async() => {
test(`Stop and remowe workspace`, async () => {
test(`Stop and remove workspace`, async () => {
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);

@@ -87,0 +85,0 @@ });

@@ -47,3 +47,2 @@ // /*********************************************************************

const SpringAppLocators = {

@@ -60,2 +59,3 @@ springTitleLocator: By.xpath('//div[@class=\'container-fluid\']//h2[text()=\'Welcome\']'),

let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
const workspaceRootFolderName: string = 'src';

@@ -81,134 +81,133 @@

});
});
});
suite('Language server validation', async () => {
test('Java LS initialization', async () => {
await projectTree.expandPathAndOpenFile(pathToJavaFolder, javaFileName);
await editor.selectTab(javaFileName);
try {
await ide.checkLsInitializationStart('Activating Language Support for Java');
await ide.waitStatusBarTextAbsence('Activating Language Support for Java', 900_000);
} catch (err) {
if (!(err instanceof error.TimeoutError)) {
throw err;
}
console.log('Known flakiness has occurred https://github.com/eclipse/che/issues/17864');
await ide.waitStatusBarContains('Activating Java Test Runner');
await ide.waitStatusBarTextAbsence('Activating Java Test Runner', 900_000);
suite('Language server validation', async () => {
test('Java LS initialization', async () => {
await projectTree.expandPathAndOpenFile(pathToJavaFolder, javaFileName);
await editor.selectTab(javaFileName);
try {
await ide.checkLsInitializationStart('Activating Language Support for Java');
await ide.waitStatusBarTextAbsence('Activating Language Support for Java', 900_000);
} catch (err) {
if (!(err instanceof error.TimeoutError)) {
throw err;
}
await checkJavaPathCompletion();
});
console.log('Known flakiness has occurred https://github.com/eclipse/che/issues/17864');
await ide.waitStatusBarContains('Activating Java Test Runner');
await ide.waitStatusBarTextAbsence('Activating Java Test Runner', 900_000);
}
test('Autocomplete', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
await editor.pressControlSpaceCombination(javaFileName);
await editor.waitSuggestionContainer();
await editor.waitSuggestion(javaFileName, 'SpringApplication - org.springframework.boot');
});
await checkJavaPathCompletion();
});
test('Error highlighting', async () => {
await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
test('Autocomplete', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
await editor.pressControlSpaceCombination(javaFileName);
await editor.waitSuggestionContainer();
await editor.waitSuggestion(javaFileName, 'SpringApplication - org.springframework.boot');
});
const textForErrorDisplaying: string = '$';
await editor.type(javaFileName, textForErrorDisplaying, 30);
test('Error highlighting', async () => {
await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
try {
await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
} catch (err) {
Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.');
await browserTabsUtil.refreshPage();
await ide.waitAndSwitchToIdeFrame();
await ide.waitIde();
await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);
}
await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE));
await editor.waitErrorInLineDisappearance(30, javaFileName);
});
const textForErrorDisplaying: string = '$';
await editor.type(javaFileName, textForErrorDisplaying, 30);
test('Suggestion', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 21);
await editor.pressControlSpaceCombination(javaFileName);
await editor.waitSuggestionWithScrolling(javaFileName, 'run(Class<?> primarySource, String... args) : ConfigurableApplicationContext', 120_000);
});
try {
await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
} catch (err) {
Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.');
await browserTabsUtil.refreshPage();
await ide.waitIde();
await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);
}
await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE));
await editor.waitErrorInLineDisappearance(30, javaFileName);
});
test('Codenavigation', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12));
await editor.waitEditorAvailable(codeNavigationClassName, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT * 4);
});
test('Suggestion', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 21);
await editor.pressControlSpaceCombination(javaFileName);
await editor.waitSuggestionWithScrolling(javaFileName, 'run(Class<?> primarySource, String... args) : ConfigurableApplicationContext', 120_000);
});
test('CodeNavigation', async () => {
await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12));
await editor.waitEditorAvailable(codeNavigationClassName, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT * 4);
});
});
suite('Validation of workspace build and run', async () => {
const mavenBuildTaskName: string = 'maven-build';
const runAppTaskName: string = 'run-with-hsqldb';
test('Build application', async () => {
await topMenu.runTask(`${mavenBuildTaskName}, ${globalTaskScope}`);
await terminal.waitIconSuccess(mavenBuildTaskName, 500_000);
});
test('Run application', async () => {
await topMenu.runTask(`${runAppTaskName}, ${globalTaskScope}`);
await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000);
// devWs specific. After running test application we can open it just in the new window.
// the preview widget is not available yet.
await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
});
// this is DevWorkspace test specific since Theia does not provide yet preview as a widget
test('Check the running application', async () => {
await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator);
});
suite('Validation of workspace build and run', async () => {
const mavenBuildTaskName: string = 'maven-build';
const runAppTaskName: string = 'run-with-hsqldb';
test('Build application', async () => {
await topMenu.runTask(`${mavenBuildTaskName}, ${globalTaskScope}`);
await terminal.waitIconSuccess(mavenBuildTaskName, 500_000);
});
test('Close the terminal running tasks', async () => {
await terminal.rejectTerminalProcess(runAppTaskName);
await terminal.closeTerminalTab(runAppTaskName);
await warningDialog.waitAndCloseIfAppear();
await terminal.closeTerminalTab(mavenBuildTaskName);
});
test('Run application', async () => {
await topMenu.runTask(`${runAppTaskName}, ${globalTaskScope}`);
await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000);
// devWs specific. After running test application we can open it just in the new window.
// the preview widget is not available yet.
await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
});
// this is DevWorkspace test specific since Theia does not provide yet preview as a widget
test('Check the running application', async () => {
await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator);
});
test('Close the terminal running tasks', async () => {
await terminal.rejectTerminalProcess(runAppTaskName);
await terminal.closeTerminalTab(runAppTaskName);
await warningDialog.waitAndCloseIfAppear();
await terminal.closeTerminalTab(mavenBuildTaskName);
});
});
suite('Validation of debug functionality', async () => {
let urlToPetClinicApp = '';
test('Launch debug', async () => {
const taskName: string = 'run-debug';
await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 180_000);
await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
});
suite('Validation of debug functionality', async () => {
let urlToPetClinicApp = '';
test('Launch debug', async () => {
const taskName: string = 'run-debug';
await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 180_000);
await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
});
test('Check content of the launched application', async () => {
const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle();
await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
urlToPetClinicApp = await browserTabsUtil.getCurrentUrl();
await browserTabsUtil.switchToWindow(mainWindowHandle);
});
test('Check content of the launched application', async () => {
const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle();
await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
urlToPetClinicApp = await browserTabsUtil.getCurrentUrl();
await browserTabsUtil.switchToWindow(mainWindowHandle);
});
test('Open debug view', async () => {
await projectTree.expandPathAndOpenFile(pathToJavaFolder + '/system', welcomeControllerJavaFileName);
await editor.selectTab(welcomeControllerJavaFileName);
await topMenu.selectOption('View', 'Debug');
await ide.waitLeftToolbarButton(LeftToolbarButton.Debug);
});
test('Open debug view', async () => {
await projectTree.expandPathAndOpenFile(pathToJavaFolder + '/system', welcomeControllerJavaFileName);
await editor.selectTab(welcomeControllerJavaFileName);
await topMenu.selectOption('View', 'Debug');
await ide.waitLeftToolbarButton(LeftToolbarButton.Debug);
});
test('Choose debug configuration', async () => {
await debugView.clickOnDebugConfigurationDropDown();
await debugView.clickOnDebugConfigurationItem('Debug (Attach) - Remote (java-spring-petclinic)');
});
test('Choose debug configuration', async () => {
await debugView.clickOnDebugConfigurationDropDown();
await debugView.clickOnDebugConfigurationItem('Debug (Attach) - Remote (java-spring-petclinic)');
});
test('Run debug', async () => {
await debugView.clickOnRunDebugButton();
await waitDebugToConnect();
});
test('Run debug', async () => {
await debugView.clickOnRunDebugButton();
await waitDebugToConnect();
});
test('Activate breakpoint', async () => {
await editor.selectTab(welcomeControllerJavaFileName);
await editor.activateBreakpoint(welcomeControllerJavaFileName, 27);
});
test('Activate breakpoint', async () => {
await editor.selectTab(welcomeControllerJavaFileName);
await editor.activateBreakpoint(welcomeControllerJavaFileName, 27);
});
test('Check debugger stop at the breakpoint', async () => {
await sendRequestToDebugApp(urlToPetClinicApp);
await waitStoppedBreakpoint(27);
});
test('Check debugger stop at the breakpoint', async () => {
await sendRequestToDebugApp(urlToPetClinicApp);
await waitStoppedBreakpoint(27);
});
});

@@ -274,13 +273,16 @@ async function checkJavaPathCompletion() {

async function sendRequestToDebugApp(urlToApp: string) {
const httpClient = axios.create();
httpClient.defaults.timeout = 1000;
const httpClient = axios.create();
httpClient.defaults.timeout = 1000;
try {
await httpClient.get(urlToApp);
} catch (error) {
if (error.message === 'timeout of 1000ms exceeded') {
console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
} else { const {data} = await httpClient.get(urlToApp);
console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>' + data);
}
}
if (error instanceof Error) {
if (error.message === 'timeout of 1000ms exceeded') {
console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
} else {
const {data} = await httpClient.get(urlToApp);
console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>' + data);
}
}
}
}

@@ -297,2 +299,1 @@

}
// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -12,3 +12,3 @@ // * This program and the accompanying materials are made

import { e2eContainer } from '../../../inversify.config';
import { CLASSES, TYPES } from '../../../inversify.types';
import { CLASSES } from '../../../inversify.types';
import { TestConstants } from '../../../TestConstants';

@@ -18,9 +18,9 @@ import { ProjectAndFileTests } from '../../../testsLibrary/ProjectAndFileTests';

import { BrowserTabsUtil } from '../../../utils/BrowserTabsUtil';
import { WorkspaceNameHandler } from '../../../utils/WorkspaceNameHandler';
import { TestWorkspaceUtil } from '../../../utils/workspace/TestWorkspaceUtil';
import { WorkspaceHandlingTests } from '../../../testsLibrary/WorkspaceHandlingTests';
import { PreferencesHandler } from '../../../utils/PreferencesHandler';
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils: TestWorkspaceUtil = e2eContainer.get<TestWorkspaceUtil>(TYPES.WorkspaceUtil);

@@ -33,5 +33,4 @@ const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/master/src`;

const tabTitle: string = 'HelloWorld.java';
let workspaceName: string;
let workspaceName: string = 'console-java-simple';
// the suite expect user to be logged in
suite('Workspace creation via factory url', async () => {

@@ -45,3 +44,9 @@ suite('Open factory URL', async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -58,6 +63,3 @@

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -64,0 +66,0 @@ });

// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -12,3 +12,3 @@ // * This program and the accompanying materials are made

import { e2eContainer } from '../../../inversify.config';
import { CLASSES, TYPES } from '../../../inversify.types';
import { CLASSES } from '../../../inversify.types';
import { TestConstants } from '../../../TestConstants';

@@ -18,9 +18,9 @@ import { ProjectAndFileTests } from '../../../testsLibrary/ProjectAndFileTests';

import { BrowserTabsUtil } from '../../../utils/BrowserTabsUtil';
import { WorkspaceNameHandler } from '../../../utils/WorkspaceNameHandler';
import { TestWorkspaceUtil } from '../../../utils/workspace/TestWorkspaceUtil';
import { WorkspaceHandlingTests } from '../../../testsLibrary/WorkspaceHandlingTests';
import { PreferencesHandler } from '../../../utils/PreferencesHandler';
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils: TestWorkspaceUtil = e2eContainer.get<TestWorkspaceUtil>(TYPES.WorkspaceUtil);

@@ -32,5 +32,4 @@ const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple`;

const tabTitle: string = 'HelloWorld.java';
let workspaceName: string;
let workspaceName: string = 'console-java-simple';
// the suite expect user to be logged in
suite('Workspace creation via factory url', async () => {

@@ -44,3 +43,9 @@ suite('Open factory URL', async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -50,3 +55,2 @@

projectAndFileTests.openFile(fileFolderPath, tabTitle);
projectAndFileTests.checkProjectBranchName('master');

@@ -57,6 +61,3 @@ });

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -63,0 +64,0 @@ });

// /*********************************************************************
// * Copyright (c) 2020 Red Hat, Inc.
// * Copyright (c) 2022 Red Hat, Inc.
// *

@@ -12,3 +12,3 @@ // * This program and the accompanying materials are made

import { e2eContainer } from '../../../inversify.config';
import { CLASSES, TYPES } from '../../../inversify.types';
import { CLASSES } from '../../../inversify.types';
import { TestConstants } from '../../../TestConstants';

@@ -18,21 +18,18 @@ import { ProjectAndFileTests } from '../../../testsLibrary/ProjectAndFileTests';

import { BrowserTabsUtil } from '../../../utils/BrowserTabsUtil';
import { WorkspaceNameHandler } from '../../../utils/WorkspaceNameHandler';
import { TestWorkspaceUtil } from '../../../utils/workspace/TestWorkspaceUtil';
import { WorkspaceHandlingTests } from '../../../testsLibrary/WorkspaceHandlingTests';
import { PreferencesHandler } from '../../../utils/PreferencesHandler';
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const testWorkspaceUtils: TestWorkspaceUtil = e2eContainer.get<TestWorkspaceUtil>(TYPES.WorkspaceUtil);
let workspaceName: string;
let factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
const workspaceSampleName: string = 'console-java-simple';
const workspaceRootFolderName: string = 'src';
const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
const tabTitle: string = 'HelloWorld.java';
let workspaceName: string = 'console-java-simple';
// the suite expect user to be logged in
suite('Workspace creation via factory url', async () => {
let factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
const workspaceSampleName: string = 'console-java-simple';
const workspaceRootFolderName: string = 'src';
const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
const tabTitle: string = 'HelloWorld.java';
suite('Open factory URL', async () => {

@@ -45,4 +42,9 @@ test(`Navigating to factory URL`, async () => {

suite('Wait workspace readyness', async () => {
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, true, true);
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName);
test('Set confirmExit preference to never', async () => {
CheReporter.registerRunningWorkspace(workspaceName);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

@@ -57,6 +59,3 @@

test('Stop and remove workspace', async () => {
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);
await testWorkspaceUtils.cleanUpRunningWorkspace(workspaceName);
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
});

@@ -63,0 +62,0 @@ });

@@ -62,3 +62,3 @@ /*********************************************************************

}
}
},
],

@@ -70,3 +70,3 @@

'type': 'chePlugin'
}
},
];

@@ -73,0 +73,0 @@

@@ -23,3 +23,2 @@ /*********************************************************************

import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
import { KeycloackUrlHandler } from '../../utils/KeycloackUrlHandler';
import { GitPlugin } from '../../pageobjects/ide/plugins/GitPlugin';

@@ -52,2 +51,4 @@ import { TopMenu } from '../../pageobjects/ide/TopMenu';

const changedFile: string = 'README.md';
// added call back url, but needs to be re-verified
const identityCallbackUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/api/oauth/callback`;
const currentDate: string = Date.now().toString();

@@ -71,3 +72,3 @@ let workspaceName: string;

await gitOauthAppsSettings.typeHomePageUrl(TestConstants.TS_SELENIUM_BASE_URL);
await gitOauthAppsSettings.typeCallbackUrl(KeycloackUrlHandler.getIdentityCallbackUrl());
await gitOauthAppsSettings.typeCallbackUrl(identityCallbackUrl);
await gitOauthAppsSettings.clickUpdateApplicationButton();

@@ -74,0 +75,0 @@ });

@@ -10,3 +10,2 @@ /*********************************************************************

**********************************************************************/
import { WorkspaceNameHandler } from '../..';
import 'reflect-metadata';

@@ -18,3 +17,2 @@ import { e2eContainer } from '../../inversify.config';

import { TestConstants } from '../../TestConstants';
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
import { Key } from 'selenium-webdriver';

@@ -27,2 +25,3 @@ import { Editor } from '../../pageobjects/ide/Editor';

import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { PreferencesHandler } from '../../utils/PreferencesHandler';

@@ -33,15 +32,14 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);

const ide: Ide = e2eContainer.get(CLASSES.Ide);
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
const editor: Editor = e2eContainer.get(CLASSES.Editor);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/Java11PluginTest.yaml';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const devFileUrl: string = 'https://github.com/che-samples/java-guestbook/tree/devfilev2';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
const codeNavigationClassName: string = 'String.class';
const sampleName: string = 'console-java-simple';
const subRootFolder: string = 'src';
const projectName: string = 'java-guestbook';
const subRootFolder: string = 'backend';
const fileFolderPath: string = `${sampleName}/src/main/java/org/eclipse/che/examples`;
const tabTitle: string = 'HelloWorld.java';
let workspaceName: string;
const fileFolderPath: string = `${projectName}/backend/src/main/java/cloudcode/guestbook/backend`;
const tabTitle: string = 'GuestBookEntry.java';
let workspaceName: string = 'java-guestbook';

@@ -54,12 +52,8 @@ suite(`The 'JavaPlugin' test`, async () => {

projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
test('Wait until created workspace is started', async () => {
await ide.waitAndSwitchToIdeFrame();
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);
await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
await projectTree.openProjectTreeContainer();
await projectTree.waitProjectImported(sampleName, subRootFolder);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

@@ -74,3 +68,3 @@ });

suite('Language server validation', async () => {
test('Wait until Java LS is initialised', async () => {
test('Wait until Java LS is initialized', async () => {
await ide.checkLsInitializationStart('Activating');

@@ -81,6 +75,6 @@ await ide.waitStatusBarTextAbsence('Activating', 900_000);

test('Autocomplete', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 10, 20);
await editor.moveCursorToLineAndChar(tabTitle, 15, 1);
await editor.pressControlSpaceCombination(tabTitle);
await editor.waitSuggestionContainer();
await editor.waitSuggestion(tabTitle, 'close() : void');
await editor.waitSuggestion(tabTitle, 'clone() : Object');
});

@@ -90,10 +84,10 @@

const textForErrorDisplaying: string = '$';
await editor.type(tabTitle, textForErrorDisplaying, 10);
await editor.waitErrorInLine(10, tabTitle, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
await editor.type(tabTitle, textForErrorDisplaying, 15);
await editor.waitErrorInLine(15, tabTitle, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
await editor.performKeyCombination(tabTitle, Key.chord(Key.BACK_SPACE));
await editor.waitErrorInLineDisappearance(10, tabTitle);
await editor.waitErrorInLineDisappearance(15, tabTitle);
});
test('Codenavigation', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 9, 12);
test('CodeNavigation', async () => {
await editor.moveCursorToLineAndChar(tabTitle, 9, 14);
await editor.performKeyCombination(tabTitle, Key.chord(Key.CONTROL, Key.F12));

@@ -100,0 +94,0 @@ await editor.waitEditorAvailable(codeNavigationClassName, 60_000);

@@ -13,3 +13,2 @@ /*********************************************************************

import { CLASSES } from '../../inversify.types';
import { Ide } from '../../pageobjects/ide/Ide';
import { TimeoutConstants } from '../../TimeoutConstants';

@@ -24,19 +23,20 @@ import { TestConstants } from '../../TestConstants';

import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
import { PreferencesHandler } from '../../utils/PreferencesHandler';
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const ide: Ide = e2eContainer.get(CLASSES.Ide);
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
const editor: Editor = e2eContainer.get(CLASSES.Editor);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/PythonPluginTest.yaml';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const sampleName: string = 'python-hello-world';
const subRootFile: string = 'README.md';
const devFileUrl: string = 'https://github.com/che-samples/python-hello-world/tree/devfilev2';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
const projectName: string = 'python-hello-world';
const subRootFolder: string = '.vscode';
const fileFolderPath: string = `${sampleName}`;
const fileFolderPath: string = `${projectName}`;
const tabTitle: string = 'hello-world.py';
let workspaceName: string;
let workspaceName: string = 'python-hello-world';

@@ -49,12 +49,8 @@ suite(`The 'PythonPlugin' test`, async () => {

projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
test('Wait until created workspace is started', async () => {
await ide.waitAndSwitchToIdeFrame();
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);
await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
await projectTree.openProjectTreeContainer();
await projectTree.waitProjectImported(sampleName, subRootFile);
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

@@ -61,0 +57,0 @@ });

@@ -143,4 +143,3 @@ /*********************************************************************

Logger.warn(`CodeExecutionTests.verifyRunningApplication application not located, probably blocked by preloader or content not available. Retrying.`);
await this.driverHelper.getDriver().switchTo().defaultContent();
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde();
await this.previewWidget.refreshPage();

@@ -147,0 +146,0 @@ await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);

@@ -22,3 +22,2 @@ /*********************************************************************

import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
import { DriverHelper } from '../utils/DriverHelper';

@@ -33,4 +32,3 @@ @injectable()

@inject(CLASSES.DebugView) private readonly debugView: DebugView,
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) { }

@@ -73,2 +71,3 @@ public errorHighlighting(openedTab: string, textToWrite: string, line: number) {

await this.editor.waitSuggestionWithScrolling(openedTab, expectedText);
await this.editor.waitTabWithSavedStatus(openedTab);
});

@@ -169,5 +168,3 @@ }

await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
await this.ide.waitAndSwitchToIdeFrame();
await this.driverHelper.wait(TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
await this.ide.waitIde();
await this.debugView.clickOnRunDebugButton();

@@ -193,5 +190,3 @@ }

await this.browserTabsUtil.refreshPage();
await this.driverHelper.wait(TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
await this.ide.waitAndSwitchToIdeFrame();
await this.driverHelper.wait(TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
await this.ide.waitIde();
await this.debugView.clickOnDebugConfigurationDropDown();

@@ -198,0 +193,0 @@ await this.debugView.clickOnDebugConfigurationItem(configurationName);

@@ -51,3 +51,2 @@ /*********************************************************************

test('Wait for workspace readiness', async () => {
await this.ide.waitAndSwitchToIdeFrame();
await this.ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);

@@ -54,0 +53,0 @@ if (checkNotification) {

@@ -17,3 +17,4 @@ /*********************************************************************

import { Workspaces } from '../pageobjects/dashboard/Workspaces';
import { WorkspaceNameHandler } from '../utils/WorkspaceNameHandler';
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
import { Logger } from '..';

@@ -33,3 +34,3 @@ @injectable()

@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
@inject(CLASSES.WorkspaceNameHandler) private readonly workspaceNameHandler: WorkspaceNameHandler) {}
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {}

@@ -41,5 +42,8 @@ public createAndOpenWorkspace(stack: string) {

await this.createWorkspace.waitPage();
const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
await this.createWorkspace.clickOnSample(stack);
await this.dashboard.waitWorkspaceStartingPage();
WorkspaceHandlingTests.workspaceName = await this.workspaceNameHandler.getNameFromUrl();
await this.browserTabsUtil.switchToWindow(parentGUID);
WorkspaceHandlingTests.workspaceName = await this.dashboard.getRecentWorkspaceName(10000);
Logger.debug(`Workspace Name is: ${WorkspaceHandlingTests.workspaceName}`);
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, 10000);
});

@@ -46,0 +50,0 @@ }

@@ -14,4 +14,5 @@ {

"emitDecoratorMetadata": true,
"noImplicitReturns": false,
"sourceMap": true
}
}
{
"rules": {
"ban": [
true,
[
"_",
"extend"
],
[
"_",
"isNull"
],
[
"_",
"isDefined"
]
"rules": {
"ban": [
true,
[
"_",
"extend"
],
"class-name": true,
"comment-format": [
true,
"check-space",
"check-lowercase"
[
"_",
"isNull"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
2
[
"_",
"isDefined"
]
],
"class-name": true,
"comment-format": [
true,
"check-space",
"check-lowercase"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
2
],
"interface-name": true,
"jsdoc-format": true,
"label-position": true,
"max-line-length": [
false,
140
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-parameter-properties": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"trailing-comma": [true, {
"singleline": "never",
"multiline": {
"objects": "ignore",
"arrays": "always",
"functions": "never",
"typeLiterals": "ignore"
}
}],
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-requires": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": true,
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
true,
"callSignature",
"indexSignature",
"parameter",
"propertySignature",
"variableDeclarator"
],
"typedef-whitespace": [
true,
[
"callSignature",
"noSpace"
],
"interface-name": true,
"jsdoc-format": true,
"label-position": true,
"label-undefined": true,
"max-line-length": [
false,
140
[
"catchClause",
"noSpace"
],
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-constructor-vars": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"no-trailing-comma": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-unreachable": true,
"no-use-before-declare": true,
"no-var-requires": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": true,
"triple-equals": [
true,
"allow-null-check"
],
"typedef": [
true,
"callSignature",
[
"indexSignature",
"parameter",
"propertySignature",
"variableDeclarator"
],
"typedef-whitespace": [
true,
[
"callSignature",
"noSpace"
],
[
"catchClause",
"noSpace"
],
[
"indexSignature",
"space"
]
],
"use-strict": false,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
"space"
]
}
],
"use-strict": false,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}

@@ -11,7 +11,4 @@ /*********************************************************************

import { AxiosRequestConfig } from 'axios';
import { TYPES } from '../../../inversify.types';
import { IAuthorizationHeaderHandler } from './IAuthorizationHeaderHandler';
import { injectable, inject } from 'inversify';
import { ITokenHandler } from '../tokens/ITokenHandler';
import { injectable } from 'inversify';

@@ -21,9 +18,6 @@ @injectable()

constructor(@inject(TYPES.ITokenHandler) private readonly tokenHandler: ITokenHandler) {
}
async get(): Promise<AxiosRequestConfig> {
const token = await this.tokenHandler.get();
return { headers: { 'Authorization': `Bearer ${token}` } };
// to-do : Fetch the cookies from user api and pass it here
return { headers: { 'cookie': `` } };
}
}

@@ -15,26 +15,28 @@ /*********************************************************************

import { ITokenHandler } from './ITokenHandler';
import { KeycloackUrlHandler } from '../../KeycloackUrlHandler';
@injectable()
export class CheMultiuserTokenHandler implements ITokenHandler {
async get(): Promise<string> {
const keycloakUrl = KeycloackUrlHandler.getTokenEndpointUrl();
async get(): Promise<string> {
// to-do: Login to the che-dashboard and fetch the authorization related info
const keycloakUrl = '';
const params = {
client_id: 'che-public',
username: TestConstants.TS_SELENIUM_USERNAME,
password: TestConstants.TS_SELENIUM_PASSWORD,
grant_type: 'password'
};
const params = {
client_id: 'che-public',
username: TestConstants.TS_SELENIUM_USERNAME,
password: TestConstants.TS_SELENIUM_PASSWORD,
grant_type: 'password',
};
try {
const responseToObtainBearerToken = await axios.post(keycloakUrl, querystring.stringify(params));
return responseToObtainBearerToken.data.access_token;
} catch (err) {
console.log(`Can not get bearer token. URL used: ${keycloakUrl}`);
throw err;
}
try {
const responseToObtainBearerToken = await axios.post(
keycloakUrl,
querystring.stringify(params)
);
return responseToObtainBearerToken.data.access_token;
} catch (err) {
console.log(`Can not get bearer token. URL used: ${keycloakUrl}`);
throw err;
}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc