Skip to content

Commit

Permalink
Repair the ra_candidate features
Browse files Browse the repository at this point in the history
The Event stream needed some tweaking (mainly to get my first name out
of the identities ;) )
  • Loading branch information
MKodde committed Feb 12, 2024
1 parent e827506 commit 6245830
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 40 deletions.
1 change: 0 additions & 1 deletion stepup/tests/behat/features/bootstrap/RaContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ public function iVisitTheRAManagementPage()
public function iRelieveOfHisRole($userName, $institution, $role)
{
$page = $this->minkContext->getSession()->getPage();

// There should be a td with the username in it, select that TR to press that button on.
$searchResult = $page->findAll('xpath', sprintf("//tr[./td[contains(.,'%s')]]", $userName));

Expand Down
59 changes: 35 additions & 24 deletions stepup/tests/behat/features/ra_candidate.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@SKIP
Feature: A RAA manages ra candidates in the ra environment
In order to promote candidates
As a RAA
Expand All @@ -8,11 +7,12 @@ Feature: A RAA manages ra candidates in the ra environment
Given institution "institution-a.example.com" can "select_raa" from institution "institution-a.example.com"
And institution "institution-b.example.com" can "select_raa" from institution "institution-a.example.com"
And institution "institution-d.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"
And a user "jane-a-ra" identified by "urn:collab:person:institution-a.example.com:jane-a-ra" from institution "institution-a.example.com"
And a user "jane-a1" identified by "urn:collab:person:institution-a.example.com:jane-a1" from institution "institution-a.example.com"
# The two users below are only used to create institutions for the SRAA switcher
And a user "DUMMY1" identified by "urn:collab:person:institution-b.example.com:dummy1" from institution "institution-b.example.com"
And a user "DUMMY2" identified by "urn:collab:person:institution-d.example.com:dummy2" from institution "institution-d.example.com"
And the user "urn:collab:person:institution-a.example.com:jane-a-ra" has a vetted "yubikey"
And a user "user-b1" identified by "urn:collab:person:institution-b.example.com:user-b1" from institution "institution-b.example.com"
And a user "user-b2" identified by "urn:collab:person:institution-d.example.com:user-b2" from institution "institution-d.example.com"
And the user "urn:collab:person:institution-a.example.com:jane-a-ra" has a vetted "yubikey" with identifier "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 the user "urn:collab:person:institution-a.example.com:jane-a-ra" has the role "raa" for institution "institution-b.example.com"
And the user "urn:collab:person:institution-a.example.com:jane-a-ra" has the role "raa" for institution "institution-d.example.com"
Expand All @@ -21,56 +21,67 @@ Feature: A RAA manages ra candidates in the ra environment
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates:
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
| Admin | dev.openconext.local |
| name | institution |
| jane-a-ra | institution-a.example.com |
| jane-b1 institution-b.example.com | institution-b.example.com |
| user-b-ra institution-b.example.com | institution-b.example.com |
| user-b5 institution-b.example.com | institution-b.example.com |
| Admin | dev.openconext.local |
| SRAA2 | dev.openconext.local |

Scenario: SRAA user checks if "Jane Toppan" is a candidate for all institutions (with filtering on institution-a)
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates for "institution-a.example.com":
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
| jane-a-ra | institution-a.example.com |


Scenario: SRAA user checks if "Jane Toppan" is a candidate for all institutions (with filtering on institution-b)
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates for "institution-b.example.com":
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
| name | institution |
| jane-b1 institution-b.example.com | institution-b.example.com |
| user-b-ra institution-b.example.com | institution-b.example.com |
| user-b5 institution-b.example.com | institution-b.example.com |

Scenario: SRAA user demotes "Jane" to no longer be an RAA for "institution-a"
Scenario: SRAA user demotes "jane-a-ra" to no longer be an RAA for "institution-a"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA Management page
Then I relieve "Jane Toppan" from "institution-a.example.com" of his "RAA" role
Then I relieve "jane-a-ra" from "institution-a.example.com" of his "RAA" role

Scenario: SRAA user checks if "Jane Toppan" is a candidate for "institution-a"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates for "institution-a.example.com":
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
| Jane Toppan | institution-a.example.com |
| name | institution |
| jane-a-ra | institution-a.example.com |
| jane-b1 institution-b.example.com | institution-b.example.com |
| user-b-ra institution-b.example.com | institution-b.example.com |
| user-b5 institution-b.example.com | institution-b.example.com |

Scenario: SRAA user checks if "Jane Toppan" is not a candidate for "institution-b"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates for "institution-b.example.com":
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
| name | institution |
| jane-b1 institution-b.example.com | institution-b.example.com |
| user-b-ra institution-b.example.com | institution-b.example.com |
| user-b5 institution-b.example.com | institution-b.example.com |

Scenario: SRAA user checks if "Jane Toppan" is not listed for "institution-a"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA Management page
Then I should see the following raas:
| name | institution | role |
| Jane Toppan | institution-b.example.com | RAA |
| Jane Toppan | institution-d.example.com | RAA |
| name | institution | role |
| jane-a-ra | institution-b.example.com | RAA |
| jane-a-ra | institution-d.example.com | RAA |

Scenario: SRAA user checks if "Jane Toppan" is listed for "institution-b"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
When I visit the RA Management page
Then I should see the following raas:
| name | institution | role |
| Jane Toppan | institution-b.example.com | RAA |
| Jane Toppan | institution-d.example.com | RAA |
| name | institution | role |
| jane-a-ra | institution-b.example.com | RAA |
| jane-a-ra | institution-d.example.com | RAA |
20 changes: 11 additions & 9 deletions stepup/tests/behat/features/ra_candidate2.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@SKIP
Feature: A RAA manages ra candidates in the ra environment (see: https://www.pivotaltracker.com/story/show/171703175)
In order to promote candidates
As a RAA
Expand All @@ -11,16 +10,19 @@ Feature: A RAA manages ra candidates in the ra environment (see: https://www.piv

And institution "institution-d.example.com" can "select_raa" from institution "institution-a.example.com"

And a user "joe-a-raa institution-a" identified by "urn:collab:person:institution-a.example.com:joe-a-raa" from institution "institution-a.example.com"
And the user "urn:collab:person:institution-a.example.com:joe-a-raa" has a vetted "yubikey"
And a user "joe-a-raa institution-a" identified by "urn:collab:person:institution-a.example.com:joe-a-raa" from institution "institution-a.example.com" with UUID "3af4eba5-8d1b-4da4-a6ba-c730356f36e1"
And the user "urn:collab:person:institution-a.example.com:joe-a-raa" has a vetted "yubikey" identified by "00000002"
And the user "urn:collab:person:institution-a.example.com:joe-a-raa" has the role "raa" for institution "institution-a.example.com"
And a user "jane-a2 institution-a" identified by "urn:collab:person:institution-a.example.com:jane-a2" from institution "institution-a.example.com" with UUID "3af4eba5-8d1b-4da4-a6ba-c730356f36e2"
And the user "urn:collab:person:institution-a.example.com:jane-a2" has a vetted "yubikey" identified by "00000003"

And a user "jane-d-raa institution-d.nl" identified by "urn:collab:person:institution-d.example.com:jane-d-raa" from institution "institution-d.example.com"
And the user "urn:collab:person:institution-d.example.com:jane-d-raa" has a vetted "yubikey"
And a user "jane-d-raa institution-d.nl" identified by "urn:collab:person:institution-d.example.com:jane-d-raa" from institution "institution-d.example.com" with UUID "3af4eba5-8d1b-4da4-a6ba-c730356f36e3"
And the user "urn:collab:person:institution-d.example.com:jane-d-raa" has a vetted "yubikey" identified by "00000004"

Scenario: RAA from instititution a should not see an RA(A) candidate from institution d
Scenario: RAA from institution a should not see an RA(A) candidate from institution d
Given I am logged in into the ra portal as "joe-a-raa" with a "yubikey" token
When I visit the RA promotion page
Then I should see the following candidates for "institution-d.example.com":
| name | institution |
| jane-a1 institution-a.example.com | institution-a.example.com |
Then I should see the following candidates for "institution-a.example.com":
| name | institution |
| jane-a2 institution-a | institution-a.example.com |
| joe-a-raa institution-a | institution-a.example.com |
7 changes: 3 additions & 4 deletions stepup/tests/behat/features/ra_candidate3.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@SKIP
Feature: A RAA manages ra candidates from virtual institutions in the ra environment
In order to promote candidates from virtual institutions
As a RAA
Expand All @@ -12,13 +11,13 @@ Feature: A RAA manages ra candidates from virtual institutions in the ra environ
And institution "institution-d.example.com" can "select_raa" from institution "institution-a.example.com"

And a user "joe-a-raa institution-a" identified by "urn:collab:person:institution-a.example.com:joe-a-raa" from institution "institution-a.example.com" with UUID "00000000-0000-4000-8000-000000000010"
And the user "urn:collab:person:institution-a.example.com:joe-a-raa" has a vetted "yubikey"
And the user "urn:collab:person:institution-a.example.com:joe-a-raa" has a vetted "yubikey" identified by "00000004"

Scenario: RAA from institution a should see "joe-a-raa" as an RA(A) candidate from "institution-d"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
And I visit the "management/create-ra/00000000-0000-4000-8000-000000000010" page in the RA environment
Then the "#ra_management_create_ra_roleAtInstitution_institution" element should contain "institution-a.example.com"
And the "#ra_management_create_ra_roleAtInstitution_institution" element should contain "institution-d.example.com"
And the "#ra_management_create_ra_roleAtInstitution_institution" element should contain "institution-b.example.com"

Scenario: SRAA user promotes "joe-a-raa" to be a RA for "institution-d"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
Expand All @@ -29,7 +28,7 @@ Feature: A RAA manages ra candidates from virtual institutions in the ra environ
Given I am logged in into the ra portal as "admin" with a "yubikey" token
And I visit the "management/create-ra/00000000-0000-4000-8000-000000000010" page in the RA environment
Then the "#ra_management_create_ra_roleAtInstitution_institution" element should contain "institution-a.example.com"
And the "#ra_management_create_ra_roleAtInstitution_institution" element should not contain "institution-d.example.com"
And the "#ra_management_create_ra_roleAtInstitution_institution" element should not contain "institution-c.example.com"

Scenario: SRAA user demotes "joe-a-raa" from a RA of "institution-d"
Given I am logged in into the ra portal as "admin" with a "yubikey" token
Expand Down
4 changes: 2 additions & 2 deletions stepup/tests/behat/fixtures/events.sql

Large diffs are not rendered by default.

0 comments on commit 6245830

Please sign in to comment.