Skip to content
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

#36 try to get a chrome and firefox e2e test running #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sangohan
Copy link

@sangohan sangohan commented Aug 1, 2022

Initial start to get an e2e test working for issue #36

The first step is to make a consistent environment to which tests can run.

I am attempting it by making use of the devcontainer feature of vscode , which lets you make use of docker to setup a dev environment that is consistent across different machines. This would let you run a test unaffected by environment differences between different maintainers.

Next step is to work out how to execute webdriver under this environment. I am still debating whether to use python selenium, or jest selenium (more natural as this whole project is in typescript...not sure why LiveTL uses python selenium, so may be someone can shed light on that?).

startUrl: 'https://www.youtube.com/watch?v=5qap5aO4i9A'
}
startUrl: 'https://www.youtube.com/watch?v=jfKfPfyJRdk',
args: process.env.BROWSER === 'firefox' ? [''] : ['--no-sandbox', '--autoplay-policy=no-user-gesture-required']
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chrome won't start under docker unless you use the --no-sandbox cli option.

The autoplay-policy option is really only there to let the video start without user interaction. It's not necessary.

@@ -31,8 +31,10 @@ export default defineConfig({
disableAutoLaunch: process.env.BROWSER === 'none',
browser: process.env.BROWSER === 'firefox' ? 'firefox' : 'chrome',
webExtConfig: {
startUrl: 'https://www.youtube.com/watch?v=5qap5aO4i9A'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

poor lofi girl, her old stream was DMCA taken down. I've replaced it with the current stream, if that's OK.

"features": {
"desktop-lite": {
"password": "vscode",
"webPort": "6080",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after starting up the devcontainer, visit http://localhost:6080 and see a web-based VNC client. Use the password vscode and connect and see a working desktop environment.

Then in the commandline or terminal, run the normal yarn start to get the browser loaded with the extension.

image

@KentoNishi
Copy link
Member

jesus this is so high effort lmao

pinging our resident e2e test writer @r2dev2

@r2dev2
Copy link
Member

r2dev2 commented Aug 3, 2022

Oh god, I should have mentioned one of the branches called e2e in which I have progress. It has a working setup of tests that I really should have merged by now. It uses python selenium (specifically the autoparaselenium library). I think docker may be overkill for this as browsers tend to execute js in the same way regardless of operating system. Also, the same test should run in windows, macos, and linux.

@r2dev2
Copy link
Member

r2dev2 commented Aug 3, 2022

The test uses python selenium because I made a library called autoparaselenium which automatically sets up selenium and which allows you run threads in multiple selenium processes.

@r2dev2
Copy link
Member

r2dev2 commented Aug 3, 2022

The usage of devcontainer is interesting. It could help the vsc users and potentially codespaces/gitpod users by setting up a dev environment automatically.

@KentoNishi can you review this to confirm that it works well for vsc/codespaces? I don't use vsc and don't have docker installed so I cannot test it out.

@r2dev2 r2dev2 requested a review from KentoNishi August 3, 2022 05:20
@sangohan
Copy link
Author

sangohan commented Aug 3, 2022

It could help the vsc users and potentially codespaces/gitpod users by setting up a dev environment automatically.

I just assumed everyone used vsc for doing typescript stuff! I guess i was wrong ;D

If devcontainers aren't that helpful, then there's no need to merge any of this stuff in! I'm not sure devcontainers work on codespaces (is that the remote vscode thing you can use on the browser?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants