diff --git a/tests/e2e/configs/inversify.config.ts b/tests/e2e/configs/inversify.config.ts index 9f647c6de54..4bb89cf6e52 100644 --- a/tests/e2e/configs/inversify.config.ts +++ b/tests/e2e/configs/inversify.config.ts @@ -53,6 +53,7 @@ import { ContainerTerminal, KubernetesCommandLineToolsExecutor } from '../utils/ import { ShellExecutor } from '../utils/ShellExecutor'; import { UserPreferences } from '../pageobjects/dashboard/UserPreferences'; import { WebTerminalPage } from '../pageobjects/webterminal/WebTerminalPage'; +import { TrustAuthorPopup } from '../pageobjects/dashboard/TrustAuthorPopup'; const e2eContainer: Container = new Container({ defaultScope: 'Transient', skipBaseClassChecks: true }); @@ -90,6 +91,8 @@ e2eContainer.bind(CLASSES.WebTerminalPage).to(WebTerminalPage); e2eContainer.bind(CLASSES.UserPreferences).to(UserPreferences); e2eContainer.bind(EXTERNAL_CLASSES.Generator).to(Generator); e2eContainer.bind(EXTERNAL_CLASSES.LocatorLoader).to(LocatorLoader); +e2eContainer.bind(EXTERNAL_CLASSES.LocatorLoader).to(LocatorLoader); +e2eContainer.bind(CLASSES.TrustAuthorPopup).to(TrustAuthorPopup); if (BASE_TEST_CONSTANTS.TS_PLATFORM === Platform.OPENSHIFT) { if (OAUTH_CONSTANTS.TS_SELENIUM_VALUE_OPENSHIFT_OAUTH) { diff --git a/tests/e2e/configs/inversify.types.ts b/tests/e2e/configs/inversify.types.ts index dd44525a41e..ab89535896f 100644 --- a/tests/e2e/configs/inversify.types.ts +++ b/tests/e2e/configs/inversify.types.ts @@ -50,7 +50,8 @@ const CLASSES: any = { ContainerTerminal: 'ContainerTerminal', UserPreferences: 'UserPreferences', WebTerminalPage: 'WebTerminalPage', - RevokeOauthPage: 'RevokeOauthPage' + RevokeOauthPage: 'RevokeOauthPage', + TrustAuthorPopup: 'TrustAuthorPopup' }; const EXTERNAL_CLASSES: any = { diff --git a/tests/e2e/constants/CHROME_DRIVER_CONSTANTS.ts b/tests/e2e/constants/CHROME_DRIVER_CONSTANTS.ts index 98ffa32a819..a6e67c65850 100644 --- a/tests/e2e/constants/CHROME_DRIVER_CONSTANTS.ts +++ b/tests/e2e/constants/CHROME_DRIVER_CONSTANTS.ts @@ -44,5 +44,5 @@ export const CHROME_DRIVER_CONSTANTS: { /** * run browser with proxy settings */ - TS_SELENIUM_PROXY_SERVER: process.env.TS_SELENIUM_PROXY_SERVER || '', + TS_SELENIUM_PROXY_SERVER: process.env.TS_SELENIUM_PROXY_SERVER || '' }; diff --git a/tests/e2e/index.ts b/tests/e2e/index.ts index 990e6e578a0..9f91e26cd3e 100644 --- a/tests/e2e/index.ts +++ b/tests/e2e/index.ts @@ -5,28 +5,29 @@ export * from './configs/mocharc'; export * from './driver/ChromeDriver'; export * from './driver/IDriver'; export * from './utils/BrowserTabsUtil'; -export * from './utils/DevWorkspaceConfigurationHelper'; export * from './utils/DevfilesRegistryHelper'; +export * from './utils/DevWorkspaceConfigurationHelper'; export * from './utils/DriverHelper'; export * from './utils/IContextParams'; export * from './utils/IKubernetesCommandLineToolsExecutor'; export * from './utils/KubernetesCommandLineToolsExecutor'; export * from './utils/Logger'; -export * from './utils/ScreenCatcher'; -export * from './utils/ShellExecutor'; -export * from './utils/StringUtil'; export * from './utils/request-handlers/CheApiRequestHandler'; export * from './utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler'; export * from './utils/request-handlers/headers/IAuthorizationHeaderHandler'; +export * from './utils/ScreenCatcher'; +export * from './utils/ShellExecutor'; +export * from './utils/StringUtil'; export * from './utils/workspace/ApiUrlResolver'; export * from './utils/workspace/ITestWorkspaceUtil'; export * from './utils/workspace/TestWorkspaceUtil'; export * from './utils/workspace/WorkspaceStatus'; export * from './pageobjects/dashboard/CreateWorkspace'; export * from './pageobjects/dashboard/Dashboard'; +export * from './pageobjects/dashboard/TrustAuthorPopup'; export * from './pageobjects/dashboard/UserPreferences'; -export * from './pageobjects/dashboard/Workspaces'; export * from './pageobjects/dashboard/workspace-details/WorkspaceDetails'; +export * from './pageobjects/dashboard/Workspaces'; export * from './pageobjects/git-providers/OauthPage'; export * from './pageobjects/ide/CheCodeLocatorLoader'; export * from './pageobjects/login/interfaces/ICheLoginPage'; diff --git a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts index 4a509556f50..4217b6db7c0 100644 --- a/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts +++ b/tests/e2e/pageobjects/dashboard/CreateWorkspace.ts @@ -15,6 +15,7 @@ import { By, Key } from 'selenium-webdriver'; import { Logger } from '../../utils/Logger'; import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS'; +import { TrustAuthorPopup } from './TrustAuthorPopup'; @injectable() export class CreateWorkspace { @@ -26,7 +27,10 @@ export class CreateWorkspace { constructor( @inject(CLASSES.DriverHelper) - private readonly driverHelper: DriverHelper + private readonly driverHelper: DriverHelper, + + @inject(CLASSES.TrustAuthorPopup) + private readonly trustAuthorPopup: TrustAuthorPopup ) {} async waitTitleContains(expectedText: string, timeout: number = TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT): Promise { @@ -84,6 +88,8 @@ export class CreateWorkspace { } await this.driverHelper.waitAndClick(CreateWorkspace.CREATE_AND_OPEN_BUTTON, timeout); + + await this.performTrustAuthorPopup(); } async clickOnEditorsDropdownListButton(sampleName: string, timeout: number): Promise { @@ -93,6 +99,16 @@ export class CreateWorkspace { await this.driverHelper.waitAndClick(editorDropdownListLocator, timeout); } + async performTrustAuthorPopup(): Promise { + Logger.debug(); + + try { + await this.trustAuthorPopup.clickContinue(); + } catch (e) { + Logger.info('Trust author popup was not shown'); + } + } + private getEditorsDropdownListLocator(sampleName: string): By { return By.xpath(`//div[text()=\'${sampleName}\']//parent::article//button`); }