-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1408 from skaut/playwright
Migrated to playwright
- Loading branch information
Showing
46 changed files
with
11,045 additions
and
15,174 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
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 |
---|---|---|
|
@@ -112,6 +112,29 @@ jobs: | |
run: | | ||
npm ci | ||
- name: Get installed Playwright version | ||
id: playwright-version | ||
run: | | ||
echo "version=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" | ||
echo "version=$(node -e "console.log(require('./package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_OUTPUT | ||
- name: Cache playwright binaries | ||
id: playwright-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: "~/.cache/ms-playwright" | ||
key: playwright-binaries-${{ runner.os }}-${{ env.cache-version }}-${{ steps.playwright-version.outputs.version }} | ||
|
||
- name: "Install playwright binaries" | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
run: | | ||
npx playwright install --with-deps | ||
- name: "Install playwright binaries" | ||
if: steps.playwright-cache.outputs.cache-hit == 'true' | ||
run: | | ||
npx playwright install-deps | ||
- name: "Run tests" | ||
run: | | ||
npm run test:frontend | ||
|
@@ -120,3 +143,10 @@ jobs: | |
uses: codecov/[email protected] | ||
with: | ||
flags: frontend | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 |
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 was deleted.
Oops, something went wrong.
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,48 @@ | ||
import { expect, test } from "playwright-test-coverage"; | ||
|
||
import { setup } from "../test-utils/stub-endpoints"; | ||
|
||
test("works with basic configuration", async ({ page }) => { | ||
await page.goto("/"); | ||
const getCalls = await setup(page); | ||
|
||
await page.evaluate(() => { | ||
window._endpointStubs.listSharedDrives = [ | ||
{ | ||
status: "success", | ||
value: { status: "success", response: [] }, | ||
}, | ||
{ | ||
status: "success", | ||
value: { status: "success", response: [] }, | ||
}, | ||
]; | ||
window._endpointStubs.move = [ | ||
{ | ||
status: "success", | ||
value: { status: "success", response: { errors: [] } }, | ||
}, | ||
]; | ||
}); | ||
|
||
await expect( | ||
page.getByText("Shared drive mover", { exact: true }), | ||
).toBeVisible(); | ||
await page.getByText("Continue").click(); | ||
await page.getByText("My Drive").click(); | ||
await page.getByText("Continue").click(); | ||
await page.getByText("My Drive").click(); | ||
await page.getByText("Continue").click(); | ||
await expect( | ||
page.getByText( | ||
'contents of the folder "My Drive" into the folder "My Drive"', | ||
), | ||
).toBeVisible(); | ||
await page.getByText("Move", { exact: true }).click(); | ||
await expect(page.getByText("Done!", { exact: true })).toBeVisible(); | ||
await expect(page.getByText("Successfully moved")).toBeVisible(); | ||
|
||
const moveCalls = getCalls("move"); | ||
expect(moveCalls).toHaveLength(1); | ||
expect(moveCalls[0]).toStrictEqual(["root", "root", true, true, false]); | ||
}); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.