Skip to content

Commit

Permalink
483148: Move services pages over to new PageHEading
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmypixel committed Dec 27, 2024
1 parent 51a9390 commit 785604c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
17 changes: 4 additions & 13 deletions test/specs/create-microservice.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 () => {
Expand All @@ -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()
})
Expand Down
36 changes: 27 additions & 9 deletions test/specs/secrets.e2e.js
Original file line number Diff line number Diff line change
@@ -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'

Expand Down Expand Up @@ -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')
Expand All @@ -53,22 +49,32 @@ 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')
})

it('Should be an overview page of all secrets page', async () => {
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')
})
})

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'
)
Expand All @@ -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'
)
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
17 changes: 4 additions & 13 deletions test/specs/services.e2e.js
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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 () => {
Expand All @@ -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()
})
})
})

0 comments on commit 785604c

Please sign in to comment.