mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-18 10:17:16 +00:00
* Adds tables test * Include .env var * Adds asElement on again * Add further loading states * Format * Hope to not lose focus * Adds ID to shared key and modifies value of input directly * Fix tables test * Format * Try uploading screenshots * indent * Fixes connection string * Try wildcard upload path * Rebuilds test structure, assertions, dependencies * Wait longer for container create * format
22 lines
822 B
TypeScript
22 lines
822 B
TypeScript
import crypto from "crypto";
|
|
import { Frame } from "puppeteer";
|
|
|
|
export async function login(connectionString: string): Promise<Frame> {
|
|
const prodUrl = "https://localhost:1234/hostedExplorer.html";
|
|
page.goto(prodUrl, { waitUntil: "networkidle2" });
|
|
|
|
// log in with connection string
|
|
const handle = await page.waitForSelector("iframe");
|
|
const frame = await handle.contentFrame();
|
|
await frame.waitFor("div > p.switchConnectTypeText", { visible: true });
|
|
await frame.click("div > p.switchConnectTypeText");
|
|
const connStr = connectionString;
|
|
await frame.type("input[class='inputToken']", connStr);
|
|
await frame.click("input[value='Connect']");
|
|
return frame;
|
|
}
|
|
|
|
export function generateUniqueName(baseName = "", length = 4): string {
|
|
return `${baseName}${crypto.randomBytes(length).toString("hex")}`;
|
|
}
|