From 785604cded4a1024b93e89045dc5c62188299e47 Mon Sep 17 00:00:00 2001 From: Ben Chidgey Date: Fri, 27 Dec 2024 22:22:27 +0000 Subject: [PATCH] 483148: Move services pages over to new PageHEading --- test/specs/create-microservice.e2e.js | 17 +++---------- test/specs/secrets.e2e.js | 36 ++++++++++++++++++++------- test/specs/services.e2e.js | 17 +++---------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/test/specs/create-microservice.e2e.js b/test/specs/create-microservice.e2e.js index 133b2a5..a9cd23d 100644 --- a/test/specs/create-microservice.e2e.js +++ b/test/specs/create-microservice.e2e.js @@ -4,6 +4,7 @@ import CreatePage from 'page-objects/create.page' import ServicesPage from 'page-objects/services.page' import FormComponent from 'components/form.component' import HeadingComponent from 'components/heading.component' +import PageHeadingComponent from 'components/page-heading.component' import EntityListComponent from 'components/entity-list.component' import ErrorPage from 'page-objects/error.page' import LoginStubPage from 'page-objects/login-stub.page' @@ -134,13 +135,8 @@ describe('Create microservice', () => { `${testRepositoryName} microservice | Core Delivery Platform - Portal` ) await expect(await ServicesPage.navIsActive()).toBe(true) - await expect(HeadingComponent.title(testRepositoryName)).toExist() - - await expect( - HeadingComponent.caption( - `Information about the ${testRepositoryName} microservice` - ) - ).toExist() + await expect(PageHeadingComponent.caption('Service')).toExist() + await expect(PageHeadingComponent.title(testRepositoryName)).toExist() }) it('Should display new microservice on services list page', async () => { @@ -150,12 +146,7 @@ describe('Create microservice', () => { 'Services | Core Delivery Platform - Portal' ) await expect(await ServicesPage.navIsActive()).toBe(true) - await expect(HeadingComponent.title('Services')).toExist() - await expect( - HeadingComponent.caption( - 'Frontend and Backend microservice information' - ) - ).toExist() + await expect(PageHeadingComponent.title('Services')).toExist() await expect(EntityListComponent.entityLink(testRepositoryName)).toExist() }) diff --git a/test/specs/secrets.e2e.js b/test/specs/secrets.e2e.js index 33b7e27..541f3f1 100644 --- a/test/specs/secrets.e2e.js +++ b/test/specs/secrets.e2e.js @@ -1,12 +1,12 @@ import { expect } from '@wdio/globals' -import HeadingComponent from 'components/heading.component' import TabsComponent from 'components/tabs.component' import SplitPaneComponent from 'components/split-pane.component' import ServicesPage from 'page-objects/services.page' import SecretsPage from 'page-objects/secrets.page' import ErrorPage from 'page-objects/error.page' import LoginStubPage from 'page-objects/login-stub.page' +import PageHeadingComponent from 'components/page-heading.component.js' const tenantService = 'cdp-portal-frontend' @@ -39,12 +39,8 @@ describe('Secrets feature', () => { it('Should be a tab on a "Service" page', async () => { await expect(await ServicesPage.navIsActive()).toBe(true) - await expect(ServicesPage.pageHeading()).toHaveText(tenantService) - await expect( - HeadingComponent.caption( - 'Information about the cdp-portal-frontend microservice' - ) - ).toExist() + await expect(PageHeadingComponent.caption('Service')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) await expect(TabsComponent.activeTab()).toHaveText('About') await expect(TabsComponent.secondTab()).toHaveText('Secrets') @@ -53,7 +49,10 @@ describe('Secrets feature', () => { describe('When navigating to Secrets overview page', () => { it('Should be able to go direct to "Secrets" overview', async () => { await SecretsPage.open(tenantService) - await expect(SecretsPage.pageHeading()).toHaveText(tenantService) + + await expect(PageHeadingComponent.caption('Secrets')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await expect(TabsComponent.activeTab()).toHaveText('Secrets') }) @@ -61,7 +60,10 @@ describe('Secrets feature', () => { await ServicesPage.open(`/${tenantService}`) await expect(await TabsComponent.secondTab()).toHaveText('Secrets') await TabsComponent.secondTab().click() - await expect(await SecretsPage.pageHeading()).toHaveText(tenantService) + + await expect(PageHeadingComponent.caption('Secrets')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await expect(TabsComponent.activeTab()).toHaveText('Secrets') }) }) @@ -69,6 +71,10 @@ describe('Secrets feature', () => { describe('When going to an Environment Secrets page', () => { it('Should be a page of that environments secrets', async () => { await SecretsPage.open(tenantService, 'management') + + await expect(PageHeadingComponent.caption('Secrets')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await expect(SecretsPage.environmentHeader()).toHaveText( 'Management secrets' ) @@ -82,6 +88,10 @@ describe('Secrets feature', () => { await expect(await ServicesPage.navIsActive()).toBe(true) await expect(await SplitPaneComponent.subNavIsActive('all')).toBe(true) await SplitPaneComponent.subNavItemLink('management').click() + + await expect(PageHeadingComponent.caption('Secrets')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await expect(SecretsPage.environmentHeader()).toHaveText( 'Management secrets' ) @@ -116,6 +126,10 @@ describe('Secrets feature', () => { // Create a secret to test against await SecretsPage.open(tenantService, 'management') + + await expect(PageHeadingComponent.caption('Secrets')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await SecretsPage.createSecretName().setValue(keyName) await SecretsPage.createSecretValue().setValue('test-value') await SecretsPage.createSecretButton().click() @@ -125,6 +139,10 @@ describe('Secrets feature', () => { it('Should be listed as updated secrets', async () => { await SecretsPage.secretAction(keyName).click() + + await expect(PageHeadingComponent.caption('Update Secret')).toExist() + await expect(PageHeadingComponent.title()).toHaveText(tenantService) + await SecretsPage.updateHeader().waitForExist() await SecretsPage.updateSecretValue().setValue('test-updated-value') await SecretsPage.updateSecretButton().click() diff --git a/test/specs/services.e2e.js b/test/specs/services.e2e.js index 22988b6..88e60a5 100644 --- a/test/specs/services.e2e.js +++ b/test/specs/services.e2e.js @@ -1,6 +1,6 @@ import { browser, expect } from '@wdio/globals' -import HeadingComponent from 'components/heading.component' +import PageHeadingComponent from 'components/page-heading.component' import ServicesPage from 'page-objects/services.page' import LoginStubPage from 'page-objects/login-stub.page' @@ -20,12 +20,7 @@ describe('Services page', () => { ) await expect(await ServicesPage.navIsActive()).toBe(true) - await expect(HeadingComponent.title('Services')).toExist() - await expect( - HeadingComponent.caption( - 'Frontend and Backend microservice information' - ) - ).toExist() + await expect(PageHeadingComponent.title('Services')).toExist() }) it('Should navigate to a "Service" page', async () => { @@ -34,12 +29,8 @@ describe('Services page', () => { `${tenantService} microservice | Core Delivery Platform - Portal` ) await expect(await ServicesPage.navIsActive()).toBe(true) - await expect(HeadingComponent.title(tenantService)).toExist() - await expect( - HeadingComponent.caption( - `Information about the ${tenantService} microservice` - ) - ).toExist() + await expect(PageHeadingComponent.title(tenantService)).toExist() + await expect(PageHeadingComponent.caption('Service')).toExist() }) }) })