From dd6094f796fb8a674334f75fd63424628b902566 Mon Sep 17 00:00:00 2001 From: Ryan Andrews Date: Tue, 24 Sep 2024 12:04:43 +0100 Subject: [PATCH] ATO-1063: Updates test matcher [deploy] Uses a new test matcher which does not have hardcoded values and instead pulls from the environment variables --- .../acceptance-features/clients/client-details.feature | 5 ++--- ui-automation-tests/support/steps/clients-steps.ts | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ui-automation-tests/acceptance-features/clients/client-details.feature b/ui-automation-tests/acceptance-features/clients/client-details.feature index 07727ca9a..dc3c7d0bc 100644 --- a/ui-automation-tests/acceptance-features/clients/client-details.feature +++ b/ui-automation-tests/acceptance-features/clients/client-details.feature @@ -9,9 +9,8 @@ Feature: A page where users can view the details associated with a client Then they should see the value for the Client ID "P0_ZdXojEGDlaZEU8Q9Zlv-fo1s" @ci @smoke - Scenario: The user wants to view the user name and password for end journey - Then they should see the text "Username: integration-user" - And they should see the text "Password: winter2021" + Scenario: The user wants to view the user name and password for integration environment + Then they should see the basic auth details for the integration environment Rule: The the hidden content and the links which open in a new tab, are available for the user to view @ci @smoke diff --git a/ui-automation-tests/support/steps/clients-steps.ts b/ui-automation-tests/support/steps/clients-steps.ts index 9d77d5010..4fc413f30 100644 --- a/ui-automation-tests/support/steps/clients-steps.ts +++ b/ui-automation-tests/support/steps/clients-steps.ts @@ -102,3 +102,9 @@ Then("they should see that claims field is not present", async function (this: T assert.ok("Claims field is not present, as expected."); } }); + +Then("they should see the basic auth details for the integration environment", async function (this: TestContext) { + const bodyText = await this.page.$eval("body", element => element.textContent); + assert.equal(bodyText?.includes(`Username: ${this.basicAuthUsername}`), true, `Body text does not contain '${this.basicAuthUsername}'`); + assert.equal(bodyText?.includes(`Password: ${this.basicAuthPassword}`), true, `Body text does not contain '${this.basicAuthPassword}'`); +});