Add smoke tests for cell toolbar keyboard shortcuts. (#19208)

This commit is contained in:
Cory Rivera
2022-04-26 15:09:36 -07:00
committed by GitHub
parent 6e2bf7521f
commit b406dda13c
2 changed files with 43 additions and 5 deletions

View File

@@ -9,15 +9,15 @@ import { QuickInput } from '../quickinput';
import { Editors } from '../editors';
import { IElement } from '..';
const winOrCtrl = process.platform === 'darwin' ? 'ctrl' : 'win';
const ctrlOrCmd = process.platform === 'darwin' ? 'cmd' : 'ctrl';
export class Notebook {
public readonly notebookToolbar: NotebookToolbar;
public readonly textCellToolbar: TextCellToolbar;
public readonly view: NotebookTreeView;
public readonly winOrCtrl = process.platform === 'darwin' ? 'ctrl' : 'win';
public readonly ctrlOrCmd = process.platform === 'darwin' ? 'cmd' : 'ctrl';
constructor(private code: Code, private quickAccess: QuickAccess, private quickInput: QuickInput, private editors: Editors) {
this.notebookToolbar = new NotebookToolbar(code);
this.textCellToolbar = new TextCellToolbar(code);
@@ -33,7 +33,7 @@ export class Notebook {
}
async newUntitledNotebook(): Promise<void> {
await this.code.dispatchKeybinding(winOrCtrl + '+Alt+n');
await this.code.dispatchKeybinding(this.winOrCtrl + '+Alt+n');
await this.editors.waitForActiveTab(`Notebook-0`);
await this.code.waitForElement('.notebookEditor');
}
@@ -93,7 +93,7 @@ export class Notebook {
private async selectAllText(selector: string): Promise<void> {
await this.code.waitAndClick(selector);
await this.code.dispatchKeybinding(ctrlOrCmd + '+a');
await this.code.dispatchKeybinding(this.ctrlOrCmd + '+a');
}
private static readonly placeholderSelector = 'div.placeholder-cell-component';