mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-15 02:48:30 -05:00
Add test for opening existing SQL file and typing text into it (#5816)
* Add test for opening existing SQL file and typing text into it * Clean up * More cleanup, remove unneeded queryEditor and add smoke test scripts * Update comments to be clearer
This commit is contained in:
28
test/smoke/src/sql/queryEditor/queryEditor.test.ts
Normal file
28
test/smoke/src/sql/queryEditor/queryEditor.test.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 '../../application';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
|
||||
export function setup() {
|
||||
describe('Query Editor Test Suite', () => {
|
||||
|
||||
it('Can open and edit existing file', async function () {
|
||||
const testFilePath = path.join(os.tmpdir(), 'QueryEditorSmokeTest.sql');
|
||||
fs.writeFileSync(testFilePath, '');
|
||||
try {
|
||||
const app = this.app as Application;
|
||||
await app.workbench.queryEditors.openFile(testFilePath);
|
||||
const fileBaseName = path.basename(testFilePath);
|
||||
await app.workbench.editor.waitForTypeInEditor(fileBaseName, 'SELECT * FROM sys.tables');
|
||||
}
|
||||
finally {
|
||||
fs.unlinkSync(testFilePath);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user