From cb48f1fd162ae56b8dae0988b60cb80f315ae1a9 Mon Sep 17 00:00:00 2001 From: Allen Annom Date: Mon, 30 Sep 2024 17:27:46 +0100 Subject: [PATCH 1/4] UML-3619 wip --- docker-compose.yml | 4 ++-- .../app/src/App/src/Service/Lpa/LpaManagerFactory.php | 6 +++--- service-api/app/test/fixtures/example_lpa.json | 4 ++-- service-front/app/test/fixtures/full_example.json | 4 ++-- .../app/test/fixtures/full_example_signed_before_2016.json | 4 ++-- service-front/app/test/fixtures/simple_example.json | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 09e73026f3..8c3723e3bc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -108,7 +108,7 @@ services: ALLOW_MERIS_LPAS: "false" INSTRUCTIONS_AND_PREFERENCES: "true" ALLOW_GOV_ONE_LOGIN: "true" - SUPPORT_DATASTORE_LPAS: "false" + SUPPORT_DATASTORE_LPAS: "true" # Local only API_SERVICE_URL: @@ -195,7 +195,7 @@ services: ALLOW_MERIS_LPAS: "false" INSTRUCTIONS_AND_PREFERENCES: "true" ALLOW_GOV_ONE_LOGIN: "true" - SUPPORT_DATASTORE_LPAS: "false" + SUPPORT_DATASTORE_LPAS: "true" # Local only AWS_ACCESS_KEY_ID: "devkey" diff --git a/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php b/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php index f080ec8b44..7f98fd5a78 100644 --- a/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php +++ b/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php @@ -16,9 +16,9 @@ public function __construct(private readonly ContainerInterface $container) public function __invoke(): LpaManagerInterface { - if (($this->container->get(FeatureEnabled::class))('support_datastore_lpas')) { - throw new RuntimeException('Datastore LPA support is enabled but not implemented yet.'); - } +// if (($this->container->get(FeatureEnabled::class))('support_datastore_lpas')) { +// throw new RuntimeException('Datastore LPA support is enabled but not implemented yet.'); +// } return $this->container->get(SiriusLpaManager::class); } diff --git a/service-api/app/test/fixtures/example_lpa.json b/service-api/app/test/fixtures/example_lpa.json index 6b03b5feb6..c6b10036ed 100644 --- a/service-api/app/test/fixtures/example_lpa.json +++ b/service-api/app/test/fixtures/example_lpa.json @@ -14,9 +14,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2018-06-30", - "lifeSustainingTreatment": "yes", + "lifeSustainingTreatment": "Option A", "onlineLpaId": "ABC123", - "attorneyActDecisions": "Example decision", + "attorneyActDecisions": "jointly", "donor": { "id": 0, "uId": "700000000053", diff --git a/service-front/app/test/fixtures/full_example.json b/service-front/app/test/fixtures/full_example.json index 0ee7d679c3..1d72f1e121 100644 --- a/service-front/app/test/fixtures/full_example.json +++ b/service-front/app/test/fixtures/full_example.json @@ -16,9 +16,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2018-06-30", - "lifeSustainingTreatment": "yes", + "lifeSustainingTreatment": "Option A", "onlineLpaId": "ABC123", - "attorneyActDecisions": "Example decision", + "attorneyActDecisions": "jointly", "hasSeveranceWarning": true, "donor": { "id": 0, diff --git a/service-front/app/test/fixtures/full_example_signed_before_2016.json b/service-front/app/test/fixtures/full_example_signed_before_2016.json index c55c371de6..4b22813620 100644 --- a/service-front/app/test/fixtures/full_example_signed_before_2016.json +++ b/service-front/app/test/fixtures/full_example_signed_before_2016.json @@ -16,9 +16,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2015-06-30", - "lifeSustainingTreatment": "yes", + "lifeSustainingTreatment": "Option A", "onlineLpaId": "ABC123", - "attorneyActDecisions": "Example decision", + "attorneyActDecisions": "jointly", "donor": { "id": 0, "uId": "700000000054", diff --git a/service-front/app/test/fixtures/simple_example.json b/service-front/app/test/fixtures/simple_example.json index 0aaf437fb8..996a0bf278 100644 --- a/service-front/app/test/fixtures/simple_example.json +++ b/service-front/app/test/fixtures/simple_example.json @@ -18,7 +18,7 @@ "lpaDonorSignatureDate": "2018-06-30", "lifeSustainingTreatment": null, "onlineLpaId": "ABC123", - "attorneyActDecisions": "Example decision", + "attorneyActDecisions": "jointly", "donor": { "id": 0, "uId": "7000-0000-0054", From 7377fe59a2480aac25bcb0f3a2dcc8d8e78b7eec Mon Sep 17 00:00:00 2001 From: Allen Annom Date: Thu, 3 Oct 2024 09:34:35 +0100 Subject: [PATCH 2/4] UML-3619 Convert incoming LPAs to combined format (repository layer) --- docker-compose.yml | 4 ++-- .../app/src/App/src/Service/Lpa/LpaManagerFactory.php | 6 +++--- service-api/app/test/fixtures/example_lpa.json | 4 ++-- service-front/app/test/fixtures/full_example.json | 4 ++-- .../app/test/fixtures/full_example_signed_before_2016.json | 4 ++-- service-front/app/test/fixtures/simple_example.json | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 8c3723e3bc..09e73026f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -108,7 +108,7 @@ services: ALLOW_MERIS_LPAS: "false" INSTRUCTIONS_AND_PREFERENCES: "true" ALLOW_GOV_ONE_LOGIN: "true" - SUPPORT_DATASTORE_LPAS: "true" + SUPPORT_DATASTORE_LPAS: "false" # Local only API_SERVICE_URL: @@ -195,7 +195,7 @@ services: ALLOW_MERIS_LPAS: "false" INSTRUCTIONS_AND_PREFERENCES: "true" ALLOW_GOV_ONE_LOGIN: "true" - SUPPORT_DATASTORE_LPAS: "true" + SUPPORT_DATASTORE_LPAS: "false" # Local only AWS_ACCESS_KEY_ID: "devkey" diff --git a/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php b/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php index 7f98fd5a78..f080ec8b44 100644 --- a/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php +++ b/service-api/app/src/App/src/Service/Lpa/LpaManagerFactory.php @@ -16,9 +16,9 @@ public function __construct(private readonly ContainerInterface $container) public function __invoke(): LpaManagerInterface { -// if (($this->container->get(FeatureEnabled::class))('support_datastore_lpas')) { -// throw new RuntimeException('Datastore LPA support is enabled but not implemented yet.'); -// } + if (($this->container->get(FeatureEnabled::class))('support_datastore_lpas')) { + throw new RuntimeException('Datastore LPA support is enabled but not implemented yet.'); + } return $this->container->get(SiriusLpaManager::class); } diff --git a/service-api/app/test/fixtures/example_lpa.json b/service-api/app/test/fixtures/example_lpa.json index c6b10036ed..6b03b5feb6 100644 --- a/service-api/app/test/fixtures/example_lpa.json +++ b/service-api/app/test/fixtures/example_lpa.json @@ -14,9 +14,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2018-06-30", - "lifeSustainingTreatment": "Option A", + "lifeSustainingTreatment": "yes", "onlineLpaId": "ABC123", - "attorneyActDecisions": "jointly", + "attorneyActDecisions": "Example decision", "donor": { "id": 0, "uId": "700000000053", diff --git a/service-front/app/test/fixtures/full_example.json b/service-front/app/test/fixtures/full_example.json index 1d72f1e121..0ee7d679c3 100644 --- a/service-front/app/test/fixtures/full_example.json +++ b/service-front/app/test/fixtures/full_example.json @@ -16,9 +16,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2018-06-30", - "lifeSustainingTreatment": "Option A", + "lifeSustainingTreatment": "yes", "onlineLpaId": "ABC123", - "attorneyActDecisions": "jointly", + "attorneyActDecisions": "Example decision", "hasSeveranceWarning": true, "donor": { "id": 0, diff --git a/service-front/app/test/fixtures/full_example_signed_before_2016.json b/service-front/app/test/fixtures/full_example_signed_before_2016.json index 4b22813620..c55c371de6 100644 --- a/service-front/app/test/fixtures/full_example_signed_before_2016.json +++ b/service-front/app/test/fixtures/full_example_signed_before_2016.json @@ -16,9 +16,9 @@ "applicationHasRestrictions": true, "applicationHasGuidance": true, "lpaDonorSignatureDate": "2015-06-30", - "lifeSustainingTreatment": "Option A", + "lifeSustainingTreatment": "yes", "onlineLpaId": "ABC123", - "attorneyActDecisions": "jointly", + "attorneyActDecisions": "Example decision", "donor": { "id": 0, "uId": "700000000054", diff --git a/service-front/app/test/fixtures/simple_example.json b/service-front/app/test/fixtures/simple_example.json index 996a0bf278..0aaf437fb8 100644 --- a/service-front/app/test/fixtures/simple_example.json +++ b/service-front/app/test/fixtures/simple_example.json @@ -18,7 +18,7 @@ "lpaDonorSignatureDate": "2018-06-30", "lifeSustainingTreatment": null, "onlineLpaId": "ABC123", - "attorneyActDecisions": "jointly", + "attorneyActDecisions": "Example decision", "donor": { "id": 0, "uId": "7000-0000-0054", From 7ffd278eb79ed82fa6dbf1659b64aeb3c182c131 Mon Sep 17 00:00:00 2001 From: Allen Annom Date: Thu, 2 Jan 2025 12:21:00 +0000 Subject: [PATCH 3/4] UML-3764 removing one login FF --- .github/workflows/_run-behat-tests.yml | 2 - docker-compose.yml | 2 - service-api/app/features/actor-logout.feature | 2 +- service-api/app/features/bootstrap/config.php | 4 +- .../app/config/autoload/features.global.php | 6 +- service-front/app/config/routes.php | 122 ++---------------- .../features/actor-account-creation.feature | 2 +- .../app/features/actor-delete-account.feature | 4 +- .../app/features/actor-password-reset.feature | 65 ---------- .../app/features/actor-terms-of-use.feature | 8 +- .../app/features/actor-your-details.feature | 8 +- .../app/features/bootstrap/behat.config.php | 1 - .../app/features/common-language.feature | 9 ++ .../context/Integration/AccountContext.php | 8 -- .../features/context/UI/AccountContext.php | 115 ++++------------- .../Factory/LogoutPageHandlerFactory.php | 6 +- .../Actor/templates/actor/settings.html.twig | 109 ++++------------ .../AuthenticationMiddlewareFactory.php | 7 - .../Common/templates/layout/default.html.twig | 6 +- .../Factory/LogoutPageHandlerFactoryTest.php | 42 +----- .../AuthenticationMiddlewareTest.php | 7 +- terraform/environment/config_file.tf | 1 - terraform/environment/region.tf | 2 - terraform/environment/region/api_ecs.tf | 4 - terraform/environment/region/use_ecs.tf | 4 - terraform/environment/region/viewer_ecs.tf | 4 - terraform/environment/terraform.tfvars.json | 5 - terraform/environment/variables.tf | 1 - tests/smoke/.env | 2 +- tests/smoke/context/AccountContext.php | 77 +++++------ tests/smoke/docker-compose.smoke.yml | 5 - 31 files changed, 118 insertions(+), 522 deletions(-) delete mode 100644 service-front/app/features/actor-password-reset.feature diff --git a/.github/workflows/_run-behat-tests.yml b/.github/workflows/_run-behat-tests.yml index 8fe3ff8031..3ad4850cd2 100644 --- a/.github/workflows/_run-behat-tests.yml +++ b/.github/workflows/_run-behat-tests.yml @@ -81,7 +81,6 @@ jobs: use_fqdn=$(cat ./terraform/environment/cluster_config.json | jq .use_fqdn | xargs) public_facing_view_fqdn=$(cat ./terraform/environment/cluster_config.json | jq .public_facing_view_fqdn | xargs) public_facing_use_fqdn=$(cat ./terraform/environment/cluster_config.json | jq .public_facing_use_fqdn | xargs) - ff_allow_gov_one_login=$(cat ./terraform/environment/cluster_config.json | jq .ff_allow_gov_one_login | xargs) ln -sf ../features tests/smoke/features @@ -90,7 +89,6 @@ jobs: BEHAT_ACTOR_URL=https://$public_facing_use_fqdn \ BEHAT_OLD_VIEWER_URL=https://$viewer_fqdn \ BEHAT_OLD_ACTOR_URL=https://$use_fqdn \ - BEHAT_FF_ALLOW_GOV_ONE_LOGIN=$ff_allow_gov_one_login \ vendor/bin/behat - name: archive failed test screenshots diff --git a/docker-compose.yml b/docker-compose.yml index ab22779ffc..451ffba641 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -104,7 +104,6 @@ services: # Feature flags DELETE_LPA_FEATURE: "true" ALLOW_MERIS_LPAS: "false" - ALLOW_GOV_ONE_LOGIN: "true" SUPPORT_DATASTORE_LPAS: "false" # Local only @@ -190,7 +189,6 @@ services: # Feature flags ALLOW_MERIS_LPAS: "false" - ALLOW_GOV_ONE_LOGIN: "true" SUPPORT_DATASTORE_LPAS: "false" # Local only diff --git a/service-api/app/features/actor-logout.feature b/service-api/app/features/actor-logout.feature index 76b0e00f99..769393384b 100644 --- a/service-api/app/features/actor-logout.feature +++ b/service-api/app/features/actor-logout.feature @@ -8,7 +8,7 @@ Feature: A user of the system is able to logout Given I am a user of the lpa application And I have been given access to use an LPA via credentials - @acceptance @ff:allow_gov_one_login:true + @acceptance Scenario: A user can logout Given I am currently signed in When I logout of the application diff --git a/service-api/app/features/bootstrap/config.php b/service-api/app/features/bootstrap/config.php index 40b32ed062..37b52978b6 100644 --- a/service-api/app/features/bootstrap/config.php +++ b/service-api/app/features/bootstrap/config.php @@ -72,7 +72,5 @@ 'discovery_url' => 'http://one-login-mock/.well-known/openid-configuration', 'identity_issuer' => 'http://identity.one-login-mock/', ], - 'feature_flags' => [ - 'allow_gov_one_login' => true, - ], + 'feature_flags' => [], ]; diff --git a/service-front/app/config/autoload/features.global.php b/service-front/app/config/autoload/features.global.php index 0a49740eae..adad578e1b 100644 --- a/service-front/app/config/autoload/features.global.php +++ b/service-front/app/config/autoload/features.global.php @@ -16,11 +16,7 @@ getenv('ALLOW_MERIS_LPAS'), FILTER_VALIDATE_BOOLEAN ) ?: false, - 'allow_gov_one_login' => filter_var( - getenv('ALLOW_GOV_ONE_LOGIN'), - FILTER_VALIDATE_BOOLEAN - ) ?: false, - 'support_datastore_lpas' => filter_var( + 'support_datastore_lpas' => filter_var( getenv('SUPPORT_DATASTORE_LPAS'), FILTER_VALIDATE_BOOLEAN ) ?: false, diff --git a/service-front/app/config/routes.php b/service-front/app/config/routes.php index 4f7a079120..3c6aac5ca7 100644 --- a/service-front/app/config/routes.php +++ b/service-front/app/config/routes.php @@ -63,22 +63,10 @@ $actorRoutes = function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { $DELETE_LPA_FEATURE = 'delete_lpa_feature'; - $ALLOW_GOV_ONE_LOGIN = 'allow_gov_one_login'; $defaultNotFoundPage = Actor\Handler\LpaDashboardHandler::class; - $config = $container->get("config"); - $feature_flags = $config["feature_flags"]; - - $app->route('/home', [ - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Actor\Handler\AuthenticateOneLoginHandler::class, - Actor\Handler\ActorTriagePageHandler::class - ) - ], ['GET', 'POST'], 'home'); + $app->route('/home', Actor\Handler\AuthenticateOneLoginHandler::class, ['GET', 'POST'], 'home'); $app->route('/', Actor\Handler\ActorTriagePageHandler::class, ['GET', 'POST'], 'home-trial'); $app->get('/healthcheck', Common\Handler\HealthcheckHandler::class, 'healthcheck'); $app->get('/stats', Actor\Handler\StatsPageHandler::class, 'actor-stats'); @@ -94,64 +82,22 @@ $app->get('/contact-us', Common\Handler\ContactUsPageHandler::class, 'contact-us'); // User creation - $app->route( - '/create-account', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\CreateAccountHandler::class, - ), - ['GET', 'POST'], - 'create-account' - ); - $app->get( - '/create-account-success', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\CreateAccountSuccessHandler::class, - ), - 'create-account-success' - ); + $app->route('/create-account',Common\Handler\GoneHandler::class,['GET', 'POST'],'create-account'); + + $app->get('/create-account-success',Common\Handler\GoneHandler::class,'create-account-success'); $app->get( '/activate-account/{token}', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - fn () => new \Laminas\Diactoros\Response\RedirectResponse('/home'), - Actor\Handler\ActivateAccountHandler::class, - ), + fn () => new \Laminas\Diactoros\Response\RedirectResponse('/home'), 'activate-account' ); // User auth - $app->route('/login', [ - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - fn () => new \Laminas\Diactoros\Response\RedirectResponse('/home'), - Actor\Handler\LoginPageHandler::class - ) - ], ['GET', 'POST'], 'login'); + $app->route('/login', fn () => new \Laminas\Diactoros\Response\RedirectResponse('/home'), ['GET', 'POST'], 'login'); $app->get('/session-expired', Actor\Handler\ActorSessionExpiredHandler::class, 'session-expired'); $app->get('/session-check', Actor\Handler\ActorSessionCheckHandler::class, 'session-check'); $app->get('/session-refresh', Common\Handler\SessionRefreshHandler::class, 'session-refresh'); - $app->get('/home/login', [ - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Actor\Handler\OneLoginCallbackHandler::class, - Common\Handler\GoneHandler::class - ) - ], 'auth-redirect'); + $app->get('/home/login', Actor\Handler\OneLoginCallbackHandler::class, 'auth-redirect'); $app->get( '/logout', @@ -163,42 +109,19 @@ ); // User management - $app->route( - '/reset-password', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\PasswordResetRequestPageHandler::class - ), - ['GET', 'POST'], - 'password-reset' - ); + $app->route('/reset-password', Common\Handler\GoneHandler::class, ['GET', 'POST'], 'password-reset'); $app->route( '/reset-password/{token}', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\PasswordResetPageHandler::class - ), + Common\Handler\GoneHandler::class, ['GET', 'POST'], 'password-reset-token' ); $app->get( '/verify-new-email/{token}', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\CompleteChangeEmailHandler::class - ), + Common\Handler\GoneHandler::class, 'verify-new-email' ); @@ -217,29 +140,8 @@ Actor\Handler\SettingsHandler::class, ], 'settings'); - $app->route('/change-password', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\ChangePasswordHandler::class - ), - ['GET','POST'], - 'change-password' - ); - - $app->route('/change-email', - new ConditionalRoutingMiddleware( - $container, - $factory, - $ALLOW_GOV_ONE_LOGIN, - Common\Handler\GoneHandler::class, - Actor\Handler\RequestChangeEmailHandler::class - ), - ['GET','POST'], - 'change-email' - ); + $app->route('/change-password', Common\Handler\GoneHandler::class, ['GET','POST'], 'change-password'); + $app->route('/change-email', Common\Handler\GoneHandler::class, ['GET','POST'], 'change-email'); $app->get('/lpa/change-details', [ Common\Middleware\Authentication\AuthenticationMiddleware::class, diff --git a/service-front/app/features/actor-account-creation.feature b/service-front/app/features/actor-account-creation.feature index 50b7bf14be..921d6c71ad 100644 --- a/service-front/app/features/actor-account-creation.feature +++ b/service-front/app/features/actor-account-creation.feature @@ -1,4 +1,4 @@ -@actor @accountcreation @ff:allow_gov_one_login:false +@actor @accountcreation Feature: Account creation As a new user I want to create an account diff --git a/service-front/app/features/actor-delete-account.feature b/service-front/app/features/actor-delete-account.feature index bb2a5a4e1c..aadf3bdc28 100644 --- a/service-front/app/features/actor-delete-account.feature +++ b/service-front/app/features/actor-delete-account.feature @@ -28,13 +28,13 @@ Feature: The user is able to delete their account Then My account is deleted And I am logged out of the service and taken to the deleted account confirmation page - @ui @ff:allow_gov_one_login:false + @ui Scenario: As a user I cannot access my account once it has been deleted Given I have deleted my account When I attempt to login to my deleted account Then I am told my credentials are incorrect - @ui @ff:allow_gov_one_login:true + @ui Scenario: As a one login user I will get a new account if I delete my existing one Given I have deleted my account When I attempt to login to my deleted account diff --git a/service-front/app/features/actor-password-reset.feature b/service-front/app/features/actor-password-reset.feature deleted file mode 100644 index 429eebeaa6..0000000000 --- a/service-front/app/features/actor-password-reset.feature +++ /dev/null @@ -1,65 +0,0 @@ -@actor @password @ff:allow_gov_one_login:false -Feature: Password Reset - As a user - If I have forgotten my password - I can request that I change it to a known value - - Background: - Given I am a user of the lpa application - - @integration @ui - Scenario: The user can request a password reset and get an email - Given I have forgotten my password - When I ask for my password to be reset - Then I receive unique instructions on how to reset my password - - @integration @ui - Scenario: The user can follow their unique instructions to supply a new password - Given I have asked for my password to be reset - When I follow my unique instructions on how to reset my password - And I choose a new password - Then my password has been associated with my user account - - @integration @ui - Scenario: The user cannot follow expired instructions to supply a new password - Given I have asked for my password to be reset - When I follow my unique expired instructions on how to reset my password - Then I am told that my instructions have expired - And I am unable to continue to reset my password - - @integration @ui - Scenario: The user cannot reset password for an account that doesn't exist - Given I have forgotten my password - When I ask for my password to be reset on an account that doesn't exist - Then I receive an email telling me I do not have an account - - @integration @ui - Scenario Outline: The user cannot set an invalid new password - Given I have asked for my password to be reset - When I follow my unique instructions on how to reset my password - And I choose a new invalid password of "" - Then I am told that my password is invalid because it needs at least - - Examples: - | password | reason | - | cheese | 12 characters or more | - - @ui - Scenario Outline: A user is allowed to provide email address in caps - Given I have forgotten my password - When I ask for my password to be reset with below correct and details - Then I receive unique instructions on how to reset my password to my provided - - Examples: - |email |email_confirmation | - |TEST@test.com |TEST@test.com | - - @ui - Scenario Outline: A user is not allowed to provide improper format email address - Given I have forgotten my password - When I ask for my password to be reset with below incorrect and details - Then I should see the message - - Examples: - |email |email_confirmation | error | - |TEST@ test.com |TEST@ test.com | Enter an email address in the correct format, like name@example.com | diff --git a/service-front/app/features/actor-terms-of-use.feature b/service-front/app/features/actor-terms-of-use.feature index e4bc5a2160..d362f887b7 100644 --- a/service-front/app/features/actor-terms-of-use.feature +++ b/service-front/app/features/actor-terms-of-use.feature @@ -4,13 +4,7 @@ Feature: View terms of use from create account page I want to check the terms of use So that I can be be sure of my rights and responsibilities for using the service - @ui @ff:allow_gov_one_login:false - Scenario: The user can access the terms of use from the create account page - Given I am on the create account page - When I request to see the actor terms of use - Then I can see the actor terms of use - - @ui @ff:allow_gov_one_login:true + @ui Scenario: The user can access the terms of use from the one login page Given I am on the one login page When I request to see the actor terms of use diff --git a/service-front/app/features/actor-your-details.feature b/service-front/app/features/actor-your-details.feature index 7eb1fb19e8..94f5f199d6 100644 --- a/service-front/app/features/actor-your-details.feature +++ b/service-front/app/features/actor-your-details.feature @@ -8,13 +8,7 @@ Feature: Settings dashboard Given I am a user of the lpa application And I am currently signed in - @ui @ff:allow_gov_one_login:false - Scenario: The user can request login details reset - Given I view my user details - When I ask for a change of donors or attorneys details - Then Then I am given instructions on how to change donor or attorney details - - @ui @ff:allow_gov_one_login:true + @ui Scenario: The user sees a link to GOV.UK One Login settings when logged in via One Login Given I view my user details When I click the govuk-settings-link link on the page diff --git a/service-front/app/features/bootstrap/behat.config.php b/service-front/app/features/bootstrap/behat.config.php index b5467a6cc8..e2fa75ec48 100644 --- a/service-front/app/features/bootstrap/behat.config.php +++ b/service-front/app/features/bootstrap/behat.config.php @@ -36,7 +36,6 @@ ], 'feature_flags' => [ 'delete_lpa_feature' => true, - 'allow_gov_one_login' => true, 'support_datastore_lpas' => false, ], 'notify' => [ diff --git a/service-front/app/features/common-language.feature b/service-front/app/features/common-language.feature index 53d324d7c4..e483339078 100644 --- a/service-front/app/features/common-language.feature +++ b/service-front/app/features/common-language.feature @@ -31,3 +31,12 @@ Feature: The application supports Welsh as a language And I access the account creation page When I create an account Then I receive unique instructions on how to activate my account in Welsh + + @ui @welsh + Scenario: Users can expect to receive notification emails in the language they are viewing + Given I prefix a url with the welsh language code + And I am not a user of the lpa application + And I want to create a new account + And I access the account creation page + When I create an account + Then I receive unique instructions on how to activate my account in Welsh diff --git a/service-front/app/features/context/Integration/AccountContext.php b/service-front/app/features/context/Integration/AccountContext.php index 823996e221..38aa08bdde 100644 --- a/service-front/app/features/context/Integration/AccountContext.php +++ b/service-front/app/features/context/Integration/AccountContext.php @@ -552,14 +552,6 @@ public function iHaveAskedToCreateANewAccount() $this->activationToken = 'activate1234567890'; } - /** - * @Given /^I have forgotten my password$/ - */ - public function iHaveForgottenMyPassword() - { - // Not needed for this context - } - /** * @Given /^I have logged in previously$/ */ diff --git a/service-front/app/features/context/UI/AccountContext.php b/service-front/app/features/context/UI/AccountContext.php index 5b85cdc67c..ecce9f3a98 100644 --- a/service-front/app/features/context/UI/AccountContext.php +++ b/service-front/app/features/context/UI/AccountContext.php @@ -172,15 +172,8 @@ public function iCanSeeTheSystemMessage(): void */ public function iAmCurrentlySignedIn(): void { - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - $this->iHaveLoggedInToOneLogin('English'); - $this->iHaveAMatchingLocalAccount(); - } else { - // do all the steps to sign in - $this->iAccessTheLoginForm(); - $this->iEnterCorrectCredentials(); - } - + $this->iHaveLoggedInToOneLogin('English'); + $this->iHaveAMatchingLocalAccount(); $this->iAmSignedIn(); } @@ -207,15 +200,6 @@ public function iAmDirectedToMyPersonalDashboard(): void $this->ui->assertPageAddress('/lpa/dashboard'); } - /** - * @Then /^Then I am given instructions on how to change donor or attorney details$/ - */ - public function iAmGivenInstructionOnHowToChangeDonorOrAttorneyDetails(): void - { - $this->ui->assertPageAddress('/lpa/change-details'); - $this->ui->assertPageContainsText('Let us know if a donor or attorney\'s details change'); - } - /** * @Then /^I am informed that there was a problem with that email address$/ */ @@ -428,14 +412,10 @@ public function iAmTakenToCompleteASatisfactionSurvey(): void assert::assertTrue(isset($locationHeader)); $this->ui->assertResponseStatus(302); - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - assert::assertStringContainsString( - 'post_logout_redirect_uri=https://www.gov.uk/done/use-lasting-power-of-attorney', - $locationHeader, - ); - } else { - assert::assertEquals($locationHeader, 'https://www.gov.uk/done/use-lasting-power-of-attorney'); - } + assert::assertStringContainsString( + 'post_logout_redirect_uri=https://www.gov.uk/done/use-lasting-power-of-attorney', + $locationHeader, + ); } /** @@ -565,22 +545,6 @@ public function iAmUnableToContinueToResetMyPassword(): void // Not needed for this context } - /** - * @When /^I ask for a change of donors or attorneys details$/ - */ - public function iAskForAChangeOfDonorsOrAttorneysDetails(): void - { - $this->ui->assertPageAddress('/settings'); - - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - $this->ui->assertPageContainsText('Change your sign-in details in your GOV.UK One Login'); - $this->ui->clickLink('Change your sign-in details in your GOV.UK One Login'); - } else { - $this->ui->assertPageContainsText('Change a donor or attorney\'s details'); - $this->ui->clickLink('Change a donor or attorney\'s details'); - } - } - /** * @When /^I ask for my password to be reset on an account that doesn't exist$/ */ @@ -1392,17 +1356,6 @@ public function iHaveDeletedMyAccount(): void $this->iConfirmThatIWantToDeleteMyAccount(); } - /** - * @Given /^I have forgotten my password$/ - */ - public function iHaveForgottenMyPassword(): void - { - $this->iAccessTheLoginForm(); - $this->ui->assertPageAddress('/login'); - - $this->ui->clickLink('Forgotten your password?'); - } - /** * @Given /^I have logged in previously$/ */ @@ -1501,21 +1454,19 @@ public function iDoFollowRedirects(): void */ public function iLogoutOfTheApplication(): void { - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'redirect_uri' => 'http://fake.url/logout' - . '?id_token_hint=token' - . '&post_logout_redirect_uri=https://www.gov.uk/done/use-lasting-power-of-attorney', - ] - ), - self::ONE_LOGIN_SERVICE_LOGOUT - ) - ); - } + $this->apiFixtures->append( + ContextUtilities::newResponse( + StatusCodeInterface::STATUS_OK, + json_encode( + [ + 'redirect_uri' => 'http://fake.url/logout' + . '?id_token_hint=token' + . '&post_logout_redirect_uri=https://www.gov.uk/done/use-lasting-power-of-attorney', + ] + ), + self::ONE_LOGIN_SERVICE_LOGOUT + ) + ); //We cannot follow redirects to external links, returns page not found $this->iDoNotFollowRedirects(); @@ -1639,26 +1590,8 @@ public function iReceiveUniqueInstructionsOnHowToResetMyPasswordToMyProvidedEmai */ public function iRequestLoginToMyAccountThatWasDeleted(): void { - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - $this->iHaveLoggedInToOneLogin('English'); - $this->iHaveAnEmailAddressThatDoesNotMatchALocalAccount(); - } else { - $this->ui->visit('/login'); - - $this->ui->fillField('email', $this->userEmail); - $this->ui->fillField('password', $this->userPassword); - - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_FORBIDDEN, - json_encode([]), - self::USER_SERVICE_AUTHENTICATE - ) - ); - - $this->ui->pressButton('Sign in'); - } + $this->iHaveLoggedInToOneLogin('English'); + $this->iHaveAnEmailAddressThatDoesNotMatchALocalAccount(); } /** @@ -1801,11 +1734,7 @@ public function iRequestToSeeTheActorPrivacyNoticePage(): void */ public function iRequestToSeeTheActorTermsOfUse(): void { - if (($this->base->container->get(FeatureEnabled::class))('allow_gov_one_login')) { - $this->ui->clickLink('terms of the Use a lasting power of attorney service.'); - } else { - $this->ui->clickLink('terms of use'); - } + $this->ui->clickLink('terms of the Use a lasting power of attorney service.'); } /** diff --git a/service-front/app/src/Actor/src/Handler/Factory/LogoutPageHandlerFactory.php b/service-front/app/src/Actor/src/Handler/Factory/LogoutPageHandlerFactory.php index 00a0aaf4d1..723c1ac8b5 100644 --- a/service-front/app/src/Actor/src/Handler/Factory/LogoutPageHandlerFactory.php +++ b/service-front/app/src/Actor/src/Handler/Factory/LogoutPageHandlerFactory.php @@ -18,11 +18,7 @@ class LogoutPageHandlerFactory { public function __invoke(ContainerInterface $container): LogoutPageHandler { - $logoutStrategy = $container->get( - ($container->get(FeatureEnabled::class))('allow_gov_one_login') - ? OneLoginService::class - : LocalAccountLogout::class, - ); + $logoutStrategy = $container->get(OneLoginService::class); return new LogoutPageHandler( $container->get(TemplateRendererInterface::class), diff --git a/service-front/app/src/Actor/templates/actor/settings.html.twig b/service-front/app/src/Actor/templates/actor/settings.html.twig index 01163c8723..b924892393 100644 --- a/service-front/app/src/Actor/templates/actor/settings.html.twig +++ b/service-front/app/src/Actor/templates/actor/settings.html.twig @@ -11,93 +11,40 @@

{% trans %}Settings{% endtrans %}

- {% if feature_enabled("allow_gov_one_login") %} -
-
-

{% trans %}Your sign-in details{% endtrans %}

-
-
-

{% trans %}You use GOV.UK One Login to sign in to the Use a lasting power of attorney service.{% endtrans %}

-

{% trans %}You can change these details in your GOV.UK One Login:{% endtrans %}

-
    -
  • {% trans %}e-mail address{% endtrans %}
  • -
  • {% trans %}password{% endtrans %}
  • -
  • {% trans %}how you get security codes to sign in{% endtrans %}
  • -
-

- - {% trans %}Change your sign-in details in your GOV.UK One Login{% endtrans %} - -

-
+
+
+

{% trans %}Your sign-in details{% endtrans %}

- -
-
-

{% trans %}Delete your Use a lasting power of attorney account{% endtrans %}

-
-
-

{% trans %}If you no longer use your Use a lasting power of attorney account, you can delete it.{% endtrans %}

-

- - {% trans %}Find out more about deleting your account{% endtrans %} - -

-
+
+

{% trans %}You use GOV.UK One Login to sign in to the Use a lasting power of attorney service.{% endtrans %}

+

{% trans %}You can change these details in your GOV.UK One Login:{% endtrans %}

+
    +
  • {% trans %}e-mail address{% endtrans %}
  • +
  • {% trans %}password{% endtrans %}
  • +
  • {% trans %}how you get security codes to sign in{% endtrans %}
  • +
+

+ + {% trans %}Change your sign-in details in your GOV.UK One Login{% endtrans %} + +

- {% else %} - -
-
-
- -
- Warning - {% trans %}You are not able to change your email address{% endtrans %} -

-

- {% trans %} This is because, on 13 August 2024, we are changing the way you sign in to the Use a lasting power of attorney service.{% endtrans %} -

+
- {% trans %}Find out more about this change{% endtrans %} -
-
+
+
+

{% trans %}Delete your Use a lasting power of attorney account{% endtrans %}

+
+
+

{% trans %}If you no longer use your Use a lasting power of attorney account, you can delete it.{% endtrans %}

+

+ + {% trans %}Find out more about deleting your account{% endtrans %} + +

-
- -
-
- {% trans %}Email address{% endtrans %} -
-
- {{ user.getDetail('email') }} -
-
-
-
- {% trans %}Password{% endtrans %} -
-
- *********** -
-
- - {% trans %}Change password{% endtrans %} - -
-
-
- -
- {% trans %}Need to update the online LPA summary?{% endtrans %}
- - {% trans %}Change a donor or attorney's details{% endtrans %} - -
- - {% endif %}
diff --git a/service-front/app/src/Common/src/Middleware/Authentication/AuthenticationMiddlewareFactory.php b/service-front/app/src/Common/src/Middleware/Authentication/AuthenticationMiddlewareFactory.php index b81f0afe3b..0a53594fcb 100644 --- a/service-front/app/src/Common/src/Middleware/Authentication/AuthenticationMiddlewareFactory.php +++ b/service-front/app/src/Common/src/Middleware/Authentication/AuthenticationMiddlewareFactory.php @@ -16,15 +16,8 @@ public function __invoke(ContainerInterface $container): AuthenticationMiddlewar { $pipe = $container->get(MiddlewarePipeInterface::class); $credentialAuthenticationMiddleware = $container->get(CredentialAuthenticationMiddleware::class); - $forcedPasswordResetMiddleware = $container->get(ForcedPasswordResetMiddleware::class); - - $feature_flags = $container->get('config')['feature_flags']; $middlewares = [$credentialAuthenticationMiddleware]; - if (!($feature_flags['allow_gov_one_login'] ?? false)) { - $middlewares[] = $forcedPasswordResetMiddleware; - } - return new AuthenticationMiddleware($pipe, ...$middlewares); } } diff --git a/service-front/app/src/Common/templates/layout/default.html.twig b/service-front/app/src/Common/templates/layout/default.html.twig index 2781e658e0..da8831e3f1 100644 --- a/service-front/app/src/Common/templates/layout/default.html.twig +++ b/service-front/app/src/Common/templates/layout/default.html.twig @@ -50,11 +50,7 @@ {{ include('@partials/cookie-banner.html.twig') }} -{% if feature_enabled('allow_gov_one_login') %} - {{ include("@partials/header/one-login.html.twig") }} -{% else %} - {{ include("@partials/header/default.html.twig") }} -{% endif %} +{{ include("@partials/header/one-login.html.twig") }} {% block content %}{% endblock %} diff --git a/service-front/app/test/ActorTest/Handler/Factory/LogoutPageHandlerFactoryTest.php b/service-front/app/test/ActorTest/Handler/Factory/LogoutPageHandlerFactoryTest.php index c4bde4c9e9..699e611c57 100644 --- a/service-front/app/test/ActorTest/Handler/Factory/LogoutPageHandlerFactoryTest.php +++ b/service-front/app/test/ActorTest/Handler/Factory/LogoutPageHandlerFactoryTest.php @@ -4,12 +4,8 @@ namespace ActorTest\Handler\Factory; -use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Test; use Actor\Handler\Factory\LogoutPageHandlerFactory; -use Common\Service\Authentication\LocalAccountLogout; -use Common\Service\Authentication\LogoutStrategy; -use Common\Service\Features\FeatureEnabled; use Common\Service\OneLogin\OneLoginService; use Mezzio\Authentication\AuthenticationInterface; use Mezzio\Helper\UrlHelper; @@ -47,44 +43,12 @@ public function setUp(): void ->willReturn($this->prophesize(LoggerInterface::class)->reveal()); } - public static function featureFlagStrategies(): array - { - return [ - 'one-login disabled' => [ - false, - LocalAccountLogout::class, - ], - 'one-login enabled' => [ - true, - OneLoginService::class, - ], - ]; - } - - /** - * @psalm-param class-string $strategyClass - */ - #[DataProvider('featureFlagStrategies')] #[Test] - public function it_creates_an_appropriate_logout_page_handler( - bool $allowGovOneLogin, - string $strategyClass, - ): void { - $featureProphecy = $this->prophesize(FeatureEnabled::class); - $featureProphecy - ->__invoke('allow_gov_one_login') - ->willReturn($allowGovOneLogin); - + public function it_creates_an_appropriate_logout_page_handler(): void { $this->container - ->get($strategyClass) + ->get(OneLoginService::class) ->shouldBeCalled() - ->willReturn($this->prophesize($strategyClass)->reveal()); - - $this->container - ->get(FeatureEnabled::class) - ->willReturn( - $featureProphecy->reveal(), - ); + ->willReturn($this->prophesize(OneLoginService::class)->reveal()); $factory = new LogoutPageHandlerFactory(); diff --git a/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php b/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php index a461a0ace2..e35414aac5 100644 --- a/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php +++ b/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php @@ -5,7 +5,6 @@ namespace CommonTest\Middleware\Authentication; use PHPUnit\Framework\Attributes\Test; -use Common\Middleware\Authentication\AuthenticationMiddleware; use Common\Middleware\Authentication\CredentialAuthenticationMiddleware; use Common\Middleware\Authentication\ForcedPasswordResetMiddleware; use Common\Middleware\Authentication\AuthenticationMiddlewareFactory; @@ -51,7 +50,7 @@ public function it_pipes_a_request_through_all_authentication_middlewares(): voi ->method('process') ->with($request, $handler) ->willReturn($response); - $matcher = $this->exactly(2); + $matcher = $this->exactly(1); $pipe->expects($matcher) ->method('pipe')->willReturnCallback(function ($parameter) use ($matcher, $credentialAuthenticationMiddleware, $forcedPasswordResetMiddleware) { @@ -88,9 +87,7 @@ public function it_excludes_forced_password_reset_when_gov_one_login_enabled(): [ 'config', [ - 'feature_flags' => [ - 'allow_gov_one_login' => true, - ], + 'feature_flags' => [], ], ], ]); diff --git a/terraform/environment/config_file.tf b/terraform/environment/config_file.tf index 23b532fb8a..7bd579a800 100644 --- a/terraform/environment/config_file.tf +++ b/terraform/environment/config_file.tf @@ -15,7 +15,6 @@ locals { viewer_codes_table = aws_dynamodb_table.viewer_codes_table.name user_lpa_actor_map = aws_dynamodb_table.user_lpa_actor_map.name stats_table = aws_dynamodb_table.stats_table.name - ff_allow_gov_one_login = local.environment.application_flags.allow_gov_one_login use_fqdn = local.active_region == "eu-west-1" ? module.eu_west_1[0].route53_fqdns.use : module.eu_west_2[0].route53_fqdns.use viewer_fqdn = local.active_region == "eu-west-1" ? module.eu_west_1[0].route53_fqdns.viewer : module.eu_west_2[0].route53_fqdns.viewer admin_fqdn = local.active_region == "eu-west-1" ? module.eu_west_1[0].route53_fqdns.admin : module.eu_west_2[0].route53_fqdns.admin diff --git a/terraform/environment/region.tf b/terraform/environment/region.tf index 1dffca588e..634295a246 100644 --- a/terraform/environment/region.tf +++ b/terraform/environment/region.tf @@ -66,7 +66,6 @@ module "eu_west_1" { } feature_flags = { - "allow_gov_one_login" = local.environment.application_flags.allow_gov_one_login "allow_meris_lpas" = local.environment.application_flags.allow_meris_lpas "deploy_opentelemetry_sidecar" = local.environment.deploy_opentelemetry_sidecar "delete_lpa_feature" = local.environment.application_flags.delete_lpa_feature @@ -153,7 +152,6 @@ module "eu_west_2" { } feature_flags = { - "allow_gov_one_login" = local.environment.application_flags.allow_gov_one_login "allow_meris_lpas" = local.environment.application_flags.allow_meris_lpas "deploy_opentelemetry_sidecar" = local.environment.deploy_opentelemetry_sidecar "delete_lpa_feature" = local.environment.application_flags.delete_lpa_feature diff --git a/terraform/environment/region/api_ecs.tf b/terraform/environment/region/api_ecs.tf index 33077bb9a2..814736ba73 100644 --- a/terraform/environment/region/api_ecs.tf +++ b/terraform/environment/region/api_ecs.tf @@ -537,10 +537,6 @@ locals { name = "SUPPORT_DATASTORE_LPAS", value = tostring(var.feature_flags.support_datastore_lpas) }, - { - name = "ALLOW_GOV_ONE_LOGIN", - value = tostring(var.feature_flags.allow_gov_one_login) - }, { name = "LOGIN_SERIAL_CACHE_URL", value = "tls://${data.aws_elasticache_replication_group.brute_force_cache_replication_group.primary_endpoint_address}" diff --git a/terraform/environment/region/use_ecs.tf b/terraform/environment/region/use_ecs.tf index c209bd1351..33e8167dd2 100644 --- a/terraform/environment/region/use_ecs.tf +++ b/terraform/environment/region/use_ecs.tf @@ -360,10 +360,6 @@ locals { name = "ALLOW_MERIS_LPAS", value = tostring(var.feature_flags.allow_meris_lpas) }, - { - name = "ALLOW_GOV_ONE_LOGIN", - value = tostring(var.feature_flags.allow_gov_one_login) - }, { name = "SUPPORT_DATASTORE_LPAS", value = tostring(var.feature_flags.support_datastore_lpas) diff --git a/terraform/environment/region/viewer_ecs.tf b/terraform/environment/region/viewer_ecs.tf index ca1ae89053..e6a91af5b0 100644 --- a/terraform/environment/region/viewer_ecs.tf +++ b/terraform/environment/region/viewer_ecs.tf @@ -326,10 +326,6 @@ locals { name = "BRUTE_FORCE_CACHE_TIMEOUT", value = "60" }, - { - name = "ALLOW_GOV_ONE_LOGIN", - value = tostring(var.feature_flags.allow_gov_one_login) - }, { name = "SUPPORT_DATASTORE_LPAS", value = tostring(var.feature_flags.support_datastore_lpas) diff --git a/terraform/environment/terraform.tfvars.json b/terraform/environment/terraform.tfvars.json index d8fc24c215..28947a7a48 100644 --- a/terraform/environment/terraform.tfvars.json +++ b/terraform/environment/terraform.tfvars.json @@ -60,7 +60,6 @@ "use_older_lpa_journey": true, "delete_lpa_feature": true, "allow_meris_lpas": false, - "allow_gov_one_login": true, "support_datastore_lpas": false }, "dynamodb_tables": { @@ -158,7 +157,6 @@ "use_older_lpa_journey": true, "delete_lpa_feature": true, "allow_meris_lpas": false, - "allow_gov_one_login": false, "support_datastore_lpas": false }, "dynamodb_tables": { @@ -256,7 +254,6 @@ "use_older_lpa_journey": true, "delete_lpa_feature": true, "allow_meris_lpas": false, - "allow_gov_one_login": true, "support_datastore_lpas": false }, "dynamodb_tables": { @@ -354,7 +351,6 @@ "use_older_lpa_journey": true, "delete_lpa_feature": true, "allow_meris_lpas": false, - "allow_gov_one_login": true, "support_datastore_lpas": false }, "dynamodb_tables": { @@ -451,7 +447,6 @@ "use_older_lpa_journey": true, "delete_lpa_feature": true, "allow_meris_lpas": false, - "allow_gov_one_login": true, "support_datastore_lpas": false }, "dynamodb_tables": { diff --git a/terraform/environment/variables.tf b/terraform/environment/variables.tf index 0c006272c0..e3eeb73683 100644 --- a/terraform/environment/variables.tf +++ b/terraform/environment/variables.tf @@ -79,7 +79,6 @@ variable "environments" { deploy_opentelemetry_sidecar = bool fargate_spot = bool application_flags = object({ - allow_gov_one_login = bool use_older_lpa_journey = bool delete_lpa_feature = bool allow_meris_lpas = bool diff --git a/tests/smoke/.env b/tests/smoke/.env index 38ce7b551c..aa864e7a28 100644 --- a/tests/smoke/.env +++ b/tests/smoke/.env @@ -1,4 +1,4 @@ -BEHAT_FF_ALLOW_GOV_ONE_LOGIN=true + ONE_LOGIN_OTP_SECRET= ONE_LOGIN_CREDENTIALS= ONE_LOGIN_USER_PASSWORD= diff --git a/tests/smoke/context/AccountContext.php b/tests/smoke/context/AccountContext.php index 000ec6492c..53ca0d4cfb 100644 --- a/tests/smoke/context/AccountContext.php +++ b/tests/smoke/context/AccountContext.php @@ -54,12 +54,8 @@ public function iHaveBeenGivenAccessToUseAnLpaViaCredentials(): void */ public function iAccessTheLoginForm(): void { - if ($this->featureFlags['allow_gov_one_login'] ?? false) { - $this->ui->visit('/home'); - $this->ui->pressButton('sign-in-one-login'); - } else { - $this->ui->visit('/login'); - } + $this->ui->visit('/home'); + $this->ui->pressButton('sign-in-one-login'); } /** @@ -67,42 +63,35 @@ public function iAccessTheLoginForm(): void */ public function iEnterCorrectCredentials(): void { - if ($this->featureFlags['allow_gov_one_login'] ?? false) { - switch ($this->detectOneLoginImplementation()) { - case OneLoginImplementation::Mock: - $this->ui->assertPageAddress('/authorize'); - $this->ui->fillField('email', $this->userEmail); - break; - case OneLoginImplementation::Integration: - case OneLoginImplementation::Production: - $this->ui->pressButton('sign-in-button'); - - $this->ui->fillField('email', $this->userEmail); - $this->ui->pressButton('Continue'); - - $this->userPassword = getenv('ONE_LOGIN_USER_PASSWORD') - ? getenv('ONE_LOGIN_USER_PASSWORD') - : throw new Exception('ONE_LOGIN_USER_PASSWORD is needed for testing against One Login'); - - $this->ui->fillField('password', $this->userPassword); - $this->ui->pressButton('Continue'); - - // Generate a 2fa secret just before use. - // There is a non-zero chance it will be incorrect if generated at the end of its 30-second window - $secret = getenv('ONE_LOGIN_OTP_SECRET') - ? getenv('ONE_LOGIN_OTP_SECRET') - : throw new Exception('ONE_LOGIN_OTP_SECRET is needed for testing against One Login'); - - $this->ui->fillField('code', TOTP::createFromSecret($secret)->now()); - } - - $this->ui->pressButton('Continue'); - } else { - $this->ui->assertPageAddress('/login'); - $this->ui->fillField('email', $this->userEmail); - $this->ui->fillField('password', $this->userPassword); - $this->ui->pressButton('Sign in'); + switch ($this->detectOneLoginImplementation()) { + case OneLoginImplementation::Mock: + $this->ui->assertPageAddress('/authorize'); + $this->ui->fillField('email', $this->userEmail); + break; + case OneLoginImplementation::Integration: + case OneLoginImplementation::Production: + $this->ui->pressButton('sign-in-button'); + + $this->ui->fillField('email', $this->userEmail); + $this->ui->pressButton('Continue'); + + $this->userPassword = getenv('ONE_LOGIN_USER_PASSWORD') + ? getenv('ONE_LOGIN_USER_PASSWORD') + : throw new Exception('ONE_LOGIN_USER_PASSWORD is needed for testing against One Login'); + + $this->ui->fillField('password', $this->userPassword); + $this->ui->pressButton('Continue'); + + // Generate a 2fa secret just before use. + // There is a non-zero chance it will be incorrect if generated at the end of its 30-second window + $secret = getenv('ONE_LOGIN_OTP_SECRET') + ? getenv('ONE_LOGIN_OTP_SECRET') + : throw new Exception('ONE_LOGIN_OTP_SECRET is needed for testing against One Login'); + + $this->ui->fillField('code', TOTP::createFromSecret($secret)->now()); } + + $this->ui->pressButton('Continue'); } private function detectOneLoginImplementation(): OneLoginImplementation @@ -138,11 +127,7 @@ private function detectOneLoginImplementation(): OneLoginImplementation */ public function iAmSignedIn(): void { - if ($this->featureFlags['allow_gov_one_login'] ?? false) { - $this->ui->assertElementOnPage('nav.one-login-header__nav'); - } else { - $this->ui->assertElementOnPage('nav.signin'); - } + $this->ui->assertElementOnPage('nav.one-login-header__nav'); } /** diff --git a/tests/smoke/docker-compose.smoke.yml b/tests/smoke/docker-compose.smoke.yml index 6138752ac7..e989e51360 100644 --- a/tests/smoke/docker-compose.smoke.yml +++ b/tests/smoke/docker-compose.smoke.yml @@ -25,11 +25,6 @@ services: BEHAT_OLD_ACTOR_URL: http://proxy:9002 BEHAT_PARAMS: '{"extensions":{"Smoke\\SmokeExtension":{"allow_insecure_https":true}}}' - # Read from .env file - BEHAT_FF_ALLOW_GOV_ONE_LOGIN: - ONE_LOGIN_OTP_SECRET: - ONE_LOGIN_CREDENTIALS: - XDEBUG_CONFIG: client_host=host.docker.internal client_port=9000 XDEBUG_MODE: develop,debug,coverage From ce25dbd2ba86e40b87665ec8938a427a98cb9a15 Mon Sep 17 00:00:00 2001 From: Allen Annom Date: Mon, 6 Jan 2025 18:02:49 +0000 Subject: [PATCH 4/4] UML-3764 removing one login FF and related tests --- .idea/phpunit.xml | 2 +- .../app/features/actor-delete-account.feature | 17 - .../features/actor-password-change.feature | 26 - .../features/actor-account-creation.feature | 82 --- .../features/actor-back-navigation.feature | 17 - .../app/features/actor-delete-account.feature | 6 - .../app/features/actor-login.feature | 93 --- .../app/features/actor-logout.feature | 8 +- .../app/features/actor-one-login.feature | 2 +- .../features/actor-password-change.feature | 33 - .../actor-password-needs-reset.feature | 21 - .../app/features/actor-privacy-notice.feature | 9 +- .../app/features/actor-triage.feature | 57 -- .../app/features/common-language.feature | 20 +- .../context/Integration/AccountContext.php | 171 ------ .../features/context/UI/AccountContext.php | 581 ------------------ .../AuthenticationMiddlewareTest.php | 4 +- tests/features/actor-login.feature | 2 +- 18 files changed, 7 insertions(+), 1144 deletions(-) delete mode 100644 service-api/app/features/actor-delete-account.feature delete mode 100644 service-api/app/features/actor-password-change.feature delete mode 100644 service-front/app/features/actor-account-creation.feature delete mode 100644 service-front/app/features/actor-login.feature delete mode 100644 service-front/app/features/actor-password-change.feature delete mode 100644 service-front/app/features/actor-password-needs-reset.feature delete mode 100644 service-front/app/features/actor-triage.feature diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml index c4e2d7b5e0..1f37cd528a 100644 --- a/.idea/phpunit.xml +++ b/.idea/phpunit.xml @@ -4,8 +4,8 @@ diff --git a/service-api/app/features/actor-delete-account.feature b/service-api/app/features/actor-delete-account.feature deleted file mode 100644 index 3170e4939d..0000000000 --- a/service-api/app/features/actor-delete-account.feature +++ /dev/null @@ -1,17 +0,0 @@ -@actor @actorDeleteAccount -Feature: The user is able to delete their account - As a user - I want to be able to delete my account - If I no longer want to use the service - - Background: - Given I am a user of the lpa application - And I am currently signed in - - @integration @acceptance - Scenario: As a user I can delete my account - Given I am on the settings page - When I request to delete my account - And I confirm that I want to delete my account - Then My account is deleted - And I am logged out of the service and taken to the index page diff --git a/service-api/app/features/actor-password-change.feature b/service-api/app/features/actor-password-change.feature deleted file mode 100644 index d5f819f139..0000000000 --- a/service-api/app/features/actor-password-change.feature +++ /dev/null @@ -1,26 +0,0 @@ -@actor @passwordchange -Feature: Authenticated Account Password Change - As a user - I want to update my password to a new value and clear previous value - I have submitted a new password - I can continue on the application - - Background: - Given I am a user of the lpa application - And I am currently signed in - - - @integration @acceptance - Scenario: The user can submit a new password of their choice - Given I am on the user dashboard page - When I ask to change my password - And I provide my current password - And I provide my new password - Then I am told my password was changed - - @integration @acceptance - Scenario: The user cannot provide their current password - Given I am on the user dashboard page - When I ask to change my password - And I cannot enter my current password - Then I am told my current password is incorrect \ No newline at end of file diff --git a/service-front/app/features/actor-account-creation.feature b/service-front/app/features/actor-account-creation.feature deleted file mode 100644 index 921d6c71ad..0000000000 --- a/service-front/app/features/actor-account-creation.feature +++ /dev/null @@ -1,82 +0,0 @@ -@actor @accountcreation -Feature: Account creation - As a new user - I want to create an account - So that I can login to add my lpas to share - - @ui @integration - Scenario: As a new user want to create an account - Given I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I create an account - Then I receive unique instructions on how to activate my account - - @ui - Scenario: The user can follow their unique instructions to activate new account - Given I have asked to create a new account - When I follow the instructions on how to activate my account - Then my account is activated and I receive a confirmation email - - @ui - Scenario: The user cannot follow expired instructions to create new account - Given I have asked to create a new account - When I follow my unique instructions after 24 hours - Then I am told my unique instructions to activate my account have expired - - @ui - Scenario: The user account creates an account which already exists - Given I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I create an account using duplicate details - Then I receive unique instructions on how to activate my account - - @ui @integration - Scenario Outline: As a new user I want to be shown the mistakes I make while creating an account - Given I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I have provided required information for account creation such as - Then I should be told my account could not be created due to - Examples: - | email | password | terms | reasons | - | | Password1 | 1 | Enter an email address in the correct format, like name@example.com | - |invalid_email | Password1 | 1 | Enter an email address in the correct format, like name@example.com | - |test@EXAMPLE.com | Password1 | | You must accept the terms of use to create an account | - |test@ Example.com| Password1 | 1 | Enter an email address in the correct format, like name@example.com | - - @ui @integration - Scenario Outline: As a new user I want to set a secure password when creating an account - Given I am not a user of the lpa application - And I access the account creation page - When I create an account with a password of - Then I should be told my account could not be created due to - - Examples: - | password | reasons | - | Sh0rt | Password must be 12 characters or more | - | | Enter your password | - - @ui - Scenario Outline: As a new user I want to be allowed email entry in uppercase format when creating an account - Given I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I have provided required information for account creation such as - Then An account is created using - - Examples: - | email | password | terms | - | TEST@example.com | Pass :)word | 1 | - | test@EXAMPLE.com | Password1$1$ | 1 | - | TEST@example.COM | ☺️✌Password!$ | 1 | - |' TEST@EXAMPLE.COM '| Password§§§§ | 1 | - - @ui @integration - Scenario: The user account cannot create an account with an email address that has been requested for reset - Given I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I create an account using with an email address that has been requested for reset - Then I am informed that there was a problem with that email address diff --git a/service-front/app/features/actor-back-navigation.feature b/service-front/app/features/actor-back-navigation.feature index bb7b3d4d74..b2a46a9d94 100644 --- a/service-front/app/features/actor-back-navigation.feature +++ b/service-front/app/features/actor-back-navigation.feature @@ -4,23 +4,6 @@ Feature: Back navigation I want the back function to take me to an appropriate page for where I am in the journey So that I can easily navigate the service - @ui @ff:allow_gov_one_login:false - Scenario: Check back function on reset password page - Given I access the login form - And I have forgotten my password - And I am on the password reset page - When I click the Back link on the page - Then I should be taken to the page - - @ui @ff:allow_gov_one_login:false - Scenario: Check back function on change password page - Given I am a user of the lpa application - And I am currently signed in - And I view my user details - And I ask to change my password - When I click the Back link on the page - Then I should be taken to the page - @ui Scenario: Check back function on add LPA page Given I am a user of the lpa application diff --git a/service-front/app/features/actor-delete-account.feature b/service-front/app/features/actor-delete-account.feature index aadf3bdc28..51ba298b06 100644 --- a/service-front/app/features/actor-delete-account.feature +++ b/service-front/app/features/actor-delete-account.feature @@ -28,12 +28,6 @@ Feature: The user is able to delete their account Then My account is deleted And I am logged out of the service and taken to the deleted account confirmation page - @ui - Scenario: As a user I cannot access my account once it has been deleted - Given I have deleted my account - When I attempt to login to my deleted account - Then I am told my credentials are incorrect - @ui Scenario: As a one login user I will get a new account if I delete my existing one Given I have deleted my account diff --git a/service-front/app/features/actor-login.feature b/service-front/app/features/actor-login.feature deleted file mode 100644 index 873e2628e9..0000000000 --- a/service-front/app/features/actor-login.feature +++ /dev/null @@ -1,93 +0,0 @@ -@actor @login @ff:allow_gov_one_login:false -Feature: A user of the system is able to login - As a user of the lpa application - I can login using my credentials - So that I can carry out operations within the application - - Background: - Given I am a user of the lpa application - And I have been given access to use an LPA via credentials - - @ui - Scenario: A user can login - Given I access the login form - When I enter correct credentials - Then I am signed in - - @ui - Scenario: A user cannot login with an incorrect password - Given I access the login form - When I enter incorrect login password - Then I am told my credentials are incorrect - - @ui - Scenario: An incorrect email will give the same message as an incorrect password - Given I access the login form - When I enter incorrect login password - Then I am told my credentials are incorrect - - @ui - Scenario: A user cannot login if they have not activated their account - Given I have not activated my account - And I access the login form - When I enter correct credentials - Then I am told my account has not been activated - - @ui - Scenario: Visiting the login page when signed in will redirect to the dashboard - Given I am currently signed in - When I attempt to sign in again - Then I am directed to my dashboard - - @ui @integration - Scenario: A user is taken to the dashboard page when they login, having logged in previously - Given I am a user of the lpa application - And I have logged in previously - When I sign in - Then I am taken to the dashboard page - - @ui - Scenario Outline: A user is allowed to login with case insensitive email address and spaces are trimmed - Given I access the login form - When I enter correct email with and below - Then I am signed in - Examples: - |email_format |password| - |'lowercase@test.com' |pa33w0rd| - |'UPPERCASE@TEST.COM' |pa33w0rd| - |' UNTRIMMED@test.com '|pa33w0rd| - - @ui - Scenario Outline: A user is not allowed to login with improper email address, blank email or password - Given I access the login form - When I enter incorrect login details with and below - Then I should see relevant message - Examples: - |email_format |password|error | - |GAP TEST@ test. com |pa33w0rd|Enter an email address in the correct format, like name@example.com | - | |pa33w0rd|Enter an email address in the correct format, like name@example.com | - |nopassword@test.com | |Enter your password | - - @ui @security - Scenario: A hacker attempts to forge the full CSRF value - Given I access the login form - When I hack the CSRF value with 'ipwnedthissiterequest' - Then I should see relevant As you have not used this service for over 20 minutes, the page has timed out. We've now refreshed the page - please try to sign in again message - - @ui @security - Scenario: A hacker attempts to forge the request id from CSRF value - Given I access the login form - When I hack the request id of the CSRF value - Then I should see relevant As you have not used this service for over 20 minutes, the page has timed out. We've now refreshed the page - please try to sign in again message - - @ui @security - Scenario: A hacker attempts to forge the token from CSRF value - Given I access the login form - When I hack the token of the CSRF value - Then I should see relevant As you have not used this service for over 20 minutes, the page has timed out. We've now refreshed the page - please try to sign in again message - - @ui @security - Scenario: A hacker cannot access the site with an empty CSRF value - Given I access the login form - When I hack the CSRF value with '' - Then I should see relevant Value is required and can't be empty message diff --git a/service-front/app/features/actor-logout.feature b/service-front/app/features/actor-logout.feature index 385d2e062f..fd80caff1d 100644 --- a/service-front/app/features/actor-logout.feature +++ b/service-front/app/features/actor-logout.feature @@ -7,13 +7,7 @@ Feature: A user of the system is able to logout Background: Given I am a user of the lpa application - @ui @ff:allow_gov_one_login:false - Scenario: A user can logout - Given I am currently signed in - When I logout of the application - Then I am taken to complete a satisfaction survey - - @ui @ff:allow_gov_one_login:true + @ui Scenario: A user can logout using one login Given I am currently signed in When I logout of the application diff --git a/service-front/app/features/actor-one-login.feature b/service-front/app/features/actor-one-login.feature index c39b208ac0..c9e142a951 100644 --- a/service-front/app/features/actor-one-login.feature +++ b/service-front/app/features/actor-one-login.feature @@ -1,4 +1,4 @@ -@actor @onelogin @ff:allow_gov_one_login:true +@actor @onelogin Feature: Authenticate One Login As a user of the application I can login using GovUK OneLogin diff --git a/service-front/app/features/actor-password-change.feature b/service-front/app/features/actor-password-change.feature deleted file mode 100644 index cf919a2bec..0000000000 --- a/service-front/app/features/actor-password-change.feature +++ /dev/null @@ -1,33 +0,0 @@ -@actor @passwordchange @ff:allow_gov_one_login:false -Feature: Authenticated Account Password Change - As a user - I want to update my password to a new value and clear previous value - I have submitted a new password - I can continue on the application - - Background: - Given I am a user of the lpa application - And I am currently signed in - And I view my user details - - @ui - Scenario: The user can submit a new password of their choice - Given I ask to change my password - When I provide my new password - Then I am told my password was changed - - @ui @integration - Scenario: The user provides wrong current password - Given I ask to change my password - When I provided incorrect current password - Then I am told my current password is incorrect - - @ui - Scenario Outline: The user attempts to set an invalid password - Given I ask to change my password - When I choose a new from below - Then I am told that my new password is invalid because it needs at least - - Examples: - | password | reason | - | Dino9 | 12 characters or more | diff --git a/service-front/app/features/actor-password-needs-reset.feature b/service-front/app/features/actor-password-needs-reset.feature deleted file mode 100644 index 57450a1796..0000000000 --- a/service-front/app/features/actor-password-needs-reset.feature +++ /dev/null @@ -1,21 +0,0 @@ -@actor @passwordNeedsReset @ff:allow_gov_one_login:false -Feature: A user of the system is able to login - As a user of the lpa application - I can login using my credentials - So that I can carry out operations within the application - - Background: - Given I am a user of the lpa application - And I have been given access to use an LPA via credentials - - @ui - Scenario: A user is requested to reset password if password security compromised - Given I access the login form - When I sign successfully - Then I am requested to reset my password - - @ui - Scenario: A user is able to reset password if password security compromised - Given My password security is compromised and requested to reset my password on login - When I request for my password to be reset - Then I receive an email and shown unique instructions on how to reset my password diff --git a/service-front/app/features/actor-privacy-notice.feature b/service-front/app/features/actor-privacy-notice.feature index be7d536792..384481bace 100644 --- a/service-front/app/features/actor-privacy-notice.feature +++ b/service-front/app/features/actor-privacy-notice.feature @@ -4,14 +4,7 @@ Feature: View privacy notice from the terms of use page I want to check the privacy notice So that I can understand how my private data will be handled by the service - @ui @ff:allow_gov_one_login:false - Scenario: user wants to see the privacy notice - Given I am on the create account page - When I request to see the actor terms of use - And I request to see the actor privacy notice - Then I can see the actor privacy notice - - @ui @ff:allow_gov_one_login:true + @ui Scenario: user wants to see the privacy notice Given I am on the one login page When I request to see the actor terms of use diff --git a/service-front/app/features/actor-triage.feature b/service-front/app/features/actor-triage.feature deleted file mode 100644 index e685290f64..0000000000 --- a/service-front/app/features/actor-triage.feature +++ /dev/null @@ -1,57 +0,0 @@ -@actor @triageEntry @ff:allow_gov_one_login:false -Feature: Triage - As a new user - I want to create an account - So that I can login to add my lpas to share - - @ui - Scenario: The user can login directly when they say they have an existing account - Given I am a user of the lpa application - And I want to use my lasting power of attorney - And I am on the triage page - When I select the option to sign in to my existing account - Then I am allowed to login - - @ui - Scenario: The user can create new account page when they say they do not have an existing account - Given I am on the triage page - When I select the option to create a new account - Then I am allowed to create an account - - @ui - Scenario: The user can navigate back to triage page from login page - Given I access the login form - When I click the Back link on the page - Then I should be taken to the triage page - - @ui - Scenario: The user can navigate back to triage page from account creation page - Given I access the account creation page - When I click the Back link on the page - Then I should be taken to the triage page - - @ui - Scenario: The user sees an error message when they do not say if they have an existing account or if they want to create one - Given I am on the triage page - When I do not provide any options and continue - Then I am not allowed to progress - - @ui - Scenario: The banner will take the user to the triage page unless they are signed in - Given I am on the create account page - When I click the Use a lasting power of attorney link on the page - Then I am taken to the triage page of the service - - @ui - Scenario: When signed in, clicking on the banner will redirect to the dashboard - Given I am a user of the lpa application - And I sign in - And I am on the settings page - When I click the Use a lasting power of attorney link on the page - Then I am taken to the dashboard page - - @ui - Scenario: The system message is shown if it is set - Given An actor system message is set - When I am on the triage page - Then I can see the system message \ No newline at end of file diff --git a/service-front/app/features/common-language.feature b/service-front/app/features/common-language.feature index e483339078..3c951bcfc2 100644 --- a/service-front/app/features/common-language.feature +++ b/service-front/app/features/common-language.feature @@ -21,22 +21,4 @@ Feature: The application supports Welsh as a language Given I prefix a url with the welsh language code When I access the service home page And I request to view the content in english - Then I should be on the home page of the service - - @ui @welsh @ff:allow_gov_one_login:false - Scenario: Users can expect to receive notification emails in the language they are viewing - Given I prefix a url with the welsh language code - And I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I create an account - Then I receive unique instructions on how to activate my account in Welsh - - @ui @welsh - Scenario: Users can expect to receive notification emails in the language they are viewing - Given I prefix a url with the welsh language code - And I am not a user of the lpa application - And I want to create a new account - And I access the account creation page - When I create an account - Then I receive unique instructions on how to activate my account in Welsh + Then I should be on the home page of the service \ No newline at end of file diff --git a/service-front/app/features/context/Integration/AccountContext.php b/service-front/app/features/context/Integration/AccountContext.php index 38aa08bdde..bd5cbca419 100644 --- a/service-front/app/features/context/Integration/AccountContext.php +++ b/service-front/app/features/context/Integration/AccountContext.php @@ -68,14 +68,6 @@ class AccountContext extends BaseIntegrationContext private ViewerCodeService $viewerCodeService; private NotifyService $notifyService; - /** - * @Given /^I access the account creation page$/ - */ - public function iAccessTheAccountCreationPage() - { - // Not needed for this context - } - /** * @Given /^I am a user of the lpa application$/ */ @@ -112,14 +104,6 @@ public function iAmCurrentlySignedIn() Assert::assertEquals($user->getIdentity(), $this->userIdentity); } - /** - * @Then /^I am informed that there was a problem with that email address$/ - */ - public function iAmInformedThatThereWasAProblemWithThatEmailAddress() - { - // Not needed for this context - } - /** * @Given /^I am logged out of the service and taken to the deleted account confirmation page$/ */ @@ -128,14 +112,6 @@ public function iAmLoggedOutOfTheServiceAndTakenToTheDeletedAccountConfirmationP // Not needed for this context } - /** - * @Given /^I am not a user of the lpa application$/ - */ - public function iAmNotAUserOfTheLpaApplication() - { - $this->userEmail = ' '; - } - /** * @Given /^I am on the change email page$/ */ @@ -188,22 +164,6 @@ public function iAmTakenToTheDashboardPage() Assert::assertEmpty($lpas); } - /** - * @Then /^I am told my current password is incorrect$/ - */ - public function iAmToldMyCurrentPasswordIsIncorrect() - { - // Not needed in this context - } - - /** - * @Then /^I am told my password was changed$/ - */ - public function iAmToldMyPasswordWasChanged() - { - // Not needed in this context - } - /** * @Then /^I am told my unique instructions to activate my account have expired$/ */ @@ -347,14 +307,6 @@ public function iClickTheLinkToVerifyMyNewEmailAddressAfterMyTokenHasExpired() Assert::assertFalse($tokenValid); } - /** - * @Given /^I confirm that I want to delete my account$/ - */ - public function iConfirmThatIWantToDeleteMyAccount() - { - // Not needed for this context - } - /** * @When /^I create an account$/ */ @@ -391,41 +343,6 @@ public function iCreateAnAccountUsingDuplicateDetails() // Not needed for this context } - /** - * @When /^I create an account using with an email address that has been requested for reset$/ - */ - public function iCreateAnAccountUsingWithAnEmailAddressThatHasBeenRequestedForReset() - { - $this->userEmail = 'test@test.com'; - $this->userPassword = 'pa33W0rd!123'; - - // API call for creating an account - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_CONFLICT, - json_encode([]), - self::USER_SERVICE_CREATE - ) - ); - - try { - $this->userService->create($this->userEmail, new HiddenString($this->userPassword)); - } catch (ApiException $ex) { - Assert::assertEquals(409, $ex->getCode()); - return; - } - - throw new ExpectationFailedException('Conflict exception was not thrown'); - } - - /** - * @When /^I create an account with a password of (.*)$/ - */ - public function iCreateAnAccountWithAPasswordOf($password) - { - // Not needed for this context - } - /** * @When /^I fill in the form and click the cancel button$/ */ @@ -466,22 +383,6 @@ public function iFollowMyUniqueExpiredInstructionsOnHowToResetMyPassword() Assert::assertStringContainsString($this->userPasswordResetToken, $query); } - /** - * @When /^I follow my unique instructions after 24 hours$/ - */ - public function iFollowMyUniqueInstructionsAfter24Hours() - { - $this->apiFixtures->append(ContextUtilities::newResponse(StatusCodeInterface::STATUS_GONE)); - - $canActivate = $this->userService->activate($this->activationToken); - Assert::assertFalse($canActivate); - - $request = $this->apiFixtures->getLastRequest(); - - $query = $request->getUri()->getQuery(); - Assert::assertStringContainsString($this->activationToken, $query); - } - /** * @When /^I follow my unique instructions on how to reset my password$/ */ @@ -552,27 +453,6 @@ public function iHaveAskedToCreateANewAccount() $this->activationToken = 'activate1234567890'; } - /** - * @Given /^I have logged in previously$/ - */ - public function iHaveLoggedInPreviously() - { - $this->iAmCurrentlySignedIn(); - } - - /** - * @When /^I have provided required information for account creation such as (.*)(.*)(.*)(.*)(.*)$/ - */ - public function iHaveProvidedRequiredInformationForAccountCreationSuchAs( - $email1, - $email2, - $password1, - $password2, - $terms, - ) { - // Not needed for this context - } - /** * @Given /^I have requested to change my email address$/ */ @@ -613,41 +493,6 @@ public function iProvideMyNewPassword() Assert::assertEquals($expectedPassword, $params['new-password']); } - /** - * @When /^I provided incorrect current password$/ - */ - public function iProvidedIncorrectCurrentPassword() - { - $expectedPassword = 'S0meS0rt0fPassw0rd'; - - - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_FORBIDDEN, - json_encode([]), - self::USER_SERVICE_CHANGE_PASSWORD - ) - ); - - try { - $this->userService->changePassword( - '123', - new HiddenString('SomeWrongValue'), - new HiddenString($expectedPassword) - ); - } catch (ApiException $exception) { - Assert::assertEquals($exception->getCode(), StatusCodeInterface::STATUS_FORBIDDEN); - - $request = $this->apiFixtures->getLastRequest(); - $params = json_decode($request->getBody()->getContents(), true); - - Assert::assertIsArray($params); - Assert::assertEquals($this->userIdentity, $params['user-id']); - Assert::assertNotEquals($this->userPassword, $params['password']); - Assert::assertEquals($expectedPassword, $params['new-password']); - } - } - /** * @Then /^I receive unique instructions on how to activate my account$/ */ @@ -913,14 +758,6 @@ public function iShouldBeSentAnEmailToBothMyCurrentAndNewEmail() Assert::assertTrue($result); } - /** - * @Then /^I should be told my account could not be created due to (.*)$/ - */ - public function iShouldBeToldMyAccountCouldNotBeCreatedDueTo() - { - // Not needed for this context - } - /** * @Then /^I should be told my email change request was successful$/ */ @@ -985,14 +822,6 @@ public function iViewMyUserDetails() // Not needed for this context } - /** - * @Given /^I want to create a new account$/ - */ - public function iWantToCreateANewAccount() - { - // Not needed for this context - } - /** * @Then /^My account email address should be reset$/ */ diff --git a/service-front/app/features/context/UI/AccountContext.php b/service-front/app/features/context/UI/AccountContext.php index ecce9f3a98..e96e7e8cb7 100644 --- a/service-front/app/features/context/UI/AccountContext.php +++ b/service-front/app/features/context/UI/AccountContext.php @@ -51,39 +51,6 @@ class AccountContext implements Context private const VIEWER_CODE_SERVICE_GET_SHARE_CODES = 'ViewerCodeService::getShareCodes'; private const SYSTEM_MESSAGE_SERVICE_GET_MESSAGES = 'SystemMessageService::getMessages'; - - - /** - * @Then /^An account is created using (.*) (.*) (.*)$/ - */ - public function anAccountIsCreatedUsingEmailPasswordTerms($email, $password, $terms): void - { - $this->activationToken = 'activate1234567890'; - $this->ui->assertPageAddress('/create-account'); - - // API call for password reset request - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'Id' => '123', - 'Email' => $email, - 'ActivationToken' => $this->activationToken, - ] - ) - ) - ); - - // API call for Notify - $this->apiFixtures->append(ContextUtilities::newResponse(StatusCodeInterface::STATUS_OK, json_encode([]))); - - $this->ui->fillField('email', $email); - $this->ui->fillField('password', $password); - $this->ui->fillField('terms', $terms); - $this->ui->pressButton('Create account'); - } - /** * @Given /^another user logs in$/ */ @@ -93,15 +60,6 @@ public function anotherUserLogsIn(): void $this->iAmCurrentlySignedIn(); } - /** - * @Given /^I access the account creation page$/ - */ - public function iAccessTheAccountCreationPage(): void - { - $this->ui->visit($this->sharedState()->basePath . '/create-account'); - $this->ui->assertPageAddress($this->sharedState()->basePath . '/create-account'); - } - /** * @Given /^I access the login form$/ */ @@ -139,15 +97,6 @@ public function iAmAUserOfTheLpaApplication(): void $this->userId = '123'; } - /** - * @Then /^I am allowed to create an account$/ - */ - public function iAmAllowedToCreateAnAccount(): void - { - $this->ui->assertPageAddress('/create-account'); - $this->ui->assertPageContainsText('Create an account'); - } - /** * @Then /^I am asked to confirm whether I am sure if I want to delete my account$/ */ @@ -157,14 +106,6 @@ public function iAmAskedToConfirmWhetherIAmSureIfIWantToDeleteMyAccount(): void $this->ui->assertPageContainsText('What happens if you delete your account'); } - /** - * @Then /^I can see the system message$/ - */ - public function iCanSeeTheSystemMessage(): void - { - $this->ui->assertPageContainsText('Use system message English'); - } - /** * @Given /^I am currently signed in$/ * @Given /^I chose to ignore setting cookies and I am on the dashboard page$/ @@ -192,14 +133,6 @@ public function iAmDirectedToLogoutOfOneLogin() ); } - /** - * @Then /^I am directed to my dashboard$/ - */ - public function iAmDirectedToMyPersonalDashboard(): void - { - $this->ui->assertPageAddress('/lpa/dashboard'); - } - /** * @Then /^I am informed that there was a problem with that email address$/ */ @@ -226,15 +159,6 @@ public function iAmNotAUserOfTheLpaApplication(): void // Not needed for this context } - /** - * @Given /^I am not allowed to progress$/ - */ - public function iAmNotAllowedToProgress(): void - { - $this->ui->assertPageAddress('/home'); - $this->ui->assertPageContainsText('Select yes if you have a Use a lasting power of attorney account'); - } - /** * @When /^I am not signed in to the use a lasting power of attorney service at this point$/ */ @@ -294,23 +218,6 @@ public function iAmOnTheConfirmAccountDeletionPage(): void $this->iRequestToDeleteMyAccount(); } - /** - * @Given /^I am on the create account page$/ - */ - public function iAmOnTheCreateAccountPage(): void - { - $this->ui->visit('/create-account'); - $this->ui->assertPageAddress('/create-account'); - } - - /** - * @When /^I am on the password reset page$/ - */ - public function iAmOnThePasswordResetPage(): void - { - $this->ui->assertPageContainsText('Reset your password'); - } - /** * @Given /^I am on the stats page$/ */ @@ -444,15 +351,6 @@ public function iAmTakenToTheDashboardPage(): void $this->ui->assertPageAddress('/lpa/dashboard'); } - /** - * @Then /^I am allowed to login$/ - */ - public function iAmTakenToTheLoginPage(): void - { - $this->ui->assertPageAddress('/login'); - $this->ui->assertPageContainsText('Sign in to your Use a lasting power of attorney account'); - } - /** * @Then /^I am taken to the session expired page$/ */ @@ -462,22 +360,6 @@ public function iAmTakenToTheSessionExpiredPage(): void $this->ui->assertPageContainsText('We\'ve signed you out'); } - /** - * @Then /^I am taken to the triage page of the service$/ - */ - public function iAmTakenToTheTriagePage(): void - { - $this->ui->assertPageAddress('/home'); - } - - /** - * @Then /^I am told my account has not been activated$/ - */ - public function iAmToldMyAccountHasNotBeenActivated(): void - { - $this->ui->assertPageContainsText('We\'ve emailed a link to ' . $this->userEmail); - } - /** * @Then /^I am told my credentials are incorrect$/ */ @@ -487,26 +369,6 @@ public function iAmToldMyCredentialsAreIncorrect(): void 'power of attorney account with that email address and password.'); } - /** - * @Then /^I am told my current password is incorrect$/ - */ - public function iAmToldMyCurrentPasswordIsIncorrect(): void - { - $this->ui->assertPageAddress('change-password'); - - $this->ui->assertPageContainsText('Current password is incorrect'); - } - - /** - * @Then /^I am told my unique instructions to activate my account have expired$/ - */ - public function iAmToldMyUniqueInstructionsToActivateMyAccountHaveExpired(): void - { - $this->activationToken = 'activate1234567890'; - $this->ui->assertPageAddress('/activate-account/' . $this->activationToken); - $this->ui->assertPageContainsText('We could not activate that account'); - } - /** * @Then /^I am told that my instructions have expired$/ */ @@ -517,16 +379,6 @@ public function iAmToldThatMyInstructionsHaveExpired(): void $this->ui->assertPageContainsText('invalid or has expired'); } - /** - * @Then /^I am told that my new password is invalid because it needs at least (.*)$/ - */ - public function iAmToldThatMyNewPasswordIsInvalidBecauseItNeedsAtLeast($reason): void - { - $this->ui->assertPageAddress('/change-password'); - - $this->ui->assertPageContainsText($reason); - } - /** * @Then /^I am told that my password is invalid because it needs at least (.*)$/ */ @@ -650,23 +502,6 @@ public function iAskToChangeMyPassword(): void } } - /** - * @When /^I attempt to sign in again$/ - */ - public function iAttemptToSignInAgain(): void - { - // Dashboard page checks for all LPA's for a user - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode([]), - self::LPA_SERVICE_GET_LPAS - ) - ); - - $this->ui->visit('/login'); - } - /** * @Then /^I can change my email if required$/ */ @@ -798,25 +633,6 @@ public function iChooseANewPassword(): void Assert::assertArrayHasKey('password', $params); } - /** - * @Given /^I choose a new (.*) from below$/ - */ - public function iChooseANewPasswordFromGiven($password): void - { - // API call for password reset request - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_FORBIDDEN, - json_encode([]) - ) - ); - - $this->ui->fillField('current_password', $this->userPassword); - $this->ui->fillField('new_password', $password); - - $this->ui->pressButton('Change password'); - } - /** * @When /^I click the (.*) link on the page$/ */ @@ -1041,15 +857,6 @@ public function iCreateAnAccountWithAPasswordOf($password): void $this->ui->pressButton('Create account'); } - /** - * @Given /^I do not provide any options and continue$/ - */ - public function iDoNotProvideAnyOptionsAndContinue(): void - { - $this->ui->assertPageAddress('/home'); - $this->ui->pressButton('Continue'); - } - /** * @When /^I enter correct credentials$/ */ @@ -1105,80 +912,6 @@ public function iEnterCorrectCredentials(): void $this->ui->pressButton('Sign in'); } - /** - * @When /^I enter correct email with '(.*)' and (.*) below$/ - */ - public function iEnterCorrectEmailWithEmailFormatAndPasswordBelow($email_format, $password): void - { - $this->ui->fillField('email', $email_format); - $this->ui->fillField('password', $password); - - if ($this->userActive) { - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'Id' => $this->userId, - 'Email' => $email_format, - 'LastLogin' => '2020-01-01', - ] - ), - self::USER_SERVICE_AUTHENTICATE - ) - ); - - // Dashboard page checks for all LPA's for a user - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode([]), - self::LPA_SERVICE_GET_LPAS - ) - ); - } else { - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_UNAUTHORIZED, - json_encode([]), - self::USER_SERVICE_AUTHENTICATE - ) - ); - } - - $this->ui->assertPageContainsText('Sign in'); - $this->ui->pressButton('Sign in'); - } - - /** - * @When /^I hack the CSRF value with '(.*)'$/ - */ - public function iEnterDetailsButHackTheCSRFTokenWith($csrfToken): void - { - $this->ui->getSession()->getPage()->find('css', '#__csrf')->setValue($csrfToken); - - $this->ui->assertPageContainsText('Sign in'); - $this->ui->pressButton('Sign in'); - } - - /** - * @When /^I enter incorrect login details with (.*) and (.*) below$/ - */ - public function iEnterInCorrectLoginDetailsWithEmailFormatAndPasswordBelow($emailFormat, $password): void - { - $this->ui->fillField('email', $emailFormat); - $this->ui->fillField('password', $password); - - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse(StatusCodeInterface::STATUS_FORBIDDEN, json_encode([])) - ); - - $this->ui->pressButton('Sign in'); - } - /** * @When I enter incorrect login email */ @@ -1195,26 +928,6 @@ public function iEnterIncorrectLoginEmail(): void $this->ui->pressButton('Sign in'); } - /** - * @When I enter incorrect login password - */ - public function iEnterIncorrectLoginPassword(): void - { - $this->ui->fillField('email', $this->userEmail); - $this->ui->fillField('password', 'inoc0rrectPassword'); - - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_FORBIDDEN, - json_encode([]), - self::USER_SERVICE_AUTHENTICATE - ) - ); - - $this->ui->pressButton('Sign in'); - } - /** * @When /^I follow my unique expired instructions on how to reset my password$/ */ @@ -1228,23 +941,6 @@ public function iFollowMyUniqueExpiredInstructionsOnHowToResetMyPassword(): void $this->ui->visit('/reset-password/123456'); } - /** - * @When /^I follow my unique instructions after 24 hours$/ - */ - public function iFollowMyUniqueInstructionsAfter24Hours(): void - { - // remove successful reset token and add failure state - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_NOT_FOUND, - '', - self::USER_SERVICE_ACTIVATE - ) - ); - - $this->ui->visit('/activate-account/' . $this->activationToken); - } - /** * @When /^I follow my unique instructions on how to reset my password$/ */ @@ -1302,32 +998,6 @@ public function iFollowTheInstructionsOnHowToActivateMyAccount(): void Assert::assertEquals('abcd2345', $params['activation_token']); } - /** - * @When /^I hack the request id of the CSRF value$/ - */ - public function iHackTheRequestIdOfTheCSRFValue(): void - { - $value = $this->ui->getSession()->getPage()->find('css', '#__csrf')->getValue(); - $separated = explode('-', $value); - $separated[1] = 'youhazbeenhaaxed'; //this is the requestid. - $hackedValue = implode('-', $separated); - $this->iEnterDetailsButHackTheCSRFTokenWith($hackedValue); - } - - /** - * @When /^I hack the token of the CSRF value$/ - */ - public function iHackTheTokenOfTheCSRFValue(): void - { - $value = $this->ui->getSession()->getPage()->find('css', '#__csrf')->getValue(); - - $separated = explode('-', $value); - $separated[0] = 'youhazbeenhaaxed'; //this is the token part. - $hackedValue = implode('-', $separated); - - $this->iEnterDetailsButHackTheCSRFTokenWith($hackedValue); - } - /** * @Given /^I have asked for my password to be reset$/ */ @@ -1356,49 +1026,6 @@ public function iHaveDeletedMyAccount(): void $this->iConfirmThatIWantToDeleteMyAccount(); } - /** - * @Given /^I have logged in previously$/ - */ - public function iHaveLoggedInPreviously(): void - { - // do all the steps to sign in - $this->iAccessTheLoginForm(); - - $this->ui->fillField('email', $this->userEmail); - $this->ui->fillField('password', $this->userPassword); - - if ($this->userActive) { - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'Id' => $this->userId, - 'Email' => $this->userEmail, - 'LastLogin' => null, - ] - ), - self::USER_SERVICE_AUTHENTICATE - ) - ); - } else { - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_UNAUTHORIZED, - json_encode([]), - self::USER_SERVICE_AUTHENTICATE - ) - ); - } - - $this->ui->pressButton('Sign in'); - - $this->iAmSignedIn(); - $this->iLogoutOfTheApplication(); - } - /** * @Given /^I have not activated my account$/ */ @@ -1407,30 +1034,6 @@ public function iHaveNotActivatedMyAccount(): void $this->userActive = false; } - /** - * @When /^I have provided required information for account creation such as (.*)(.*)(.*)$/ - */ - public function iHaveProvidedRequiredInformationForAccountCreationSuchAs($email, $password, $terms): void - { - $this->ui->assertPageAddress('/create-account'); - - // API call for password reset request - $this->apiFixtures->append( - ContextUtilities::newResponse(StatusCodeInterface::STATUS_OK, json_encode([]), self::USER_SERVICE_CREATE) - ); - - // API call for Notify - $this->apiFixtures->append(ContextUtilities::newResponse(StatusCodeInterface::STATUS_OK, json_encode([]))); - - $this->ui->fillField('email', $email); - $this->ui->fillField('show_hide_password', $password); - if ($terms === 1) { - $this->ui->checkOption('terms'); - } - - $this->ui->pressButton('Create account'); - } - /** * @Given /^I have requested to change my email address$/ */ @@ -1517,28 +1120,6 @@ public function iProvideMyNewPassword(): void $this->ui->pressButton('Change password'); } - /** - * @When /^I provided incorrect current password$/ - */ - public function iProvidedIncorrectCurrentPassword(): void - { - $newPassword = 'Password123!'; - - // API call for password reset request - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_FORBIDDEN, - json_encode([]), - self::USER_SERVICE_CHANGE_PASSWORD - ) - ); - - $this->ui->fillField('current_password', 'wrongPassword'); - $this->ui->fillField('new_password', $newPassword); - - $this->ui->pressButton('Change password'); - } - /** * @Then /^I receive unique instructions on how to activate my account$/ */ @@ -1552,17 +1133,6 @@ public function iReceiveUniqueInstructionsOnHowToActivateMyAccount(): void assert($this->apiFixtures->count() === 0); } - /** - * @Then /^I receive unique instructions on how to activate my account in Welsh$/ - */ - public function iReceiveUniqueInstructionsOnHowToActivateMyAccountInWelsh(): void - { - $request = $this->apiFixtures->getLastRequest(); - - $requestBody = $request->getBody()->getContents(); - Assert::assertStringContainsString('"locale":"cy_GB"', $requestBody); - } - /** * @Then /^I receive unique instructions on how to reset my password$/ * @Then /^I receive an email telling me I do not have an account$/ @@ -1737,27 +1307,6 @@ public function iRequestToSeeTheActorTermsOfUse(): void $this->ui->clickLink('terms of the Use a lasting power of attorney service.'); } - /** - * @Given /^I select the option to create a new account$/ - */ - public function iSelectTheOptionToCreateNewAccount(): void - { - $this->ui->assertPageAddress('/home'); - $this->ui->fillField('triageEntry', 'no'); - $this->ui->pressButton('Continue'); - } - - /** - * @When /^I select the option to sign in to my existing account$/ - */ - public function iSelectTheOptionToSignInToMyExistingAccount(): void - { - $this->ui->assertPageAddress('/home'); - $this->ui->assertPageContainsText('Use a lasting power of attorney'); - $this->ui->fillField('triageEntry', 'yes'); - $this->ui->pressButton('Continue'); - } - /** * @Given /^I should be able to login with my new email address$/ * @Then /^I see a flash message confirming my email address has been changed$/ @@ -1841,15 +1390,6 @@ public function iShouldBeToldThatMyRequestWasSuccessful(): void $this->ui->assertPageContainsText('We\'ve emailed a link to ' . $this->newUserEmail); } - /** - * @Then /^I should see relevant (.*) message$/ - */ - public function iShouldSeeRelevantErrorMessage($error): void - { - $this->ui->assertPageAddress('/login'); - $this->ui->assertPageContainsText($error); - } - /** * @Then /^I should see the (.*) message$/ */ @@ -1923,16 +1463,6 @@ public function myAccountEmailAddressShouldBeReset(): void // Not needed for this context } - /** - * @Then /^my account is activated and I receive a confirmation email$/ - */ - public function myAccountIsActivatedAndIReceiveAConfirmationEmail(): void - { - $this->ui->assertPageAddress('/login'); - $this->ui->assertPageContainsText('Account activated successfully'); - $this->ui->assertPageContainsText('sign in'); - } - /** * @Then /^My account is deleted$/ */ @@ -1949,108 +1479,6 @@ public function myEmailResetTokenIsStillValid(): void $this->userEmailResetToken = '12345abcde'; } - /** - * @Then /^my password has been associated with my user account$/ - * @Then /^I am told my password was changed$/ - */ - public function myPasswordHasBeenAssociatedWithMyUserAccount(): void - { - $this->ui->assertPageAddress('/login'); - $this->ui->assertPageContainsText('Password changed successfully'); - - Assert::assertEquals(0, $this->apiFixtures->count()); - } - - /** - * @When /^I sign successfully$/ - */ - public function iSignInSuccessfully(): void - { - $this->ui->fillField('email', $this->userEmail); - $this->ui->fillField('password', $this->userPassword); - - - // API call for authentication - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'Id' => $this->userId, - 'Email' => $this->userEmail, - 'LastLogin' => '2020-01-01', - 'NeedsReset' => '2020-10-10', - ] - ), - self::USER_SERVICE_AUTHENTICATE - ) - ); - } - - /** - * @Then /^I am requested to reset my password$/ - */ - public function iAmRequestedToResetMyPassword(): void - { - $this->ui->pressButton('Sign in'); - $this->ui->assertPageAddress('/lpa/dashboard'); - - //Using first line of body to make sure this step is distinguished from other change password pages - $this->ui->assertPageContainsText('Keeping our online services secure is very important to us'); - } - - /** - * @Then /^My password security is compromised and requested to reset my password on login$/ - */ - public function myPasswordSecurityIsCompromisedAndRequestedToReset(): void - { - $this->iAccessTheLoginForm(); - $this->iSignInSuccessfully(); - $this->iAmRequestedToResetMyPassword(); - } - - /** - * @Then /^I request for my password to be reset$/ - */ - public function iRequestForMyPasswordToBeReset( - $email = 'opg-use-an-lpa+test-user1@digital.justice.gov.uk', - $email_confirmation = 'opg-use-an-lpa+test-user1@digital.justice.gov.uk', - ) { - // API call for password reset request - $this->apiFixtures->append( - ContextUtilities::newResponse( - StatusCodeInterface::STATUS_OK, - json_encode( - [ - 'Id' => $this->userId, - 'PasswordResetToken' => '123456', - ] - ), - self::USER_SERVICE_REQUEST_PASSWORD_RESET - ) - ); - - // API call for Notify - $this->apiFixtures->append(ContextUtilities::newResponse(StatusCodeInterface::STATUS_OK, json_encode([]))); - $this->ui->pressButton('Email me the link'); - $this->ui->assertPageContainsText('We\'ve emailed a link to'); - - $request = $this->apiFixtures->getLastRequest(); - $params = json_decode($request->getBody()->getContents(), true); - - Assert::assertArrayHasKey('passwordResetUrl', $params); - Assert::assertArrayHasKey('recipient', $params); - } - - /** - * @Then /^I receive an email and shown unique instructions on how to reset my password$/ - */ - public function iReceiveAnEmailAndShownUniqueInstructionsOnHowToResetMyPassword(): void - { - $this->ui->assertPageAddress('/reset-password'); - $this->ui->assertPageContainsText('We\'ve emailed a link to '); - } - /** * @Given /^I am on the one login page$/ */ @@ -2295,13 +1723,4 @@ public function iSeeAnEmptyLPADashboard(): void $this->ui->clickLink('Add your first LPA'); } - /** - * @When /^An actor system message is set$/ - */ - public function aSystemMessageIsSet(): void { - $this->systemMessages = [ - 'use/en' => 'Use system message English', - 'use/cy' => 'Use system message Welsh' - ]; - } } diff --git a/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php b/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php index e35414aac5..f61dc877d3 100644 --- a/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php +++ b/service-front/app/test/CommonTest/Middleware/Authentication/AuthenticationMiddlewareTest.php @@ -38,9 +38,7 @@ public function it_pipes_a_request_through_all_authentication_middlewares(): voi [ 'config', [ - 'feature_flags' => [ - 'allow_gov_one_login' => false, - ], + 'feature_flags' => [], ], ], ] diff --git a/tests/features/actor-login.feature b/tests/features/actor-login.feature index e415e352f8..11a22e5107 100644 --- a/tests/features/actor-login.feature +++ b/tests/features/actor-login.feature @@ -8,7 +8,7 @@ Feature: A user of the system is able to login Given I am a user of the lpa application And I have been given access to use an LPA via credentials - @smoke @ff:allow_gov_one_login:from_env + @smoke Scenario: A user can login Given I access the login form When I enter correct credentials