when disposing of database during playwright test, refresh tree to remove deleted database

This commit is contained in:
Asier Isayas
2025-12-29 17:13:22 -05:00
parent ff5ebda58e
commit 1736e24429
3 changed files with 105 additions and 94 deletions

View File

@@ -5,6 +5,7 @@ import { BulkOperationType, Container, CosmosClient, CosmosClientOptions, Databa
import { AzureIdentityCredentialAdapter } from "@azure/ms-rest-js";
import {
DataExplorer,
generateUniqueName,
getAccountName,
getAzureCLICredentials,
@@ -69,8 +70,14 @@ export class TestContainerContext {
public testData: Map<string, TestItem>,
) {}
async dispose() {
async dispose(explorer: DataExplorer) {
await this.database.delete();
// refresh tree to remove deleted database
if (explorer) {
const refreshButton = explorer.frame.getByTestId("Sidebar/RefreshButton");
await refreshButton.click();
}
}
}