mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 09:18:59 +00:00
smoke - add test to verify an editor can be saved
This commit is contained in:
parent
4667cac14b
commit
05de5834b0
|
@ -38,6 +38,39 @@ export function setup(ensureStableCode: () => string | undefined, logger: Logger
|
|||
app = undefined;
|
||||
});
|
||||
|
||||
it('verifies editors can save and restore', async function () {
|
||||
app = await startApp(this.defaultOptions);
|
||||
|
||||
const readmeMd = 'readme.md';
|
||||
const appJs = 'app.js';
|
||||
const textToType = 'Hello, Code';
|
||||
|
||||
// open first editor
|
||||
await app.workbench.quickaccess.openFile(readmeMd);
|
||||
await app.workbench.quickaccess.runCommand('View: Keep Editor');
|
||||
|
||||
// open second editor and type
|
||||
await app.workbench.quickaccess.openFile('app.js');
|
||||
await app.workbench.editor.waitForTypeInEditor(appJs, textToType);
|
||||
await app.workbench.editors.waitForTab(appJs, true);
|
||||
|
||||
// save
|
||||
await app.workbench.editors.saveOpenedFile();
|
||||
await app.workbench.editors.waitForTab(appJs, false);
|
||||
|
||||
// close editor
|
||||
const waitForEditorClosed = app.workbench.editors.waitForActiveEditor(readmeMd);
|
||||
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
|
||||
await waitForEditorClosed;
|
||||
|
||||
// open editor again and verify contents
|
||||
await app.workbench.quickaccess.openFile(appJs);
|
||||
await app.workbench.editor.waitForEditorContents(appJs, contents => contents.indexOf(textToType) > -1);
|
||||
|
||||
await app.stop();
|
||||
app = undefined;
|
||||
});
|
||||
|
||||
it('verifies that "hot exit" works for dirty files (without delay)', function () {
|
||||
return testHotExit.call(this, undefined);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue