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
4
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.77.0 to 7.78.0-next-4d97c65

7

constants/API_TEST_CONSTANTS.ts

@@ -21,5 +21,10 @@ /** *******************************************************************

GIT_HUB_CHE_DEVFILE_REGISTRY_URL: string;
TS_GIT_API_AUTH_TOKEN: string;
} = {
INBUILT_APPLICATION_DEVFILE_REGISTRY_URL: (): string => `${BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}/devfile-registry/devfiles/`,
GIT_HUB_CHE_DEVFILE_REGISTRY_URL: 'https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/'
GIT_HUB_CHE_DEVFILE_REGISTRY_URL: 'https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/',
/**
* gitHub has a rate limit for unauthorized requests to GitHub API. We can prevent this problems using authorization token
*/
TS_GIT_API_AUTH_TOKEN: process.env.TS_GIT_API_AUTH_TOKEN || ''
};

@@ -26,0 +31,0 @@ export const API_TEST_CONSTANTS: {

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

TESTING_APPLICATION_NAME: () => string;
TEST_NAMESPACE: string;
} = {

@@ -58,2 +59,7 @@ /**

/**
* openshift project or k8s namespace which is used by test
*/
TEST_NAMESPACE: process.env.TEST_NAMESPACE || '',
/**
* application name (DevSpaces or Che)

@@ -68,3 +74,2 @@ */

},
/**

@@ -71,0 +76,0 @@ * testing application version

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

INBUILT_APPLICATION_DEVFILE_REGISTRY_URL: () => `${BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}/devfile-registry/devfiles/`,
GIT_HUB_CHE_DEVFILE_REGISTRY_URL: 'https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/'
GIT_HUB_CHE_DEVFILE_REGISTRY_URL: 'https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/',
/**
* gitHub has a rate limit for unauthorized requests to GitHub API. We can prevent this problems using authorization token
*/
TS_GIT_API_AUTH_TOKEN: process.env.TS_GIT_API_AUTH_TOKEN || ''
};

@@ -24,0 +28,0 @@ exports.API_TEST_CONSTANTS = {

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

/**
* openshift project or k8s namespace which is used by test
*/
TEST_NAMESPACE: process.env.TEST_NAMESPACE || '',
/**
* application name (DevSpaces or Che)

@@ -38,0 +42,0 @@ */

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

projectFolderItem: selenium_webdriver_1.By.xpath('.//div[contains(@class, "rootfolder-icon projects-name-dir")]')
},
ScmView: {
manageWorkspaceTrust: selenium_webdriver_1.By.xpath('.//a[@class="monaco-button monaco-text-button"]'),
modifiedFile: selenium_webdriver_1.By.xpath('//div[@class="monaco-list-row" and contains(@aria-label, "Modified")]')
},
Workbench: {
workspaceTrustButton: selenium_webdriver_1.By.xpath('//a[@role="button" and text()="Trust"]')
}

@@ -60,0 +67,0 @@ }

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

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger_1.Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -103,0 +107,0 @@ });

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

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger_1.Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -118,0 +122,0 @@ });

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

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger_1.Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -115,0 +119,0 @@ });

@@ -64,2 +64,18 @@ "use strict";

/**
* manage to 'Trusted' Workspace Mode, when the trust author dialog does not appear
* the "Manage Workspace Trust" box is appeared in Source Control View
*/
async performManageWorkspaceTrustBox() {
Logger_1.Logger.debug();
try {
await this.driverHelper.waitAndClick(this.cheCodeLocatorLoader.webCheCodeLocators.ScmView.manageWorkspaceTrust, TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT);
await this.driverHelper.waitAndClick(this.cheCodeLocatorLoader.webCheCodeLocators.Workbench.workspaceTrustButton, TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT);
await this.driverHelper.waitAndClick(this.cheCodeLocatorLoader.webCheCodeLocators.ScmView.modifiedFile, TIMEOUT_CONSTANTS_1.TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT);
}
catch (err) {
Logger_1.Logger.error(`Manage Workspace Trust box was not shown: ${err}`);
throw err;
}
}
/**
* find an ViewSection with project tree.

@@ -66,0 +82,0 @@ * @returns Promise resolving to ViewSection object

@@ -68,6 +68,7 @@ "use strict";

const content = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
const devfileRegistryPrefix = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_PLATFORM === BASE_TEST_CONSTANTS_1.Platform.OPENSHIFT
? BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL + '/devfile-registry'
: '';
for (const sample of content) {
const linkToDevWorkspaceYaml = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
'/devfile-registry' +
sample.links.devWorkspaces['che-incubator/che-code/latest'];
const linkToDevWorkspaceYaml = `${devfileRegistryPrefix}${sample.links.devWorkspaces['che-incubator/che-code/latest']}`;
devfileSamples.push({

@@ -99,4 +100,15 @@ name: sample.displayName,

}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async getContent(url, headers) {
Logger_1.Logger.trace(`${url}`);
if (API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES.TS_GIT_API_AUTH_TOKEN.length !== 0) {
/**
* if we use - https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/ URL
* for generating devfiles we can get a problem with rate limits to GitHub API,
* but we can pass auth. token for increase the limit and avoiding problems
*/
headers = {
headers: { Authorization: API_TEST_CONSTANTS_1.SUPPORTED_DEVFILE_REGISTRIES.TS_GIT_API_AUTH_TOKEN }
};
}
let response;

@@ -103,0 +115,0 @@ try {

5

dist/utils/KubernetesCommandLineToolsExecutor.js

@@ -73,3 +73,6 @@ "use strict";

get namespace() {
if (!this._namespace) {
if (BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_NAMESPACE.length > 0) {
this._namespace = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TEST_NAMESPACE;
}
else if (!this._namespace) {
const applicationName = BASE_TEST_CONSTANTS_1.BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();

@@ -76,0 +79,0 @@ if (applicationName === 'default') {

{
"name": "@eclipse-che/che-e2e",
"version": "7.77.0",
"version": "7.78.0-next-4d97c65",
"description": "",

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

"inversify": "6.0.1",
"reflect-metadata": "0.1.13",
"@eclipse-che/che-devworkspace-generator": "7.77.0"
"reflect-metadata": "0.1.13"
},

@@ -72,0 +71,0 @@ "resolutions": {

@@ -54,2 +54,9 @@ /** *******************************************************************

projectFolderItem: By.xpath('.//div[contains(@class, "rootfolder-icon projects-name-dir")]')
},
ScmView: {
manageWorkspaceTrust: By.xpath('.//a[@class="monaco-button monaco-text-button"]'),
modifiedFile: By.xpath('//div[@class="monaco-list-row" and contains(@aria-label, "Modified")]')
},
Workbench: {
workspaceTrustButton: By.xpath('//a[@role="button" and text()="Trust"]')
}

@@ -56,0 +63,0 @@ }

@@ -134,2 +134,6 @@ /** *******************************************************************

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -136,0 +140,0 @@ });

@@ -151,2 +151,6 @@ /** *******************************************************************

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -153,0 +157,0 @@ });

@@ -152,2 +152,6 @@ /** *******************************************************************

[scmProvider, ...rest] = await scmView.getProviders();
if (scmProvider === undefined) {
await projectAndFileTests.performManageWorkspaceTrustBox();
[scmProvider, ...rest] = await scmView.getProviders();
}
Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);

@@ -154,0 +158,0 @@ });

@@ -62,2 +62,28 @@ /** *******************************************************************

/**
* manage to 'Trusted' Workspace Mode, when the trust author dialog does not appear
* the "Manage Workspace Trust" box is appeared in Source Control View
*/
async performManageWorkspaceTrustBox(): Promise<void> {
Logger.debug();
try {
await this.driverHelper.waitAndClick(
(this.cheCodeLocatorLoader.webCheCodeLocators.ScmView as any).manageWorkspaceTrust,
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
);
await this.driverHelper.waitAndClick(
(this.cheCodeLocatorLoader.webCheCodeLocators.Workbench as any).workspaceTrustButton,
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
);
await this.driverHelper.waitAndClick(
(this.cheCodeLocatorLoader.webCheCodeLocators.ScmView as any).modifiedFile,
TIMEOUT_CONSTANTS.TS_DIALOG_WINDOW_DEFAULT_TIMEOUT
);
} catch (err) {
Logger.error(`Manage Workspace Trust box was not shown: ${err}`);
throw err;
}
}
/**
* find an ViewSection with project tree.

@@ -64,0 +90,0 @@ * @returns Promise resolving to ViewSection object

@@ -15,3 +15,3 @@ /** *******************************************************************

import { injectable } from 'inversify';
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
import { BASE_TEST_CONSTANTS, Platform } from '../constants/BASE_TEST_CONSTANTS';

@@ -68,7 +68,8 @@ @injectable()

const content: any[any] = await this.getInbuiltDevfilesRegistryContent(sampleNamePatterns);
const devfileRegistryPrefix: string =
BASE_TEST_CONSTANTS.TS_PLATFORM === Platform.OPENSHIFT
? BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL + '/devfile-registry'
: '';
for (const sample of content) {
const linkToDevWorkspaceYaml: any =
BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL +
'/devfile-registry' +
sample.links.devWorkspaces['che-incubator/che-code/latest'];
const linkToDevWorkspaceYaml: any = `${devfileRegistryPrefix}${sample.links.devWorkspaces['che-incubator/che-code/latest']}`;
devfileSamples.push({

@@ -102,5 +103,15 @@ name: sample.displayName,

// eslint-disable-next-line @typescript-eslint/no-unused-vars
private async getContent(url: string, headers?: object): Promise<AxiosResponse> {
Logger.trace(`${url}`);
if (SUPPORTED_DEVFILE_REGISTRIES.TS_GIT_API_AUTH_TOKEN.length !== 0) {
/**
* if we use - https://api.github.com/repos/eclipse-che/che-devfile-registry/contents/devfiles/ URL
* for generating devfiles we can get a problem with rate limits to GitHub API,
* but we can pass auth. token for increase the limit and avoiding problems
*/
headers = {
headers: { Authorization: SUPPORTED_DEVFILE_REGISTRIES.TS_GIT_API_AUTH_TOKEN }
};
}
let response: AxiosResponse | undefined;

@@ -107,0 +118,0 @@ try {

@@ -49,3 +49,5 @@ /** *******************************************************************

get namespace(): string | undefined {
if (!this._namespace) {
if (BASE_TEST_CONSTANTS.TEST_NAMESPACE.length > 0) {
this._namespace = BASE_TEST_CONSTANTS.TEST_NAMESPACE;
} else if (!this._namespace) {
const applicationName: string = BASE_TEST_CONSTANTS.TESTING_APPLICATION_NAME();

@@ -52,0 +54,0 @@ if (applicationName === 'default') {

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