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

Migrating the functional mocha test from Spectron to PlayWright #1062

Merged

Conversation

araujoarthur0
Copy link
Collaborator

Related issue

Helps #1037, Closes #653

Context / Background

The mocha test we had was using Spectron, which has sadly been deprecated.
The new suggestion the Electron team made is to use PlayWright. Thus I'm migrating the test to it.

What change is being introduced by this PR?

  • Migrating electron aspects of mocha test to use playwright rather than spectron. Calls are a little different but I've kept the goal of each test.
    • One difference is that in playwright apparently the "preferences" state of the app is kept between the tests. So after switching to day view, I have to revert to month view or the next test will start from the day view instead of from scratch.
    • One of the tests is also failing some times, so I've disabled it.
  • I added the tests back to the PR pipeline, and switched to c8 to get and merge the coverage report.

How will this be tested?

Test is passing fine now.

@araujoarthur0 araujoarthur0 changed the title Migrating mocha to playwright Migrating the single mocha test we had from Spectron to PlayWright Feb 3, 2024
@araujoarthur0 araujoarthur0 changed the title Migrating the single mocha test we had from Spectron to PlayWright Migrating the functional mocha test from Spectron to PlayWright Feb 3, 2024
Copy link

codecov bot commented Feb 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.81%. Comparing base (b3fd77f) to head (ac0bf42).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1062       +/-   ##
===========================================
- Coverage   81.79%   56.81%   -24.98%     
===========================================
  Files          22       22               
  Lines        1401     3270     +1869     
  Branches      214      419      +205     
===========================================
+ Hits         1146     1858      +712     
- Misses        255     1412     +1157     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@araujoarthur0 araujoarthur0 force-pushed the migrating-mocha-to-playwright branch from c0b66fe to b7ef380 Compare February 6, 2024 00:37
@araujoarthur0 araujoarthur0 force-pushed the migrating-mocha-to-playwright branch from e39b027 to 0708a27 Compare February 6, 2024 02:35
@araujoarthur0
Copy link
Collaborator Author

I think we'll have to accept that the coverage report will not be properly done with c8 and esm #34. There doesn't seem to be any workaround either.

@araujoarthur0
Copy link
Collaborator Author

@tupaschoal what do you think?

@tupaschoal
Copy link
Collaborator

I think that's fine @araujoarthur0

@araujoarthur0 araujoarthur0 merged commit 3a4e99f into thamara:main Mar 9, 2024
8 of 9 checks passed
@araujoarthur0 araujoarthur0 deleted the migrating-mocha-to-playwright branch March 9, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate why mocha tests are timing out intermittently
2 participants