Skip to content

Commit

Permalink
Linting repository
Browse files Browse the repository at this point in the history
Signed-off-by: Tibor Dancs <[email protected]>
  • Loading branch information
ScrewTSW committed Sep 5, 2022
1 parent 7ca956e commit 1ee769e
Show file tree
Hide file tree
Showing 20 changed files with 79 additions and 107 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/tests/e2e/GitPublishBranch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.Work

const workspacePrefixUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/dashboard/#/ide/${TestConstants.TS_SELENIUM_USERNAME}/`;
const wsNameGitPublishBranch = workspaceNameHandler.generateWorkspaceName('checkGitPublishBranch-', 5);
const changedFile = 'README.md';
// const changedFile = 'README.md';
const branchName = workspaceNameHandler.generateWorkspaceName('checkGitPublishBranch', 5);
const file = `https://github.com/${TestConstants.TS_GITHUB_TEST_REPO}/blob/${branchName}/README.md`;

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests/e2e/GitSelfSignCert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const workspaceName = 'gitSelfSignCert';

suite('Checking git + self sign cert', async () => {
const workspacePrefixUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/dashboard/#/ide/${TestConstants.TS_SELENIUM_USERNAME}/`;
const gitProjectUrl = `https://${TestConstants.TS_SELF_HOSTED_GIT_SERVER_URL}/maxura/gitService.git`;
const committedFile = 'README.md';
// const gitProjectUrl = `https://${TestConstants.TS_SELF_HOSTED_GIT_SERVER_URL}/maxura/gitService.git`;
// const committedFile = 'README.md';

suiteSetup(async function () {
const wsConfig = await testWorkspaceUtils.getBaseDevfile();
Expand Down
10 changes: 4 additions & 6 deletions tests/e2e/tests/e2e/OpenshiftConnector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,25 @@
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/

import { Key } from 'selenium-webdriver';
import { e2eContainer } from '../../inversify.config';
import { CLASSES, TYPES } from '../../inversify.types';
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
import { ICheLoginPage } from '../../pageobjects/login/ICheLoginPage';
import { TestConstants } from '../../TestConstants';
import { DriverHelper } from '../../utils/DriverHelper';
// import { DriverHelper } from '../../utils/DriverHelper';
import { PreferencesHandler, TerminalRendererType } from '../../utils/PreferencesHandler';
import { TimeoutConstants } from '../../TimeoutConstants';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import CheReporter from '../../driver/CheReporter';

const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
// const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
const loginPage: ICheLoginPage = e2eContainer.get<ICheLoginPage>(TYPES.CheLogin);
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
const preferencesHalder: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
const projectName: string = 'node-js';
const selectSugestionSuffix: string = '(Press \'Enter\' to confirm your input or \'Escape\' to cancel)';
// const projectName: string = 'node-js';
// const selectSugestionSuffix: string = '(Press \'Enter\' to confirm your input or \'Escape\' to cancel)';
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);

suite('Openshift connector user story', async () => {
Expand Down
24 changes: 11 additions & 13 deletions tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { CLASSES } from '../../inversify.types';
import { DriverHelper } from '../../utils/DriverHelper';
import { e2eContainer } from '../../inversify.config';
import { Key, error, By } from 'selenium-webdriver';
import { Logger } from '../../utils/Logger';
import { By } from 'selenium-webdriver';
import { TestConstants } from '../../TestConstants';
import { TimeoutConstants } from '../../TimeoutConstants';
import * as fs from 'fs';
import axios from 'axios';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import CheReporter from '../../driver/CheReporter';

const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const projectName: string = 'java-spring-petclinic';
const workspaceRootFolderName: string = 'src';
const pathToJavaFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic`;
const javaFileName: string = 'PetClinicApplication.java';
const classPathFilename: string = '.classpath';
// const workspaceRootFolderName: string = 'src';
// const pathToJavaFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic`;
// const javaFileName: string = 'PetClinicApplication.java';
// const classPathFilename: string = '.classpath';
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
const codeNavigationClassName: string = 'SpringApplication.class';
const globalTaskScope = 'Global';
const welcomeControllerJavaFileName: string = 'WelcomeController.java';
// const codeNavigationClassName: string = 'SpringApplication.class';
// const globalTaskScope = 'Global';
// const welcomeControllerJavaFileName: string = 'WelcomeController.java';

const SpringAppLocators = {
springTitleLocator: By.xpath('//div[@class=\'container-fluid\']//h2[text()=\'Welcome\']'),
Expand All @@ -43,7 +41,7 @@ const SpringAppLocators = {
suite('Workspace creation via factory url', async () => {
let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;

const workspaceRootFolderName: string = 'src';
// const workspaceRootFolderName: string = 'src';

suite('Open factory URL', async () => {
// this is DevWorkspace test specific - we create the test ws. using factory instead of chectl
Expand Down Expand Up @@ -125,8 +123,8 @@ suite('Language server validation', async () => {
});

suite('Validation of workspace build and run', async () => {
const mavenBuildTaskName: string = 'maven-build';
const runAppTaskName: string = 'run-with-hsqldb';
// 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);
Expand Down
45 changes: 21 additions & 24 deletions tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,42 @@
**********************************************************************/

import { e2eContainer } from '../../inversify.config';
import { DriverHelper } from '../../utils/DriverHelper';
// import { DriverHelper } from '../../utils/DriverHelper';
import { CLASSES } from '../../inversify.types';
import { TestConstants } from '../../TestConstants';
import { By, Key, error } from 'selenium-webdriver';
// import { By } from 'selenium-webdriver';
import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
import { TimeoutConstants } from '../../TimeoutConstants';
import { Logger } from '../../utils/Logger';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
// import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import CheReporter from '../../driver/CheReporter';
import * as fs from 'fs';

const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
// const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
const projectName: string = 'petclinic';
const workspaceRootFolderName: string = 'src';
// const projectName: string = 'petclinic';
// const workspaceRootFolderName: string = 'src';
const workspaceName: string = TestConstants.TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME;
const pathToJavaFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic`;
const pathToChangedJavaFileFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic/system`;
const classPathFilename: string = '.classpath';
const javaFileName: string = 'PetClinicApplication.java';
const weclomeControllerJavaFileName: string = 'WelcomeController.java';
const changedJavaFileName: string = 'CrashController.java';
const textForErrorMessageChange: string = 'HHHHHHHHHHHHH';
const codeNavigationClassName: string = 'SpringApplication.class';
const pathToYamlFolder: string = projectName;
const yamlFileName: string = 'devfile.yaml';
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const globalTaskScope = 'Global';

const SpringAppLocators = {
// const pathToJavaFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic`;
// const pathToChangedJavaFileFolder: string = `${projectName}/${workspaceRootFolderName}/main/java/org/springframework/samples/petclinic/system`;
// const classPathFilename: string = '.classpath';
// const javaFileName: string = 'PetClinicApplication.java';
// const weclomeControllerJavaFileName: string = 'WelcomeController.java';
// const changedJavaFileName: string = 'CrashController.java';
// const textForErrorMessageChange: string = 'HHHHHHHHHHHHH';
// const codeNavigationClassName: string = 'SpringApplication.class';
// const pathToYamlFolder: string = projectName;
// const yamlFileName: string = 'devfile.yaml';
// const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
// const globalTaskScope = 'Global';

/*const SpringAppLocators = {
springTitleLocator: By.xpath('//div[@class=\'container-fluid\']//h2[text()=\'Welcome\']'),
springMenuButtonLocator: By.css('button[data-target=\'#main-navbar\']'),
springErrorButtonLocator: By.xpath('//div[@id=\'main-navbar\']//span[text()=\'Error\']'),
springHomeButtonLocator: By.className('navbar-brand'),
springErrorMessageLocator: By.xpath(`//h2[text()='Something happened...']`)
};
};*/

suite('Validation of workspace start', async () => {
test('Start workspace', async () => {
Expand Down
14 changes: 6 additions & 8 deletions tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,30 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
import { GitLoginPage } from '../../pageobjects/third-parties/GitLoginPage';
import { GitOauthAppsSettings } from '../../pageobjects/third-parties/GitOauthAppsSettings';
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
// import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { Key } from 'selenium-webdriver';

const workspaceHandling: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const githubLoginPage: GitLoginPage = e2eContainer.get(CLASSES.GitLoginPage);
const gitOauthAppsSettings: GitOauthAppsSettings = e2eContainer.get(CLASSES.GitOauthAppsSettings);
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
// const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);

const devfileUrl: string = `https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/GitHubPullRequestPlugin.yaml`;
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const branchName: string = workspaceNameHandler.generateWorkspaceName('ghPrPlugin-', 10);
const projectName: string = 'Spoon-Knife';
// const branchName: string = workspaceNameHandler.generateWorkspaceName('ghPrPlugin-', 10);
// const projectName: string = 'Spoon-Knife';
const oAuthAppName: string = 'eclipse-che';
const changedFile: string = 'README.md';
// 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();
// const currentDate: string = Date.now().toString();

suite(`The 'GitHubPullRequestPlugin' test`, async () => {
suite('Setup github', async () => {
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/tests/plugins/InstallPluginUsingUI.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
Expand All @@ -23,7 +22,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/InstallPluginUsingUI.yaml';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;

const pluginTitle: string = 'java11';
// const pluginTitle: string = 'java11';

suite(`The 'InstallPluginUsingUI' test`, async () => {
suite('Create workspace', async () => {
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/tests/plugins/JavaPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { Key } from 'selenium-webdriver';
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
Expand All @@ -26,7 +24,7 @@ const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.Preferen

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 codeNavigationClassName: string = 'String.class';
const projectName: string = 'java-guestbook';
const subRootFolder: string = 'backend';

Expand Down
10 changes: 4 additions & 6 deletions tests/e2e/tests/plugins/PhpPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { Key } from 'selenium-webdriver';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
Expand All @@ -22,11 +20,11 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti

const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/PhpPluginTest.yaml';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const projectName: string = 'php-web-simple';
const subRootFolder: string = 'README.md';
// const projectName: string = 'php-web-simple';
// const subRootFolder: string = 'README.md';

const fileFolderPath: string = `${projectName}`;
const tabTitle: string = 'index.php';
// const fileFolderPath: string = `${projectName}`;
// const tabTitle: string = 'index.php';

suite(`The 'PhpPlugin' tests`, async () => {
suite('Create workspace', async () => {
Expand Down
6 changes: 2 additions & 4 deletions tests/e2e/tests/plugins/PythonPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { Key } from 'selenium-webdriver';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
Expand All @@ -29,8 +27,8 @@ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFil
const projectName: string = 'python-hello-world';
const subRootFolder: string = '.vscode';

const fileFolderPath: string = `${projectName}`;
const tabTitle: string = 'hello-world.py';
// const fileFolderPath: string = `${projectName}`;
// const tabTitle: string = 'hello-world.py';

suite(`The 'PythonPlugin' test`, async () => {
suite('Create workspace', async () => {
Expand Down
13 changes: 6 additions & 7 deletions tests/e2e/tests/plugins/TypescriptPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import 'reflect-metadata';
import { DriverHelper } from '../../utils/DriverHelper';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { Key, By } from 'selenium-webdriver';
import { By } from 'selenium-webdriver';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
Expand All @@ -28,14 +27,14 @@ const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.Preferen

const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/typescript-plugin';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const codeNavigationClassName: string = 'OpenDefinition.ts';
// const codeNavigationClassName: string = 'OpenDefinition.ts';
const projectName: string = 'web-nodejs-sample';
const subRootFolder: string = 'app';
const sampleBodyLocator: By = By.xpath(`//body[text()='Hello World!']`);
const fileFolderPath: string = `${projectName}`;
const debugFileFolderPath: string = `${projectName}/app`;
const debugFile: string = 'app.js';
const tabTitle: string = 'typescript-node-debug.ts';
// const fileFolderPath: string = `${projectName}`;
// const debugFileFolderPath: string = `${projectName}/app`;
// const debugFile: string = 'app.js';
// const tabTitle: string = 'typescript-node-debug.ts';

suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
suite('Create workspace', async () => {
Expand Down
5 changes: 2 additions & 3 deletions tests/e2e/tests/plugins/VscodeKubernetesPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import 'reflect-metadata';
import { e2eContainer } from '../../inversify.config';
import { CLASSES } from '../../inversify.types';
import { TimeoutConstants } from '../../TimeoutConstants';
import { TestConstants } from '../../TestConstants';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
Expand All @@ -21,8 +20,8 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti

const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/VscodeKubernetesPlugin.yaml';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const sampleName: string = 'nodejs-web-app';
const subRootFolder: string = 'app';
// const sampleName: string = 'nodejs-web-app';
// const subRootFolder: string = 'app';

suite(`The 'VscodeKubernetesPlugin' test`, async () => {
suite('Create workspace', async () => {
Expand Down
Loading

0 comments on commit 1ee769e

Please sign in to comment.