From 715d3d381fa34c37e8eddb8a94191989f4ffc0b5 Mon Sep 17 00:00:00 2001 From: Ihor Okhrimenko Date: Tue, 7 Sep 2021 18:10:04 +0300 Subject: [PATCH] The "GitHubPullRequestPlugin" unexpectedly fails on the openshift-ci (#20434) Signed-off-by: Ihor Okhrimenko --- tests/e2e/pageobjects/ide/QuickOpenContainer.ts | 4 ++-- tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/e2e/pageobjects/ide/QuickOpenContainer.ts b/tests/e2e/pageobjects/ide/QuickOpenContainer.ts index 0000803a6cf..34d9d92da9b 100644 --- a/tests/e2e/pageobjects/ide/QuickOpenContainer.ts +++ b/tests/e2e/pageobjects/ide/QuickOpenContainer.ts @@ -44,13 +44,13 @@ export class QuickOpenContainer { public async type(text: string) { Logger.debug(`QuickOpenContainer.type "${text}"`); - await this.driverHelper.enterValue(By.css('.quick-open-input input'), text); + await this.driverHelper.type(By.css('div.monaco-inputbox input.input'), text); } public async typeAndSelectSuggestion(text: string, suggestedText: string) { Logger.debug('QuickOpenContainer.typeAndSelectSuggestion'); - await this.driverHelper.type(By.css('div.monaco-inputbox input.input'), text); + await this.type(text); // sometimes the UI dropdawn may closed unexpectedly for more stability add 500ms delay. await this.driverHelper.wait(2000); await this.clickOnContainerItem(suggestedText); diff --git a/tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts b/tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts index 7dd218cc223..06d9fef07a4 100644 --- a/tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts +++ b/tests/e2e/tests/plugins/GitHubPullRequestPlugin.spec.ts @@ -27,6 +27,7 @@ import { QuickOpenContainer } from '../../pageobjects/ide/QuickOpenContainer'; import { Editor } from '../../pageobjects/ide/Editor'; import CheReporter from '../../driver/CheReporter'; import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; +import { Key } from 'selenium-webdriver'; const ide: Ide = e2eContainer.get(CLASSES.Ide); const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree); @@ -91,7 +92,7 @@ suite(`The 'GitHubPullRequestPlugin' test`, async () => { test('Create new branch', async () => { await topMenu.selectOption('View', 'Find Command...'); await quickOpenContainer.typeAndSelectSuggestion('branch', 'Git: Create Branch...'); - await quickOpenContainer.typeAndSelectSuggestion(branchName, `Please provide a new branch name (Press 'Enter' to confirm or 'Escape' to cancel)`); + await quickOpenContainer.type(`${branchName}${Key.ENTER}`); await projectTree.expandPathAndOpenFile('Spoon-Knife', changedFile); await editor.type(changedFile, currentDate + '\n', 1);