Smoke tests (#9814)

* move

* add inital test; need basic sqllite connection

* before sqlite

* sqlite

* add smoke tests

* working tests

* fix app names

* fix quick open

* fix smoke tests

* add win32 smoke tests

* fix smoke test

* fix win32 smoke

* no continue

* continue on error

* add vscode smokes

* remove vscode tests

* continue on error

* allow sqlite to use relative paths

* add linux smoke tests

* fix build files

* use dispatch instead of select

* fix linux build again

* fix darwin

* get select working

* try and use screen shots

* screen shots

* remove smoke tests linux

* try vscodes sqlite

* fix compile

* fix webpack

* fix deps

* try this again

* try force a rebuild

* try npm rebuild

* add sqlite to be rebuilt

* distro

* try vscode sqlite again

* revert changes to driver and simplify edits

* fix compile

* fix imports

* move sqlite out

* remove unneeded change

* add extensions path

* fix web tests

* no continue on error
This commit is contained in:
Anthony Dresser
2020-04-03 00:01:32 -07:00
committed by GitHub
parent 589de854d5
commit 6e6649d006
33 changed files with 234 additions and 244 deletions

View File

@@ -121,7 +121,7 @@ export async function spawn(options: SpawnOptions): Promise<Code> {
let connectDriver: typeof connectElectronDriver;
if (options.web) {
await launch(options.userDataDir, options.workspacePath, options.codePath);
await launch(options.userDataDir, options.workspacePath, options.extensionsPath, options.codePath);
connectDriver = connectPlaywrightDriver.bind(connectPlaywrightDriver, options.browser);
return connect(connectDriver, child, '', handle, options.logger);
}

View File

@@ -92,7 +92,7 @@ let server: ChildProcess | undefined;
let endpoint: string | undefined;
let workspacePath: string | undefined;
export async function launch(userDataDir: string, _workspacePath: string, codeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH): Promise<void> {
export async function launch(userDataDir: string, _workspacePath: string, extensionsDir: string, codeServerPath = process.env.VSCODE_REMOTE_SERVER_PATH): Promise<void> {
workspacePath = _workspacePath;
const agentFolder = userDataDir;
@@ -110,7 +110,7 @@ export async function launch(userDataDir: string, _workspacePath: string, codeSe
}
server = spawn(
serverLocation,
['--browser', 'none', '--driver', 'web'],
['--browser', 'none', '--driver', 'web', '--extensions-dir', `${extensionsDir}`],
{ env }
);
server.stderr?.on('data', error => console.log(`Server stderr: ${error}`));

View File

@@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Code } from '../code';
export class QueryEditor {
public readonly commandBar: CommandBar;
constructor(code: Code) {
this.commandBar = new CommandBar(code);
}
}
export class CommandBar {
private static readonly COMMAND_BAR_BUTTON = '.query-editor .carbon-taskbar ul>:nth-child(${INDEX})';
constructor(private code: Code) { }
public async clickButton(index: number): Promise<void> {
await this.code.waitAndClick(CommandBar.COMMAND_BAR_BUTTON.replace('${INDEX}', '' + index));
}
public async waitForButton(index: number, label: string): Promise<void> {
await this.code.waitForTextContent(CommandBar.COMMAND_BAR_BUTTON.replace('${INDEX}', '' + index), label);
}
}

View File

@@ -24,6 +24,7 @@ import { Terminal } from './terminal';
import { ConnectionDialog } from './sql/connectionDialog';
import { Profiler } from './sql/profiler';
import { QueryEditors } from './sql/queryEditors';
import { QueryEditor } from './sql/queryEditor';
// {{END}}
export interface Commands {
@@ -52,6 +53,7 @@ export class Workbench {
readonly connectionDialog: ConnectionDialog;
readonly profiler: Profiler;
readonly queryEditors: QueryEditors;
readonly queryEditor: QueryEditor;
// {{END}}
constructor(code: Code, userDataPath: string) {
@@ -74,6 +76,7 @@ export class Workbench {
this.connectionDialog = new ConnectionDialog(code);
this.profiler = new Profiler(code, this.quickaccess);
this.queryEditors = new QueryEditors(code);
this.queryEditor = new QueryEditor(code);
// {{END}}
}
}