mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-29 17:06:58 +00:00
9926fd97a2
* Changes to publish pane * fixed format errors * fixed failing test * added test explorer changes for mongo accounts * added log for test * fixed lit errors * added secrets to ci.yml file * fixed failing self serve test
50 lines
2.1 KiB
TypeScript
50 lines
2.1 KiB
TypeScript
import { Frame } from "puppeteer";
|
|
import { TestExplorerParams } from "../testExplorer/TestExplorerParams";
|
|
import { getTestExplorerFrame } from "../testExplorer/TestExplorerUtils";
|
|
import { SelfServeType } from "../../src/SelfServe/SelfServeUtils";
|
|
import { ApiKind } from "../../src/Contracts/DataModels";
|
|
|
|
jest.setTimeout(300000);
|
|
|
|
let frame: Frame;
|
|
describe("Self Serve", () => {
|
|
it("Launch Self Serve Example", async () => {
|
|
try {
|
|
frame = await getTestExplorerFrame(
|
|
ApiKind.SQL,
|
|
new Map<string, string>([[TestExplorerParams.selfServeType, SelfServeType.example]])
|
|
);
|
|
|
|
// wait for refresh RP call to end
|
|
await frame.waitFor(10000);
|
|
|
|
// id of the display element is in the format {PROPERTY_NAME}-{DISPLAY_NAME}-{DISPLAY_TYPE}
|
|
await frame.waitForSelector("#description-text-display");
|
|
|
|
const regions = await frame.waitForSelector("#regions-dropdown-input");
|
|
let disabledLoggingToggle = await frame.$$("#enableLogging-toggle-input[disabled]");
|
|
expect(disabledLoggingToggle).toHaveLength(0);
|
|
await regions.click();
|
|
const regionsDropdownElement1 = await frame.waitForSelector("#regions-dropdown-input-list0");
|
|
await regionsDropdownElement1.click();
|
|
disabledLoggingToggle = await frame.$$("#enableLogging-toggle-input[disabled]");
|
|
expect(disabledLoggingToggle).toHaveLength(1);
|
|
|
|
await frame.waitForSelector("#accountName-textField-input");
|
|
|
|
const enableDbLevelThroughput = await frame.waitForSelector("#enableDbLevelThroughput-toggle-input");
|
|
const dbThroughput = await frame.$$("#dbThroughput-slider-input");
|
|
expect(dbThroughput).toHaveLength(0);
|
|
await enableDbLevelThroughput.click();
|
|
await frame.waitForSelector("#dbThroughput-slider-input");
|
|
|
|
await frame.waitForSelector("#collectionThroughput-spinner-input");
|
|
} catch (error) {
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
const testName = (expect as any).getState().currentTestName;
|
|
await page.screenshot({ path: `Test Failed ${testName}.jpg` });
|
|
throw error;
|
|
}
|
|
});
|
|
});
|