|
5 | 5 | order: 4 |
6 | 6 | --- |
7 | 7 |
|
8 | | -import { Aside } from '@astrojs/starlight/components'; |
| 8 | +import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; |
9 | 9 | import { Image } from "astro:assets"; |
10 | 10 | import TestTimeChart from "../../../assets/test-time-chart.png"; |
11 | 11 |
|
|
80 | 80 | - How slow the slowest test is |
81 | 81 | - How performant the app the tests are run against is |
82 | 82 |
|
83 | | -We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like. |
| 83 | +We think that we have the fastest Playwright test runner on the market, but we're really curious to hear what your experience in running Endform versus Playwright in your test suite is like. |
| 84 | + |
| 85 | +## Running in CI |
| 86 | + |
| 87 | +Let's make a CI workflow that runs the tests with Endform. |
| 88 | + |
| 89 | +<Tabs> |
| 90 | + <TabItem label=".github/workflows/e2e-tests.yml"> |
| 91 | +```yaml |
| 92 | +name: Endform tests on main |
| 93 | + |
| 94 | +on: |
| 95 | + repository_dispatch: |
| 96 | + types: |
| 97 | + - 'vercel.deployment.success' |
| 98 | + |
| 99 | +jobs: |
| 100 | + e2e-tests: |
| 101 | + timeout-minutes: 5 |
| 102 | + runs-on: ubuntu-latest |
| 103 | + steps: |
| 104 | + - name: Checkout code |
| 105 | + uses: actions/checkout@v4 |
| 106 | + |
| 107 | + - name: Set up pnpm |
| 108 | + uses: pnpm/action-setup@v4 |
| 109 | + |
| 110 | + - name: Setup Node.js |
| 111 | + uses: actions/setup-node@v4 |
| 112 | + with: |
| 113 | + node-version: lts/* |
| 114 | + cache: 'pnpm' |
| 115 | + |
| 116 | + - name: Install dependencies |
| 117 | + run: pnpm install |
| 118 | + |
| 119 | + - name: Run Playwright tests with Endform |
| 120 | + run: npx endform@latest test |
| 121 | + env: |
| 122 | + ENDFORM_API_KEY: ${{ secrets.ENDFORM_API_KEY }} |
| 123 | +``` |
| 124 | + </TabItem> |
| 125 | +</Tabs> |
| 126 | +
|
| 127 | +Here we used the [`repository_dispatch` event](https://vercel.com/docs/git/vercel-for-github#repository-dispatch-events) to trigger the workflow when the Vercel deployment is successful. |
| 128 | + |
| 129 | +Some other thigns you could try are: |
| 130 | + |
| 131 | +- Just trigger on commits to the main branch |
| 132 | +- Triggering on pull requests |
| 133 | +- Sending a message to a Slack channel when the tests are successful or fail |
0 commit comments