mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Add Remote Book dialog smoke test (#15932)
* Add Remote Book smoke test * fixes * distro * Try closing toasts (cherry picked from commit fd53c91375f4ba73554c801be3378375b2521d31)
This commit is contained in:
34
test/smoke/src/sql/areas/notebook/addRemoteBook.test.ts
Normal file
34
test/smoke/src/sql/areas/notebook/addRemoteBook.test.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Application } from '../../../../../automation';
|
||||
import { promises as fs } from 'fs';
|
||||
import * as path from 'path';
|
||||
import { assert } from 'console';
|
||||
|
||||
const AddRemoteBookCommand = 'Jupyter Books: Add Remote Jupyter Book';
|
||||
const JUPYTER_BOOK = 'CU';
|
||||
const VERSION = '1.0';
|
||||
const LANGUAGE = 'EN';
|
||||
export function setup() {
|
||||
|
||||
describe('AddRemoteBookDialog', () => {
|
||||
|
||||
it('can open remote book', async function () {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.quickaccess.runCommand(AddRemoteBookCommand);
|
||||
await app.workbench.addRemoteBookDialog.setLocation('GitHub');
|
||||
await app.workbench.addRemoteBookDialog.setRepoUrl('repos/microsoft/tigertoolbox');
|
||||
await app.workbench.addRemoteBookDialog.search();
|
||||
await app.workbench.addRemoteBookDialog.setRelease('SQL Server Big Data Clusters Operational Guide');
|
||||
await app.workbench.addRemoteBookDialog.setJupyterBook(JUPYTER_BOOK);
|
||||
await app.workbench.addRemoteBookDialog.setVersion(VERSION);
|
||||
await app.workbench.addRemoteBookDialog.setLanguage(LANGUAGE);
|
||||
await app.workbench.addRemoteBookDialog.add();
|
||||
const bookExists = await fs.stat(path.join(app.workspacePathOrFolder, `${JUPYTER_BOOK}-${VERSION}-${LANGUAGE}`));
|
||||
assert(!!bookExists, 'Expected book was not created');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -61,6 +61,9 @@ export function setup() {
|
||||
// Try our best to clean up but don't fail the test if we can't
|
||||
}
|
||||
}
|
||||
const app = this.app as Application;
|
||||
// Workaround for error notification trying to read deleted books
|
||||
await app.workbench.notificationToast.closeNotificationToasts();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user