From 5e4f78d927b99a05057ed7dea12914ac8d0eae6c Mon Sep 17 00:00:00 2001 From: qwas Date: Mon, 28 Jul 2025 23:18:39 +0800 Subject: [PATCH 1/8] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0Cypress=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E5=90=AF=E5=8A=A8=E5=91=BD=E4=BB=A4=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=9E=84=E5=BB=BA=E5=92=8C=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 792d481..ea7bbdd 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -49,7 +49,7 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} with: - start: npm run dev + start: run run build && npm run start wait-on: http://localhost:3000 wait-on-timeout: 120 # 让测试继续运行,不影响上传步骤 From 5d4ee472ec4e29d1ad82665ef00c255b38a2c3a6 Mon Sep 17 00:00:00 2001 From: qwas Date: Mon, 28 Jul 2025 23:27:48 +0800 Subject: [PATCH 2/8] fix: typo fix --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index ea7bbdd..de41d64 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -49,7 +49,7 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} with: - start: run run build && npm run start + start: pnpm run build && pnpm run start wait-on: http://localhost:3000 wait-on-timeout: 120 # 让测试继续运行,不影响上传步骤 From bda2d99d4cea7ce23dbf995852d9437baa0b6233 Mon Sep 17 00:00:00 2001 From: qwas Date: Mon, 28 Jul 2025 23:42:59 +0800 Subject: [PATCH 3/8] fix: fix server command --- .github/workflows/e2e-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index de41d64..5067a97 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -49,7 +49,7 @@ jobs: env: DATABASE_URL: ${{ secrets.DATABASE_URL }} with: - start: pnpm run build && pnpm run start + start: pnpm run build, pnpm run start wait-on: http://localhost:3000 wait-on-timeout: 120 # 让测试继续运行,不影响上传步骤 From 7257e12fcfe6ee34ee196af6352fe9ac5615b800 Mon Sep 17 00:00:00 2001 From: qwas Date: Tue, 29 Jul 2025 00:04:43 +0800 Subject: [PATCH 4/8] =?UTF-8?q?test:=20=E5=A4=84=E7=90=86e2e=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 5067a97..ca8c252 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -22,11 +22,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Install Node.js uses: actions/setup-node@v4 with: @@ -34,6 +29,11 @@ jobs: cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Install Dependencies run: pnpm install @@ -43,13 +43,16 @@ jobs: - name: Cypress Info run: pnpm exec cypress info - - name: Run Cypress tests + - name: Build App + run: pnpm run build + + - name: Run Cypress E2E tests id: run-cypress uses: cypress-io/github-action@v6 env: DATABASE_URL: ${{ secrets.DATABASE_URL }} with: - start: pnpm run build, pnpm run start + start: pnpm run start wait-on: http://localhost:3000 wait-on-timeout: 120 # 让测试继续运行,不影响上传步骤 @@ -76,4 +79,4 @@ jobs: exit 1 else echo "✅ Cypress tests passed" - fi + fi \ No newline at end of file From 7ad947c98da033f888f513b0a2b65604216af6bc Mon Sep 17 00:00:00 2001 From: qwas Date: Tue, 29 Jul 2025 00:06:58 +0800 Subject: [PATCH 5/8] =?UTF-8?q?test:=20=E5=A4=84=E7=90=86=20e2e=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index ca8c252..eebdc18 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -55,7 +55,6 @@ jobs: start: pnpm run start wait-on: http://localhost:3000 wait-on-timeout: 120 - # 让测试继续运行,不影响上传步骤 continue-on-error: true - name: Upload screenshots @@ -79,4 +78,4 @@ jobs: exit 1 else echo "✅ Cypress tests passed" - fi \ No newline at end of file + fi From 24037d4c2ae2e4439a486f83b679167107da5859 Mon Sep 17 00:00:00 2001 From: qwas Date: Tue, 29 Jul 2025 00:15:09 +0800 Subject: [PATCH 6/8] =?UTF-8?q?test:=20=E5=A4=84=E7=90=86=20e2e=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index eebdc18..e47f01b 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -22,6 +22,13 @@ jobs: - name: Checkout uses: actions/checkout@v4 + # 先装 pnpm, 再装 node,文档示例就是这样写的 + # https://github.com/pnpm/action-setup?tab=readme-ov-file#use-cache-to-reduce-installation-time + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + - name: Install Node.js uses: actions/setup-node@v4 with: @@ -29,11 +36,6 @@ jobs: cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10 - - name: Install Dependencies run: pnpm install From f9f8c36c09df07875df532fa8d7fcdf5e6b42963 Mon Sep 17 00:00:00 2001 From: qwas Date: Tue, 29 Jul 2025 00:17:58 +0800 Subject: [PATCH 7/8] =?UTF-8?q?test:=20=E5=A4=84=E7=90=86=20e2e=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index e47f01b..40c67d4 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -46,6 +46,8 @@ jobs: run: pnpm exec cypress info - name: Build App + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} run: pnpm run build - name: Run Cypress E2E tests From d21598f4a90d98d72229902f71b07c49e592b256 Mon Sep 17 00:00:00 2001 From: qwas Date: Tue, 29 Jul 2025 00:24:36 +0800 Subject: [PATCH 8/8] =?UTF-8?q?test:=20=E4=BD=BF=E7=94=A8=20chrome=20?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/e2e-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 40c67d4..2e2d5df 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -59,6 +59,8 @@ jobs: start: pnpm run start wait-on: http://localhost:3000 wait-on-timeout: 120 + browser: chrome + headed: true continue-on-error: true - name: Upload screenshots