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

fix: Use page.locator in Playwright reports #26224

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Dec 8, 2023

SUMMARY

Per Playwright's docs, page.wait_for_selector method is deprecated. This PR replaces usages of that method with page.locator suggested by the docs.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

  1. Enable PLAYWRIGHT_REPORTS_AND_THUMBNAILS feature flag
  2. Run some reports and verify that it works like before

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (07e5fe8) 69.19% compared to head (55910a7) 69.17%.

Files Patch % Lines
superset/utils/webdriver.py 6.66% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26224      +/-   ##
==========================================
- Coverage   69.19%   69.17%   -0.03%     
==========================================
  Files        1945     1945              
  Lines       75938    75946       +8     
  Branches     8458     8458              
==========================================
- Hits        52545    52533      -12     
- Misses      21208    21228      +20     
  Partials     2185     2185              
Flag Coverage Δ
hive 53.67% <12.50%> (-0.02%) ⬇️
mysql ?
postgres 78.18% <12.50%> (-0.02%) ⬇️
presto 53.62% <12.50%> (-0.02%) ⬇️
python 82.83% <12.50%> (-0.06%) ⬇️
sqlite 76.83% <12.50%> (-0.02%) ⬇️
unit 55.80% <12.50%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

page.wait_for_selector(
".slice_container", timeout=self._screenshot_locate_wait * 1000
)
for slice_container_elem in page.locator(".slice_container").all():
Copy link
Member

Choose a reason for hiding this comment

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

I assume all of these .all() methods are safe for the loop and will just return empty if none are present

Copy link
Member Author

@kgabryje kgabryje Dec 8, 2023

Choose a reason for hiding this comment

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

Yes, page.locator returns a Locator object, not None or list of html elements. Calling .all() on Locator that points to nothing returns an empty array.

@kgabryje kgabryje merged commit dbed64a into apache:master Dec 8, 2023
33 checks passed
@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Dec 8, 2023
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Dec 8, 2023
@michael-s-molina michael-s-molina added the v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch label Dec 11, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 11, 2023
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Dec 11, 2023
@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Dec 12, 2023
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
@mistercrunch mistercrunch added 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2023.49 size/M v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.1.0 🍒 3.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants