Skip to content

[playwright] OUIA and updated readme#106

Merged
mshriver merged 3 commits into
RedHatQE:feature-playwrightfrom
digitronik:ouia
Oct 21, 2025
Merged

[playwright] OUIA and updated readme#106
mshriver merged 3 commits into
RedHatQE:feature-playwrightfrom
digitronik:ouia

Conversation

@digitronik

@digitronik digitronik commented Oct 17, 2025

Copy link
Copy Markdown
Member

Summary by Sourcery

Revise documentation to incorporate Playwright-based testing, clean up obsolete code and dependencies, enhance modal tests for OUIA compliance, and modernize the CI workflow with dynamic parallelism and coverage reporting.

Enhancements:

  • Revamp documentation to reflect Playwright integration and modern UI testing workflows.
  • Refactor OUIA modal tests to use text_content().strip() for consistent text assertions.
  • Remove unused FormSelect._select_element property and obsolete pytest option.

CI:

  • Update GitHub Actions workflow to use pytest -n auto for parallelism and re-enable Codecov upload.

Documentation:

  • Expand README with sections for Overview, Installation, Supported Components, Development, Testing, and Debugging.

Tests:

  • Adjust modal OUIA tests to trim whitespace in text_content assertions and remove --ignore rule for testing/ouia.

Chores:

  • Drop selenium dependency from pyproject.toml to avoid migration errors.

@sourcery-ai

sourcery-ai Bot commented Oct 17, 2025

Copy link
Copy Markdown

Reviewer's Guide

This PR integrates Playwright as the browser engine, fully revamps project documentation and testing instructions, refactors OUIA tests for Playwright compatibility, updates CI configuration for auto-parallel runs and Codecov reporting, and removes legacy Selenium code and options along with its dependency.

Entity relationship diagram for test options after Selenium removal

erDiagram
    TEST_OPTION {
        string browser
        string pf_version
        boolean headless
        int slowmo
        int n
    }
    TEST_OPTION ||--o| TEST_RUN : configures
    TEST_RUN {
        datetime start_time
        datetime end_time
        string status
    }
Loading

Class diagram for FormSelect after Selenium removal

classDiagram
    class FormSelect {
        +all_enabled_options()
        +fill(value)
    }
    %% Note: _select_element property removed
Loading

File-Level Changes

Change Details Files
Revamped README to document Playwright integration and usage
  • Added Overview, Installation, Development sections
  • Expanded Testing instructions with commands and options table
  • Reformatted Components and Patterns listings
README.md
Updated CI workflow for auto-parallel execution and coverage upload
  • Changed pytest -n 3 to -n auto
  • Removed ignore filter for ouia tests
  • Re-enabled Codecov upload step
.github/workflows/tests.yaml
Refactored OUIA tests to use Playwright-compatible text_content
  • Replaced .text with .text_content().strip() in assertions
  • Updated modal tests to strip whitespace before validation
testing/ouia/test_modal_ouia.py
Cleaned up legacy component code
  • Removed redundant _select_element property from FormSelect
src/widgetastic_patternfly5/components/forms/form_select.py
Cleaned up project dependencies
  • Removed explicit Selenium dependency from pyproject
  • Pinned widgetastic.core dependency to GitHub URL
pyproject.toml
Simplified pytest configuration
  • Removed unused --force-host option from conftest
testing/conftest.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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

Blocking issues:

  • An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)

General comments:

  • Verify that removing the selenium dependency hasn’t left any residual imports or code paths relying on Selenium to avoid runtime errors.
  • Ensure pytest-xdist is installed in your CI setup so that the new '-n auto' flag actually enables parallel test execution.
  • Double-check the impact of removing the _select_element property in FormSelect to ensure no downstream code relies on it, or provide a deprecation alias if needed.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Verify that removing the selenium dependency hasn’t left any residual imports or code paths relying on Selenium to avoid runtime errors.
- Ensure pytest-xdist is installed in your CI setup so that the new '-n auto' flag actually enables parallel test execution.
- Double-check the impact of removing the `_select_element` property in FormSelect to ensure no downstream code relies on it, or provide a deprecation alias if needed.

## Individual Comments

### Comment 1
<location> `.github/workflows/tests.yaml:85` </location>
<code_context>
        uses: codecov/codecov-action@v4
</code_context>

<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.

*Source: opengrep*
</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 .github/workflows/tests.yaml Outdated
@codecov

codecov Bot commented Oct 17, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (feature-playwright@afa3871). Learn more about missing BASE report.

Files with missing lines Patch % Lines
testing/ouia/test_modal_ouia.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             feature-playwright     #106   +/-   ##
=====================================================
  Coverage                      ?   97.77%           
=====================================================
  Files                         ?       48           
  Lines                         ?     1931           
  Branches                      ?        0           
=====================================================
  Hits                          ?     1888           
  Misses                        ?       43           
  Partials                      ?        0           
Flag Coverage Δ
unittests 97.77% <75.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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New security issues found

Comment thread .github/workflows/tests.yaml
if: matrix.run-coverage == true
timeout-minutes: 25
run: |
pytest -v -n 2 --headless --browser=${{ matrix.browser }} --pf-version=${{ matrix.pf-version }} --cov=./ --cov-report=xml --reruns 2 --reruns-delay 5

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Consider (separate PR) adding a hatch config so we can just use hatch run test and hatch run test-cov and can set many of these options as default.

@mshriver mshriver merged commit 6d4220a into RedHatQE:feature-playwright Oct 21, 2025
10 of 11 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.

2 participants