impactx icon indicating copy to clipboard operation
impactx copied to clipboard

[Draft] Unit Test for dashboard

Open proy30 opened this issue 1 year ago • 0 comments

This PR introduces the first unit test for the ImpactX dashboard, leveraging the SeleniumBase library to simulate a simulation run by a user with the GUI.

Key Features

  • The unit test runs a simulation using the parameters from the FODO cell example on the GUI. (takes ~1 minute)
  • The test is considered successful if the simulation is completed without errors.

Issues

  • ~~Dependency on Running Dashboard:~~
    • ~~The current implementation requires the ImpactX dashboard to run in a separate terminal before executing the test via pytest.~~
    • ~~Can investigate to potentially have dashboard be launched within the test itself.~~
    • ~~Unit test is flaky with passing/failing, unsure if this is due to code error or error in pytest implementation. Need to investigate. Started occurring after the implementation of subprocess.~~
  • Adding seleniumbase as a dependency
    • Unsure where to add. (implemented incorrectly)

Checklist

  • [X] Implement unit test for impactx-dashboard (testing with FODO cell simulation parameters.
  • [X] Automate the dashboard launch within the test.
  • [X] Fix flaky unit test
  • [x] Include seleniumbase dependency in CI test files
  • [x] Include trame dependencies in CI test files
  • [ ] Fix headless state for ctest

Resolves #667

proy30 avatar Sep 19 '24 17:09 proy30