From bafe2f61777cf57e9b8f6e0f1545d47b205e7118 Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 10:37:54 +0300 Subject: [PATCH] adapt steps for checking the test app. and closing tasks --- tests/e2e/package.json | 4 +-- .../DevWorkspaceHappyPath.spec.ts | 27 ++++++++----------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 5052803dd9b6..243ea36da7f2 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -10,7 +10,7 @@ "test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha.opts", "load-test": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-load.opts", "test-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-happy-path.opts", - "test-devworkspace-happy-path": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-devworkspace-happy-path.opts", + "test-devworkspace-happy-path": "./generateIndex.sh && npm run tsc && mocha --opts mocha-devworkspace-happy-path.opts", "test-wkspc-creation-and-ls": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-wkspc-creation-and-ls.opts", "test-java-vertx": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-java-vertx.opts", "test-git-ssh": "./generateIndex.sh && npm run lint && npm run tsc && mocha --opts mocha-git-ssh.opts", @@ -39,7 +39,7 @@ "@types/selenium-webdriver": "3.0.16", "axios": "0.21.1", "chai": "4.2.0", - "chromedriver": "89.0.0", + "chromedriver": "^93.0.1", "mocha": "7.1.1", "rimraf": "2.6.2", "selenium-webdriver": "3.6.0", diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 80b2f8872a0f..083a3f1212dd 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -15,16 +15,14 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; import { TestConstants } from '../../TestConstants'; import { Ide } from '../../pageobjects/ide/Ide'; import { TimeoutConstants } from '../../TimeoutConstants'; +import { TopMenu } from '../../pageobjects/ide/TopMenu'; import { ProjectTree } from '../../pageobjects/ide/ProjectTree'; import { Editor } from '../../pageobjects/ide/Editor'; import { Key, error, By } from 'selenium-webdriver'; import { DriverHelper } from '../../utils/DriverHelper'; import { Logger } from '../../utils/Logger'; -import { TopMenu } from '../../pageobjects/ide/TopMenu'; import { Terminal } from '../../pageobjects/ide/Terminal'; import { DialogWindow } from '../../pageobjects/ide/DialogWindow'; -import { PreviewWidget } from '../../pageobjects/ide/PreviewWidget'; -import { RightToolBar } from '../../pageobjects/ide/RightToolBar'; import * as fs from 'fs'; const ide: Ide = e2eContainer.get(CLASSES.Ide); @@ -41,8 +39,6 @@ const codeNavigationClassName: string = 'SpringApplication.class'; const topMenu: TopMenu = e2eContainer.get(CLASSES.TopMenu); const globalTaskScope = 'Global'; const terminal: Terminal = e2eContainer.get(CLASSES.Terminal); -const previewWidget: PreviewWidget = e2eContainer.get(CLASSES.PreviewWidget); -const rightToolBar: RightToolBar = e2eContainer.get(CLASSES.RightToolBar); const warningDialog: DialogWindow = e2eContainer.get(CLASSES.DialogWindow); @@ -78,7 +74,7 @@ suite('Workspace creation via factory url', async () => { }); }); - suite.skip('Language server validation', async () => { + suite('Language server validation', async () => { test('Java LS initialization', async () => { await projectTree.expandPathAndOpenFile(pathToJavaFolder, javaFileName); await ide.waitNotificationAndClickOnButton('The workspace contains Java projects. Would you like to import them?', 'Yes'); @@ -138,8 +134,7 @@ suite('Workspace creation via factory url', async () => { }); }); suite('Validation of workspace build and run', async () => { - - test.skip('Build application', async () => { + test('Build application', async () => { const taskName: string = 'build'; await topMenu.runTask(`${taskName}, ${globalTaskScope}`); await terminal.waitIconSuccess(taskName, 500_000); @@ -156,16 +151,11 @@ suite('Workspace creation via factory url', async () => { await switchApptWindowAndCheck(SpringAppLocators.springTitleLocator); }); - test('Close preview widget', async () => { - await rightToolBar.clickOnToolIcon('Preview'); - await previewWidget.waitPreviewWidgetAbsence(); - }); - test('Close the terminal running tasks', async () => { - await terminal.closeTerminalTab('build-file-output'); await terminal.rejectTerminalProcess('run'); await terminal.closeTerminalTab('run'); await warningDialog.waitAndCloseIfAppear(); + await terminal.closeTerminalTab('build'); }); }); @@ -194,6 +184,11 @@ async function checkJavaPathCompletion() { async function switchApptWindowAndCheck(contentLocator: By) { const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle(); await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT); - await driverHelper.waitPresence(contentLocator); - await browserTabsUtil.switchToWindow(mainWindowHandle); + const isApplicationTitleVisible: boolean = await driverHelper.isVisible(contentLocator); + if (!isApplicationTitleVisible) { + await driverHelper.getDriver().sleep(5000); + await driverHelper.getDriver().navigate().refresh(); + await browserTabsUtil.switchToWindow(mainWindowHandle); + await ide.waitAndSwitchToIdeFrame(); + } }