diff --git a/test/fx.ts b/test/fx.ts index 164191a34..7b7742c38 100644 --- a/test/fx.ts +++ b/test/fx.ts @@ -457,6 +457,10 @@ export class DataExplorer { /** Opens the Scale & Settings panel for the specified container */ async openScaleAndSettings(context: TestContainerContext): Promise { + // refresh tree to remove deleted database + const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton"); + await refreshButton.click(); + const containerNode = await this.waitForContainerNode(context.database.id, context.container.id); await containerNode.expand(); diff --git a/test/sql/scaleAndSettings/changePartitionKey.spec.ts b/test/sql/scaleAndSettings/changePartitionKey.spec.ts index 21cd219ac..da9b422ef 100644 --- a/test/sql/scaleAndSettings/changePartitionKey.spec.ts +++ b/test/sql/scaleAndSettings/changePartitionKey.spec.ts @@ -24,7 +24,7 @@ test.describe("Change Partition Key", () => { }); test.afterAll("Delete Test Database", async () => { - await context?.dispose(explorer); + await context?.dispose(); }); test("Change partition key path", async () => { diff --git a/test/sql/scaleAndSettings/scale.spec.ts b/test/sql/scaleAndSettings/scale.spec.ts index 4d0d30ddf..57e3b8008 100644 --- a/test/sql/scaleAndSettings/scale.spec.ts +++ b/test/sql/scaleAndSettings/scale.spec.ts @@ -24,7 +24,7 @@ test.describe("Autoscale and Manual throughput", () => { }); test.afterEach("Delete Test Database", async () => { - await context?.dispose(explorer); + await context?.dispose(); }); test("Update autoscale max throughput", async () => { diff --git a/test/testData.ts b/test/testData.ts index 647f6307b..9cb55caa9 100644 --- a/test/testData.ts +++ b/test/testData.ts @@ -5,13 +5,12 @@ import { BulkOperationType, Container, CosmosClient, CosmosClientOptions, Databa import { AzureIdentityCredentialAdapter } from "@azure/ms-rest-js"; import { - DataExplorer, generateUniqueName, getAccountName, getAzureCLICredentials, resourceGroupName, subscriptionId, - TestAccount, + TestAccount } from "./fx"; export interface TestItem { @@ -70,14 +69,8 @@ export class TestContainerContext { public testData: Map, ) {} - async dispose(explorer: DataExplorer) { + async dispose() { await this.database.delete(); - - // refresh tree to remove deleted database - if (explorer) { - const refreshButton = explorer.frame.getByTestId("Sidebar/RefreshButton"); - await refreshButton.click(); - } } }