Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/dns_dashboards.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('(OCP-67087 Network_Observability) DNSTracking test', { tags: ['Network
cy.contains('Display options').should('exist').click()

cy.get('[data-test-id=edge-handler]').should('exist').each((g) => {
expect(g.text()).to.match(/\d* ms/gm);
expect(g.text()).to.match(/\d+\s*ms/);
});

// verify Query Summary stats for DNSTracking
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/flowRTT_dashboards.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('(OCP-68246 Network_Observability) FlowRTT test', { tags: ['Network_Obs
cy.get(filterSelectors.filterInput).type("protocol=TCP" + '{enter}').click()

cy.get('[data-test-id=edge-handler]').each((g) => {
expect(g.text()).to.match(/\d* ms/gm);
expect(g.text()).to.match(/\d+\s*ms/);
});
netflowPage.clearAllFilters()

Expand Down
1 change: 0 additions & 1 deletion web/cypress/integration-tests/health_dashboards.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Operator } from "@views/netobserv"
import { dashboard, dashboardSelectors } from "@views/dashboards-page"

const healthPanels = [
"flows-per-second-chart",
"global-sampling-chart",
"errors-last-minute-chart",
"dropped-flows-per-second-chart"
Expand Down
5 changes: 1 addition & 4 deletions web/cypress/integration-tests/netflow_conversations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ describe('(OCP-71787 Network_Observability) Conversation tracking test', { tags:
})

it("(OCP-71787, aramesha, Network_Observability) should verify Query Summary panel", function () {
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.get('#query-options-dropdown').click();
cy.get('#recordType-allConnections').click()
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.changeQueryOption('Conversation')

// validate Query Summary panel
let warningExists = false
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/netflow_export.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('(OCP-72610 Network_Observability) Export automation', { tags: ['Networ
cy.byTestID("table-composable").should('exist')
cy.showAdvancedOptions();
cy.get('#export-button').should('exist').click()
cy.get('.footer > [data-test="export-button"]').should('exist').then((exportbtn) => {
cy.get('[data-test="export-modal-footer"] > [data-test="export-button"]').should('exist').then((exportbtn) => {
cy.wrap(exportbtn).click()
// wait for download to complete
cy.wait(3000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('(OCP-67615, OCP-72874 Network_Observability) Return external traffic a
})

after("all tests", function () {
cy.adminCLI('oc delete -f cypress/fixtures/test-pod.yaml')
cy.adminCLI('oc delete -f cypress/fixtures/test-pod.yaml --ignore-not-found')
Operator.deleteFlowCollector()
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/network_health.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('(OCP-84821 Network_Observability) Network Health test', { tags: ['Netw
})

after("any test", function () {
cy.adminCLI('oc delete -f cypress/fixtures/dns_errors.yaml')
cy.adminCLI('oc delete -f cypress/fixtures/dns_errors.yaml --ignore-not-found')
Operator.deleteFlowCollector()
cy.adminCLI(`oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`)
})
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/overview_page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ describe('(OCP-54839 Network_Observability) Netflow Overview page tests', { tags
// verify single focus graph toggle
cy.get('#focus-switch').check()
// verify 'Top 5 average bytes rates' panel is in focus
cy.get('#overview-absolute-graph').contains('Top 5 average bytes rates');
cy.get('#overview-sticky-graph').contains('Top 5 average bytes rates');
cy.get('[data-test-metrics]').its('length').should('gt', 0);

// verify other panels are scrollable on the right
Expand Down
6 changes: 3 additions & 3 deletions web/cypress/integration-tests/prom_datasource_only.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ describe('(OCP-74049, OCP-73875 Network_Observability) Prometheus datasource onl
cy.checkNetflowTraffic("Disabled")

// verify only prom and auto dataSource is enabled in query options
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.get('#query-options-dropdown').click();
cy.byTestID('query-options-dropdown').click();
cy.get('#query-options-popper').click();
cy.get('#dataSource-loki').should('be.disabled')
cy.get('#dataSource-prom').should('not.be.disabled')
cy.get('#dataSource-auto').should('not.be.disabled')
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.byTestID('query-options-dropdown').click();

// verify resource scope is not observed with prom dataSource
cy.byTestID("show-view-options-button").should('exist').click().then(views => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/integration-tests/static_plugin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('(OCP-84156 Network_Observability) StaticPlugin test', { tags: ['Networ
cy.get(pluginSelectors.update).click()
// Wait for flowcollector to get ready
cy.wait(20000)
cy.get('[id=Ready-row]').each($td => {
cy.get('[id=Ready-row]', { timeout: 60000 }).each($td => {
cy.wrap($td).should('have.attr', 'data-test-status', 'True')
cy.wrap($td).should('have.attr', "data-test-reason", 'Ready')
})
Expand Down
12 changes: 9 additions & 3 deletions web/cypress/integration-tests/table_queryopts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,15 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408 Network_Observability) Net
cy.contains('Date').should('exist')
})

it("(OCP-68125, aramesha, Network_Observability)should verify DSCP column is enbaled by default", function () {
it("(OCP-68125, aramesha, Network_Observability) should verify DSCP column", function () {
netflowPage.stopAutoRefresh()
cy.openColumnsModal().then(col => {
cy.get(colSelectors.columnsModal).should('be.visible')
cy.get('#Dscp').check()
cy.byTestID(colSelectors.save).click()
})
cy.reload()
Comment thread
coderabbitai[bot] marked this conversation as resolved.

Comment thread
Amoghrd marked this conversation as resolved.
cy.byTestID('table-composable').should('exist').within(() => {
cy.get(colSelectors.dscp).should('exist')
})
Expand All @@ -114,8 +122,6 @@ describe('(OCP-50532, OCP-50531, OCP-50530, OCP-59408 Network_Observability) Net
cy.get(filterSelectors.filterInput).type("dscp=0" + '{enter}').click()
cy.get('#dscp-0-toggle > span.pf-v5-c-menu-toggle__text').should('contain.text', 'Standard')

netflowPage.stopAutoRefresh()
Comment thread
Amoghrd marked this conversation as resolved.

// Verify DSCP value is Standard for all rows
cy.get('[data-test-td-column-id=Dscp]').each((td) => {
expect(td).attr("data-test-td-value").to.contain(0)
Expand Down
21 changes: 19 additions & 2 deletions web/cypress/views/dashboards-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,25 @@ export const appsInfra = [

Cypress.Commands.add('checkDashboards', (names) => {
for (let i = 0; i < names.length; i++) {
cy.byTestID(names[i], { timeout: 120000 }).should('exist')
.find(graphSelector.graphBody, { timeout: 120000 }).should('not.have.class', 'pf-v6-c-empty-state')
// Wait for panel to exist
cy.byTestID(names[i], { timeout: 120000 }).should('exist').first().then($panel => {
// Scroll panel into view to ensure it loads
cy.wrap($panel).scrollIntoView()
})

// Add wait to allow metrics to populate
cy.wait(2000)

// Check that graph body doesn't have empty state - use a custom retry mechanism
cy.byTestID(names[i], { timeout: 120000 }).first().within(() => {
cy.get(graphSelector.graphBody, { timeout: 120000 }).should($body => {
const hasEmptyState = $body.hasClass('pf-v6-c-empty-state')
if (hasEmptyState) {
// Force a retry by throwing an error
throw new Error('Dashboard panel still showing empty state, retrying...')
}
})
})
}
})

Expand Down
14 changes: 8 additions & 6 deletions web/cypress/views/netflow-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ export const netflowPage = {
stopAutoRefresh: () => {
cy.byTestID(genSelectors.refreshDrop).should('exist').then($btn => {
// only stop refresh if it's not already OFF
if ($btn.text() != "Refresh off") {
cy.wrap($btn).click({ force: true })
cy.get('[data-test="OFF_KEY"]').should('exist').click({ force: true })
if (!$btn.text().includes("Refresh off")) {
cy.byTestID(genSelectors.refreshDrop).click()
// Wait for dropdown menu to be rendered and visible
cy.get('.pf-v5-c-menu').should('be.visible')
cy.get('body').find('[data-test="OFF_KEY"]').click()
}
})
},
Expand Down Expand Up @@ -347,9 +349,9 @@ Cypress.Commands.add('checkQuerySummary', (metric) => {
});

Cypress.Commands.add('changeQueryOption', (name: string) => {
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.get('#query-options-dropdown').contains(name).click();
cy.get('#filter-toolbar-search-filters').contains('Query options').click();
cy.byTestID('query-options-dropdown').click();
cy.get('#query-options-popper').contains(name).click();
cy.byTestID('query-options-dropdown').click();
});

Cypress.Commands.add('visitNetflowTrafficTab', (page) => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/views/netobserv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const Operator = {
}
})
// don't create flowcollector if already exists
cy.get('div.loading-box:nth-child(1)').should('be.visible').then(() => {
cy.get('div.loading-box__loaded:nth-child(2)', { timeout: 60000 }).should('be.visible').then(() => {
if (Cypress.$('td[role="gridcell"]').length == 0) {
cy.log("Deploying flowcollector")
switch (parameters) {
Expand Down
Loading