Skip to content

Commit 23e0d9c

Browse files
test(e2e): migrate to Playwright (#6888)
* test(e2e): migrate to playwright * revert next-env changes * fix next types * fix ie11 test run * remove firefox tests for next.js --------- Co-authored-by: Haroen Viaene <hello@haroen.me>
1 parent 4e5c126 commit 23e0d9c

42 files changed

Lines changed: 1594 additions & 649 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 98 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,18 @@ workflows:
7676
branches:
7777
only:
7878
- master
79-
- e2e tests:
79+
- e2e tests playwright:
80+
context: fx-libraries
81+
requires:
82+
- examples
83+
filters:
84+
branches:
85+
only:
86+
- master
87+
- e2e tests ie11:
8088
context: fx-libraries
8189
requires:
8290
- examples
83-
matrix:
84-
parameters:
85-
browser: [chrome, firefox, internet explorer]
8691
filters:
8792
branches:
8893
only:
@@ -113,7 +118,7 @@ workflows:
113118
- legacy algoliasearch v3
114119
- legacy algoliasearch v4
115120
- helper docs
116-
- e2e tests
121+
- e2e tests playwright
117122
filters:
118123
branches:
119124
only:
@@ -141,13 +146,14 @@ workflows:
141146
- examples:
142147
requires:
143148
- build
144-
- e2e tests:
149+
- e2e tests playwright:
150+
context: fx-libraries
151+
requires:
152+
- examples
153+
- e2e tests ie11:
145154
context: fx-libraries
146155
requires:
147156
- examples
148-
matrix:
149-
parameters:
150-
browser: [chrome, firefox, internet explorer]
151157
- e2e tests router nextjs:
152158
context: fx-libraries
153159
requires:
@@ -331,13 +337,70 @@ jobs:
331337
paths:
332338
- website/algoliasearch-helper-js
333339

334-
e2e tests:
340+
e2e tests playwright:
341+
<<: *defaults
342+
resource_class: large
343+
steps:
344+
- checkout
345+
- *attach_workspace
346+
- *install_yarn_version
347+
- *restore_yarn_cache
348+
- *run_yarn_install
349+
- run:
350+
name: Install Playwright browsers
351+
command: npx playwright install --with-deps chromium firefox
352+
- run:
353+
name: End-to-end tests (Playwright)
354+
command: yarn run test:e2e:playwright
355+
- store_test_results:
356+
path: tests/e2e/junit/playwright/
357+
- store_artifacts:
358+
path: tests/e2e/playwright/playwright-report/
359+
- slack/notify:
360+
channel: $SLACK_E2E_NOTIF_CHANNEL
361+
event: fail
362+
custom: |
363+
{
364+
"blocks": [
365+
{
366+
"type": "header",
367+
"text": {
368+
"type": "plain_text",
369+
"text": ":warning: End-to-end tests failed",
370+
"emoji": true
371+
}
372+
},
373+
{
374+
"type": "section",
375+
"fields": [
376+
{
377+
"type": "mrkdwn",
378+
"text": "*Project*: $CIRCLE_PROJECT_REPONAME"
379+
},
380+
{
381+
"type": "mrkdwn",
382+
"text": "*Framework*: Playwright"
383+
}
384+
]
385+
},
386+
{
387+
"type": "actions",
388+
"elements": [
389+
{
390+
"type": "button",
391+
"text": {
392+
"type": "plain_text",
393+
"text": "CircleCI"
394+
},
395+
"url": "$CIRCLE_BUILD_URL"
396+
}
397+
]
398+
}
399+
]
400+
}
401+
402+
e2e tests ie11:
335403
<<: *defaults
336-
parameters:
337-
browser:
338-
type: string
339-
environment:
340-
E2E_BROWSER: << parameters.browser >>
341404
resource_class: large
342405
steps:
343406
- checkout
@@ -346,14 +409,13 @@ jobs:
346409
- *restore_yarn_cache
347410
- *run_yarn_install
348411
- run:
349-
name: End-to-end tests
350-
command: yarn run test:e2e:saucelabs
412+
name: End-to-end tests (IE11)
413+
command: yarn run test:e2e:ie11
351414
- store_test_results:
352-
path: junit/wdio/
415+
path: tests/e2e/junit/wdio/
353416
- slack/notify:
354417
channel: $SLACK_E2E_NOTIF_CHANNEL
355418
event: fail
356-
# See: https://app.slack.com/block-kit-builder/
357419
custom: |
358420
{
359421
"blocks": [
@@ -374,7 +436,7 @@ jobs:
374436
},
375437
{
376438
"type": "mrkdwn",
377-
"text": "*Browser*: << parameters.browser >>"
439+
"text": "*Browser*: Internet Explorer 11"
378440
}
379441
]
380442
},
@@ -412,10 +474,15 @@ jobs:
412474
- *restore_yarn_cache
413475
- *run_yarn_install
414476
- run:
415-
name: End-to-end tests
416-
command: yarn workspace react-instantsearch-router-nextjs run test:e2e:saucelabs
477+
name: Install Playwright browsers
478+
command: npx playwright install --with-deps chromium firefox
479+
- run:
480+
name: End-to-end tests (Playwright)
481+
command: yarn workspace react-instantsearch-router-nextjs run test:e2e
417482
- store_test_results:
418-
path: packages/react-instantsearch-router-nextjs/junit/wdio/
483+
path: packages/react-instantsearch-router-nextjs/junit/playwright/
484+
- store_artifacts:
485+
path: packages/react-instantsearch-router-nextjs/playwright-report/
419486

420487
e2e tests app router nextjs:
421488
<<: *defaults
@@ -427,10 +494,15 @@ jobs:
427494
- *restore_yarn_cache
428495
- *run_yarn_install
429496
- run:
430-
name: End-to-end tests
431-
command: yarn workspace react-instantsearch-nextjs run test:e2e:saucelabs
497+
name: Install Playwright browsers
498+
command: npx playwright install --with-deps chromium firefox
499+
- run:
500+
name: End-to-end tests (Playwright)
501+
command: yarn workspace react-instantsearch-nextjs run test:e2e
432502
- store_test_results:
433-
path: packages/react-instantsearch-nextjs/junit/wdio/
503+
path: packages/react-instantsearch-nextjs/junit/playwright/
504+
- store_artifacts:
505+
path: packages/react-instantsearch-nextjs/playwright-report/
434506

435507
release if needed:
436508
<<: *defaults

0 commit comments

Comments
 (0)