Skip to content

Commit ccb2a27

Browse files
Add Argos CI snapshot testing for desktop E2E tests (#2010)
* Add Argos CI snapshot testing for desktop E2E tests - Add @argos-ci/cli and @argos-ci/webdriverio dependencies to desktop-e2e - Update test/app.spec.js to capture screenshots using argosScreenshot - Add .gitignore to exclude screenshots folder - Update desktop-e2e-linux action to upload screenshots to Argos CI - Pass ARGOS_TOKEN to the action in desktop_cd.yaml workflow Co-Authored-By: yujonglee <[email protected]> * chore: update lockfile for desktop-e2e Argos deps Co-Authored-By: yujonglee <[email protected]> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 0a2649a commit ccb2a27

File tree

6 files changed

+91
-2
lines changed

6 files changed

+91
-2
lines changed

.github/actions/desktop-e2e-linux/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ inputs:
88
description: Rust target triple for the build
99
required: false
1010
default: x86_64-unknown-linux-gnu
11+
argos_token:
12+
description: Argos CI token for uploading screenshots
13+
required: false
1114
runs:
1215
using: composite
1316
steps:
@@ -33,3 +36,8 @@ runs:
3336
run: pnpm -F desktop-e2e test
3437
env:
3538
APP_BINARY_PATH: ${{ env.APP_BINARY_PATH }}
39+
- name: Upload screenshots to Argos
40+
if: ${{ inputs.argos_token != '' }}
41+
shell: bash
42+
run: pnpm -F desktop-e2e exec argos upload --token ${{ inputs.argos_token }} --build-name desktop screenshots
43+
working-directory: ${{ github.workspace }}/apps/desktop-e2e

.github/workflows/desktop_cd.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ jobs:
231231
with:
232232
channel: ${{ inputs.channel }}
233233
target_triple: x86_64-unknown-linux-gnu
234+
argos_token: ${{ secrets.ARGOS_TOKEN }}
234235
- if: ${{ inputs.channel != 'staging' }}
235236
uses: ./.github/actions/cn_release
236237
with:

apps/desktop-e2e/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Argos screenshots
2+
screenshots/

apps/desktop-e2e/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"test": "wdio run wdio.conf.js"
88
},
99
"devDependencies": {
10+
"@argos-ci/cli": "^3.1.0",
11+
"@argos-ci/webdriverio": "^0.4.0",
1012
"@wdio/cli": "^9.20.1",
1113
"@wdio/local-runner": "^9.20.1",
1214
"@wdio/mocha-framework": "^9.20.1",

apps/desktop-e2e/test/app.spec.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { expect } from "@wdio/globals";
1+
import { argosScreenshot } from "@argos-ci/webdriverio";
2+
import { browser, expect } from "@wdio/globals";
23

34
describe("Hyprnote Desktop App", () => {
45
it("should launch the application", async () => {
@@ -10,4 +11,8 @@ describe("Hyprnote Desktop App", () => {
1011
const windowHandles = await browser.getWindowHandles();
1112
expect(windowHandles.length).toBeGreaterThan(0);
1213
});
14+
15+
it("should capture main window screenshot", async () => {
16+
await argosScreenshot(browser, "main-window");
17+
});
1318
});

pnpm-lock.yaml

Lines changed: 72 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)