-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update 'factory' E2E tests according changes in IDE to 'Source Contro…
…l' (#23153) * Create new pageobject 'ViewsMoreActionsButton' * Update service files * Update 'factory' tests
- Loading branch information
Showing
7 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** ******************************************************************* | ||
* copyright (c) 2024 Red Hat, Inc. | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
**********************************************************************/ | ||
import { inject, injectable } from 'inversify'; | ||
import 'reflect-metadata'; | ||
import { e2eContainer } from '../../configs/inversify.config'; | ||
import { CLASSES } from '../../configs/inversify.types'; | ||
import { By } from 'selenium-webdriver'; | ||
import { DriverHelper } from '../../utils/DriverHelper'; | ||
import { Logger } from '../../utils/Logger'; | ||
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS'; | ||
import { CheCodeLocatorLoader } from './CheCodeLocatorLoader'; | ||
import { ContextMenu, NewScmView, SingleScmProvider, Locators } from 'monaco-page-objects'; | ||
|
||
@injectable() | ||
export class ViewsMoreActionsButton { | ||
private static readonly VIEWS_AND_MORE_ACTIONS_BUTTON: By = By.xpath('//a[@role="button" and @aria-label="Views and More Actions..."]'); | ||
|
||
constructor( | ||
@inject(CLASSES.DriverHelper) | ||
readonly driverHelper: DriverHelper | ||
) {} | ||
|
||
async closeSourceControlGraph(): Promise<void> { | ||
Logger.debug(); | ||
|
||
const cheCodeLocatorLoader: CheCodeLocatorLoader = e2eContainer.get(CLASSES.CheCodeLocatorLoader); | ||
const webCheCodeLocators: Locators = cheCodeLocatorLoader.webCheCodeLocators; | ||
|
||
const scmView: NewScmView = new NewScmView(); | ||
const [scmProvider]: SingleScmProvider[] = await scmView.getProviders(); | ||
|
||
Logger.debug('scmProvider.openMoreActions'); | ||
const scmContextMenu: ContextMenu = await scmProvider.openMoreActions(); | ||
await this.driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView); | ||
Logger.debug('scmContextMenu.select: "Source Control Graph"'); | ||
await scmContextMenu.select('Source Control Graph'); | ||
} | ||
|
||
async viewsAndMoreActionsButtonIsVisible(timeout: number = TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM): Promise<boolean> { | ||
Logger.debug(); | ||
|
||
const viewsActionsButton: boolean = await this.driverHelper.waitVisibilityBoolean( | ||
ViewsMoreActionsButton.VIEWS_AND_MORE_ACTIONS_BUTTON, | ||
timeout | ||
); | ||
|
||
return viewsActionsButton; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters