diff --git a/extensions/integration-tests/src/objectExplorer.test.ts b/extensions/integration-tests/src/objectExplorer.test.ts index b3c6867e9f..c81f2f5999 100644 --- a/extensions/integration-tests/src/objectExplorer.test.ts +++ b/extensions/integration-tests/src/objectExplorer.test.ts @@ -42,7 +42,7 @@ class ObjectExplorerTester { @stressify({ dop: ObjectExplorerTester.ParallelCount }) async bdcNodeLabelTest(): Promise { const expectedNodeLabel = ['Databases', 'Security', 'Server Objects', 'Data Services']; - let server = await getBdcServer(); + const server = await getBdcServer(); await this.verifyOeNode(server, 6000, expectedNodeLabel); } @@ -50,7 +50,7 @@ class ObjectExplorerTester { async standaloneNodeLabelTest(): Promise { if (process.platform === 'win32') { const expectedNodeLabel = ['Databases', 'Security', 'Server Objects']; - let server = await getStandaloneServer(); + const server = await getStandaloneServer(); await this.verifyOeNode(server, 3000, expectedNodeLabel); } } @@ -58,28 +58,22 @@ class ObjectExplorerTester { @stressify({ dop: ObjectExplorerTester.ParallelCount }) async sqlDbNodeLabelTest(): Promise { const expectedNodeLabel = ['Databases', 'Security']; - let server = await getAzureServer(); + const server = await getAzureServer(); await this.verifyOeNode(server, 3000, expectedNodeLabel); } @stressify({ dop: ObjectExplorerTester.ParallelCount }) async sqlDbContextMenuTest(): Promise { - let server = await getAzureServer(); - let expectedActions: string[]; - // Properties comes from the admin-tool-ext-win extension which is for Windows only, so the item won't show up on non-Win32 platforms - if (process.platform === 'win32') { - expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler', 'Properties']; - } - else { - expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler']; - } + const server = await getAzureServer(); + const expectedActions = ['Manage', 'New Query', 'New Notebook', 'Disconnect', 'Delete Connection', 'Refresh', 'Data-tier Application wizard', 'Launch Profiler']; await this.verifyContextMenu(server, expectedActions); } @stressify({ dop: ObjectExplorerTester.ParallelCount }) async standaloneContextMenuTest(): Promise { - let server = await getStandaloneServer(); + const server = await getStandaloneServer(); let expectedActions: string[] = []; + // Generate Scripts and Properties come from the admin-tool-ext-win extension which is for Windows only, so the item won't show up on non-Win32 platforms if (process.platform === 'win32') { expectedActions = ['Manage', 'New Query', 'New Notebook', 'Backup', 'Restore', 'Refresh', 'Data-tier Application wizard', 'Schema Compare', 'Import wizard', 'Generate Scripts...', 'Properties']; } @@ -91,7 +85,7 @@ class ObjectExplorerTester { @stressify({ dop: ObjectExplorerTester.ParallelCount }) async bdcContextMenuTest(): Promise { - let server = await getBdcServer(); + const server = await getBdcServer(); let expectedActions: string[]; // Properties comes from the admin-tool-ext-win extension which is for Windows only, so the item won't show up on non-Win32 platforms if (process.platform === 'win32') { @@ -105,29 +99,29 @@ class ObjectExplorerTester { async verifyContextMenu(server: TestServerProfile, expectedActions: string[]): Promise { await connectToServer(server, 3000); - let nodes = await azdata.objectexplorer.getActiveConnectionNodes(); + const nodes = await azdata.objectexplorer.getActiveConnectionNodes(); assert(nodes.length > 0, `Expecting at least one active connection, actual: ${nodes.length}`); - let index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); + const index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); assert(index !== -1, `Failed to find server: "${server.serverName}" in OE tree`); - let node = nodes[index]; - let actions = await azdata.objectexplorer.getNodeActions(node.connectionId, node.nodePath); + const node = nodes[index]; + const actions = await azdata.objectexplorer.getNodeActions(node.connectionId, node.nodePath); - let expectedString = expectedActions.join(','); + const expectedString = expectedActions.join(','); const actualString = actions.join(','); assert(expectedActions.length === actions.length && expectedString === actualString, `Expected actions: "${expectedString}", Actual actions: "${actualString}"`); } async verifyOeNode(server: TestServerProfile, timeout: number, expectedNodeLabel: string[]): Promise { await connectToServer(server, timeout); - let nodes = await azdata.objectexplorer.getActiveConnectionNodes(); + const nodes = await azdata.objectexplorer.getActiveConnectionNodes(); assert(nodes.length > 0, `Expecting at least one active connection, actual: ${nodes.length}`); - let index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); + const index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); assert(index !== -1, `Failed to find server: "${server.serverName}" in OE tree`); - let actualNodeLabel = []; - let children = await nodes[index].getChildren(); + const actualNodeLabel = []; + const children = await nodes[index].getChildren(); assert(children.length === expectedNodeLabel.length, `Expecting node count: ${expectedNodeLabel.length}, Actual: ${children.length}`); children.forEach(c => actualNodeLabel.push(c.label)); @@ -138,27 +132,27 @@ class ObjectExplorerTester { await connectToServer(server, timeoutinMS); - let nodes = await azdata.objectexplorer.getActiveConnectionNodes(); + const nodes = await azdata.objectexplorer.getActiveConnectionNodes(); assert(nodes.length > 0, `Expecting at least one active connection, actual: ${nodes.length}`); - let index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); + const index = nodes.findIndex(node => node.nodePath.includes(server.serverName)); assert(index !== -1, `Failed to find server: "${server.serverName}" in OE tree`); - let ownerUri = await azdata.connection.getUriForConnection(nodes[index].connectionId); - let dbName: string = 'ads_test_VerifyDBContextMenu_' + new Date().getTime().toString(); + const ownerUri = await azdata.connection.getUriForConnection(nodes[index].connectionId); + const dbName: string = 'ads_test_VerifyDBContextMenu_' + new Date().getTime().toString(); try { await createDB(dbName, ownerUri); - let serverNode = nodes[index]; - let children = await serverNode.getChildren(); + const serverNode = nodes[index]; + const children = await serverNode.getChildren(); assert(children[0].label.toLocaleLowerCase === 'Databases'.toLocaleLowerCase, `Expected Databases node. Actual ${children[0].label}`); - let databasesFolder = children[0]; + const databasesFolder = children[0]; - let databases = await databasesFolder.getChildren(); + const databases = await databasesFolder.getChildren(); assert(databases.length > 2, `No database present, can not test further`); // System Databses folder and at least one database - let actions = await azdata.objectexplorer.getNodeActions(databases[1].connectionId, databases[1].nodePath); + const actions = await azdata.objectexplorer.getNodeActions(databases[1].connectionId, databases[1].nodePath); const expectedString = expectedActions.join(','); const actualString = actions.join(',');