azure-dev
azure-dev copied to clipboard
playwright test fail in todo-nodejs-mongo
Describe the issue: playwright test fail when delete a item.
Repro steps:
- Run command
azd up
- Run command
cd tests
- Run command
npm i && npx playwright install
- Run command
npx playwright test
Environment: OS : Linux(Ubuntu 20.04) Template: https://github.com/Azure-Samples/todo-nodejs-mongo
Expected behavior: playwright test can success.
@jongio for notification.
Can you please re-run this a few times and verify it fails every time?
@jongio I have run about 5 times, results are all failed.
Is this in WSL or a VM? Would be good to know more about your hardware setup. Thanks
@jongio this might be related to the fact that it takes some minutes after deploying to actually get the server up and running (serving).
According to the steps in the issue, tests are running right after running azd up
.
Can we verify if tests would fail if we run them at least ~10 minutes after running azd up
? ( 10 minutes should be more than enough).
If that's the issue/case, we might consider adding some logic to the azp deploy
command to wait for backend to be responsive. For example, starting a polling routine to send a ping
request to the server every minute and does not exits until server respond with a pong
:) . They running azd deploy
would finish when the app is actually ready to be used
@v-yilinhu - Please validate @vhvb1989's thoughts, by running azd up, letting it finish, and the manually hitting the site in the same environment.
@jongio According to the comments, we run the test at least ~10 minutes after running azd up
, but it still failed, the browser we use for testing is Firefox(version-101.0.1) in Linux VM.
However, when we installed Chrome(version-102.0.5005.115) in Linux VM to try again, it passed.
Besides, it can pass in Windows desktop by using FireFox.
we are only running the tests on chrome today, so maybe it was failing because of that not being installed.
@jongio Is it enough that our tests only run successfully on Chrome? If so, maybe we can close this issue.
Besides, we can add some reminders to the README.md: Currently only Google Chrome is supported.
Can you please investigate why this isn't working in Firefox?
@Jongio We have made some progress in investigating this issue. Firefox between the linux and windows desktop,the web page of the project deployment, the interface effect of the delete position is different, see the following figure for details.
1.Firefox in Linux:
2.Firefox in windows desktop:
Maybe we can consider that our code can add an else judgment to take this situation(...
) about firefox in Linux into account.
Can you please see about updating the playwright test to account for this?
@Jongio The PR https://github.com/Azure/azure-dev/pull/1362 to fix this issue is ready, please review.
The following templates has the same issue on DevContainer , Linux(Ubuntu 20.04) and Codespace:
- https://github.com/azure-samples/todo-csharp-cosmos-sql
- https://github.com/azure-samples/todo-nodejs-mongo
- https://github.com/azure-samples/todo-nodejs-mongo-aca
- https://github.com/azure-samples/todo-python-mongo
- https://github.com/azure-samples/todo-python-mongo-aca
@v-yilinhu Could you re-run the test to see if we still have this problem? I'm not able to reproduce this error. All tests passed on Linux(Ubuntu 20.04).
@hemarina We re-run the test, this issue can't be reproduced on Linux(Ubuntu 20.04),Codespace and DevContainer.