mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
feat: convert thirdparty donation tests to Playwright (#55043)
This commit is contained in:
@@ -142,7 +142,7 @@ jobs:
|
||||
run: |
|
||||
pnpm run start-ci &
|
||||
sleep 10
|
||||
npx playwright test --project=${{ matrix.browsers }}
|
||||
npx playwright test --project=${{ matrix.browsers }} --grep-invert 'third-party-donation.spec.ts'
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
|
||||
@@ -53,17 +53,21 @@ jobs:
|
||||
|
||||
- name: Set freeCodeCamp Environment Variables
|
||||
run: |
|
||||
sed '/STRIPE/d; /PAYPAL/d;' sample.env > .env
|
||||
sed '/STRIPE/d; /PAYPAL/d; /PATREON/d;' sample.env > .env
|
||||
echo 'STRIPE_PUBLIC_KEY=${{ secrets.STRIPE_PUBLIC_KEY }}' >> .env
|
||||
echo 'STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }}' >> .env
|
||||
echo 'PAYPAL_CLIENT_ID=${{ secrets.PAYPAL_CLIENT_ID }}' >> .env
|
||||
echo 'PATREON_CLIENT_ID=${{ secrets.PATREON_CLIENT_ID }}' >> .env
|
||||
|
||||
- name: Install and Build
|
||||
run: |
|
||||
pnpm install
|
||||
pnpm run build
|
||||
- name: Seed Database
|
||||
run: pnpm run seed
|
||||
pnpm run create:shared
|
||||
pnpm run build:curriculum
|
||||
pnpm run build:server
|
||||
|
||||
- name: Seed Database with Certified User
|
||||
run: pnpm run seed:certified-user
|
||||
|
||||
- name: Move serve.json to Public Folder
|
||||
run: cp client-config/serve.json client/public/serve.json
|
||||
|
||||
@@ -71,21 +75,18 @@ jobs:
|
||||
- name: Install pm2
|
||||
run: npm i -g pm2
|
||||
|
||||
# In our cypress config, we default to the cypress/e2e/default directory.
|
||||
# We need to change this to cypress/e2e/ for the specific tests we are running
|
||||
# in this workflow.
|
||||
#
|
||||
- name: Adjust the Cypress Config
|
||||
run: |
|
||||
sed -i 's#cypress/e2e/default/#cypress/e2e/#g' cypress.config.js
|
||||
- name: Install playwright dependencies
|
||||
run: npx playwright install --with-deps
|
||||
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v6
|
||||
- name: Run playwright tests
|
||||
run: |
|
||||
pnpm run start-ci &
|
||||
sleep 10
|
||||
npx playwright test third-party-donation.spec.ts --project=${{ matrix.browsers }}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
record: ${{ env.CYPRESS_RECORD_KEY != 0 }}
|
||||
start: pnpm run start-ci
|
||||
wait-on: http://localhost:8000
|
||||
wait-on-timeout: 1200
|
||||
config: baseUrl=http://localhost:8000
|
||||
browser: chrome
|
||||
spec: 'cypress/e2e/third-party/donate-page.ts'
|
||||
name: playwright-report-${{ matrix.browsers }}
|
||||
path: playwright/reporter
|
||||
retention-days: 30
|
||||
|
||||
Reference in New Issue
Block a user