-
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.
implement workaround for Go to symbol feature
Signed-off-by: musienko maksym <mmusiien@redhat.com>
- Loading branch information
1 parent
5e64cff
commit dadb74b
Showing
9 changed files
with
120 additions
and
29 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
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,39 @@ | ||
import 'reflect-metadata'; | ||
import { injectable, inject } from 'inversify'; | ||
import { DriverHelper } from '../../utils/DriverHelper'; | ||
import { CLASSES } from '../../inversify.types'; | ||
import { WebElement, Button, By, Key} from 'selenium-webdriver'; | ||
import { TestConstants} from '../../TestConstants'; | ||
|
||
|
||
|
||
@injectable() | ||
export class ContextMenu { | ||
private static readonly SUGGESTION_WIDGET_BODY_CSS: string = 'ul.p-Menu-content'; | ||
|
||
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { } | ||
|
||
|
||
async invokeContextMenuOnTheElementWithMouse(elementLocator: By, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT ) { | ||
const webElement: WebElement = await this.driverHelper.waitVisibility(elementLocator, timeout); | ||
await this.driverHelper.getAction().click(webElement, Button.RIGHT).perform(); | ||
this.waitContextMenu(timeout); | ||
} | ||
async invokeContextMenuOnActiveElementWithKeys( timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT ) { | ||
this.driverHelper.getDriver().switchTo().activeElement().sendKeys(Key.SHIFT + Key.F10); | ||
this.waitContextMenu(timeout); | ||
} | ||
|
||
|
||
async waitContextMenuAndClickOnItem(nameOfitem: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT ) { | ||
const itemLocator: string = `//div[@class='p-Menu-itemLabel' and text()='${nameOfitem}']`; | ||
await this.waitContextMenu(); | ||
await this.driverHelper.waitAndClick(By.xpath(itemLocator), timeout); | ||
} | ||
|
||
async waitContextMenu(timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) { | ||
await this.driverHelper.waitVisibility(By.css(ContextMenu.SUGGESTION_WIDGET_BODY_CSS), timeout); | ||
} | ||
|
||
|
||
} |
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