Skip to content

Commit

Permalink
fix: Correct typo in ElementWithContextMenu
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Jul 17, 2024
1 parent 9bffd73 commit 10bd3dc
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 43 deletions.
10 changes: 5 additions & 5 deletions packages/page-objects/src/components/ElementWithContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ import { until, error } from 'selenium-webdriver';
/**
* Abstract element that has a context menu
*/
export abstract class ElementWithContexMenu extends AbstractElement {
export abstract class ElementWithContextMenu extends AbstractElement {
/**
* Open context menu on the element
*/
async openContextMenu(): Promise<ContextMenu> {
const workbench = await this.getDriver().findElement(ElementWithContexMenu.locators.Workbench.constructor);
const menus = await workbench.findElements(ElementWithContexMenu.locators.ContextMenu.contextView);
const workbench = await this.getDriver().findElement(ElementWithContextMenu.locators.Workbench.constructor);
const menus = await workbench.findElements(ElementWithContextMenu.locators.ContextMenu.contextView);

if (menus.length < 1) {
await this.getDriver().actions().contextClick(this).perform();
await this.getDriver().wait(until.elementLocated(ElementWithContexMenu.locators.ContextMenu.contextView), 2000);
await this.getDriver().wait(until.elementLocated(ElementWithContextMenu.locators.ContextMenu.contextView), 2000);
return new ContextMenu(workbench).wait();
} else if ((await workbench.findElements(ElementWithContexMenu.locators.ContextMenu.viewBlock)).length > 0) {
} else if ((await workbench.findElements(ElementWithContextMenu.locators.ContextMenu.viewBlock)).length > 0) {
await this.getDriver().actions().contextClick(this).perform();
try {
await this.getDriver().wait(until.elementIsNotVisible(this), 1000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

import { WebElement } from 'selenium-webdriver';
import { ActivityBar, ContextMenu } from '../..';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';

/**
* Page object representing the global action controls on the bottom of the action bar
*/
export class ActionsControl extends ElementWithContexMenu {
export class ActionsControl extends ElementWithContextMenu {
constructor(element: WebElement, bar: ActivityBar) {
super(element, bar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/

import { ActionsControl, ViewControl } from '../..';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';

/**
* Page object representing the left side activity bar in VS Code
*/
export class ActivityBar extends ElementWithContexMenu {
export class ActivityBar extends ElementWithContextMenu {
constructor() {
super(ActivityBar.locators.ActivityBar.constructor, ActivityBar.locators.Workbench.constructor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
*/

import { ActivityBar, DebugView, SideBarView, ScmView } from '../..';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { WebElement } from 'selenium-webdriver';
import { NewScmView } from '../sidebar/scm/NewScmView';

/**
* Page object representing a view container item in the activity bar
*/
export class ViewControl extends ElementWithContexMenu {
export class ViewControl extends ElementWithContextMenu {
constructor(element: WebElement, bar: ActivityBar) {
super(element, bar);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
*/

import { Key } from 'selenium-webdriver';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';

/**
* View with channel selector
*/
export abstract class ChannelView extends ElementWithContexMenu {
export abstract class ChannelView extends ElementWithContextMenu {
protected actionsLabel!: string;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { BottomBarPanel } from '../..';
import { AbstractElement } from '../AbstractElement';
import { WebElement } from 'selenium-webdriver';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';

/**
* Problems view in the bottom panel
Expand Down Expand Up @@ -102,7 +102,7 @@ export class ProblemsView extends AbstractElement {
/**
* Page object for a Marker in Problems view
*/
export class Marker extends ElementWithContexMenu {
export class Marker extends ElementWithContextMenu {
constructor(element: WebElement, view: ProblemsView) {
super(element, view);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/bottomBar/Views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { Key, until } from 'selenium-webdriver';
import { BottomBarPanel, ContentAssist, Workbench } from '../..';
import { TextView, ChannelView } from './AbstractViews';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';

/**
* Output view of the bottom panel
Expand All @@ -42,7 +42,7 @@ export class OutputView extends TextView {
* Debug Console view on the bottom panel
* Most functionality will only be available when a debug session is running
*/
export class DebugConsoleView extends ElementWithContexMenu {
export class DebugConsoleView extends ElementWithContextMenu {
constructor(panel: BottomBarPanel = new BottomBarPanel()) {
super(DebugConsoleView.locators.DebugConsoleView.constructor, panel);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/editor/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* limitations under the License.
*/

import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { EditorTab, EditorView, EditorGroup } from '../..';
import { WebElement, Locator } from 'selenium-webdriver';

/**
* Abstract representation of an editor tab
*/
export abstract class Editor extends ElementWithContexMenu {
export abstract class Editor extends ElementWithContextMenu {
constructor(view: EditorView | EditorGroup = new EditorView(), base: Locator | WebElement = Editor.locators.Editor.constructor) {
super(base, view);
}
Expand Down
7 changes: 3 additions & 4 deletions packages/page-objects/src/components/editor/EditorAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

import { EditorGroup } from './EditorView';
import { By, ContextMenu, Key, WebElement } from '../..';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { ChromiumWebDriver } from 'selenium-webdriver/chromium';

export class EditorAction extends ElementWithContexMenu {

export class EditorAction extends ElementWithContextMenu {
constructor(element: WebElement, parent: EditorGroup) {
super(element, parent);
}
Expand Down Expand Up @@ -59,7 +58,7 @@ export class EditorActionDropdown extends EditorAction {
}
} else if (chromiumVersion && parseInt(chromiumVersion.split('.')[0]) >= 100) {
await this.click();
const workbench = await this.getDriver().findElement(ElementWithContexMenu.locators.Workbench.constructor);
const workbench = await this.getDriver().findElement(ElementWithContextMenu.locators.Workbench.constructor);
return new ContextMenu(workbench).wait();
}
return await super.openContextMenu();
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/editor/EditorView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { error, WebElement } from 'selenium-webdriver';
import { TextEditor } from '../..';
import { AbstractElement } from '../AbstractElement';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { DiffEditor } from './DiffEditor';
import { Editor } from './Editor';
import { EditorAction, EditorActionDropdown } from './EditorAction';
Expand Down Expand Up @@ -374,7 +374,7 @@ export class EditorGroup extends AbstractElement {
/**
* Page object for editor view tab
*/
export class EditorTab extends ElementWithContexMenu {
export class EditorTab extends ElementWithContextMenu {
constructor(element: WebElement, view: EditorView) {
super(element, view);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/editor/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { By, Key, until, WebElement } from 'selenium-webdriver';
import { fileURLToPath } from 'url';
import { StatusBar } from '../statusBar/StatusBar';
import { Editor } from './Editor';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { AbstractElement } from '../AbstractElement';
import { Breakpoint } from './Breakpoint';
import { ChromiumWebDriver } from 'selenium-webdriver/chromium';
Expand Down Expand Up @@ -545,7 +545,7 @@ export class TextEditor extends Editor {
/**
* Text selection block
*/
class Selection extends ElementWithContexMenu {
class Selection extends ElementWithContextMenu {
constructor(el: WebElement, editor: TextEditor) {
super(el, editor);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/sidebar/ViewItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
* limitations under the License.
*/

import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { AbstractElement } from '../AbstractElement';
import { WebElement, By, error } from 'selenium-webdriver';
import { NullAttributeError } from '../../errors/NullAttributeError';

/**
* Arbitrary item in the side bar view
*/
export abstract class ViewItem extends ElementWithContexMenu {
export abstract class ViewItem extends ElementWithContextMenu {
/**
* Select the item in the view.
* Note that selecting the item will toggle its expand state when applicable.
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/sidebar/ViewSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { By, until, WebElement } from 'selenium-webdriver';
import { ContextMenu, ViewContent, ViewItem, waitForAttributeValue, WelcomeContentSection } from '../..';
import { AbstractElement } from '../AbstractElement';
import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { ChromiumWebDriver } from 'selenium-webdriver/chromium';

export type ViewSectionConstructor<T extends ViewSection> = {
Expand Down Expand Up @@ -177,7 +177,7 @@ export abstract class ViewSection extends AbstractElement {
return undefined;
}
const section = this;
const btn = new (class extends ElementWithContexMenu {
const btn = new (class extends ElementWithContextMenu {
async openContextMenu() {
await this.click();
const shadowRootHost = await section.findElements(By.className('shadow-root-host'));
Expand Down
4 changes: 2 additions & 2 deletions packages/page-objects/src/components/sidebar/ViewTitlePart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
* limitations under the License.
*/

import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { AbstractElement } from '../AbstractElement';
import { By, SideBarView } from '../..';

/**
* Page object representing the top (title) part of a side bar view
*/
export class ViewTitlePart extends ElementWithContexMenu {
export class ViewTitlePart extends ElementWithContextMenu {
constructor(view: SideBarView = new SideBarView()) {
super(ViewTitlePart.locators.ViewTitlePart.constructor, view);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { ScmView, ScmProvider, MoreAction, ScmChange } from './ScmView';
import { WebElement, Key } from 'selenium-webdriver';
import { ContextMenu } from '../../menu/ContextMenu';
import { ElementWithContexMenu } from '../../ElementWithContextMenu';
import { ElementWithContextMenu } from '../../ElementWithContextMenu';
import { TitleActionButton } from '../ViewTitlePart';

/**
Expand Down Expand Up @@ -181,7 +181,7 @@ export class MultiScmProvider extends ScmProvider {
}
}

class MultiMoreAction extends ElementWithContexMenu {
class MultiMoreAction extends ElementWithContextMenu {
constructor(scm: ScmProvider) {
super(MoreAction.locators.ScmView.multiMore, scm);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/page-objects/src/components/sidebar/scm/ScmView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { SideBarView } from '../SideBarView';
import { WebElement, Key, By } from 'selenium-webdriver';
import { AbstractElement } from '../../AbstractElement';
import { ContextMenu } from '../../..';
import { ElementWithContexMenu } from '../../ElementWithContextMenu';
import { ElementWithContextMenu } from '../../ElementWithContextMenu';
import { ChromiumWebDriver } from 'selenium-webdriver/chromium';

/**
Expand Down Expand Up @@ -188,7 +188,7 @@ export class ScmProvider extends AbstractElement {
/**
* Page object representing a SCM change tree item
*/
export class ScmChange extends ElementWithContexMenu {
export class ScmChange extends ElementWithContextMenu {
constructor(row: WebElement, provider: ScmProvider) {
super(row, provider);
}
Expand Down Expand Up @@ -270,7 +270,7 @@ export class ScmChange extends ElementWithContexMenu {
}
}

export class MoreAction extends ElementWithContexMenu {
export class MoreAction extends ElementWithContextMenu {
constructor(scm: ScmProvider | ScmView) {
super(MoreAction.locators.ScmView.more, scm);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ export class MoreAction extends ElementWithContexMenu {
}
} else if (chromiumVersion && parseInt(chromiumVersion.split('.')[0]) >= 100) {
await this.click();
const workbench = await this.getDriver().findElement(ElementWithContexMenu.locators.Workbench.constructor);
const workbench = await this.getDriver().findElement(ElementWithContextMenu.locators.Workbench.constructor);
return new ContextMenu(workbench).wait();
}
return await super.openContextMenu();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
* limitations under the License.
*/

import { ElementWithContexMenu } from '../../../ElementWithContextMenu';
import { ElementWithContextMenu } from '../../../ElementWithContextMenu';

export class SectionBreakpoint extends ElementWithContexMenu {}
export class SectionBreakpoint extends ElementWithContextMenu {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { ElementWithContexMenu } from '../ElementWithContextMenu';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
import { AbstractElement } from '../AbstractElement';
import { By, until, WebElement } from 'selenium-webdriver';

Expand All @@ -32,7 +32,7 @@ export enum NotificationType {
/**
* Abstract element representing a notification
*/
export abstract class Notification extends ElementWithContexMenu {
export abstract class Notification extends ElementWithContextMenu {
/**
* Get the message of the notification
* @returns Promise resolving to notification message
Expand Down

0 comments on commit 10bd3dc

Please sign in to comment.