diff --git a/cypress/e2e/po/detail/node.po.ts b/cypress/e2e/po/detail/node.po.ts new file mode 100644 index 00000000000..5e3eafc932a --- /dev/null +++ b/cypress/e2e/po/detail/node.po.ts @@ -0,0 +1,18 @@ +import PagePo from '@/cypress/e2e/po/pages/page.po'; + +/** + * Details component for nodes + */ +export default class NodeDetailsPo extends PagePo { + private static createPath(cluster: string, nodeName: string) { + return `/c/${ cluster }/explorer/node/${ nodeName }`; + } + + static goTo(path: string): Cypress.Chainable { + throw new Error('invalid'); + } + + constructor(cluster: string, nodeName: string) { + super(NodeDetailsPo.createPath(cluster, nodeName)); + } +} diff --git a/cypress/e2e/po/pages/cluster-manager/namespace.po.ts b/cypress/e2e/po/pages/cluster-manager/namespace.po.ts index 59da215a32a..feb8ca6cfa5 100644 --- a/cypress/e2e/po/pages/cluster-manager/namespace.po.ts +++ b/cypress/e2e/po/pages/cluster-manager/namespace.po.ts @@ -10,6 +10,6 @@ export default class ClusterManagerNamespacePagePo extends PagePo { } namespace() { - return cy.get('.mastehead-resource-title'); + return cy.get('.masthead-resource-title'); } } diff --git a/cypress/e2e/tests/pages/explorer2/nodes/node-detail.spec.ts b/cypress/e2e/tests/pages/explorer2/nodes/node-detail.spec.ts index 18b7ecfc306..5a46b64f28f 100644 --- a/cypress/e2e/tests/pages/explorer2/nodes/node-detail.spec.ts +++ b/cypress/e2e/tests/pages/explorer2/nodes/node-detail.spec.ts @@ -2,6 +2,7 @@ import ResourceTable from '@/cypress/e2e/po//components/resource-table.po'; import ClusterDashboardPagePo from '@/cypress/e2e/po/pages/explorer/cluster-dashboard.po'; import HomePagePo from '@/cypress/e2e/po/pages/home.po'; import ProductNavPo from '@/cypress/e2e/po/side-bars/product-side-nav.po'; +import NodeDetailsPo from '@/cypress/e2e/po/detail/node.po'; describe('Node detail', { tags: ['@explorer2', '@adminUser'], testIsolation: 'off' }, () => { before(() => { @@ -25,12 +26,20 @@ describe('Node detail', { tags: ['@explorer2', '@adminUser'], testIsolation: 'of // Wait for loading indicator to go nodeList.sortableTable().checkLoadingIndicatorNotVisible(); - nodeList.sortableTable().rowElementLink(0, 2).click(); - cy.get('.title .primaryheader h1').should('be.visible'); - cy.get('.title .primaryheader h1').invoke('text').should('contain', 'Node:'); - cy.reload(); - // check that the page rendered is a detail view - cy.get('.title .primaryheader h1').should('be.visible'); - cy.get('.title .primaryheader h1').invoke('text').should('contain', 'Node:'); + nodeList.sortableTable().rowNames().then((nodes) => { + const node = nodes[0]; + + nodeList.sortableTable().rowElementLink(0, 2).click(); + + const nodeDetail = new NodeDetailsPo('local', node); + + nodeDetail.waitForPage(); + nodeDetail.mastheadTitle().should('contain', `${ node }`); + + cy.reload(); + + nodeDetail.waitForPage(); + nodeDetail.mastheadTitle().should('contain', `${ node }`); + }); }); }); diff --git a/shell/components/ResourceDetail/Masthead.vue b/shell/components/ResourceDetail/Masthead.vue index 75262450c3f..b8f66fb591f 100644 --- a/shell/components/ResourceDetail/Masthead.vue +++ b/shell/components/ResourceDetail/Masthead.vue @@ -442,7 +442,7 @@ export default { {{ value.detailPageHeaderActionOverride(realMode) }}