added logging statements

This commit is contained in:
Srinath Narayanan 2020-11-18 12:28:17 -08:00
parent d7a077c558
commit 543c876430
2 changed files with 14 additions and 16 deletions

View File

@ -46,7 +46,7 @@ const getDatabaseAccount = async (
notebooksAccountName: string
): Promise<DatabaseAccountsGetResponse> => {
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 => {
@ -100,6 +100,8 @@ const initTestExplorer = async (): Promise<void> => {
portalRunnerDatabaseAccount
);
console.log("token:" + token)
console.log("db:" + databaseAccount)
const initTestExplorerContent = {
type: MessageTypes.InitTestExplorer,
inputs: {

View File

@ -10,29 +10,25 @@ let frame: Frame;
let uploadedNotebookNode: ElementHandle<Element>;
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 () => {
try {
frame = await getTestExplorerFrame();
const uploadNotebookPath = path.join(__dirname, "testNotebooks", notebookName);
await uploadNotebook(frame, uploadNotebookPath);
uploadedNotebookNode = await getNotebookNode(frame, notebookName);
await uploadedNotebookNode.click();
await frame.waitForSelector(".tabNavText");
const tabTitle = await frame.$eval(".tabNavText", element => element.textContent);
expect(tabTitle).toEqual(notebookName);
const closeIcon = await frame.waitForSelector(".close-Icon");
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) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const testName = (expect as any).getState().currentTestName;