Skip to content

Commit

Permalink
chore: Adapt Happy Path tests to the changes related to the Monaco up…
Browse files Browse the repository at this point in the history
…grade

Signed-off-by: Roman Nikitenko <[email protected]>
  • Loading branch information
RomanNikitenko committed Aug 2, 2021
1 parent dd703d6 commit 2bea613
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/e2e/pageobjects/ide/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export class Editor {
}

private getEditorLineXpathLocator(lineNumber: number): string {
return `(//div[contains(@class,'lines-content')]//div[@class='view-lines']/div[@class='view-line'])[${lineNumber}]`;
return `(//div[contains(@class,'lines-content')]//div[@class='view-lines monaco-mouse-cursor-text']/div[@class='view-line'])[${lineNumber}]`;
}

private getSuggestionLineXpathLocator(suggestionText: string): By {
Expand Down
6 changes: 3 additions & 3 deletions tests/e2e/pageobjects/ide/QuickOpenContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ export class QuickOpenContainer {
public async waitContainer(timeout: number = TimeoutConstants.TS_SELENIUM_TOP_MENU_QUICK_CONTAINER_TIMEOUT) {
Logger.debug('QuickOpenContainer.waitContainer');

const monacoQuickOpenContainerLocator: By = By.xpath('//div[@class=\'monaco-quick-open-widget\']');
const monacoQuickOpenContainerLocator: By = By.xpath('//div[@class=\'quick-input-widget show-file-icons\']');
await this.driverHelper.waitVisibility(monacoQuickOpenContainerLocator, timeout);
}

public async waitContainerDisappearance() {
Logger.debug('QuickOpenContainer.waitContainerDisappearance');

const monacoQuickOpenContainerLocator: By = By.xpath('//div[@class=\'monaco-quick-open-widget\' and @aria-hidden=\'true\']');
const monacoQuickOpenContainerLocator: By = By.xpath('//div[@class=\'quick-input-widget show-file-icons\' and @aria-hidden=\'true\']');
await this.driverHelper.waitDisappearance(monacoQuickOpenContainerLocator);
}

public async clickOnContainerItem(itemText: string, timeout: number = TimeoutConstants.TS_SELENIUM_TOP_MENU_QUICK_CONTAINER_TIMEOUT) {
Logger.debug(`QuickOpenContainer.clickOnContainerItem "${itemText}"`);

const quickContainerItemLocator: By = By.css(`div[aria-label="${itemText}, picker"]`);
const quickContainerItemLocator: By = By.css(`div[aria-label="${itemText}"]`);
await this.waitContainer(timeout);
await this.driverHelper.waitAndClick(quickContainerItemLocator, timeout);
await this.waitContainerDisappearance();
Expand Down
22 changes: 13 additions & 9 deletions tests/e2e/tests/e2e_happy_path/HappyPath.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ 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\']'),
Expand Down Expand Up @@ -155,13 +156,14 @@ suite('Language server validation', async () => {

suite('Validation of workspace build and run', async () => {
test('Build application', async () => {
let buildTaskName: string = 'build-file-output';
await topMenu.runTask(buildTaskName);
await terminal.waitIconSuccess(buildTaskName, 250_000);
const taskName: string = 'build-file-output';
await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
await terminal.waitIconSuccess(taskName, 250_000);
});

test('Run application', async () => {
await topMenu.runTask('run');
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 Preview');
});
Expand Down Expand Up @@ -196,13 +198,14 @@ suite('Display source code changes in the running application', async () => {
});

test('Build application with changes', async () => {
let buildTaskName: string = 'build';
await topMenu.runTask('build');
await terminal.waitIconSuccess(buildTaskName, 250_000);
const taskName: string = 'build';
await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
await terminal.waitIconSuccess(taskName, 250_000);
});

test('Run application with changes', async () => {
await topMenu.runTask('run-with-changes');
const taskName: string = 'run-with-changes';
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 Preview');
});
Expand All @@ -226,7 +229,8 @@ suite('Display source code changes in the running application', async () => {

suite('Validation of debug functionality', async () => {
test('Launch debug', async () => {
await topMenu.runTask('run-debug');
const taskName: string = 'run-debug';
await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 180_000);
await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In Preview');
});
Expand Down

0 comments on commit 2bea613

Please sign in to comment.