-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add simple end2end testing with playwright #86
base: main
Are you sure you want to change the base?
Conversation
Got following error: browserType.launch: Executable doesn't exist at /root/.cache/ms-playwright/chromium-1055/chrome-linux/chrome Full output: sudo just e2e-test
# Setup
cd docker && docker compose up -d
[+] Running 8/0
✔ Container ol-live-mempool-web-1 Running 0.0s
✔ Container ol-live-electrs-1 Running 0.0s
✔ Container ol-live-bitcoin-core-1 Running 0.0s
✔ Container ol-live-ord-1 Running 0.0s
✔ Container ol-live-fixtures-1 Running 0.0s
✔ Container ol-live-mempool-db-1 Running 0.0s
✔ Container ol-live-mempool-api-1 Running 0.0s
✔ Container ol-live-nginx-proxy-1 Running 0.0s
just watch > /dev/null 2>&1 & echo $! > pidfile # record pid to kill process later
sleep 5 # Wait for just watch finish starting
# test
node test/end2end/runner.ts
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
browserType.launch: Executable doesn't exist at /root/.cache/ms-playwright/chromium-1055/chrome-linux/chrome
╔═════════════════════════════════════════════════════════════════════════╗
║ Looks like Playwright Test or Playwright was just installed or updated. ║
║ Please run the following command to download new browsers: ║
║ ║
║ npx playwright install ║
║ ║
║ <3 Playwright Team ║
╚═════════════════════════════════════════════════════════════════════════╝
at ordilabs/repos/live/test/end2end/runner.ts:4:34
at Object.<anonymous> (ordilabs/repos/live/test/end2end/runner.ts:22:3) {
name: 'Error'
}
Node.js v18.15.0
error: Recipe `e2e-test` failed on line 173 with exit code 1 Notes:
|
Update # test
npx playwright install
npx ts-node test/end2end/runner.ts In case use sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/node" "/usr/local/bin/node"
sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/nvm" "/usr/local/bin/nvm"
sudo ln -s "$NVM_DIR/versions/node/$(nvm version)/bin/npx" "/usr/local/bin/npx" |
http://live-ol.local/ gives me page.goto: net::ERR_CONNECTION_RESET at http://live-ol.local/
=========================== logs ===========================
navigating to "http://live-ol.local/", waiting until "load"
============================================================
at live/test/end2end/runner.ts:8:14 {
name: 'Error'
}
error: Recipe `e2e-test` failed on line 171 with exit code 1 @fjahr What are your entries in cat /etc/hosts
127.0.0.1 mempool-ol.local
::1 mempool-ol.local
127.0.0.1 ord-ol.local
::1 ord-ol.local
127.0.0.1 live-ol.local
::1 live-ol.local |
test/end2end/runner.ts
Outdated
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
|
||
await page.goto('http://live-ol.local'); |
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.
Port 3000
(http://live-ol.local:3000
) is needed to me to fix #86 (comment)
# test
npx playwright install
npx ts-node test/end2end/runner.ts
Test passed
Only (last) issue now: # Teardown
kill $(cat pidfile) && rm pidfile # kill watch process
sh: 1: kill: No such process
error: Recipe `e2e-test` failed on line 173 with exit code 1 |
@sectore Did you try running |
Looks like a second order effect when the watch process wasn't actually started. Did the test pass on this run? |
I have the same, for me it wasn't needed. Can you suggest changes that make it work in your environment?
|
So is this in general the setup that we want conceptually and I can remove the draft mode? @FelixWeis |
Aproach ACK. few ideas
|
@fjahr Trying to answer your questions here:
Yes
I've just added
Yes, tests did pass. |
@sectore addressed your comments as far as I could without breaking my own environment, please give it another try. But I guess @FelixWeis is right, this should be dockerized. I haven't worked with docker for a while so this would take me some time. How about you @sectore ? Are you familiar with Docker and want to take it over from here? |
Sorry, I'm not that deep into Docker as well. But I think dockerizing tests would solve issues I have locally with |
@@ -10,6 +10,7 @@ We use Docker to containerize all micro-services and you `just` need to run a fe | |||
|
|||
- [Rust ^1.68](https://rustup.rs/) | |||
- [nodejs ^18.15](https://nodejs.org/en) | |||
- [Typescript](https://www.typescriptlang.org/) |
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.
To avoid mismatch of users global installed TypeScript version I would recommend to put it into devDependencies
of package.json
.
Thanks until here! Assigning this to myself now to explore the dockerization. |
No description provided.