@redhat-developer/page-objects
Version:
Page Object API implementation for a VS Code editor used by ExTester framework.
105 lines (104 loc) • 3.83 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 { BottomBarPanel } from '../..';
import { AbstractElement } from '../AbstractElement';
import { WebElement } from 'selenium-webdriver';
import { ElementWithContextMenu } from '../ElementWithContextMenu';
/**
* Problems view in the bottom panel
*/
export declare class ProblemsView extends AbstractElement {
constructor(panel?: BottomBarPanel);
/**
* Set the filter using the input box on the problems view
* @param pattern filter to use, preferably a glob pattern
* @returns Promise resolving when the filter pattern is filled in
*/
setFilter(pattern: string): Promise<void>;
/**
* Clear all filters
* @returns Promise resolving to the filter field WebElement
*/
clearFilter(): Promise<WebElement>;
/**
* Collapse all collapsible markers in the problems view
* @returns Promise resolving when the collapse all button is pressed
*/
collapseAll(): Promise<void>;
/**
* @deprecated The method should not be used and getAllVisibleMarkers() should be used instead.
*/
getAllMarkers(type: MarkerType): Promise<Marker[]>;
/**
* Get all visible markers from the problems view with the given type.
* Warning: this only returns the markers that are visible, and not the
* entire list, so calls to this function may change depending on the
* environment in which the tests are running in.
* To get all markers regardless of type, use MarkerType.Any
* @param type type of markers to retrieve
* @returns Promise resolving to array of Marker objects
*/
getAllVisibleMarkers(type: MarkerType): Promise<Marker[]>;
/**
* Gets the count badge
* @returns Promise resolving to the WebElement representing the count badge
*/
getCountBadge(): Promise<WebElement>;
}
/**
* Page object for a Marker in Problems view
*/
export declare class Marker extends ElementWithContextMenu {
constructor(element: WebElement, view: ProblemsView);
/**
* Get the type of the marker. Possible types are:
* - File
* - Error
* - Warning
* @returns Promise resolving to a MarkerType
*/
getType(): Promise<MarkerType>;
/**
* Get the full text of the Marker row
* @returns Promise resolving to a Marker row text
*/
getText(): Promise<string>;
/**
* Get the Marker label text
* @returns Promise resolving to a Marker label
*/
getLabel(): Promise<string>;
/**
* Expand/Collapse the Marker if possible
* @param expand True to expand, False to collapse
* @returns Promise resolving when the expand/collapse twistie is clicked
*/
toggleExpand(expand: boolean): Promise<void>;
}
/**
* Possible types of markers
* - File = expandable item representing a file
* - Error = an error marker
* - Warning = a warning marker
* - Any = any of the above
*/
export declare enum MarkerType {
File = "file",
Error = "error",
Warning = "warning",
Any = "any"
}