-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { test, expect } from "@playwright/test" | ||
|
||
let privateKey = null | ||
let publicKey = null | ||
|
||
// run tests one after another | ||
test.describe.configure({ mode: "serial" }) | ||
|
||
test("regenerate api keys", async ({ page }) => { | ||
await page.goto("/settings") | ||
|
||
publicKey = await page.getByTestId("private-key").textContent() | ||
|
||
const firstPrivateKey = await page.getByTestId("private-key").textContent() | ||
|
||
// expect to not be empty string | ||
expect(firstPrivateKey).not.toEqual("") | ||
|
||
await page.getByTestId("regenerate-private-key-button").click() | ||
|
||
const secondPrivateKey = await page.getByTestId("private-key").textContent() | ||
|
||
console.log({ firstPrivateKey, secondPrivateKey }) | ||
|
||
expect(firstPrivateKey).not.toEqual(secondPrivateKey) | ||
Check failure on line 25 in e2e/api.spec.ts GitHub Actions / run-tests[chromium] › api.spec.ts:9:5 › regenerate api keys
Check failure on line 25 in e2e/api.spec.ts GitHub Actions / run-tests[chromium] › api.spec.ts:9:5 › regenerate api keys
Check failure on line 25 in e2e/api.spec.ts GitHub Actions / run-tests[chromium] › api.spec.ts:9:5 › regenerate api keys
|
||
|
||
privateKey = secondPrivateKey | ||
}) | ||
|
||
test("private api /logs", async ({ page }) => { | ||
// Test API query | ||
|
||
const res = await fetch(process.env.API_URL + "/api/v1/runs", { | ||
method: "POST", | ||
headers: { | ||
"X-API-Key": privateKey!, | ||
}, | ||
}) | ||
|
||
const json = await res.json() | ||
|
||
expect(json).toEqual([]) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters