mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
### **PR Type**
Enhancement, Tests
___
### **Description**
- Replace icon tabs with reusable app-tabs component
- Introduce Alerts/Incidents viewMode switching logic
- Add extensive UI tests for new tab functionality
- Update getPath logic and dev script configuration
___
### Diagram Walkthrough
```mermaid
flowchart LR
TabsComp["app-tabs component"] --> ViewState["viewMode state"]
ViewState --> AlertsView["Alerts view UI"]
ViewState --> IncidentsView["Incidents view UI"]
Tests["UI tests"] --> TabsComp
```
<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>zincutils.ts</strong><dd><code>Refine getPath base URL
logic</code>
</dd></summary>
<hr>
web/src/utils/zincutils.ts
<ul><li>refine getPath logic for web base path<br> <li> conditionally
prepend "/web/" on localhost</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9819/files#diff-d3d59688cccdcc6c84ebe88b698c6910030abecc3125f4c0ef81b0df023699ba">+1/-1</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>AlertList.vue</strong><dd><code>Replace custom tabs
with app-tabs</code>
</dd></summary>
<hr>
web/src/components/alerts/AlertList.vue
<ul><li>remove custom icon-only view tabs<br> <li> integrate
<code>app-tabs</code> for view switching<br> <li> add
<code>viewTabs</code> computed property<br> <li> update related SCSS
styling</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9819/files#diff-be3e41b823e163b226ffc270d95cc4981e59c600851e4e0d10ee5e4ee994ac8e">+35/-92</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Tests</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>alertsPage.js</strong><dd><code>Add view mode tab
methods and locators</code>
</dd></summary>
<hr>
tests/ui-testing/pages/alertsPages/alertsPage.js
<ul><li>add locators for alert and incident tabs<br> <li> implement
click and expect methods for tabs<br> <li> add search methods for both
views</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9819/files#diff-79ee01d6d7f145f19207b93b87143b545a1188cfc6a82bc8c45fecfbf68f8a1d">+113/-0</a>
</td>
</tr>
<tr>
<td>
<details>
<summary><strong>alertsIncidentsTabs.spec.js</strong><dd><code>Add E2E
tests for alerts/incidents tabs</code>
</dd></summary>
<hr>
tests/ui-testing/playwright-tests/Alerts/alertsIncidentsTabs.spec.js
<ul><li>add E2E tests for tabs visibility and switching<br> <li> cover
functional and edge-case scenarios</ul>
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9819/files#diff-3776665660a181de2d08e4d3bccc481191e7ac88f4e4b0943c869ffa4eb12ffd">+347/-0</a>
</td>
</tr>
</table></td></tr><tr><td><strong>Configuration
changes</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>package.json</strong><dd><code>Add base path to dev
script</code>
</dd></summary>
<hr>
web/package.json
- update `dev` script to include base `/web/`
</details>
</td>
<td><a
href="https://github.com/openobserve/openobserve/pull/9819/files#diff-b861012a5dd72b8a9f3281b7cf09f5a779c98569d040b1bbc1db50f1b15e7cce">+1/-1</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___
zinc-observe-ui-automation
Playwright UI Testing
Installation
npm install
Running Tests
Using Playwright Runner UI (Recommended)
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:
- Playwright Runner UI - Set environment variables through the web interface
- Environment Variables - Set variables in terminal or .env file