@redhat-developer/page-objects
Version:
Page Object API implementation for a VS Code editor used by ExTester framework.
96 lines (95 loc) • 3.27 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 { ElementWithContextMenu } from '../ElementWithContextMenu';
import { AbstractElement } from '../AbstractElement';
import { By, WebElement } from 'selenium-webdriver';
/**
* Available types of notifications
*/
export declare enum NotificationType {
Info = "info",
Warning = "warning",
Error = "error",
Any = "any"
}
/**
* Abstract element representing a notification
*/
export declare abstract class Notification extends ElementWithContextMenu {
/**
* Get the message of the notification
* @returns Promise resolving to notification message
*/
getMessage(): Promise<string>;
/**
* Get the type of the notification
* @returns Promise resolving to NotificationType
*/
getType(): Promise<NotificationType>;
/**
* Get the source of the notification as text
* @returns Promise resolving to notification source
* @deprecated For VS Code 1.88+ this method won't be working any more
*/
getSource(): Promise<string>;
/**
* Find whether the notification has an active progress bar
* @returns Promise resolving to true/false
*/
hasProgress(): Promise<boolean>;
/**
* Dismiss the notification
* @returns Promise resolving when notification is dismissed
*/
dismiss(): Promise<void>;
/**
* Get the action buttons of the notification as an array
* of NotificationButton objects
* @returns Promise resolving to array of NotificationButton objects
*/
getActions(): Promise<NotificationButton[]>;
/**
* Click on an action button with the given title
* @param title title of the action/button
* @returns Promise resolving when the select button is pressed
*/
takeAction(title: string): Promise<void>;
/**
* Expand the notification if possible
*/
expand(): Promise<void>;
}
/**
* Notification displayed on its own in the notifications-toasts container
*/
export declare class StandaloneNotification extends Notification {
constructor(notification: WebElement);
}
/**
* Notification displayed within the notifications center
*/
export declare class CenterNotification extends Notification {
constructor(notification: WebElement);
}
/**
* Notification button
*/
declare class NotificationButton extends AbstractElement {
constructor(buttonConstructor: By, notification: Notification);
getTitle(): Promise<string>;
}
export {};