mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-12 23:47:29 +01:00
debug new document and save document count
This commit is contained in:
+26
-14
@@ -57,25 +57,37 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
|
|||||||
|
|
||||||
await span.click();
|
await span.click();
|
||||||
let newDocumentId;
|
let newDocumentId;
|
||||||
|
let retryCount = 0;
|
||||||
await retry(async () => {
|
await retry(async () => {
|
||||||
const newDocumentButton = await explorer.waitForCommandBarButton(CommandBarButton.NewDocument, 5000);
|
try {
|
||||||
await expect(newDocumentButton).toBeVisible();
|
const newDocumentButton = await explorer.waitForCommandBarButton(CommandBarButton.NewDocument, 5000);
|
||||||
await expect(newDocumentButton).toBeEnabled();
|
await expect(newDocumentButton).toBeVisible();
|
||||||
await newDocumentButton.click();
|
await expect(newDocumentButton).toBeEnabled();
|
||||||
|
await newDocumentButton.click();
|
||||||
|
console.log(`DEBUG: Clicked New Document button - retryCount=${retryCount}`);
|
||||||
|
await expect(documentsTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });
|
||||||
|
|
||||||
await expect(documentsTab.resultsEditor.locator).toBeAttached({ timeout: 60 * 1000 });
|
newDocumentId = `${Date.now().toString()}-delete`;
|
||||||
|
|
||||||
newDocumentId = `${Date.now().toString()}-delete`;
|
const newDocument = {
|
||||||
|
_id: newDocumentId,
|
||||||
|
...setPartitionKeys(partitionKeys || []),
|
||||||
|
};
|
||||||
|
|
||||||
const newDocument = {
|
await documentsTab.resultsEditor.setText(JSON.stringify(newDocument));
|
||||||
_id: newDocumentId,
|
const saveButton = await explorer.waitForCommandBarButton(CommandBarButton.Save, 5000);
|
||||||
...setPartitionKeys(partitionKeys || []),
|
await saveButton.click({ timeout: 5000 });
|
||||||
};
|
console.log(`DEBUG: Clicked Save button - retryCount=${retryCount}`);
|
||||||
|
|
||||||
await documentsTab.resultsEditor.setText(JSON.stringify(newDocument));
|
await expect(saveButton).toBeHidden({ timeout: 5000 });
|
||||||
const saveButton = await explorer.waitForCommandBarButton(CommandBarButton.Save, 5000);
|
} catch (err) {
|
||||||
await saveButton.click({ timeout: 5000 });
|
retryCount++;
|
||||||
await expect(saveButton).toBeHidden({ timeout: 5000 });
|
console.warn(
|
||||||
|
`DEBUG: Attempt ${retryCount} to create new document from ${docId} failed: ${(err as Error).message}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
}, 3);
|
}, 3);
|
||||||
|
|
||||||
await documentsTab.setFilter(`{_id: "${newDocumentId}"}`);
|
await documentsTab.setFilter(`{_id: "${newDocumentId}"}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user