mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-02-23 12:37:25 +00:00
added logging statements
This commit is contained in:
parent
d7a077c558
commit
543c876430
@ -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: {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user