-
Notifications
You must be signed in to change notification settings - Fork 6
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
[test] Add e2e testing #125
Conversation
83fa727
to
0c40188
Compare
0c40188
to
a9be777
Compare
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.
LGTM 🔥
I posted a couple of nits.
- run: yarn install | ||
|
||
- name: Install playwright | ||
run: yarn workspace @dd/tests playwright install --with-deps |
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 believe that this step will still run even when the playwright cache is hit
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.
Yes, it is necessary, we can only cache the binaries, but we still need to install some shared libraries (installed in a different directory than the binaries).
Though, it will not need to download the binaries (browsers mostly).
// Transform the content here with the context we have. | ||
callback( | ||
null, | ||
template(chunk.toString('utf-8'), { interpolate: INTERPOLATE_RX })(context), |
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'm wondering if this could fail when a particular chunk includes the start symbol ({{
) but not the other one (}}
), which would in this case be included in the next chunk?
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's a fair concern, I'll see if I can prevent this issue from happening.
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.
Removed the streaming process, and used fs.readFile
instead.
Didn't find any solution to keep the streaming.
await page.waitForSelector('body'); | ||
}; | ||
|
||
describe('Browser SDK injection', () => { |
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.
Browser SDK injection
I think this is an oversight, the description seems to be off
What and why?
It would feel safer to actually test in browser, IRL situations.
How?
Add e2e testing with Playwright.
unit/
and add thee2e/
peer directory.yarn cli dev-server
command to run a local dev server.yarn test:unit
.yarn test:e2e
command to run playwright.