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

Dashboard - new testing framework: playwright #1078

Merged

Conversation

notoraptor
Copy link
Collaborator

Description

Hi @bouthilx ! This is a PR that adds all changes related to unit tests, excluding changes related to experiment progress bar.

As this work was done to be able to test infinite scroll, I kept infinite scrolling feature added in this PR.

This PR replaces old dashboard testing framework React testing library with a new framework Playwright which uses a real browser in backend, allowing to make more complex tests, especially tests that needs HTML components with real dimensions. This is particularly necessary to test how a component reacts to a scrolling.

Changes

  • Add infinite scrolling to experiments nav bar
  • Replace React Testing Library with Playwright
  • Rewrite a new Github Actions to use Playwright
  • Rewrite all old tests to work with Playwright
  • Add a new test for nav bar scrolling in dashboard/src/src/__tests__/ExperimentNavBar.test.js
  • Add a new PKL database containing supplementary uncompleted experiments. These experiments are not yet used here, as it is mainly to test progress bars, but I leave it here as it changes a single line in tests. I can remove it from this PR if necessary. Other related changes:
    • Add a script to add supplementary experiments, to use if we need to regenerate the new DB
    • Update the script that copy data from PKL db to Mongo db, to use new PKL db as source, and clean Mongo DB before copying new data. This script is used to populate a Mongo DB in CI.

Checklist

Tests

  • I added corresponding tests for bug fixes and new features. If possible, the tests fail without the changes
  • All new and existing tests are passing ($ tox -e py38; replace 38 by your Python version if necessary)

Documentation

  • I have updated the relevant documentation related to my changes

Quality

  • I have read the CONTRIBUTING doc
  • My commits messages follow this format
  • My code follows the style guidelines ($ tox -e lint)

@notoraptor notoraptor changed the title [Dashboard] new testing framework: playwright Dashboard - new testing framework: playwright Feb 1, 2023
Copy link
Member

@bouthilx bouthilx left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! I relaunched the tests. I don't understand how the current failures would relate to the current changes in this PR.

@notoraptor
Copy link
Collaborator Author

I relaunched failing tests (test-long-algo).

…ard SRC tests, as they won't currently pass.
- do not retry playwright tests
- bounding boxes values aren't all stable.
…s (waitFor() does not seem to work when waiting for multiple elements)
- remove upload-artifact
- fix 2 more test files work with playwright
Move nav bar scrolling test into nav bar tests file
Fix experimentrs visualizations tests and add them to CI
- Set up database with additional uncompleted experiments
- Use new database for unit tests
Keep everything else, including infinite scroll
@notoraptor notoraptor force-pushed the dashboard-new-testing-framework branch from b822d75 to bf3a8c5 Compare February 2, 2023 20:20
@notoraptor
Copy link
Collaborator Author

Rebased!

@bouthilx bouthilx merged commit 14e614e into Epistimio:develop Feb 3, 2023
@notoraptor notoraptor deleted the dashboard-new-testing-framework branch February 3, 2023 14:23
@notoraptor notoraptor mentioned this pull request Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants