crates.io icon indicating copy to clipboard operation
crates.io copied to clipboard

[WIP] Add e2e tests with Playwright

Open eth3lbert opened this issue 1 year ago • 1 comments

This PR starts porting some of the current test suit to Playwright. Additionally, the tests will be implemented in Typescript.

eth3lbert avatar Apr 22 '24 20:04 eth3lbert

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.48%. Comparing base (c8a0c8a) to head (9f29ace). Report is 1 commits behind head on main.

:exclamation: Current head 9f29ace differs from pull request most recent head dcdfb87

Please upload reports for the commit dcdfb87 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8521      +/-   ##
==========================================
- Coverage   88.48%   88.48%   -0.01%     
==========================================
  Files         276      276              
  Lines       27433    27433              
==========================================
- Hits        24274    24273       -1     
- Misses       3159     3160       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 22 '24 20:04 codecov[bot]

A script like the following, which leverages delta, could be helpful for reviewing the changes. This script would compare the new implementation to the old one.

import sys
from subprocess import PIPE, run


def get_changed_files():
    cmd = "git diff --name-only -r HEAD^ main"
    output = run(cmd, stdout=PIPE, stderr=PIPE, shell=True, universal_newlines=True)
    files = output.stdout
    return files


for new in get_changed_files().splitlines():
    if not new.endswith(".spec.ts"):
        continue
    old = new.replace("e2e", "tests").replace(".spec.ts", "-test.js")
    cmd = f"diff -u --ignore-space-change {old} {new} | delta"
    output = run(cmd, stdout=PIPE, stderr=PIPE, shell=True, universal_newlines=True)
    print(output.stdout)
    sys.stdin.read(1)

eth3lbert avatar May 06 '24 10:05 eth3lbert

due to the size of the diff and my upcoming PTO I probably won't be able to review the PR this week, but I've put it on my todo list for next week :)

Turbo87 avatar May 06 '24 16:05 Turbo87

Thanks! This PR definitely took some time to review, so I appreciate it.

eth3lbert avatar May 06 '24 22:05 eth3lbert

:umbrella: The latest upstream changes (presumably 551c4ef1f7998a0a014c31d3e869ec3cd3ad71df) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar May 13 '24 07:05 bors

Thanks for the review! I'll integrate this change into our CI in a follow-up PR.


After this PR is merged, should we skip the overlapping Ember tests that have already been rewritten in Playwright?

eth3lbert avatar May 17 '24 15:05 eth3lbert

:umbrella: The latest upstream changes (presumably 1a6567df11ee21315ac24424bc87f2b181fa12f7) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar May 20 '24 11:05 bors

After this PR is merged, should we skip the overlapping Ember tests that have already been rewritten in Playwright?

I think it's best to keep them running in parallel for now until we're confident about the new test setup

Turbo87 avatar May 23 '24 08:05 Turbo87