Conversation
| browser = p.chromium.launch() | ||
| page = browser.new_page() | ||
|
|
||
| response = page.goto(f"{base_url.rstrip('/')}/heartbeat") |
There was a problem hiding this comment.
| response = page.goto(f"{base_url.rstrip('/')}/heartbeat") | |
| response = page.goto(f"{base_url.rstrip('/')}/heartbeat?extended=true") |
you could do this. And also the ingration test could check by different key of dict, other services like celery and forum. So we could have the info if those services are working as expected.
There was a problem hiding this comment.
is the test wrong? the test just checks a 200 code status it doesn't matter the response itself so if the service is down the status code would be 200 no matter what but the status key would be false ?
.github/workflows/smoke-tests.yml
Outdated
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install pytest-playwright |
There was a problem hiding this comment.
Why do you select playwright instead of selenium??
There was a problem hiding this comment.
And why do you select these tools that use Chromium instead of other tools like K6 or Locust (load testing tools)? To test the browser behavior??
There was a problem hiding this comment.
Why do you select playwright instead of selenium??
Playwright was selected over Selenium primarily due to its modern architecture, improved reliability, and built-in tooling. Key reasons include:
- Launch and Modernity
- Browser Support
- Speed and Performance
- Handling Dynamic Content
- Setup and Ease of Use
Reference : https://www.browserstack.com/guide/playwright-vs-selenium
There was a problem hiding this comment.
And why do you select these tools that use Chromium instead of other tools like K6 or Locust (load testing tools)? To test the browser behavior??
Tools like K6 and Locust are excellent for load testing, but they are not suitable for browser-based functional validation. Here's why Playwright was chosen:
Goal mismatch:
- K6/Locust simulate HTTP traffic and are ideal for performance/load testing (e.g., 1000 users hitting an API).
- Playwright controls a real browser, making it ideal for verifying user experience, JavaScript execution, and UI behavior.
React-based UI needs full rendering: - Open edX LMS relies heavily on client-side rendering and dynamic content.
- Tools like K6/Locust don’t execute JavaScript, so they cannot validate DOM updates, modals, or SPA navigation
In short: Playwright tests browser behavior, while K6/Locust test backend load. The selected tool matches the functional validation goals.
.github/workflows/smoke-tests.yml
Outdated
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install pytest-playwright | ||
| playwright install |
There was a problem hiding this comment.
Do you think there is a way to not repeat these steps? What are being used in all the jobs.?
Or maybe use some cache for python or something like that, at least to reduce the time of reconfiguring and installing Python and dependencies?
e48a518 to
4a26397
Compare
4a26397 to
cad5443
Compare
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Set up Python |
There was a problem hiding this comment.
Could we add here a cache step like this.
https://github.com/nelc/eox-nelp/blob/76fdc2245533faa2a5f6f34fdd5476854dc706f4/.github/workflows/tests.yml#L22-L32
Also we could add a integration requirements file to add eg pytest-playwright. And try to dont reconfigure python and the pip requirement for each test.
cc50737 to
94d50b9
Compare
| @@ -0,0 +1 @@ | |||
| pytest-playwright | |||
There was a problem hiding this comment.
Please pin to a version to manage the hit or not of the cache. =)
There was a problem hiding this comment.
This version cannot be pin for two reason
- python version is variable so we cannot ensure that the pinned version will be compatible with all the python versions
- Pinned versions are just useful when there are conflicts and pip should install the last available version compatible with the current version
The cache is handled by the python version if that changes the cache shouldn't return anything
94d50b9 to
057d484
Compare
johanseto
left a comment
There was a problem hiding this comment.
I have a little of doubt about the cache behavior, but let's test it going forward.
Description
This PR introduces a complete suite of reusable Playwright-based smoke tests for validating core Open edX LMS functionality.
✅ Implemented Test Scripts
test_login_user.py: Confirms login works and dashboard loads.test_view_course.py: Loads a specific course and verifies structure and content.test_eox_plugins.py: Loops through/eox-*/eox-infoendpoints and prints version metadata.test_heartbeat.py: Simple check for availability of/heartbeatendpoint.test_complete_multiplechoice_unit.py: Navigates to a unit, selects a multiple-choice option, and submits it.test_register_user.py: Fills out the dynamic user registration form and asserts success.