-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add playwright CI testing #1542
Conversation
size-limit report 📦
|
packages/browser-tests/.env
Outdated
@@ -0,0 +1,3 @@ | |||
EXAMPLE_TEMPLATE="web-chat" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what is the best practice here as I assume this will fail if we do any breaking change in the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once breaking change is introduced to an example under testing it won't affect CI right away since examples are shipped with a particular version of @waku/create-app
.
Or what API do you mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once breaking change is introduced to an example under testing it won't affect CI right away since examples are shipped with a particular version of @waku/create-app.
From the PR's description:
it injects links to repository's version of packages;
what repository are we referring to? My understanding is:
- Pull latest web-chat code from js-waku-examples repo
- Does some symlink to replace web-chat's dependency with code from the current js-waku git branch
- build web-chat, runs some test
if a breaking change on any of the js-waku package happens, then the web-chat code pull cannot use the new changed js-waku API, and hence the CI would fail.
What part am I not understanding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, to solve this one should update an example to correspond to the breaking changes in js-waku
To do this there are two ways:
- locally bind to the latest version of
js-waku
and push changes to an example - dirty and doesn't really cover everything; - some intermediate publications of
js-waku
so this issue should solve it - update release process to make releases for commits #1543
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means the flow for release will be something like:
- check if test against example fails;
- if yes - go and upgrade example to
next
package version; - check again - if ok - release;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any specific reasons we're doing .js
files and not .ts
?
packages/browser-tests/.env
Outdated
@@ -0,0 +1,3 @@ | |||
EXAMPLE_TEMPLATE="web-chat" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should .env
be pushed to GH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is ok to push .env
file, to make it explicit - renamed it to .env.local
to imply it is defaults for local running
@danisharora099 yes, because they are simple scripts that are run over |
Problem
js-waku
is a library dedicated for browser environment and sometimes it happens that something breaks at the point of integrations ofjs-waku
and some web application (consumer).Solution
To solve this problems I considered different options:
basic
karma
testing;discarded due to limitations of what can be tested (most common use is unit tests execution in browser context), poor integration with web frameworks;
jest
with add-ons;the same goes here since, would require
karma
anyway and it is still not the answer to our problem. One thing that is good is to testReact
components - but we are not interested in it;puppeteer
;poor support of anything but Chrome;
playwright
;this is what I choose to move forward. This tool allows easily run tests in different browsers and allows to treat web app under testing as a web site, which is the end goal of our testing - to make sure latest version builds and works in browser environment
How
playwright
will work:web-chat
example by using@waku/create-app
and it injects links to repository's version of packages;localhost:8080
;Current design allows us to do following (will document into Epic):
Notes