@redhat-developer/page-objects
Version:
Page Object API implementation for a VS Code editor used by ExTester framework.
70 lines (69 loc) • 3.25 kB
TypeScript
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License", destination); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { WebElement } from 'selenium-webdriver';
import { AbstractElement } from '../AbstractElement';
import { ViewSection } from '../..';
/**
* A button that appears in the welcome content and can be clicked to execute a command.
*
* To execute the command bound to this button simply run: `await button.click();`.
*/
export declare class WelcomeContentButton extends AbstractElement {
/**
* @param panel The panel containing the button in the welcome section
* @param welcomeSection The enclosing welcome section
*/
constructor(panel: WebElement, welcomeSection: WelcomeContentSection);
/** Return the title displayed on this button */
getTitle(): Promise<string>;
}
/**
* A section in an empty custom view, see:
* https://code.visualstudio.com/api/extension-guides/tree-view#welcome-content
*
* The welcome section contains two types of elements: text entries and buttons that can be bound to commands.
* The text sections can be accessed via [[getTextSections]], the buttons on the
* other hand via [[getButtons]].
* This however looses the information of the order of the buttons and lines
* with respect to each other. This can be remedied by using [[getContents]],
* which returns both in the order that they are found (at the expense, that you
* now must use typechecks to find out what you got).
*/
export declare class WelcomeContentSection extends AbstractElement {
/**
* @param panel The panel containing the welcome content.
* @param parent The webElement in which the welcome content is embedded.
*/
constructor(panel: WebElement, parent: ViewSection);
/**
* Combination of [[getButtons]] and [[getTextSections]]: returns all entries in the welcome view in the order that they appear.
*/
getContents(): Promise<(WelcomeContentButton | string)[]>;
/**
* Returns a specific button from the welcome view that matches the given title.
* @param title The title of the button to search for.
* @returns A `WelcomeContentButton` if found, otherwise `undefined`.
*/
getButton(title: string): Promise<WelcomeContentButton | undefined>;
/** Finds all buttons in the welcome content */
getButtons(): Promise<WelcomeContentButton[]>;
/**
* Finds all text entries in the welcome content and returns each line as an
* element in an array.
*/
getTextSections(): Promise<string[]>;
}