Skip to content

Conversation

carlosthe19916
Copy link
Contributor

@carlosthe19916 carlosthe19916 commented Aug 20, 2025

Summary by Sourcery

Migrate existing Trustify-tests and add a full Playwright-based E2E test suite with page object models and spec files for core application pages

New Features:

  • Introduce Playwright page object classes (Toolbar, Table, Pagination, DetailsPageLayout, LabelsModal, Navigation) for structured UI interactions
  • Implement Playwright test suites for list and details views across Advisories, Packages, SBOMs, and Vulnerabilities without using Cucumber feature files
  • Add helper utilities for sorting assertions in tests

Enhancements:

  • Migrate all tests from the trustify-tests repository into this project for consolidated E2E coverage
  • Update devcontainer and environment configuration to support the new Playwright tests

Tests:

  • Include comprehensive spec files covering columns, filtering, sorting, pagination, donutchart, and actions across all pages

Copy link

@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.

Sorry @carlosthe19916, your pull request is too large to review

Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.21%. Comparing base (888b0d3) to head (f70fa03).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #658      +/-   ##
==========================================
+ Coverage   57.28%   63.21%   +5.93%     
==========================================
  Files         146      150       +4     
  Lines        2430     2474      +44     
  Branches      552      561       +9     
==========================================
+ Hits         1392     1564     +172     
+ Misses        833      687     -146     
- Partials      205      223      +18     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@carlosthe19916 carlosthe19916 changed the title Move trustify-tests & include PR #62 feat: add playwright tests that do not require cucumber feature files Aug 21, 2025
@carlosthe19916 carlosthe19916 added the backport release/0.3.z This PR should be backported to release/0.3.z branch. label Aug 21, 2025
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
Signed-off-by: Carlos Feria <2582866+carlosthe19916@users.noreply.github.com>
# Conflicts:
#	.devcontainer/template.json
@carlosthe19916 carlosthe19916 force-pushed the task/move-trustify-testsw branch from afd3bbd to 07f30d6 Compare August 21, 2025 12:05
@carlosthe19916 carlosthe19916 marked this pull request as ready for review August 21, 2025 12:13
Copy link

sourcery-ai bot commented Aug 21, 2025

Reviewer's Guide

This PR migrates the existing end-to-end tests from the trustify-tests repository into native Playwright tests, eliminating the need for Cucumber feature files. It introduces a suite of reusable page object models (Toolbar, Table, Pagination, DetailsPageLayout, LabelsModal, Navigation, Helpers), entity-specific page classes (ListPage, DetailsPage, Tab classes for Advisories, Packages, SBOMs, Vulnerabilities), and comprehensive spec files covering sorting, filtering, pagination, and UI actions. The configuration has also been updated to support the new test setup.

File-Level Changes

Change Details Files
Introduce reusable Playwright page object models
  • Create Toolbar with methods for filter and label assertions
  • Define Table for sorting, action clicks, row validations
  • Implement Pagination controls and validations
  • Add DetailsPageLayout for tab and header interactions
  • Add LabelsModal for label management in dialogs
e2e/tests/ui/pages/Toolbar.ts
e2e/tests/ui/pages/Table.ts
e2e/tests/ui/pages/Pagination.ts
e2e/tests/ui/pages/DetailsPageLayout.ts
e2e/tests/ui/pages/LabelsModal.ts
Add navigation and helper utilities
  • Implement Navigation class for sidebar routing
  • Provide Helpers with sortArray and expectSort utilities
e2e/tests/ui/pages/Navigation.ts
e2e/tests/ui/pages/Helpers.ts
Implement entity-specific page classes
  • Add ListPage classes for AdvisoryListPage, PackageListPage, SbomListPage, VulnerabilityListPage
  • Add DetailsPage classes for AdvisoryDetailsPage, PackageDetailsPage, SbomDetailsPage, VulnerabilityDetailsPage
  • Create Tab classes under each details folder to encapsulate toolbar, table, pagination
e2e/tests/ui/pages/*ListPage.ts
e2e/tests/ui/pages/*DetailsPage.ts
e2e/tests/ui/pages/*Tab.ts
Add comprehensive Playwright test specs
  • Include spec files for columns, filter, pagination, sort across all pages
  • Cover info and action interactions in detail pages
  • Add donut chart validation for SBOM vulnerability details
e2e/tests/ui/pages/**/*.spec.ts
Update development container and environment configuration
  • Adjust .devcontainer/template.json settings for Playwright environment
  • Update .env with test-specific variables
.devcontainer/template.json
.env

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

@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 there - I've reviewed your changes - here's some feedback:

  • Consider DRY-ing up the nearly identical Tab classes by extracting a generic base or factory to reduce boilerplate and maintenance overhead.
  • Many page objects expose internal Locator fields (e.g. _toolbar, _table) publicly – make those private or provide explicit methods to better encapsulate implementation details.
  • Navigation.goToSidebar always starts by calling /upload; this indirection can slow or break tests—consider parameterizing the entry path or navigating directly to the target page.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider DRY-ing up the nearly identical Tab classes by extracting a generic base or factory to reduce boilerplate and maintenance overhead.
- Many page objects expose internal Locator fields (e.g. _toolbar, _table) publicly – make those private or provide explicit methods to better encapsulate implementation details.
- Navigation.goToSidebar always starts by calling `/upload`; this indirection can slow or break tests—consider parameterizing the entry path or navigating directly to the target page.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release/0.3.z This PR should be backported to release/0.3.z branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant