Skip to content

Fix strict mode violation in Audit Logs Playwright tests#26043

Merged
harsh-vador merged 5 commits intomainfrom
fix-audit-logs-spec
Feb 23, 2026
Merged

Fix strict mode violation in Audit Logs Playwright tests#26043
harsh-vador merged 5 commits intomainfrom
fix-audit-logs-spec

Conversation

@harsh-vador
Copy link
Copy Markdown
Contributor

@harsh-vador harsh-vador commented Feb 23, 2026

Describe your changes:

Screenshot 2026-02-23 at 2 50 46 PM Screenshot 2026-02-23 at 3 44 51 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

  • Fixed Playwright strict mode violations:
    • Added .first() to date picker cell selectors to resolve ambiguous element matching in date range selection tests
    • Improved waitForResponse filtering with specific URL endpoints and query parameters to prevent false response interception (e.g., userName=admin, entityType= checks)
    • Enhanced test reliability for user filter, entity type filter, and export functionality workflows

This will update automatically on new commits.

@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 65%
65.74% (56404/85804) 45.17% (29537/65389) 47.98% (8906/18561)

chirag-madlani
chirag-madlani previously approved these changes Feb 23, 2026
Comment thread openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/AuditLogs.spec.ts Outdated
Comment thread openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/AuditLogs.spec.ts Outdated
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Feb 23, 2026

Code Review ✅ Approved 1 resolved / 1 findings

Clean test fix: more specific API response matching and .first() for strict mode compliance. The previous lowerCase() issue is resolved — the problematic call has been removed. No new issues found.

✅ 1 resolved
Bug: lowerCase() breaks URL matching for multi-word entity types

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/AuditLogs.spec.ts:352
Lodash's lowerCase() converts strings to space-separated lowercase words, not simple lowercase. For example:

  • lowerCase("Table")"table"
  • lowerCase("Database Service")"database service" ✗ (the URL has entityType=databaseService)

The test reads the display label from .dropdown-option-label (which renders option.label — e.g., "Database Service"), then uses lowerCase() to match against the URL query parameter (which uses option.key — e.g., "databaseService").

This works for single-word entity types but will fail for multi-word ones like "Database Service", "Search Index", "Dashboard Data Model", "Glossary Term", etc. Since the test picks the first item from the dropdown, whether it fails depends on the test environment's data — making this a latent source of flakiness.

Consider using toLower from lodash (which doesn't add spaces: toLower("Database Service")"database service") — but that still won't match databaseService. A more robust approach would be to use a case-insensitive URL check, or better yet, extract the entity type key from the dropdown option's data attribute rather than its display text.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

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

Was this helpful? React with 👍 / 👎 | Gitar

@harsh-vador harsh-vador enabled auto-merge (squash) February 23, 2026 11:17
@sonarqubecloud
Copy link
Copy Markdown

@harsh-vador harsh-vador merged commit b0aecba into main Feb 23, 2026
27 of 28 checks passed
@harsh-vador harsh-vador deleted the fix-audit-logs-spec branch February 23, 2026 13:29
harsh-vador added a commit that referenced this pull request Feb 23, 2026
* Fix strict mode violation in Audit Logs Playwright tests

* add required api waits

* address gitar

* nit

* remove unwanted check

(cherry picked from commit b0aecba)
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.

2 participants