✅ (playwright.config.ts): reduce workers to 1 to opt out of parallel tests on CI
✅ (userSettings.spec.ts): add end-to-end test for interacting with API Keys
This commit is contained in:
parent
ed845f5eb5
commit
c7f6353111
2 changed files with 24 additions and 1 deletions
|
|
@ -21,7 +21,7 @@ export default defineConfig({
|
||||||
/* Retry on CI only */
|
/* Retry on CI only */
|
||||||
retries: process.env.CI ? 2 : 0,
|
retries: process.env.CI ? 2 : 0,
|
||||||
/* Opt out of parallel tests on CI. */
|
/* Opt out of parallel tests on CI. */
|
||||||
workers: 5,
|
workers: 1,
|
||||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||||
timeout: 120 * 1000,
|
timeout: 120 * 1000,
|
||||||
// reporter: [
|
// reporter: [
|
||||||
|
|
|
||||||
|
|
@ -89,3 +89,26 @@ test("should see shortcuts", async ({ page }) => {
|
||||||
await page.getByText("Undo", { exact: true }).isVisible();
|
await page.getByText("Undo", { exact: true }).isVisible();
|
||||||
await page.getByText("Redo", { exact: true }).isVisible();
|
await page.getByText("Redo", { exact: true }).isVisible();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("should interact with API Keys", async ({ page }) => {
|
||||||
|
await page.goto("/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
await page.getByTestId("user-profile-settings").click();
|
||||||
|
await page.getByText("Settings").click();
|
||||||
|
await page.getByText("API Keys").click();
|
||||||
|
await page.getByText("API Keys", { exact: true }).nth(1).isVisible();
|
||||||
|
await page.getByText("Add New").click();
|
||||||
|
await page.getByPlaceholder("Insert a name for your API Key").isVisible();
|
||||||
|
|
||||||
|
const randomName = Math.random().toString(36).substring(2);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.getByPlaceholder("Insert a name for your API Key")
|
||||||
|
.fill(randomName);
|
||||||
|
await page.getByText("Create Secret Key", { exact: true }).click();
|
||||||
|
await page.getByText("Please save").isVisible();
|
||||||
|
await page.getByTestId("icon-Copy").click();
|
||||||
|
await page.waitForTimeout(1000);
|
||||||
|
await page.getByText("Api Key Copied!").isVisible();
|
||||||
|
await page.getByText(randomName).isVisible();
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue