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

refactor: Update integration tests to resolve chromium upgrade 3 #2679

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

pan-kot
Copy link
Member

@pan-kot pan-kot commented Sep 6, 2024

Description

Related to cloudscape-design/browser-test-tools#105 (see dry-run test failures).

Switching to Chromium --headless=new causes failures to our tests that depend on screen size. The refactoring fixes the issue for some of the app layout tests to either remove the dependency completely or make assertions depend on the measured viewport height.

Related:

How has this been tested?

  • Verified the tests work with old and new headless mode
Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.79%. Comparing base (78993c6) to head (4244eef).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2679      +/-   ##
==========================================
- Coverage   95.79%   95.79%   -0.01%     
==========================================
  Files         744      744              
  Lines       20566    20566              
  Branches     7011     6639     -372     
==========================================
- Hits        19702    19701       -1     
- Misses        856      857       +1     
  Partials        8        8              

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

@pan-kot pan-kot marked this pull request as ready for review September 6, 2024 13:02
@pan-kot pan-kot requested a review from a team as a code owner September 6, 2024 13:02
@pan-kot pan-kot requested review from cansuaa and removed request for a team September 6, 2024 13:02
@pan-kot pan-kot changed the title refactor: App layout tests compatible with chromium --headless=new refactor: Update integration tests to resolve chromium upgrade 3 Sep 6, 2024
expect((await page.getSplitPanelSize()).height).toEqual(160);
await page.dragResizerTo({ x: 0, y: 0 });
expect(Math.round((await page.getSplitPanelSize()).height)).toEqual(277);
const splitPanelMaxSize = screenHeight - 40 - headerRect.height;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 40?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Then should we use that variable directly here? or at least add a comment?

Copy link
Member Author

Choose a reason for hiding this comment

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

I hesitate to do either, to be honest, as both solutions create a binding between the test and the implementation. I think the fact the assertion is now a formula is good because it makes the intent better clear and we can even define the test against multiple screen heights to ensure the formula holds. The constant 40 is just a part of that. Technically, the implementation can change, e.g. we can move it to the different place in code or compute the constant as a sum of two smaller ones - but that should not matter unless the actual value changes, so it is the actual value that is here important.

@pan-kot pan-kot added this pull request to the merge queue Sep 6, 2024
Merged via the queue into main with commit 66204d2 Sep 6, 2024
35 checks passed
@pan-kot pan-kot deleted the refactor-chromium-tests-3 branch September 6, 2024 15:52
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.

2 participants