-
Notifications
You must be signed in to change notification settings - Fork 0
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 playwright test suite #81
Conversation
24728c9
to
dd305e3
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.
Please consider how to make it run locally, include dependency installation etc, if it runs from docker, please also explain how it works in the README.md file thanks.
.github/workflows/ui_test.yml
Outdated
: # set-version will always download the latest version of yarn | ||
yarn policies set-version 4.3.0 | ||
yarn install --immutable | ||
yarn dev --host 0.0.0.0 |
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.
One question, how can the dev run all these test locally before push? I believe you need to start the server and then run these test in console mode.
However can it be more automated so that you can run yarn playright and have everything run automatically include start the docker locally, then you can use the same in the github action. So you know it works locally, then github works rather then have something diff and you need to debug from two places
@@ -0,0 +1,26 @@ | |||
import pytest | |||
from playwright.sync_api import Page, expect |
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.
If you can add a README.md in the playright folder to tell other how to invoke the run locally will be great, thanks
Could not load conda plugin cannot import name 'ChannelAuthBase' from 'conda.plugins.types' (/home/raymond/anaconda3/lib/python3.9/site-packages/conda/plugins/types.py) cannot import name 'ChannelAuthBase' from 'conda.plugins.types' (/home/raymond/anaconda3/lib/python3.9/site-packages/conda/plugins/types.py) I have anacronda installed not sure if that causing issue? |
Remove Playright:build:web and test |
@utas-raymondng |
I need to run --> npx playwright install-deps to include the missing lib, can you add it to readme? Also I need to run the yarn dev to start to server before I can run the pytest --headed, that means I am not using the mock server? |
I'll add that. Thanks
The API's are mocked. So, the web server & playwright tests run separately and the API calls are captured by playwright and then it provide mocked responses according to the request (instead of making the actual API request). |
d84c827
to
908023a
Compare
|
I make the following change and merge the main to your branch as pretty outdated if (import.meta.env.MODE === "dev") { added to MapContext so can you try if you can get the reference back using window.MAP_CONTEXT ?, you should get a context of type and if you can update the branch with your local change will be good |
… into testing/78-build-test-framework
After some more research, I think there is no way to interact with the React in e2e testing, you can however do it with the component testing https://playwright.dev/docs/test-components I created another PR from your branch so to make the item a bit easier to manage by introduce a <TestHelper/> so you we can insert more to the testProps if needed in the future. https://github.com/aodn/aodn-portal-v2/tree/testing/78-react-map-context |
@utas-raymondng Component testing cannot be used in python playwright and it will not be available for the python version of playwright (see here). I have to use JS/TS to build the test framework, if I want to use component testing |
No description provided.