Skip to content

Use timeout instead of num_sec#125

Merged
mshriver merged 1 commit into
RedHatQE:legacy-selenium-supportfrom
LadislavVasina1:wait-for-timeout-legacy-selenium-support
Jun 3, 2026
Merged

Use timeout instead of num_sec#125
mshriver merged 1 commit into
RedHatQE:legacy-selenium-supportfrom
LadislavVasina1:wait-for-timeout-legacy-selenium-support

Conversation

@LadislavVasina1
Copy link
Copy Markdown

@LadislavVasina1 LadislavVasina1 commented Jun 2, 2026

Manual CP of #123 for legacy-selenium-support branch which is used by https://github.com/SatelliteQE/airgun

Summary by Sourcery

Replace deprecated wait_for num_sec parameter with timeout across components and tests.

Bug Fixes:

  • Correct a typo in the chip disappearance wait message.

Enhancements:

  • Standardize wait_for usage in chip, navigation, and pagination code by using the timeout parameter instead of num_sec.

Tests:

  • Update pagination-related tests to use the timeout parameter when waiting for paginator display.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 2, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates usages of the wait_for helper to use the newer timeout keyword instead of the deprecated num_sec, and fixes a minor typo in a log/message string, across chip, navigation, and pagination components and tests.

File-Level Changes

Change Details Files
Replace deprecated num_sec parameter with timeout in calls to wait_for and clean up a related status message.
  • Update chip component interactions to use timeout when waiting for chip removal and show more/less state changes.
  • Update navigation component loaded check to use timeout for the OUIA-safe wait.
  • Update pagination component tests (standard and OUIA) to use timeout when waiting for paginator visibility.
  • Fix typo in the chip disappearance wait message string.
src/widgetastic_patternfly5/components/chip.py
src/widgetastic_patternfly5/components/navigation.py
testing/components/test_pagination.py
testing/ouia/test_pagination_ouia.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="testing/components/test_pagination.py" line_range="23" />
<code_context>
     paginator = TestView(browser).paginator
     browser.click(SIDE_BAR_LOCATOR)  # To jump on specific paginator to avoid flakyness in tests.
-    wait_for(lambda: paginator.is_displayed, num_sec=10)
+    wait_for(lambda: paginator.is_displayed, timeout=10)
     yield paginator
     try:
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider calling `is_displayed` in the wait predicate to ensure we are waiting on a boolean condition

The predicate `lambda: paginator.is_displayed` returns the attribute itself, not the result of a visibility check. Please change this to `lambda: paginator.is_displayed()` if `is_displayed` is a method, or keep it as an attribute only if it’s a property that returns a boolean. Otherwise the wait may succeed without actually confirming the paginator is visible.

Suggested implementation:

```python
    paginator = TestView(browser).paginator
    browser.click(SIDE_BAR_LOCATOR)  # To jump on specific paginator to avoid flakyness in tests.
    wait_for(lambda: paginator.is_displayed(), timeout=10)
    yield paginator
    try:

```

If `is_displayed` is actually implemented as a boolean property (not a method) on `paginator`, this change should instead be reverted to the attribute form and the underlying implementation updated (if needed) to ensure it returns a boolean. In that case, confirm `is_displayed` is a `@property` and returns `True` only when the paginator is visible.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread testing/components/test_pagination.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.06%. Comparing base (82a38a8) to head (bd9092f).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           legacy-selenium-support     #125   +/-   ##
========================================================
  Coverage                    99.06%   99.06%           
========================================================
  Files                           48       48           
  Lines                         1932     1932           
========================================================
  Hits                          1914     1914           
  Misses                          18       18           
Flag Coverage Δ
unittests 99.06% <100.00%> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mshriver mshriver merged commit 349bbe6 into RedHatQE:legacy-selenium-support Jun 3, 2026
8 of 12 checks passed
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.

3 participants