From 568376c47734abcfd4f2c822e419ae8fcd5343f1 Mon Sep 17 00:00:00 2001 From: Bas Date: Wed, 11 Dec 2024 15:48:28 +0100 Subject: [PATCH] Add stepup pagination test --- .../features/bootstrap/FeatureContext.php | 16 +++++ .../behat/features/bootstrap/RaContext.php | 2 + stepup/tests/behat/features/mw_paging.feature | 69 +++++++++++++++++++ .../{replay.feature => mw_replay.feature} | 0 4 files changed, 87 insertions(+) create mode 100644 stepup/tests/behat/features/mw_paging.feature rename stepup/tests/behat/features/{replay.feature => mw_replay.feature} (100%) diff --git a/stepup/tests/behat/features/bootstrap/FeatureContext.php b/stepup/tests/behat/features/bootstrap/FeatureContext.php index 6f792a8..4e7ddb3 100644 --- a/stepup/tests/behat/features/bootstrap/FeatureContext.php +++ b/stepup/tests/behat/features/bootstrap/FeatureContext.php @@ -332,6 +332,22 @@ public function theUserHasTheRole($nameId, $role, $institution) $this->apiContext->iRequest('POST', '/command'); } + /** + * @Given /^I click on link "([^"]*)"$/ + */ + public function iClickOnLink($name) + { + $this->minkContext->clickLink($name); + } + + /** + * @Given /^I should be on page "([^"]*)"$/ + */ + public function iShouldBeOnPage($url) + { + $this->minkContext->assertPageAddress($url); + } + private function proveYubikeyPossession($identityData) { // 1.1 prove possession of a yubikey token diff --git a/stepup/tests/behat/features/bootstrap/RaContext.php b/stepup/tests/behat/features/bootstrap/RaContext.php index 8614be8..452e2d2 100644 --- a/stepup/tests/behat/features/bootstrap/RaContext.php +++ b/stepup/tests/behat/features/bootstrap/RaContext.php @@ -354,6 +354,8 @@ public function openFirstAuditLogForInstitution($institution) ); } $searchResult->clickLink('Audit log'); + + $this->minkContext->assertPageContainsText('Audit log'); } /** diff --git a/stepup/tests/behat/features/mw_paging.feature b/stepup/tests/behat/features/mw_paging.feature new file mode 100644 index 0000000..5bc0327 --- /dev/null +++ b/stepup/tests/behat/features/mw_paging.feature @@ -0,0 +1,69 @@ +Feature: The paging should work for the token audit log + In order to see a log trace + As a SRAA + I must be able to see the next page of the token audit log + + Scenario: A user registers a SMS token in selfservice using RA vetting + Given a user "jane-a1" identified by "urn:collab:person:institution-a.example.com:jane-a1" from institution "institution-a.example.com" with UUID "00000000-0000-4000-a000-000000000010" + And the user "urn:collab:person:institution-a.example.com:jane-a1" has a vetted "yubikey" with identifier "00000010" + And institution "institution-a.example.com" can "select_raa" from institution "institution-a.example.com" + And institution "institution-a.example.com" can "use_ra" from institution "institution-a.example.com" + And institution "institution-a.example.com" can "use_raa" from institution "institution-a.example.com" + And I am logged in into the ra portal as "admin" with a "yubikey" token + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + And I visit the RA promotion page + And I change the role of "jane-a1" to become "RA" for institution "institution-a.example.com" + And I visit the RA Management page + And I relieve "jane-a1" from "institution-a.example.com" of his "RA" role + When I visit the Tokens page + And I open the audit log for a user of "institution-a.example.com" + And I click on link "Next" + Then I should be on page "/second-factors/00000000-0000-4000-a000-000000000010/auditlog?p=2" + And I should see "Admin" diff --git a/stepup/tests/behat/features/replay.feature b/stepup/tests/behat/features/mw_replay.feature similarity index 100% rename from stepup/tests/behat/features/replay.feature rename to stepup/tests/behat/features/mw_replay.feature