mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-23 20:48:11 +00:00
added logging statements
This commit is contained in:
parent
d7a077c558
commit
543c876430
@ -46,7 +46,7 @@ const getDatabaseAccount = async (
|
|||||||
notebooksAccountName: string
|
notebooksAccountName: string
|
||||||
): Promise<DatabaseAccountsGetResponse> => {
|
): Promise<DatabaseAccountsGetResponse> => {
|
||||||
const client = new CosmosDBManagementClient(new CustomSigner(token), notebooksAccountSubscriptonId);
|
const client = new CosmosDBManagementClient(new CustomSigner(token), notebooksAccountSubscriptonId);
|
||||||
return await client.databaseAccounts.get(notebooksAccountResourceGroup, notebooksAccountName);
|
return client.databaseAccounts.get(notebooksAccountResourceGroup, notebooksAccountName);
|
||||||
};
|
};
|
||||||
|
|
||||||
const sendMessageToExplorerFrame = (data: unknown): void => {
|
const sendMessageToExplorerFrame = (data: unknown): void => {
|
||||||
@ -100,6 +100,8 @@ const initTestExplorer = async (): Promise<void> => {
|
|||||||
portalRunnerDatabaseAccount
|
portalRunnerDatabaseAccount
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log("token:" + token)
|
||||||
|
console.log("db:" + databaseAccount)
|
||||||
const initTestExplorerContent = {
|
const initTestExplorerContent = {
|
||||||
type: MessageTypes.InitTestExplorer,
|
type: MessageTypes.InitTestExplorer,
|
||||||
inputs: {
|
inputs: {
|
||||||
|
@ -10,29 +10,25 @@ let frame: Frame;
|
|||||||
let uploadedNotebookNode: ElementHandle<Element>;
|
let uploadedNotebookNode: ElementHandle<Element>;
|
||||||
|
|
||||||
describe("Notebook UI tests", () => {
|
describe("Notebook UI tests", () => {
|
||||||
beforeAll(async () => {
|
|
||||||
frame = await getTestExplorerFrame();
|
|
||||||
const uploadNotebookPath = path.join(__dirname, "testNotebooks", notebookName);
|
|
||||||
await uploadNotebook(frame, uploadNotebookPath);
|
|
||||||
uploadedNotebookNode = await getNotebookNode(frame, notebookName);
|
|
||||||
});
|
|
||||||
|
|
||||||
afterAll(async () => {
|
|
||||||
await deleteNotebook(frame, uploadedNotebookNode);
|
|
||||||
const deletedNotebookNode = await getNotebookNode(frame, notebookName);
|
|
||||||
if (deletedNotebookNode) {
|
|
||||||
throw new Error(`Deletion of notebook ${notebookName} failed`);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
it("Upload, Open and Delete Notebook", async () => {
|
it("Upload, Open and Delete Notebook", async () => {
|
||||||
try {
|
try {
|
||||||
|
frame = await getTestExplorerFrame();
|
||||||
|
const uploadNotebookPath = path.join(__dirname, "testNotebooks", notebookName);
|
||||||
|
await uploadNotebook(frame, uploadNotebookPath);
|
||||||
|
uploadedNotebookNode = await getNotebookNode(frame, notebookName);
|
||||||
|
|
||||||
await uploadedNotebookNode.click();
|
await uploadedNotebookNode.click();
|
||||||
await frame.waitForSelector(".tabNavText");
|
await frame.waitForSelector(".tabNavText");
|
||||||
const tabTitle = await frame.$eval(".tabNavText", element => element.textContent);
|
const tabTitle = await frame.$eval(".tabNavText", element => element.textContent);
|
||||||
expect(tabTitle).toEqual(notebookName);
|
expect(tabTitle).toEqual(notebookName);
|
||||||
const closeIcon = await frame.waitForSelector(".close-Icon");
|
const closeIcon = await frame.waitForSelector(".close-Icon");
|
||||||
await closeIcon.click();
|
await closeIcon.click();
|
||||||
|
|
||||||
|
await deleteNotebook(frame, uploadedNotebookNode);
|
||||||
|
const deletedNotebookNode = await getNotebookNode(frame, notebookName);
|
||||||
|
if (deletedNotebookNode) {
|
||||||
|
throw new Error(`Deletion of notebook ${notebookName} failed`);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const testName = (expect as any).getState().currentTestName;
|
const testName = (expect as any).getState().currentTestName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user