Skip to content

Commit 1813969

Browse files
committed
ci: refactored end-to-end workflow
1 parent 9614658 commit 1813969

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

.github/workflows/end-to-end-tests.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66
- push
77
- workflow_call
88
jobs:
9-
test-suites:
9+
web-component-suites:
10+
name: Web-Component tests and utilities verification
1011
runs-on: ubuntu-latest
1112
# Stop the occasional rogue instance before the 6h GitHub limit
1213
timeout-minutes: 15
@@ -22,10 +23,6 @@ jobs:
2223
- name: Install everything
2324
run: npm install
2425

25-
- name: Ng test for studio-web
26-
run: |
27-
npx nx build web-component
28-
npx nx test:once studio-web
2926
- name: Cypress run for web-component
3027
uses: cypress-io/github-action@v6
3128
with:
@@ -54,15 +51,15 @@ jobs:
5451
npx nx bundle web-component
5552
git status
5653
git diff --word-diff=porcelain --word-diff-regex=... --color | perl -ple 's/^(\x1b[^ -+]{0,6})? (.{81,})$/$1 . " " . substr($2, 0, 40) . " [... " . (length($2)-80) . " bytes ...] " . substr($2, -40)/ex'
57-
playwright-tests:
58-
name: Run Playwright test-suites
54+
studio-e2e-tests:
55+
name: Studio Web test-suites
5956
timeout-minutes: 60
6057
runs-on: ubuntu-latest
6158
strategy:
6259
fail-fast: false
6360
matrix:
64-
shardIndex: [1, 2, 3, 4]
65-
shardTotal: [4]
61+
shardIndex: [1, 2, 3]
62+
shardTotal: [3]
6663
steps:
6764
- uses: actions/checkout@v4
6865
- uses: actions/setup-node@v4
@@ -80,14 +77,18 @@ jobs:
8077
run: npm install
8178
- name: Install dependencies
8279
run: npm ci
80+
- name: Ng test for studio-web
81+
run: |
82+
npx nx build web-component
83+
npx nx test:once studio-web
8384
- name: Run studio-web in the background
8485
run: |
8586
npx nx build web-component
8687
npx nx run-many --targets=serve,serve-fr,serve-es --projects=web-component,studio-web --parallel 6 &
8788
8889
# wait for the studio web to be up
89-
sleep 100
90-
curl --retry 20 --retry-delay 30 --retry-all-errors http://localhost:4200
90+
sleep 50
91+
curl --retry 20 --retry-delay 10 --retry-all-errors http://localhost:4200 > /dev/null
9192
- name: Run Playwright tests for studio-web
9293
run: |
9394
npx playwright install --with-deps chromium
@@ -102,8 +103,8 @@ jobs:
102103
merge-reports:
103104
# Merge reports after playwright-tests, even if some shards have failed
104105
if: ${{ !cancelled() }}
105-
needs: [playwright-tests]
106-
name: "Merge playwright reports"
106+
needs: [studio-e2e-tests]
107+
name: "Merge playwright reports from studio-web end-to-end tests"
107108
runs-on: ubuntu-latest
108109
steps:
109110
- uses: actions/checkout@v4
@@ -123,10 +124,10 @@ jobs:
123124
pattern: blob-report-*
124125
merge-multiple: true
125126

126-
- name: Merge into HTML Report
127+
- name: Merge into a single HTML Report
127128
run: npx playwright merge-reports --reporter=html,github ./all-blob-reports
128129

129-
- name: Upload HTML report
130+
- name: Upload single HTML report
130131
uses: actions/upload-artifact@v4
131132
with:
132133
name: html-report--attempt-${{ github.run_attempt }}

packages/studio-web/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default defineConfig({
2121
/* Retry on CI only */
2222
retries: process.env.CI ? 2 : 3,
2323
/* Opt out of parallel tests on CI. */
24-
workers: process.env.CI ? 1 : 2,
24+
workers: process.env.CI ? 4 : undefined,
2525
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
2626
reporter: process.env.CI ? [["blob", { open: "never" }]] : "html",
2727
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

packages/studio-web/tests/editor/use-audio-toolbar.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ test("should edit alignment and words (editor)", async ({ page, isMobile }) => {
1212
//first handle
1313
const handle = await page.getByTitle("-1.070").locator("handle").first();
1414
await handle.scrollIntoViewIfNeeded();
15+
await page.mouse.wheel(0, 50);
16+
1517
const segment = await page.getByTitle("0.840-1.070");
1618
await segment.click();
1719
await page.locator("#wavesurferContainer").hover();
1820
if (isMobile) {
21+
console.log("scrolling for mobile");
1922
await page.mouse.wheel(-130, 0);
2023
}
21-
24+
await expect(handle, "handle bar should be in view").toBeVisible();
2225
const segBoxPreChange = await segment.boundingBox();
2326
//move the handle to the left to about 0.5
2427
await handle.hover();

0 commit comments

Comments
 (0)