Skip to content

Commit

Permalink
feat: re-introduced sharding, 1 job per playwright project
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanConn committed Aug 3, 2023
1 parent 76c9636 commit fc6844a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/playwright_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ env:

jobs:
e2e_tests:
name: 'Playwright Tests'
runs-on: ubuntu-latest
timeout-minutes: 30
name: 'Playwright Tests - ${{ matrix.project }} - Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project: [chromium, webkit]
shardIndex: [1]
shardTotal: [1]
timeout-minutes: 5
steps:
- name: checkout
uses: actions/checkout@v3
Expand All @@ -49,11 +55,11 @@ jobs:

- name: Run Playwright tests
working-directory: ./laboratory
run: npx playwright test
run: npx playwright test --project=${{ matrix.project }} --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
name: playwright-report-${{ matrix.project }}-shard-${{ matrix.shardIndex }}
path: ./laboratory/playwright-report/
retention-days: 30
retention-days: 7
9 changes: 1 addition & 8 deletions laboratory/.env.local.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# Get your projectId at https://cloud.walletconnect.com
NEXT_PUBLIC_PROJECT_ID=""
NEXT_PUBLIC_SENTRY_DSN="" # OPTIONAL

# E2E test vars (optional)
LOCAL_LABS_URL="http://localhost:3000"
LOCAL_WALLET_URL="http://localhost:3001"

LABS_URL="https://labs.walletconnect.com"
WALLET_URL="https://react-wallet.walletconnect.com/"
NEXT_PUBLIC_SENTRY_DSN="" # OPTIONAL
4 changes: 3 additions & 1 deletion laboratory/tests/shared/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const DEFAULT_SESSION_PARAMS: SessionParams = {

export const LOCAL_LABS_URL = 'http://localhost:3000/with-wagmi/react'
export const LOCAL_WALLET_URL = 'http://localhost:3001'
export const WALLET_URL = 'https://react-wallet.walletconnect.com/'
export const WALLET_URL = process.env.CI
? 'https://react-wallet.walletconnect.com/'
: LOCAL_WALLET_URL
14 changes: 10 additions & 4 deletions laboratory/tests/w3m-wallet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ testMW.describe('W3M using wallet web-example', () => {
}
)

testMW('Should be able to connect', ({ modalPage, walletPage }) => {
expect(modalPage).toBeDefined()
expect(walletPage).toBeDefined()
})
testMW(
'Should be able to connect, then disconnect',
async ({ modalPage, walletPage, modalValidator, walletValidator }) => {
expect(modalPage).toBeDefined()
expect(walletPage).toBeDefined()
await modalPage.disconnect()
await modalValidator.expectDisconnected()
await walletValidator.expectDisconnected()
}
)

testMW(
'Should send disconnect to wallet',
Expand Down

0 comments on commit fc6844a

Please sign in to comment.