mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
### **PR Type** Tests, Enhancement ___ ### **Description** - Remove duplicate Playwright dependencies - Enhance HomePage and StreamsPage POMs with selectors and methods - Add landing page and language translation E2E tests - Extend multistream, stream settings, creation, streaming tests ___ ### **Test Coverage Added** #### Landing Page Tests (landingPage.spec.js) Tests navigation and state preservation across the application: - **14 pages tested**: 7 sidebar pages + 7 settings tabs - **Sidebar pages**: Home, Metrics, Traces, Dashboards, Streams, Alerts, Ingestion - **Settings tabs**: General, Organization Parameters, Alert Destinations, Pipeline Destinations, Templates, Cipher Keys, Sensitive Data Redaction - **Validates**: UI elements on each page, logs state preservation after navigation, header elements (logo, menus, org selector) - **Result**: All 14 pages preserve logs state correctly #### Language Translation Tests (languageTranslation.spec.js) Tests translation coverage across the entire application: - **10 languages tested**: German, Spanish, French, Italian, Dutch, Portuguese, Turkish, Japanese, Korean, Chinese (Simplified) - **12 main pages**: Home, Logs, Metrics, Traces, RUM, Pipelines, Dashboards, Streams, Reports, Alerts, Data Sources, IAM - **22 sub-pages/tabs**: Covers all nested navigation sections - **Coverage threshold**: 80% (ideal), 70% (acceptable) - **Execution**: Runs in parallel for all languages ___ ### Diagram Walkthrough ```mermaid flowchart LR DependenciesFix["Fix Playwright dependencies"] HomePagePOM["Enhanced HomePage POM"] StreamsPagePOM["Enhanced StreamsPage POM"] LandingTests["Landing Page Tests"] LangTests["Language Translation Tests"] StreamCreation["Stream Creation Tests"] MultiStream["Multistream & Streaming Tests"] SettingsTests["Stream Settings Tests"] NameCasing["Stream Name Casing Tests"] DependenciesFix --> HomePagePOM DependenciesFix --> StreamsPagePOM HomePagePOM --> LandingTests HomePagePOM --> LangTests StreamsPagePOM --> StreamCreation StreamsPagePOM --> MultiStream StreamsPagePOM --> SettingsTests StreamsPagePOM --> NameCasing ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>2 files</summary><table> <tr> <td><strong>homePage.js</strong><dd><code>Add landing page selectors and navigation methods</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-a87a274f3fb078f54064ee23c75018dee7d10e99cd19e44134580e360bc829e2">+524/-66</a></td> </tr> <tr> <td><strong>streamsPage.js</strong><dd><code>Add stream creation methods and no-data handling</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-792df584eb1625d35fd1e33a5a37aa3ada28f15ec1e77a1921f1c56e50bf70d2">+250/-1</a> </td> </tr> </table></details></td></tr><tr><td><strong>Tests</strong></td><td><details><summary>7 files</summary><table> <tr> <td><strong>landingPage.spec.js</strong><dd><code>Add landing page navigation state tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-64b7396577833870bf18b21492967ad1e46cefaebaabad6792022bac038b5d96">+590/-0</a> </td> </tr> <tr> <td><strong>languageTranslation.spec.js</strong><dd><code>Add language translation coverage tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-f3ec604702d670acc0417e71327aae98e8255d63d53c68644c458ef913056276">[link]</a> </td> </tr> <tr> <td><strong>multiselect-stream.spec.js</strong><dd><code>Enhance multistream selection and tagging</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-057fce3dbfdd642ca63bece7ba136c34cb5e293de63bf895a6fb212b067d447a">+51/-49</a> </td> </tr> <tr> <td><strong>stream-settings.spec.js</strong><dd><code>Add stream settings configuration tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-05c1f861248ccaeb39b5ccd13bcbf2903de53a59e8522bd5344247f769940b15">+51/-46</a> </td> </tr> <tr> <td><strong>streamCreation.spec.js</strong><dd><code>Add stream creation feature test suite</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-fc1b39bc28f6ebeb48d74c674213ad4eac9c85580def23ed6be257042a4d2d32">+234/-0</a> </td> </tr> <tr> <td><strong>streaming.spec.js</strong><dd><code>Add streaming flow tests with logging</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-1428c96aa08768746bd6a299d9d3956bc687e1d1d1dead12c6bc73dfa579d61c">+19/-10</a> </td> </tr> <tr> <td><strong>streamname.spec.js</strong><dd><code>Add stream name casing preservation tests</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-49828efdc034005c097422deadc8b892bb1e54942d024e40d640fd10c5aa2793">+41/-10</a> </td> </tr> </table></details></td></tr><tr><td><strong>Configuration changes</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>playwright.yml</strong><dd><code>Include new specs in CI workflow</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-7afcd2d8f7b49bda74843f209eefb7b2da45f7e7803bf2e4bd636699b76aa2d3">+2/-0</a> </td> </tr> </table></details></td></tr><tr><td><strong>Dependencies</strong></td><td><details><summary>1 files</summary><table> <tr> <td><strong>package.json</strong><dd><code>Remove redundant Playwright dependencies</code> </dd></td> <td><a href="https://github.com/openobserve/openobserve/pull/9686/files#diff-a41ba7975823b7b2dc071285391f835fbefd33bfffeb5aa2fba3ae15425cc64f">+0/-4</a> </td> </tr> </table></details></td></tr></tr></tbody></table> </details> ___
63 lines
2.1 KiB
JavaScript
63 lines
2.1 KiB
JavaScript
const { test, expect, navigateToBase } = require('../utils/enhanced-baseFixtures.js');
|
|
const PageManager = require('../../pages/page-manager.js');
|
|
const testLogger = require('../utils/test-logger.js');
|
|
|
|
test.describe.configure({ mode: "parallel" });
|
|
|
|
test.describe("Stream name casing preservation tests", () => {
|
|
let pm;
|
|
const TEST_STREAMS = [
|
|
{ name: "e2e_MyUpperStream1" },
|
|
{ name: "e2e_mylowerstream1" },
|
|
];
|
|
|
|
test.beforeEach(async ({ page }, testInfo) => {
|
|
testLogger.testStart(testInfo.title, testInfo.file);
|
|
await navigateToBase(page);
|
|
pm = new PageManager(page);
|
|
testLogger.info('Test setup completed');
|
|
});
|
|
|
|
test.afterEach(async ({ page }, testInfo) => {
|
|
// Cleanup: Delete test streams
|
|
for (const stream of TEST_STREAMS) {
|
|
try {
|
|
await pm.streamsPage.deleteStreamViaAPI(stream.name, 'logs');
|
|
testLogger.info('Cleaned up stream', { streamName: stream.name });
|
|
} catch (e) {
|
|
// Stream may not exist, ignore
|
|
}
|
|
}
|
|
if (testInfo.status) {
|
|
testLogger.testEnd(testInfo.title, testInfo.status, testInfo.duration);
|
|
}
|
|
});
|
|
|
|
test("should preserve stream name casing after ingestion and show in stream explorer", {
|
|
tag: ['@streamName', '@casing', '@all', '@streams']
|
|
}, async ({ page }) => {
|
|
testLogger.info('Testing stream name casing preservation');
|
|
|
|
// Ingest data into streams
|
|
for (const stream of TEST_STREAMS) {
|
|
await pm.streamsPage.ingestTestData(stream.name);
|
|
testLogger.info('Ingested test data', { streamName: stream.name });
|
|
}
|
|
|
|
// Wait for indexing
|
|
await page.waitForTimeout(2000);
|
|
|
|
// Validate streams in Stream Explorer
|
|
for (const stream of TEST_STREAMS) {
|
|
await pm.streamsPage.navigateToStreamExplorer();
|
|
await pm.streamsPage.searchStream(stream.name);
|
|
await pm.streamsPage.verifyStreamNameVisibility(stream.name);
|
|
await pm.streamsPage.exploreStream();
|
|
await pm.streamsPage.verifyStreamExploration();
|
|
await pm.streamsPage.goBack();
|
|
testLogger.info('Verified stream casing', { streamName: stream.name });
|
|
}
|
|
|
|
testLogger.info('Stream name casing preservation test completed');
|
|
});
|
|
});
|