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
372
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.48.0-dev-29d4f0d to 7.48.0-dev-8e6670a

2

dist/pageobjects/ide/Editor.js

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

Logger_1.Logger.debug(`Editor.closeTab "${tabTitle}"`);
const tabCloseButtonLocator = selenium_webdriver_1.By.xpath(`//div[text()='${tabTitle}']/parent::li//div[contains(@class, 'p-TabBar-tabCloseIcon')]`);
const tabCloseButtonLocator = selenium_webdriver_1.By.xpath(`//li[contains(@id,'${tabTitle}')]//div[contains(@class, 'p-TabBar-tabCloseIcon')]`);
await this.driverHelper.waitAndClick(tabCloseButtonLocator, timeout);

@@ -151,0 +151,0 @@ }

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

const TimeoutConstants_1 = require("../../TimeoutConstants");
/**
* @deprecated Preview widget is no longer a valid page fragment.
*/
let PreviewWidget = PreviewWidget_1 = class PreviewWidget {

@@ -36,0 +39,0 @@ constructor(driverHelper, ide) {

@@ -39,8 +39,8 @@ "use strict";

const DriverHelper_1 = require("../utils/DriverHelper");
const PreviewWidget_1 = require("../pageobjects/ide/PreviewWidget");
const RightToolBar_1 = require("../pageobjects/ide/RightToolBar");
const Logger_1 = require("../utils/Logger");
const QuickOpenContainer_1 = require("../pageobjects/ide/QuickOpenContainer");
const BrowserTabsUtil_1 = require("../utils/BrowserTabsUtil");
const WorkspaceHandlingTests_1 = require("./WorkspaceHandlingTests");
let CodeExecutionTests = CodeExecutionTests_1 = class CodeExecutionTests {
constructor(terminal, topMenu, ide, dialogWindow, driverHelper, previewWidget, rightToolBar, quickOpenContainer) {
constructor(terminal, topMenu, ide, dialogWindow, driverHelper, quickOpenContainer, browserTabsUtil, workspaceHandlingTests) {
this.terminal = terminal;

@@ -51,5 +51,5 @@ this.topMenu = topMenu;

this.driverHelper = driverHelper;
this.previewWidget = previewWidget;
this.rightToolBar = rightToolBar;
this.quickOpenContainer = quickOpenContainer;
this.browserTabsUtil = browserTabsUtil;
this.workspaceHandlingTests = workspaceHandlingTests;
}

@@ -124,5 +124,9 @@ runTask(taskName, timeout) {

await this.ide.clickOnNotificationButton(notificationText, buttonText);
CodeExecutionTests_1.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5000);
CodeExecutionTests_1.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});
}
/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
runTaskWithNotificationAndOpenLinkPreviewNoUrl(taskName, notificationText, timeout) {

@@ -133,3 +137,4 @@ test(`Run command '${taskName}' expecting notification`, async () => {

await this.ide.clickOnNotificationButton(notificationText, 'Open In Preview');
CodeExecutionTests_1.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5000);
CodeExecutionTests_1.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});

@@ -142,3 +147,4 @@ }

await this.ide.waitNotificationAndOpenLink(portOpenText, timeout);
CodeExecutionTests_1.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5000);
CodeExecutionTests_1.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});

@@ -148,15 +154,23 @@ }

test(`Verify running application by locator: '${locator}'`, async () => {
await this.previewWidget.waitApplicationOpened(CodeExecutionTests_1.lastApplicationUrl, applicationCheckTimeout);
try {
await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);
}
catch (err) {
// fix for preloader / application not available in preview widget
// https://issues.redhat.com/browse/CRW-2175
if (err instanceof selenium_webdriver_1.error.TimeoutError) {
Logger_1.Logger.warn(`CodeExecutionTests.verifyRunningApplication application not located, probably blocked by preloader or content not available. Retrying.`);
await this.ide.waitIde();
await this.previewWidget.refreshPage();
await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);
let timeout = applicationCheckTimeout / polling;
let attempts = applicationCheckTimeout / timeout;
for (let i = 0; i < attempts; i++) {
try {
await this.driverHelper.waitPresence(locator, timeout);
}
catch (err) {
if (err instanceof selenium_webdriver_1.error.TimeoutError) {
if (i === attempts - 1) {
Logger_1.Logger.error(`CodeExecutionTests.verifyRunningApplication out of retries to wait for ${locator} presence.`);
throw err;
}
else {
Logger_1.Logger.trace(`CodeExecutionTests.verifyRunningApplication timed out waiting for ${locator} presence. Retrying ${i}.`);
}
}
else {
Logger_1.Logger.error(`CodeExecutionTests.verifyRunningApplication failed with unexpected exception.`);
throw err;
}
}
}

@@ -168,11 +182,16 @@ });

}
/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
refreshPreviewWindow() {
test('Refreshing preview widget', async () => {
await this.previewWidget.refreshPage();
Logger_1.Logger.warn(`Method is deprecated.`);
});
}
/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
closePreviewWidget() {
test('Close preview widget', async () => {
await this.rightToolBar.clickOnToolIcon('Preview');
await this.previewWidget.waitPreviewWidgetAbsence();
Logger_1.Logger.warn(`Method is deprecated.`);
});

@@ -215,5 +234,5 @@ }

__param(4, inversify_1.inject(inversify_types_1.CLASSES.DriverHelper)),
__param(5, inversify_1.inject(inversify_types_1.CLASSES.PreviewWidget)),
__param(6, inversify_1.inject(inversify_types_1.CLASSES.RightToolBar)),
__param(7, inversify_1.inject(inversify_types_1.CLASSES.QuickOpenContainer)),
__param(5, inversify_1.inject(inversify_types_1.CLASSES.QuickOpenContainer)),
__param(6, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
__param(7, inversify_1.inject(inversify_types_1.CLASSES.WorkspaceHandlingTests)),
__metadata("design:paramtypes", [Terminal_1.Terminal,

@@ -224,7 +243,7 @@ TopMenu_1.TopMenu,

DriverHelper_1.DriverHelper,
PreviewWidget_1.PreviewWidget,
RightToolBar_1.RightToolBar,
QuickOpenContainer_1.QuickOpenContainer])
QuickOpenContainer_1.QuickOpenContainer,
BrowserTabsUtil_1.BrowserTabsUtil,
WorkspaceHandlingTests_1.WorkspaceHandlingTests])
], CodeExecutionTests);
exports.CodeExecutionTests = CodeExecutionTests;
//# sourceMappingURL=CodeExecutionTests.js.map
{
"name": "@eclipse-che/che-e2e",
"version": "7.48.0-dev-29d4f0d",
"version": "7.48.0-dev-8e6670a",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -186,3 +186,3 @@ /*********************************************************************

const tabCloseButtonLocator: By = By.xpath(`//div[text()='${tabTitle}']/parent::li//div[contains(@class, 'p-TabBar-tabCloseIcon')]`);
const tabCloseButtonLocator: By = By.xpath(`//li[contains(@id,'${tabTitle}')]//div[contains(@class, 'p-TabBar-tabCloseIcon')]`);

@@ -189,0 +189,0 @@ await this.driverHelper.waitAndClick(tabCloseButtonLocator, timeout);

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

/**
* @deprecated Preview widget is no longer a valid page fragment.
*/
@injectable()

@@ -22,0 +25,0 @@ export class PreviewWidget {

@@ -21,6 +21,6 @@ /*********************************************************************

import { DriverHelper } from '../utils/DriverHelper';
import { PreviewWidget } from '../pageobjects/ide/PreviewWidget';
import { RightToolBar } from '../pageobjects/ide/RightToolBar';
import { Logger } from '../utils/Logger';
import { QuickOpenContainer } from '../pageobjects/ide/QuickOpenContainer';
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
import { WorkspaceHandlingTests } from './WorkspaceHandlingTests';

@@ -38,5 +38,5 @@ @injectable()

@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
@inject(CLASSES.PreviewWidget) private readonly previewWidget: PreviewWidget,
@inject(CLASSES.RightToolBar) private readonly rightToolBar: RightToolBar,
@inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer) {}
@inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer,
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
@inject(CLASSES.WorkspaceHandlingTests) private readonly workspaceHandlingTests: WorkspaceHandlingTests) {}

@@ -113,6 +113,10 @@ public runTask(taskName: string, timeout: number) {

await this.ide.clickOnNotificationButton(notificationText, buttonText);
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5_000);
CodeExecutionTests.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});
}
/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
public runTaskWithNotificationAndOpenLinkPreviewNoUrl(taskName: string, notificationText: string, timeout: number) {

@@ -123,3 +127,4 @@ test(`Run command '${taskName}' expecting notification`, async () => {

await this.ide.clickOnNotificationButton(notificationText, 'Open In Preview');
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5_000);
CodeExecutionTests.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});

@@ -133,3 +138,4 @@ }

await this.ide.waitNotificationAndOpenLink(portOpenText, timeout);
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
await this.driverHelper.wait(5_000);
CodeExecutionTests.lastApplicationUrl = await this.driverHelper.getDriver().getCurrentUrl();
});

@@ -140,13 +146,19 @@ }

test(`Verify running application by locator: '${locator}'`, async () => {
await this.previewWidget.waitApplicationOpened(CodeExecutionTests.lastApplicationUrl, applicationCheckTimeout);
try {
await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);
} catch (err) {
// fix for preloader / application not available in preview widget
// https://issues.redhat.com/browse/CRW-2175
if (err instanceof error.TimeoutError) {
Logger.warn(`CodeExecutionTests.verifyRunningApplication application not located, probably blocked by preloader or content not available. Retrying.`);
await this.ide.waitIde();
await this.previewWidget.refreshPage();
await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);
let timeout: number = applicationCheckTimeout / polling;
let attempts: number = applicationCheckTimeout / timeout;
for (let i = 0; i < attempts; i++) {
try {
await this.driverHelper.waitPresence(locator, timeout);
} catch (err) {
if (err instanceof error.TimeoutError) {
if (i === attempts - 1) {
Logger.error(`CodeExecutionTests.verifyRunningApplication out of retries to wait for ${locator} presence.`);
throw err;
} else {
Logger.trace(`CodeExecutionTests.verifyRunningApplication timed out waiting for ${locator} presence. Retrying ${i}.`);
}
} else {
Logger.error(`CodeExecutionTests.verifyRunningApplication failed with unexpected exception.`);
throw err;
}
}

@@ -161,12 +173,17 @@ }

/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
public refreshPreviewWindow() {
test('Refreshing preview widget', async () => {
await this.previewWidget.refreshPage();
Logger.warn(`Method is deprecated.`);
});
}
/**
* @deprecated This method should not be used, preview widget is no longer a valid page fragment.
*/
public closePreviewWidget() {
test('Close preview widget', async () => {
await this.rightToolBar.clickOnToolIcon('Preview');
await this.previewWidget.waitPreviewWidgetAbsence();
Logger.warn(`Method is deprecated.`);
});

@@ -173,0 +190,0 @@ }

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