mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-05 18:47:41 +00:00
refresh databases in test instead of product code
This commit is contained in:
@@ -598,18 +598,10 @@ export default class Collection implements ViewModels.Collection {
|
|||||||
public onSettingsClick = async (): Promise<void> => {
|
public onSettingsClick = async (): Promise<void> => {
|
||||||
useSelectedNode.getState().setSelectedNode(this);
|
useSelectedNode.getState().setSelectedNode(this);
|
||||||
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
|
const throughputCap = userContext.databaseAccount?.properties.capacity?.totalThroughputLimit;
|
||||||
await this.container.onRefreshResourcesClick();
|
// // Refresh all databases in case they were deleted outside of user session
|
||||||
|
// await this.container.onRefreshResourcesClick();
|
||||||
|
|
||||||
throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await this.loadOffer();
|
throughputCap && throughputCap !== -1 ? await useDatabases.getState().loadAllOffers() : await this.loadOffer();
|
||||||
// if (throughputCap && throughputCap !== -1) {
|
|
||||||
// try {
|
|
||||||
// await useDatabases.getState().loadAllOffers();
|
|
||||||
// } catch {
|
|
||||||
// console.log("Fail quietly");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// await this.loadOffer();
|
|
||||||
// }
|
|
||||||
this.selectedSubnodeKind(ViewModels.CollectionTabKind.Settings);
|
this.selectedSubnodeKind(ViewModels.CollectionTabKind.Settings);
|
||||||
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.SelectItem, ActionModifiers.Mark, {
|
||||||
description: "Settings node",
|
description: "Settings node",
|
||||||
|
|||||||
12
test/fx.ts
12
test/fx.ts
@@ -460,12 +460,12 @@ export class DataExplorer {
|
|||||||
const containerNode = await this.waitForContainerNode(context.database.id, context.container.id);
|
const containerNode = await this.waitForContainerNode(context.database.id, context.container.id);
|
||||||
await containerNode.expand();
|
await containerNode.expand();
|
||||||
|
|
||||||
// // refresh tree to remove deleted database
|
// refresh tree to remove deleted database
|
||||||
// const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton");
|
const refreshButton = this.frame.getByTestId("Sidebar/RefreshButton");
|
||||||
// await refreshButton.click();
|
await refreshButton.click();
|
||||||
// await expect(this.getConsoleMessage()).toContainText("Successfully refreshed databases", {
|
await expect(this.getConsoleMessage()).toContainText("Successfully refreshed databases", {
|
||||||
// timeout: ONE_MINUTE_MS,
|
timeout: ONE_MINUTE_MS,
|
||||||
// });
|
});
|
||||||
|
|
||||||
const scaleAndSettingsButton = this.frame.getByTestId(
|
const scaleAndSettingsButton = this.frame.getByTestId(
|
||||||
`TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`,
|
`TreeNode:${context.database.id}/${context.container.id}/Scale & Settings`,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect, Page, test } from "@playwright/test";
|
import { expect, Page, test } from "@playwright/test";
|
||||||
import { DataExplorer, ONE_MINUTE_MS, TestAccount } from "../../fx";
|
import { DataExplorer, TestAccount } from "../../fx";
|
||||||
import { createTestSQLContainer, TestContainerContext } from "../../testData";
|
import { createTestSQLContainer, TestContainerContext } from "../../testData";
|
||||||
|
|
||||||
test.describe("Change Partition Key", () => {
|
test.describe("Change Partition Key", () => {
|
||||||
@@ -62,7 +62,7 @@ test.describe("Change Partition Key", () => {
|
|||||||
await changePkPanel.getByTestId("Panel/OkButton").click();
|
await changePkPanel.getByTestId("Panel/OkButton").click();
|
||||||
|
|
||||||
await pageInstance.waitForLoadState("networkidle");
|
await pageInstance.waitForLoadState("networkidle");
|
||||||
await expect(changePkPanel).not.toBeVisible({ timeout: 5 * ONE_MINUTE_MS });
|
await expect(changePkPanel).not.toBeVisible({ timeout: 60 * 1000 });
|
||||||
|
|
||||||
// Verify partition key change job
|
// Verify partition key change job
|
||||||
const jobText = explorer.frame.getByText(/Partition key change job/);
|
const jobText = explorer.frame.getByText(/Partition key change job/);
|
||||||
|
|||||||
@@ -13,8 +13,11 @@ test.describe("Autoscale and Manual throughput", () => {
|
|||||||
let context: TestContainerContext = null!;
|
let context: TestContainerContext = null!;
|
||||||
let explorer: DataExplorer = null!;
|
let explorer: DataExplorer = null!;
|
||||||
|
|
||||||
test.beforeEach("Create Test Database & Open container settings", async ({ page }) => {
|
test.beforeAll("Create Test Database", async () => {
|
||||||
context = await createTestSQLContainer();
|
context = await createTestSQLContainer();
|
||||||
|
});
|
||||||
|
|
||||||
|
test.beforeEach("Open container settings", async ({ page }) => {
|
||||||
explorer = await DataExplorer.open(page, TestAccount.SQL);
|
explorer = await DataExplorer.open(page, TestAccount.SQL);
|
||||||
|
|
||||||
// Click Scale & Settings and open Scale tab
|
// Click Scale & Settings and open Scale tab
|
||||||
@@ -23,7 +26,7 @@ test.describe("Autoscale and Manual throughput", () => {
|
|||||||
await scaleTab.click();
|
await scaleTab.click();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach("Delete Test Database", async () => {
|
test.afterAll("Delete Test Database", async () => {
|
||||||
await context?.dispose();
|
await context?.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user