From 5840ec1bdda3adb13daa5588eac99fad5f7ec834 Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Thu, 16 Sep 2021 16:17:10 +0300 Subject: [PATCH 1/7] Adapt testsuites for Language server validation and build features --- .../DevWorkspaceHappyPath.spec.ts | 175 +++++++++++++++++- 1 file changed, 165 insertions(+), 10 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 95106ba5754..80b2f8872a0 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -10,35 +10,190 @@ import { e2eContainer } from '../../inversify.config'; import { CLASSES } from '../../inversify.types'; -import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests'; import CheReporter from '../../driver/CheReporter'; import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; -import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler'; import { TestConstants } from '../../TestConstants'; +import { Ide } from '../../pageobjects/ide/Ide'; +import { TimeoutConstants } from '../../TimeoutConstants'; +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 projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests); +const ide: Ide = e2eContainer.get(CLASSES.Ide); +const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree); const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); -const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler); +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 editor: Editor = e2eContainer.get(CLASSES.Editor); +const classPathFilename: string = '.classpath'; +const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper); +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); + + +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...']`) +}; // this test checks only workspace created from "web-nodejs-sample" https://github.com/devfile/devworkspace-operator/blob/main/samples/flattened_theia-next.yaml. suite('Workspace creation via factory url', async () => { - let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`; - const workspaceSampleName: string = 'java-spring-petclinic'; const workspaceRootFolderName: string = 'src'; suite('Open factory URL', async () => { + test(`Navigating to factory URL`, async () => { await browserTabsUtil.navigateTo(factoryUrl); }); - }); - suite('Wait workspace readiness', async () => { test('Register running workspace', async () => { - CheReporter.registerRunningWorkspace(await workspaceNameHandler.getNameFromUrl()); + CheReporter.registerRunningWorkspace(projectName); }); - projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName); + test('Register running workspace', async () => { + await ide.waitAndSwitchToIdeFrame(); + await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + await projectTree.openProjectTreeContainer(); + await projectTree.waitProjectImported(projectName, workspaceRootFolderName); + }); + }); }); + suite.skip('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'); + await editor.selectTab(javaFileName); + try { + await ide.checkLsInitializationStart('Activating Language Support for Java'); + await ide.waitStatusBarTextAbsence('Activating Language Support for Java', 900_000); + } catch (err) { + if (!(err instanceof error.TimeoutError)) { + throw err; + } + + console.log('Known flakiness has occurred https://github.com/eclipse/che/issues/17864'); + await ide.waitStatusBarContains('Activating Java Test Runner'); + await ide.waitStatusBarTextAbsence('Activating Java Test Runner', 900_000); + } + + await checkJavaPathCompletion(); + }); + + test('Autocomplete', async () => { + await editor.moveCursorToLineAndChar(javaFileName, 32, 17); + await editor.pressControlSpaceCombination(javaFileName); + await editor.waitSuggestionContainer(); + await editor.waitSuggestion(javaFileName, 'SpringApplication - org.springframework.boot'); + }); + + test('Error highlighting', async () => { + await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004 + + const textForErrorDisplaying: string = '$'; + await editor.type(javaFileName, textForErrorDisplaying, 30); + + try { + await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT); + } catch (err) { + Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.'); + await browserTabsUtil.refreshPage(); + await ide.waitAndSwitchToIdeFrame(); + await ide.waitIde(); + await editor.waitErrorInLine(30, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2); + } + await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE)); + await editor.waitErrorInLineDisappearance(30); + }); + + test('Suggestion', async () => { + await editor.moveCursorToLineAndChar(javaFileName, 32, 21); + await editor.pressControlSpaceCombination(javaFileName); + await editor.waitSuggestionWithScrolling(javaFileName, 'run(Class primarySource, String... args) : ConfigurableApplicationContext', 120_000); + }); + + test('Codenavigation', async () => { + await editor.moveCursorToLineAndChar(javaFileName, 32, 17); + await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12)); + await editor.waitEditorAvailable(codeNavigationClassName, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT * 4); + }); +}); + suite('Validation of workspace build and run', async () => { + + test.skip('Build application', async () => { + const taskName: string = 'build'; + await topMenu.runTask(`${taskName}, ${globalTaskScope}`); + await terminal.waitIconSuccess(taskName, 500_000); + }); + + test('Run application', async () => { + const taskName: string = 'run'; + await topMenu.runTask(`${taskName}, ${globalTaskScope}`); + await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000); + await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab'); + }); + + test('Check the running application', 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(); + }); }); + +async function checkJavaPathCompletion() { + if (await ide.isNotificationPresent('Classpath is incomplete. Only syntax errors will be reported')) { + const classpathText: string = fs.readFileSync('./files/happy-path/petclinic-classpath.txt', 'utf8'); + const workaroundReportText: string = '\n############################## \n\n' + + 'Known issue: https://github.com/eclipse/che/issues/13427 \n' + + '\"Java LS \"Classpath is incomplete\" warning when loading petclinic\" \n' + + '\".classpath\" will be configured with next settings: \n\n' + + classpathText + '\n' + + '############################## \n'; + + console.log(workaroundReportText); + + await projectTree.expandPathAndOpenFile(projectName, classPathFilename); + await editor.waitEditorAvailable(classPathFilename); + await editor.type(classPathFilename, Key.chord(Key.CONTROL, 'a'), 1); + await editor.performKeyCombination(classPathFilename, Key.DELETE); + await editor.type(classPathFilename, classpathText, 1); + await editor.waitTabWithSavedStatus(classPathFilename); + } +} + +// when we use devfile v.2 the test app. is opened in the separete window insrtead of widget +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); +} From fd6b3aeb080dc803b5ba7a0fea2ae60bdd2c4b6b Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 10:37:54 +0300 Subject: [PATCH 2/7] adapt steps for checking the test app. and closing tasks --- .../DevWorkspaceHappyPath.spec.ts | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 80b2f8872a0..97f18f71c35 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'); }); }); @@ -190,10 +180,15 @@ async function checkJavaPathCompletion() { } } -// when we use devfile v.2 the test app. is opened in the separete window insrtead of widget +// when we use devfile v.2 the test app. is opened in the separate window instead of widget 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(); + } } From 792789818291c50742359370a4f1aec8d5b66fba Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 10:50:29 +0300 Subject: [PATCH 3/7] replace literal on constant --- tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 97f18f71c35..835c6cf117a 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -186,7 +186,7 @@ async function switchApptWindowAndCheck(contentLocator: By) { await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT); const isApplicationTitleVisible: boolean = await driverHelper.isVisible(contentLocator); if (!isApplicationTitleVisible) { - await driverHelper.getDriver().sleep(5000); + await driverHelper.getDriver().sleep(TimeoutConstants.TS_SELENIUM_DIALOG_WIDGET_TIMEOUT); await driverHelper.getDriver().navigate().refresh(); await browserTabsUtil.switchToWindow(mainWindowHandle); await ide.waitAndSwitchToIdeFrame(); From 6116aec4fe6816bb7133afee3fdc94a15087c7ae Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 11:21:32 +0300 Subject: [PATCH 4/7] fix formatting and typo --- .../DevWorkspaceHappyPath.spec.ts | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 835c6cf117a..40a0fdd1226 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -135,27 +135,27 @@ suite('Workspace creation via factory url', async () => { }); suite('Validation of workspace build and run', async () => { test('Build application', async () => { - const taskName: string = 'build'; - await topMenu.runTask(`${taskName}, ${globalTaskScope}`); - await terminal.waitIconSuccess(taskName, 500_000); + const taskName: string = 'build'; + await topMenu.runTask(`${taskName}, ${globalTaskScope}`); + await terminal.waitIconSuccess(taskName, 500_000); }); - test('Run application', async () => { - const taskName: string = 'run'; - await topMenu.runTask(`${taskName}, ${globalTaskScope}`); - await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000); - await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab'); + test('Run application', async () => { + const taskName: string = 'run'; + await topMenu.runTask(`${taskName}, ${globalTaskScope}`); + await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000); + await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab'); }); - test('Check the running application', async () => { - await switchApptWindowAndCheck(SpringAppLocators.springTitleLocator); + test('Check the running application', async () => { + await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator); }); - test('Close the terminal running tasks', async () => { - await terminal.rejectTerminalProcess('run'); - await terminal.closeTerminalTab('run'); - await warningDialog.waitAndCloseIfAppear(); - await terminal.closeTerminalTab('build'); + test('Close the terminal running tasks', async () => { + await terminal.rejectTerminalProcess('run'); + await terminal.closeTerminalTab('run'); + await warningDialog.waitAndCloseIfAppear(); + await terminal.closeTerminalTab('build'); }); }); @@ -181,7 +181,7 @@ async function checkJavaPathCompletion() { } // when we use devfile v.2 the test app. is opened in the separate window instead of widget -async function switchApptWindowAndCheck(contentLocator: By) { +async function switchAppWindowAndCheck(contentLocator: By) { const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle(); await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT); const isApplicationTitleVisible: boolean = await driverHelper.isVisible(contentLocator); From 06d9c13e55da5f37bc937a92d50a4254390d62ef Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 12:02:21 +0300 Subject: [PATCH 5/7] fix-formatting --- .../tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 40a0fdd1226..584c583a573 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -66,10 +66,10 @@ suite('Workspace creation via factory url', async () => { }); test('Register running workspace', async () => { - await ide.waitAndSwitchToIdeFrame(); - await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); - await projectTree.openProjectTreeContainer(); - await projectTree.waitProjectImported(projectName, workspaceRootFolderName); + await ide.waitAndSwitchToIdeFrame(); + await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + await projectTree.openProjectTreeContainer(); + await projectTree.waitProjectImported(projectName, workspaceRootFolderName); }); }); }); From 31316e4b9613b212d2bf4682ef8ed6aea5245683 Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 18:03:57 +0300 Subject: [PATCH 6/7] Add comments for DEWS specific places --- .../tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index 584c583a573..f7158fd5d19 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -56,7 +56,7 @@ suite('Workspace creation via factory url', async () => { const workspaceRootFolderName: string = 'src'; suite('Open factory URL', async () => { - + //this is DevWorkspace test specific - we create the test ws. using factory instead of chectl test(`Navigating to factory URL`, async () => { await browserTabsUtil.navigateTo(factoryUrl); }); @@ -68,6 +68,8 @@ suite('Workspace creation via factory url', async () => { test('Register running workspace', async () => { await ide.waitAndSwitchToIdeFrame(); await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); + // In this place we do not check 'Do you trust the authors of', 'Yes, I trust' message + // It is DevWorkspace test specific. After consuming the factory the notification does not appear await projectTree.openProjectTreeContainer(); await projectTree.waitProjectImported(projectName, workspaceRootFolderName); }); @@ -144,9 +146,11 @@ suite('Workspace creation via factory url', async () => { const taskName: string = 'run'; await topMenu.runTask(`${taskName}, ${globalTaskScope}`); await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000); + // DevWs specific. After running test application we can open it just in the new window. + // The preview widget is not available yet. await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab'); }); - + // This is DevWorkspace test specific since Theia does not provide yet preview as a widget test('Check the running application', async () => { await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator); }); @@ -180,7 +184,7 @@ async function checkJavaPathCompletion() { } } -// when we use devfile v.2 the test app. is opened in the separate window instead of widget +// This is DevWorkspace test specific since Theia does not provide yet preview as a widget async function switchAppWindowAndCheck(contentLocator: By) { const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle(); await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT); From 19bf62578a88bb82f2f308642549039a0a8d3480 Mon Sep 17 00:00:00 2001 From: musienko maksym Date: Mon, 20 Sep 2021 21:10:33 +0300 Subject: [PATCH 7/7] fix comments (should start with lower case) --- .../e2e_happy_path/DevWorkspaceHappyPath.spec.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts index f7158fd5d19..14ddb30b363 100644 --- a/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +++ b/tests/e2e/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts @@ -56,7 +56,7 @@ suite('Workspace creation via factory url', async () => { const workspaceRootFolderName: string = 'src'; suite('Open factory URL', async () => { - //this is DevWorkspace test specific - we create the test ws. using factory instead of chectl + // this is DevWorkspace test specific - we create the test ws. using factory instead of chectl test(`Navigating to factory URL`, async () => { await browserTabsUtil.navigateTo(factoryUrl); }); @@ -68,8 +68,8 @@ suite('Workspace creation via factory url', async () => { test('Register running workspace', async () => { await ide.waitAndSwitchToIdeFrame(); await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); - // In this place we do not check 'Do you trust the authors of', 'Yes, I trust' message - // It is DevWorkspace test specific. After consuming the factory the notification does not appear + // in this place we do not check 'Do you trust the authors of', 'Yes, I trust' message + // it is DevWorkspace test specific. After consuming the factory the notification does not appear await projectTree.openProjectTreeContainer(); await projectTree.waitProjectImported(projectName, workspaceRootFolderName); }); @@ -146,11 +146,11 @@ suite('Workspace creation via factory url', async () => { const taskName: string = 'run'; await topMenu.runTask(`${taskName}, ${globalTaskScope}`); await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000); - // DevWs specific. After running test application we can open it just in the new window. - // The preview widget is not available yet. + // devWs specific. After running test application we can open it just in the new window. + // the preview widget is not available yet. await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab'); }); - // This is DevWorkspace test specific since Theia does not provide yet preview as a widget + // this is DevWorkspace test specific since Theia does not provide yet preview as a widget test('Check the running application', async () => { await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator); }); @@ -184,7 +184,7 @@ async function checkJavaPathCompletion() { } } -// This is DevWorkspace test specific since Theia does not provide yet preview as a widget +// this is DevWorkspace test specific since Theia does not provide yet preview as a widget async function switchAppWindowAndCheck(contentLocator: By) { const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle(); await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);