Files
openobserve/tests/ui-testing
Shrinath Rao 5a25853ac6 fix(e2e): update getSeverityColors selector for robust DOM matching (#9798)
### **User description**
## Summary
- Fix severity color test failing due to CSS selector not matching DOM
elements
- Update `getSeverityColors()` method in logsPage.js with multi-fallback
selector strategy

## Problem
The original selector `div[class*="tw:absolute"][class*="tw:left-0"]`
failed to match elements because Tailwind CSS class names with colons
need different escaping in querySelector.

**Error:**
```
Expected: 8
Received: 0
```

## Solution
Implement robust multi-fallback approach:
1. First try inline style selector: `div[style*="background"]`
2. Fallback to escaped class selector: `div[class*="tw\\:absolute"]`
3. Final fallback: iterate through divs to find absolute positioned
element with backgroundColor

## Test Results
All 8 severity levels now verified successfully:
- ✅ Severity 0-7 colors all match expected values
- ✅ Test passes in 28.7s


___

### **PR Type**
Bug fix, Tests


___

### **Description**
- Add multi-fallback selector for severity color div

- Skip transparent or missing background elements

- Broaden severity text pattern matching


___



<details> <summary><h3> File Walkthrough</h3></summary>

<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>logsPage.js</strong><dd><code>Robust colorDiv selector
and severity parsing</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

tests/ui-testing/pages/logsPages/logsPage.js

<ul><li>Added inline style selector for background color div<br> <li>
Fallback to escaped Tailwind class selector<br> <li> Computed style
fallback for absolute-positioned div<br> <li> Skip transparent or
missing divs before parsing<br> <li> Extended severity patterns for
varied text formats</ul>


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9798/files#diff-8045b343491d8943869c1af74cdafab204dc49c02a70294417e73f47d35e0b59">+36/-3</a>&nbsp;
&nbsp; </td>

</tr>
</table></td></tr></tr></tbody></table>

</details>

___
2025-12-29 23:31:41 +05:30
..
2024-11-13 15:13:36 +05:30

zinc-observe-ui-automation

Playwright UI Testing

Installation

npm install

Running Tests

cd playwright-runner
npm start

Then open http://localhost:3000 to access the test runner interface.

Using Command Line

# Run all tests
npx playwright test

# Run specific test by tag
npx playwright test -g @alertsImportExport

# Run in headed mode
npx playwright test --headed

# Run specific test file
npx playwright test Alerts/alerts-import.spec.js

Environment Configuration

Tests can be configured using:

  1. Playwright Runner UI - Set environment variables through the web interface
  2. Environment Variables - Set variables in terminal or .env file