Files
openobserve/tests/ui-testing/pages/dataPage.js
T
ShyamOOAI 6f52dc444d test: Change Org (#5201)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Release Notes

- **New Features**
- Introduced comprehensive UI testing for the Home, Ingestion, Login,
Logs, Metrics, Traces, Pipelines, Rum, Dashboard, Alerts, Reports, Data,
IAM, and About pages.
- Added functionality to handle organization changes and validations
across multiple pages, including default organization selections.
- New test suite for validating organization change scenarios across
various pages.
	- Enhanced login functionality for internal users.
- Introduced new classes and methods for the Metrics, Streams, Rum, and
Alerts pages to support UI testing.
- Added new classes for the Data and IAM pages, expanding testing
capabilities.
	- Enhanced Management page with navigation and validation capabilities.
- New methods for validating page URLs and content across various pages.

- **Bug Fixes**
- Improved validation methods to ensure proper navigation and content
checks on various pages.

- **Documentation**
- Updated testing framework to include new test cases and improved
structure for organization change tests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-12-04 11:01:16 +05:30

39 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 }).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() {
await expect(this.page).toHaveURL(/defaulttestmulti/);
}
async dataURLValidation() {
await expect(this.page).toHaveURL(/ingestion/);
}
}