Files
openobserve/tests/ui-testing/pages/dataPage.js
T
Sai Nikhil 19a37e5992 fix: org related changes (#7187)
### **User description**
1. This PR fixes 2 issues  
Fetching user roles for OSS is not supported
Introduce organization to oss


___

### **PR Type**
Bug fix, Enhancement


___

### **Description**
- Restrict fetchUserRoles to enterprise/cloud

- Add organizations tab in OSS IAM view

- Introduce organizations route for OSS

- Remove duplicate org route in enterprise


___



### **Changes walkthrough** 📝
<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>AddUser.vue</strong><dd><code>Conditional
fetchUserRoles for OSS</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/components/iam/users/AddUser.vue

<li>Wrapped fetchUserRoles under environment check<br> <li> Prevent
roles fetching in OSS mode


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7187/files#diff-47543c0488c8cb5bcf77e2bb4af9d0a5dd249993cd9577c4852f7950c7aaec91">+3/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>
</table></td></tr><tr><td><strong>Enhancement</strong></td><td><table>
<tr>
  <td>
    <details>
<summary><strong>IdentityAccessManagement.vue</strong><dd><code>Add
organizations tab for OSS</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; </dd></summary>
<hr>

web/src/views/IdentityAccessManagement.vue

- Added "organizations" to OSS tabs list


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7187/files#diff-60b63024c98ee8927e12f9ebec93e99ba7ff419038cfe1cc57d49de1f6f342d6">+1/-1</a>&nbsp;
&nbsp; &nbsp; </td>

</tr>

<tr>
  <td>
    <details>
<summary><strong>useEnterpriseRoutes.ts</strong><dd><code>Add
organizations route for OSS</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </dd></summary>
<hr>

web/src/composables/shared/useEnterpriseRoutes.ts

<li>Added OSS "organizations" route entry<br> <li> Removed duplicate
enterprise org route


</details>


  </td>
<td><a
href="https://github.com/openobserve/openobserve/pull/7187/files#diff-962367ed3d329e73232da2c262cf10c60b14820dd43e95e94302cdcb2f080cbe">+10/-8</a>&nbsp;
&nbsp; </td>

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

___

> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about PR-Agent
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>
2025-06-20 10:04:52 +05:30

40 lines
1.1 KiB
JavaScript

// dataPage.js
import { expect } from '@playwright/test';
export class DataPage {
constructor(page) {
this.page = page;
this.dataPageMenu = page.locator('[data-test="menu-link-\\/ingestion-item"]');
}
async gotoDataPage() {
await this.dataPageMenu.click();
await expect(this.page.getByRole('main')).toContainText('Data sources');
}
async dataPageDefaultOrg() {
await this.page.locator('[data-test="navbar-organizations-select"]').getByText('arrow_drop_down').click();
await this.page.getByText('default', { exact: true }).first().click();
}
async dataPageDefaultMultiOrg() {
await this.page.locator('[data-test="navbar-organizations-select"]').getByText('arrow_drop_down').click();
await this.page.getByRole('option', { name: 'defaulttestmulti' }).locator('div').nth(2).click();
}
async dataPageURLValidation() {
// TODO: Fix this test
// await expect(this.page).not.toHaveURL(/default/);
}
async dataURLValidation() {
await expect(this.page).toHaveURL(/ingestion/);
}
}