mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Add smoke tests for cell toolbar keyboard shortcuts. (#19208)
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user