Skip to content

Commit

Permalink
adjust Argos CI workflow & spec
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinLin512 committed Dec 30, 2024
1 parent 82a44a0 commit 2088e69
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/argos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,17 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps --force

- name: Run server
run: npm start > server.log 2>&1 &

- name: Wait for server to start
run: sleep 10

- name: Wait for server readiness
run: |
for i in {1..30}; do
curl -f http://localhost:3000 && break || sleep 2;
done
# - name: Run server
# run: npm start > server.log 2>&1 &
#
# - name: Wait for server to start
# run: sleep 10
#
# - name: Wait for server readiness
# run: |
# for i in {1..30}; do
# curl -f http://localhost:3000 && break || sleep 2;
# done

- name: Run visual tests
run: npm run argos-chrome

- name: Upload screenshots to Argos CI
env:
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
run: npx argos upload
15 changes: 11 additions & 4 deletions tests/example.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { test } from "@playwright/test";
import { argosScreenshot } from "@argos-ci/playwright";

test("screenshot homepage", async ({ page }) => {
await page.goto("http://localhost:3000");
await argosScreenshot(page, "homepage");
});
const pages = [
{ name: "homepage", path: "/" },
{ name: "#", path: "/docs/vue/lifecycle_hooks" },
];

for (const { name, path } of pages) {
test(`Run Argos screenshot on ${name} (${path})`, async ({ page }) => {
await page.goto(path);
await argosScreenshot(page, path);
});
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"plugins": [{ "name": "typescript-plugin-css-modules" }]
"plugins": [{ "name": "typescript-plugin-css-modules" }],
"types": ["@playwright/test"]
}
}

0 comments on commit 2088e69

Please # to comment.