-
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.
* wip * env setting * revert webServer setting * fix: login logic * fix: install only chromium * fix: extend timeout * fix * fix * fix: get report * fix path * fix * fix * fix * fix * test * test * fix * fix: pass secrets * fix: e2e tests * ci: setup e2e workflow cron * test * Revert "test" This reverts commit 8fab00a. * fix: job name * fix: use cache * rename * test * Update .github/workflows/e2e_web.yml Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Revert "test" This reverts commit 35acab6. --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
2943e6f
commit 6253e15
Showing
18 changed files
with
156 additions
and
150 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,51 @@ | ||
name: Web E2E test | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 3 * * 1-5" | ||
jobs: | ||
e2e: | ||
name: playwright | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: web | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
cache-dependency-path: "**/yarn.lock" | ||
- name: Install dependencies | ||
run: yarn install | ||
- name: Get installed Playwright version | ||
id: playwright-version | ||
run: echo "version=$( node -e "console.log(require('@playwright/test/package.json').version)" )" >> $GITHUB_OUTPUT | ||
- name: Cache Playwright browsers | ||
id: playwright-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/ms-playwright | ||
key: "${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}" | ||
restore-keys: | | ||
${{ runner.os }}-playwright- | ||
- name: Install Playwright system dependencies and browsers | ||
if: steps.playwright-cache.outputs.cache-hit != 'true' | ||
run: yarn playwright install --with-deps chromium | ||
- name: Install Playwright system dependencies | ||
if: steps.playwright-cache.outputs.cache-hit == 'true' | ||
run: yarn playwright install-deps chromium | ||
- name: Run Playwright tests | ||
run: yarn e2e | ||
env: | ||
REEARTH_CMS_API: https://api.cms.test.reearth.dev/api | ||
REEARTH_CMS_E2E_BASEURL: https://cms.test.reearth.dev | ||
REEARTH_CMS_E2E_USERNAME: ${{ secrets.REEARTH_WEB_E2E_USERNAME }} | ||
REEARTH_CMS_E2E_PASSWORD: ${{ secrets.REEARTH_WEB_E2E_PASSWORD }} | ||
- uses: actions/upload-artifact@v4 | ||
if: failure() | ||
with: | ||
name: test-results | ||
path: web/test-results/ | ||
retention-days: 7 |
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 |
---|---|---|
|
@@ -57,3 +57,4 @@ amplifytools.xcconfig | |
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
/e2e/utils/.auth |
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,21 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
import { baseURL, authFile } from "../playwright.config"; | ||
|
||
import { config } from "./utils/config"; | ||
|
||
const { userName, password } = config; | ||
|
||
test("authenticate", async ({ page }) => { | ||
expect(userName).toBeTruthy(); | ||
expect(password).toBeTruthy(); | ||
await page.goto(baseURL); | ||
await page.getByPlaceholder("username/email").fill(userName as string); | ||
await page.getByPlaceholder("your password").fill(password as string); | ||
await page.getByText("LOG IN").click(); | ||
await page.waitForURL(baseURL); | ||
await expect(page.getByRole("button", { name: "New Project" }).first()).toBeVisible({ | ||
timeout: 10 * 1000, | ||
}); | ||
await page.context().storageState({ path: authFile }); | ||
}); |
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
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
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
Oops, something went wrong.