Skip to content

Refactor: DataQualityAndProfiler spec and created DataQuality.spec and Profiler.spec#25371

Merged
ShaileshParmar11 merged 2 commits intomainfrom
fix-dq-pw-test
Jan 19, 2026
Merged

Refactor: DataQualityAndProfiler spec and created DataQuality.spec and Profiler.spec#25371
ShaileshParmar11 merged 2 commits intomainfrom
fix-dq-pw-test

Conversation

@ShaileshParmar11
Copy link
Copy Markdown
Contributor

@ShaileshParmar11 ShaileshParmar11 commented Jan 19, 2026

Describe your changes:

This pull request refactors several utility functions in testCases.ts to improve code readability and maintainability by reformatting multi-line statements, removing unnecessary timeouts, and consistently applying async/await patterns. The changes focus on making the code style more consistent and easier to follow, especially around Playwright test steps and file operations.

Code style and readability improvements:

  • Reformatted multi-line async calls and chained methods for better readability in functions such as verifyPageAccess, navigateToBulkEditPage, and addTestCaseValidationRows, ensuring consistent indentation and code structure. [1] [2] [3]
  • Updated file operations to use more readable arrow function formatting and improved CSV file handling in cleanupDownloadedCSV and performE2EExportImportFlow. [1] [2]

Test step consistency and reliability:

  • Removed custom timeouts from selectors and assertions, relying on default Playwright behavior for better reliability and reduced flakiness in tests.
  • Applied consistent async/await patterns and improved expectation formatting for test case validation and bulk edit flows, including clearer response handling and toast notification checks. [1] [2]

Bulk edit and import/export flow enhancements:

  • Improved code structure for bulk editing test cases, including more readable cell navigation and tag assignment.
  • Removed redundant blank lines and streamlined step descriptions for clarity in the export/import test flow.
Screenshot 2026-01-19 at 4 42 31 PM Screenshot 2026-01-19 at 1 07 35 PM

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Summary by Gitar

  • Test suite reorganization:
    • Split monolithic e2e/Pages/DataQualityAndProfiler.spec.ts (1,481 lines) into focused DataQuality.spec.ts and Profiler.spec.ts in e2e/Features/DataQuality/
  • Test file structure:
    • Wrapped tests in test.describe blocks with proper tagging and moved lifecycle hooks inside describe scopes
  • Code formatting standardization:
    • Applied consistent multi-line formatting patterns to ~158 lines in utils/testCases.ts for improved readability

This will update automatically on new commits.


Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the large DataQualityAndProfiler.spec.ts test file by splitting it into two focused files: DataQuality.spec.ts and Profiler.spec.ts. Additionally, it improves code readability in the testCases.ts utility file by reformatting multi-line statements, removing unnecessary timeouts, and applying consistent async/await patterns.

Changes:

  • Split DataQualityAndProfiler.spec.ts (1481 lines) into DataQuality.spec.ts (1265 lines) and Profiler.spec.ts (403 lines) for better test organization
  • Improved code formatting in testCases.ts utility functions with better indentation and consistent multi-line patterns
  • Removed custom timeout parameters from selectors, relying on Playwright's default behavior for better reliability

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
openmetadata-ui/src/main/resources/ui/playwright/utils/testCases.ts Reformatted async/await patterns, improved readability of multi-line statements, removed unnecessary timeout parameters from selectors
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/DataQualityAndProfiler.spec.ts Deleted - split into separate DataQuality and Profiler specs
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/Profiler.spec.ts New file containing profiler-specific tests with role access validation and profiler settings configuration
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/DataQuality/DataQuality.spec.ts New file containing data quality test cases, filters, and pagination functionality

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 19, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.98% (53823/81569) 43.98% (27061/61524) 47.85% (8465/17690)

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Jan 19, 2026

🔍 CI failure analysis for 2984866: Single CI failure in ServiceForm test with 10 flaky tests detected, all unrelated to this PR's DataQuality refactoring changes.

Issue

playwright-ci-postgresql job (shard 3/6, job 60785271999) failed with:

1 Hard Failure:

  • ServiceForm.spec.ts:327 - "Verify service name field validation errors" - TimeoutError: page.goto timeout 60000ms exceeded, followed by fs.unlinkSync error trying to delete a certificate file

10 Flaky Tests:

  • Settings Navigation (2 tests) - drag/drop reordering, navigation blocker
  • Permissions tests (2 tests) - Glossary and SearchIndex service permissions
  • Custom Widgets, Explore Discovery, Metric, ServiceForm tests
  • Common patterns: timeout errors, "Target page, context or browser has been closed", element visibility issues

Root Cause

These failures are unrelated to the PR changes. This PR only modified:

  • e2e/Features/DataQuality/DataQuality.spec.ts (new file, split from DataQualityAndProfiler)
  • e2e/Features/DataQuality/Profiler.spec.ts (new file, split from DataQualityAndProfiler)
  • e2e/Pages/DataQualityAndProfiler.spec.ts (deleted)
  • utils/testCases.ts (code formatting)

The failing tests are in completely different areas (ServiceForm, Settings, Permissions) that have no code relationship to the DataQuality test reorganization.

Details

The failures show classic flaky/environmental patterns:

  1. High success rate: 504 tests passed, only 1 hard failure + 10 flaky = 97.9% success
  2. Timeout issues: Multiple "page.goto timeout", "page.waitForResponse timeout" errors
  3. Infrastructure problems: "Target page, context or browser has been closed" suggests browser/environment instability
  4. File system error: The ServiceForm test failed trying to clean up a test certificate file (ENOENT error on fs.unlinkSync), indicating test cleanup issues
  5. Flaky designation: Playwright itself marked 10 tests as "flaky" meaning they passed on retry

The test reorganization in this PR is purely structural - splitting one file into two focused files with identical test logic.

Code Review ✅ Approved

Clean test file reorganization that improves maintainability by splitting a 1481-line monolithic test file into focused DataQuality.spec.ts and Profiler.spec.ts files, with consistent formatting applied throughout utility functions.

What Works Well

Good separation of concerns - profiler tests are now isolated from data quality tests, making it easier to run and maintain specific test suites. Lifecycle hooks (beforeAll, afterAll, beforeEach) are properly scoped inside test.describe blocks, improving test isolation. Removal of hardcoded timeouts in favor of Playwright defaults reduces test flakiness.

Rules 🎸 2 actions taken

Gitar Rules

🎸 Flaky Test Retry: Detected and analyzed flaky test patterns; posted comprehensive analysis
🎸 Summary Enhancement: Added technical summary to PR description highlighting test suite reorganization

1 rule not applicable. Show all rules by commenting gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off Gitar will not commit updates to this branch.
Display: compact Hiding non-applicable rules.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | This comment will update automatically (Docs)

@sonarqubecloud
Copy link
Copy Markdown

@ShaileshParmar11 ShaileshParmar11 merged commit f909495 into main Jan 19, 2026
23 of 24 checks passed
@ShaileshParmar11 ShaileshParmar11 deleted the fix-dq-pw-test branch January 19, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants