Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for pagination #24

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions stepup/tests/behat/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions stepup/tests/behat/features/bootstrap/RaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ public function openFirstAuditLogForInstitution($institution)
);
}
$searchResult->clickLink('Audit log');

$this->minkContext->assertPageContainsText('Audit log');
}

/**
Expand Down
69 changes: 69 additions & 0 deletions stepup/tests/behat/features/mw_paging.feature
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Feature: A RAA can view the institution configuration
"""
And I authenticate to the Middleware API
And I request "POST /management/institution-configuration"
And a user "Jane Toppan" identified by "urn:collab:person:institution-a.example.com:jane-a-raa" from institution "institution-a.example.com" with UUID "00000000-0000-4000-A000-000000000001"
And a user "Jane Toppan" identified by "urn:collab:person:institution-a.example.com:jane-a-raa" from institution "institution-a.example.com" with UUID "00000000-0000-4000-a000-000000000001"
And the user "urn:collab:person:institution-a.example.com:jane-a-raa" has a vetted "yubikey" with identifier "00000001"
And the user "urn:collab:person:institution-a.example.com:jane-a-raa" has the role "raa" for institution "institution-a.example.com"

Expand Down
4 changes: 2 additions & 2 deletions stepup/tests/behat/features/ra_profile.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ Feature: A RA(A) can view profile information
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 institution "institution-a.example.com" can "select_raa" from institution "institution-a.example.com"
And a user "Jane Toppan" identified by "urn:collab:person:institution-a.example.com:jane-a-ra" from institution "institution-a.example.com" with UUID "00000000-0000-4000-A000-000000000001"
And a user "Jane Toppan" identified by "urn:collab:person:institution-a.example.com:jane-a-ra" from institution "institution-a.example.com" with UUID "00000000-0000-4000-a000-000000000001"
And the user "urn:collab:person:institution-a.example.com:jane-a-ra" has a vetted "yubikey" identified by "00000001"
And the user "urn:collab:person:institution-a.example.com:jane-a-ra" has the role "raa" for institution "institution-a.example.com"
And a user "Joe Satriani" identified by "urn:collab:person:institution-a.example.com:joe-a-ra" from institution "institution-a.example.com" with UUID "00000000-0000-4000-A000-000000000002"
And a user "Joe Satriani" identified by "urn:collab:person:institution-a.example.com:joe-a-ra" from institution "institution-a.example.com" with UUID "00000000-0000-4000-a000-000000000002"
And the user "urn:collab:person:institution-a.example.com:joe-a-ra" has a vetted "yubikey" identified by "00000002"
And the user "urn:collab:person:institution-a.example.com:joe-a-ra" has the role "ra" for institution "institution-a.example.com"

Expand Down
Loading