This commit is contained in:
Ibrahima G. Coulibaly 2024-06-28 16:25:24 +01:00
commit 7bd8e4a349
3 changed files with 23 additions and 13 deletions

View file

@ -9,7 +9,7 @@ on:
- main - main
jobs: jobs:
build-and-test: test-and-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
@ -29,7 +29,7 @@ jobs:
- name: Build project - name: Build project
run: npm run build run: npm run build
playwright: e2e-test:
name: 'Playwright Tests' name: 'Playwright Tests'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -42,7 +42,7 @@ jobs:
- name: Install Playwright Browsers - name: Install Playwright Browsers
run: npx playwright install --with-deps run: npx playwright install --with-deps
- name: Run Playwright tests - name: Run Playwright tests
run: npm run test:e2e:run run: npx playwright test
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
with: with:
@ -51,7 +51,9 @@ jobs:
retention-days: 30 retention-days: 30
deploy: deploy:
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
needs: build-and-test needs:
- test-and-build
- playwright
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code

20
.idea/workspace.xml generated
View file

@ -5,7 +5,9 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="ci: run e2e tests"> <list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="ci: run e2e tests">
<change beforePath="$PROJECT_DIR$/.github/workflows/ci.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.github/workflows/ci.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/playwright.config.ts" beforeDir="false" afterPath="$PROJECT_DIR$/playwright.config.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -198,14 +200,6 @@
<workItem from="1719492452780" duration="8000" /> <workItem from="1719492452780" duration="8000" />
<workItem from="1719496624579" duration="6148000" /> <workItem from="1719496624579" duration="6148000" />
</task> </task>
<task id="LOCAL-00029" summary="refactor: tool options components">
<option name="closed" value="true" />
<created>1719152057230</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1719152057230</updated>
</task>
<task id="LOCAL-00030" summary="fix: join text service"> <task id="LOCAL-00030" summary="fix: join text service">
<option name="closed" value="true" /> <option name="closed" value="true" />
<created>1719153044395</created> <created>1719153044395</created>
@ -590,7 +584,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1719587132558</updated> <updated>1719587132558</updated>
</task> </task>
<option name="localTasksCounter" value="78" /> <task id="LOCAL-00078" summary="ci: run e2e tests">
<option name="closed" value="true" />
<created>1719587281298</created>
<option name="number" value="00078" />
<option name="presentableId" value="LOCAL-00078" />
<option name="project" value="LOCAL" />
<updated>1719587281298</updated>
</task>
<option name="localTasksCounter" value="79" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">

View file

@ -1,5 +1,7 @@
import { defineConfig, devices } from '@playwright/test'; import { defineConfig, devices } from '@playwright/test';
const baseUrl = process.env.BASE_URL || 'http://localhost:5050';
export default defineConfig({ export default defineConfig({
testDir: './src', testDir: './src',
testMatch: /\.e2e\.(spec\.)?ts$/, testMatch: /\.e2e\.(spec\.)?ts$/,
@ -9,6 +11,10 @@ export default defineConfig({
baseURL: 'http://localhost:5173', baseURL: 'http://localhost:5173',
trace: 'on-first-retry' trace: 'on-first-retry'
}, },
webServer: {
command: 'npm run preview',
url: 'http://localhost:4173'
},
projects: [ projects: [
{ {
name: 'chromium', name: 'chromium',