Type-check Playwright E2E tests in CI (#2600)

This commit is contained in:
Vsevolod Kukol
2026-09-30 22:01:09 +02:00
committed by GitHub
parent 0842b1f131
commit 52674c2aa5
6 changed files with 30 additions and 10 deletions
+15
View File
@@ -4,6 +4,21 @@ This directory contains end-to-end tests for Cosmos Data Explorer.
These tests **require** that you either deploy, or have access to, several Cosmos test Accounts.
The tests run in [Playwright](https://playwright.dev/), using the official Playwright test framework.
## Type-checking
After installing dependencies, run this command from the repository root:
```shell
npm run compile:e2e
```
This checks all test TypeScript files and `playwright.config.ts` without emitting files,
starting a browser, or connecting to Azure. It also loads the application declarations
needed by code imported from the tests. CI runs this check in the Compile TypeScript job.
`npm run compile` checks the application, not the E2E suite. Playwright's `--list` option
checks test discovery but does not replace TypeScript type-checking.
## Required Resources
To run all the tests, you need:
+1
View File
@@ -470,6 +470,7 @@ export enum CommandBarButton {
ExecuteQuery = "Execute Query",
UploadItem = "Upload Item",
NewDocument = "New Document",
NewItem = "New Item",
View = "View",
}
+3 -3
View File
@@ -88,7 +88,7 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
let newDocumentId;
await waitForDocumentToLoad(docId);
await retry(async () => {
const newDocumentButton = await explorer.waitForCommandBarButton("New Item", 5000);
const newDocumentButton = await explorer.waitForCommandBarButton(CommandBarButton.NewItem, 5000);
await expect(newDocumentButton).toBeVisible();
await expect(newDocumentButton).toBeEnabled();
await newDocumentButton.click();
@@ -103,7 +103,7 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
};
await documentsTab.resultsEditor.setText(JSON.stringify(newDocument));
const saveButton = await explorer.waitForCommandBarButton("Save", 5000);
const saveButton = await explorer.waitForCommandBarButton(CommandBarButton.Save, 5000);
await saveButton.click({ timeout: 5000 });
await expect(saveButton).toBeHidden({ timeout: 5000 });
}, 3);
@@ -117,7 +117,7 @@ for (const { name, databaseId, containerId, documents } of documentTestCases) {
await newSpan.click();
await waitForDocumentToLoad(newDocumentId);
const deleteButton = await explorer.waitForCommandBarButton("Delete", 5000);
const deleteButton = await explorer.waitForCommandBarButton(CommandBarButton.Delete, 5000);
await deleteButton.click();
const deleteDialogButton = await explorer.waitForDialogButton("Delete", 5000);