-
Notifications
You must be signed in to change notification settings - Fork 72
Notification
github-actions[bot] edited this page Jul 30, 2024
·
6 revisions
To get notifications outside the notifications center, one should use a Workbench
object:
import { Workbench } from 'vscode-extension-tester';
...
const notifications = await new Workbench().getNotifications();
const notification = notifications[0];
// get the message
const message = await notification.getMessage();
// get the type (error/warning/info)
const type = await notification.getType();
// get the source as string, if shown
const source = await notification getSource();
// find if there is an active progress bar
const hasProgress = await notification.hasProgress();
// dismiss the notification
await notification.dismiss();
// get available actions (buttons)
const actions = await notification.getActions();
// get an action's title (text)
const title = actions[0].getTitle();
// take action (i.e. click a button with title)
await notification.takeAction("Install All");