diff --git a/e2e-saas/mocha-all.opts b/e2e-saas/mocha-all.opts index dfa3e9a68..337c7fd42 100644 --- a/e2e-saas/mocha-all.opts +++ b/e2e-saas/mocha-all.opts @@ -1,6 +1,6 @@ --timeout 120000 --reporter 'node_modules/e2e/dist/driver/CheReporter.js' -u tdd ---spec ./dist/tests/login/Login.spec.js ---spec ./node_modules/e2e/dist/tests/devfiles/JavaVertx.spec.js ---spec ./node_modules/e2e/dist/tests/devfiles/JavaMaven.spec.js +--spec ./dist/tests/login/Login.spec +--spec ./dist/tests/devfiles/JavaMaven.spec +--spec ./node_modules/e2e/dist/tests/devfiles/JavaVertx.spec diff --git a/e2e-saas/tests/devfiles/JavaMaven.spec.ts b/e2e-saas/tests/devfiles/JavaMaven.spec.ts new file mode 100644 index 000000000..dde31375d --- /dev/null +++ b/e2e-saas/tests/devfiles/JavaMaven.spec.ts @@ -0,0 +1,45 @@ +/********************************************************************* + * Copyright (c) 2019 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 + **********************************************************************/ +import 'reflect-metadata'; +import { NameGenerator} from 'e2e'; +import * as testLibrary from 'e2e'; + +const workspaceName: string = NameGenerator.generate('wksp-test-', 5); +const sampleName: string = 'console-java-simple'; +const fileFolderPath: string = `${sampleName}/src/main/java/org/eclipse/che/examples`; +const tabTitle: string = 'HelloWorld.java'; +const codeNavigationClassName: string = 'String.class'; +const stack : string = 'Java Maven'; +const taskName: string = 'maven build'; + +suite(`${stack} test`, async () => { + suite (`Create ${stack} workspace ${workspaceName}`, async () => { + testLibrary.createAndOpenWorkspace(workspaceName, stack); + testLibrary.waitWorkspaceReadiness(workspaceName, sampleName, 'src'); + }); + + suite('Validation of workspace build and run', async () => { + testLibrary.runTask(taskName, 120_000); + testLibrary.closeTerminal(taskName); + }); + + suite('Language server validation', async () => { + testLibrary.openFile(fileFolderPath, tabTitle); + testLibrary.suggestionInvoking(tabTitle, 10, 20, 'append(char c) : PrintStream'); + testLibrary.errorHighlighting(tabTitle, 'erroneous_text', 11); + testLibrary.autocomplete(tabTitle, 10, 11, 'System - java.lang'); + testLibrary.codeNavigation(tabTitle, 9, 10, codeNavigationClassName); + }); + + suite ('Stop and remove workspace', async() => { + testLibrary.stopWorkspace(workspaceName); + testLibrary.removeWorkspace(workspaceName); + }); +});