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
378
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

to
7.45.0-dev-14d9e32

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);

@@ -35,6 +35,8 @@ "use strict";

const Logger_1 = require("../../utils/Logger");
const BrowserTabsUtil_1 = require("../../utils/BrowserTabsUtil");
let Dashboard = Dashboard_1 = class Dashboard {
constructor(driverHelper, workspaces) {
constructor(driverHelper, workspaces, browserTabUtil) {
this.driverHelper = driverHelper;
this.workspaces = workspaces;
this.browserTabUtil = browserTabUtil;
}

@@ -67,2 +69,7 @@ async stopWorkspaceByUI(workspaceName) {

Logger_1.Logger.debug('Dashboard.openDashboard');
const windowHandles = await this.browserTabUtil.getAllWindowHandles();
if (windowHandles.length > 1) {
const windowHandle = await this.browserTabUtil.getCurrentWindowHandle();
await this.browserTabUtil.waitAndSwitchToAnotherWindow(windowHandle, 1000);
}
await this.driverHelper.getDriver().navigate().to(TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL);

@@ -100,2 +107,6 @@ await this.waitPage();

}
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);
}
};

@@ -110,6 +121,8 @@ Dashboard.WORKSPACES_BUTTON_XPATH = `//div[@id='page-sidebar']//a[contains(text(), 'Workspaces (')]`;

__param(1, inversify_1.inject(inversify_types_1.CLASSES.Workspaces)),
__param(2, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper,
Workspaces_1.Workspaces])
Workspaces_1.Workspaces,
BrowserTabsUtil_1.BrowserTabsUtil])
], Dashboard);
exports.Dashboard = Dashboard;
//# sourceMappingURL=Dashboard.js.map

@@ -57,10 +57,20 @@ "use strict";

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'));
}

@@ -67,0 +77,0 @@ Logger_1.Logger.error(`Switching to IDE frame failed.`);

@@ -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,3 +195,3 @@ async clickCollapseAllButton() {

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

@@ -207,3 +209,3 @@ await this.ide.waitIde();

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

@@ -225,3 +227,3 @@ await this.ide.waitIde();

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

@@ -274,7 +276,9 @@ await this.ide.waitAndSwitchToIdeFrame();

__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 @@ });

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

const welcomeControllerJavaFileName = 'WelcomeController.java';
const factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml`;
const SpringAppLocators = {

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

suite('Workspace creation via factory url', async () => {
let factoryUrl = `${TestConstants_1.TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
// let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
const workspaceRootFolderName = 'src';

@@ -258,9 +259,11 @@ suite('Open factory URL', async () => {

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 +270,0 @@ }

@@ -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 @@ });

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

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

@@ -83,0 +84,0 @@ }

@@ -33,4 +33,6 @@ "use strict";

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, workspaceNameHandler, browserTabsUtil) {
this.dashboard = dashboard;

@@ -40,2 +42,3 @@ this.createWorkspace = createWorkspace;

this.workspaceNameHandler = workspaceNameHandler;
this.browserTabsUtil = browserTabsUtil;
}

@@ -50,5 +53,9 @@ 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();
// WorkspaceHandlingTests.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);
});

@@ -84,8 +91,10 @@ }

__param(3, inversify_1.inject(inversify_types_1.CLASSES.WorkspaceNameHandler)),
__param(4, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__metadata("design:paramtypes", [Dashboard_1.Dashboard,
CreateWorkspace_1.CreateWorkspace,
Workspaces_1.Workspaces,
WorkspaceNameHandler_1.WorkspaceNameHandler])
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';

{
"name": "@eclipse-che/che-e2e",
"version": "7.45.0-dev-0129fe6",
"version": "7.45.0-dev-14d9e32",
"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",

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

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

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

constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces) { }
@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabUtil: BrowserTabsUtil) { }

@@ -65,3 +67,7 @@ async stopWorkspaceByUI(workspaceName: string) {

Logger.debug('Dashboard.openDashboard');
const windowHandles = await this.browserTabUtil.getAllWindowHandles();
if (windowHandles.length > 1) {
const windowHandle = await this.browserTabUtil.getCurrentWindowHandle();
await this.browserTabUtil.waitAndSwitchToAnotherWindow(windowHandle, 1000);
}
await this.driverHelper.getDriver().navigate().to(TestConstants.TS_SELENIUM_BASE_URL);

@@ -115,2 +121,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);
}
}

@@ -50,5 +50,14 @@ /*********************************************************************

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;

@@ -58,4 +67,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'));
}

@@ -62,0 +71,0 @@

@@ -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,3 +244,3 @@ async clickCollapseAllButton() {

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

@@ -259,3 +261,3 @@ await this.ide.waitIde();

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

@@ -266,3 +268,2 @@ await this.ide.waitIde();

}
return;

@@ -289,3 +290,3 @@ }

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

@@ -292,0 +293,0 @@ await this.ide.waitAndSwitchToIdeFrame();

@@ -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 @@ });

@@ -46,4 +46,4 @@ // /*********************************************************************

const welcomeControllerJavaFileName: string = 'WelcomeController.java';
const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml`;
const SpringAppLocators = {

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

suite('Workspace creation via factory url', async () => {
let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
// let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
const workspaceRootFolderName: string = 'src';

@@ -81,134 +82,134 @@

});
});
});
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.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);
});
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 +275,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 +301,1 @@

}

@@ -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 @@ });

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

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

@@ -73,0 +74,0 @@ }

@@ -18,2 +18,4 @@ /*********************************************************************

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

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

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

@@ -41,5 +44,9 @@ 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();
// 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 +53,0 @@ }

@@ -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