diff --git a/tests/Functional/Features/Context/WebContext.php b/tests/Functional/Features/Context/WebContext.php index 696f8726..400ccb3e 100644 --- a/tests/Functional/Features/Context/WebContext.php +++ b/tests/Functional/Features/Context/WebContext.php @@ -309,6 +309,14 @@ public function iShouldSeeANameIDWithEmailAddress($emailAddress){ } } + /** + * @Given I have :language set as my stepup-locale cookie value + */ + public function iHaveSetAsMyPreference($language) + { + $this->minkContext->getSession()->setCookie('stepup_locale', $language); + } + private function receiveResponse() { $samlResponse = $this->minkContext->getSession()->getPage()->find('css', 'input[name="SAMLResponse"]'); diff --git a/tests/Functional/Features/registration.feature b/tests/Functional/Features/registration.feature index 34c086b9..0ca85b27 100644 --- a/tests/Functional/Features/registration.feature +++ b/tests/Functional/Features/registration.feature @@ -13,6 +13,30 @@ Feature: When an user needs to register for a new token And the SAML Response should contain element "StatusCode" with attribute "Value" with attribute value "urn:oasis:names:tc:SAML:2.0:status:Success" And the SAML Response should contain element "NameID" with value containing "test-user@institution-a.example.com" + Scenario: The user is presented the page in his preferred language based on stepup-locale cookie NL + Given I have "nl" set as my stepup-locale cookie value + And I send a registration request request to "https://azure-mfa.stepup.example.com/saml/sso" + Then I should see "Registratie" + + Scenario: The user is presented the page in his preferred language based on stepup-locale cookie EN + Given I have "en" set as my stepup-locale cookie value + And I send a registration request request to "https://azure-mfa.stepup.example.com/saml/sso" + Then I should see "Registration" + + Scenario: When a user is registering a new token and switches back and forth from English to Dutch language during registration + Given I send a registration request request to "https://azure-mfa.stepup.example.com/saml/sso" + Then I should see "Registration" + And I follow "NL" + Then I should see "Registratie" + And I follow "EN" + Then I should see "Registration" + And I fill in "Email address" with "test-user@institution-a.example.com" + When I press "Submit" + And I press "Submit-success" + Then I should be on "https://azure-mfa.stepup.example.com/saml/sso_return" + And the SAML Response should contain element "StatusCode" with attribute "Value" with attribute value "urn:oasis:names:tc:SAML:2.0:status:Success" + And the SAML Response should contain element "NameID" with value containing "test-user@institution-a.example.com" + Scenario: When a user is registering a new token, authentication at Azure MFA fails Given I send a registration request request to "https://azure-mfa.stepup.example.com/saml/sso" Then I should see "Registration"