re #93070. test for command arguments.
parent
d17550f4a8
commit
5e96337121
|
@ -31,6 +31,11 @@
|
|||
{
|
||||
"command": "vscode-notebook-tests.createNewNotebook",
|
||||
"title": "Create New Notebook"
|
||||
},
|
||||
{
|
||||
"command": "vscode-notebook-tests.debugAction",
|
||||
"title": "Debug Notebook Test Cell Action",
|
||||
"icon": "$(debug)"
|
||||
}
|
||||
],
|
||||
"notebookProvider": [
|
||||
|
@ -63,6 +68,15 @@
|
|||
"text/custom"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"menus": {
|
||||
"notebook/cell/title": [
|
||||
{
|
||||
"command": "vscode-notebook-tests.debugAction",
|
||||
"when": "notebookViewType == notebookSmokeTest",
|
||||
"group": "inline@1"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -93,4 +93,15 @@ export function smokeTestActivate(context: vscode.ExtensionContext): any {
|
|||
return;
|
||||
},
|
||||
}));
|
||||
|
||||
context.subscriptions.push(vscode.commands.registerCommand('vscode-notebook-tests.debugAction', async (cell: vscode.NotebookCell) => {
|
||||
if (cell) {
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
const fullRange = new vscode.Range(0, 0, cell.document.lineCount - 1, cell.document.lineAt(cell.document.lineCount - 1).range.end.character);
|
||||
edit.replace(cell.document.uri, fullRange, 'test');
|
||||
await vscode.workspace.applyEdit(edit);
|
||||
} else {
|
||||
throw new Error('Cell not set correctly');
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
|
|
@ -89,4 +89,8 @@ export class Notebook {
|
|||
async executeActiveCell(): Promise<void> {
|
||||
await this.quickAccess.runCommand('notebook.cell.execute');
|
||||
}
|
||||
|
||||
async executeCellAction(selector: string): Promise<void> {
|
||||
await this.code.waitAndClick(selector);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,5 +62,13 @@ export function setup() {
|
|||
await app.workbench.notebook.focusOutCellOutput();
|
||||
await app.workbench.notebook.waitForActiveCellEditorContents('code()');
|
||||
});
|
||||
|
||||
it('cell action execution', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.notebook.openNotebook();
|
||||
await app.workbench.notebook.insertNotebookCell('code');
|
||||
await app.workbench.notebook.executeCellAction('.notebook-editor .monaco-list-row.focused div.monaco-toolbar .codicon-debug');
|
||||
await app.workbench.notebook.waitForActiveCellEditorContents('test');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue