Repository navigation
Add Behat and Cypress coverage for the WAYF remember-my-choice epic #2112
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
Open
kayjoosten
wants to merge
11
commits into
wayf-remember-choice-checkbox
Choose a base branch
from
wayf-epic-test-coverage
base: wayf-remember-choice-checkbox
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
cef5976
Enable the per-SP WAYF remember-choice mode for CI
kayjoosten 1bd070c
Add fixture/step support for enabling WAYF remember-choice per SP
kayjoosten 34765e3
Add Behat steps for selecting an IdP with remember-choice and asserti…
kayjoosten a762f36
Add RememberWayfChoice.feature Behat scenarios for #2084
kayjoosten 39de7d8
Fix it.only regression in wayf.general.spec.js
kayjoosten 2755454
Add Cypress coverage for the remember-choice checkbox -> hidden field…
kayjoosten dfd27c7
Fix undefined property access on EmptyMduiElement
kayjoosten 7a59b56
Assert the remembered IdP on WAYF skip
kayjoosten abaea27
Cover the legacy remember-choice cookie branch
kayjoosten ecb1e08
Remove it.only reintroduced by rebasing onto checkbox branch
kayjoosten 34e751b
Cover the cookie removal page and per-SP-only mock WAYF
kayjoosten File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
src/OpenConext/EngineBlockFunctionalTestingBundle/Features/RememberWayfChoice.feature
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| Feature: | ||
| In order to not have to pick my IdP every time I log in to the same SP | ||
| As a user | ||
| I want EngineBlock to remember my previous IdP choice for that SP | ||
|
|
||
| Background: | ||
| Given an EngineBlock instance on "dev.openconext.local" | ||
| And no registered SPs | ||
| And no registered Idps | ||
| And an Identity Provider named "Dummy-IdP" | ||
| And an Identity Provider named "Second-IdP" | ||
| And a Service Provider named "Remembering-SP" | ||
| And SP "Remembering-SP" allows remembering the WAYF choice | ||
| And a Service Provider named "Non-Remembering-SP" | ||
|
|
||
| Scenario: Remembering a choice skips the WAYF on a subsequent login | ||
| When I log in at "Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF and remember my choice | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| Then the "rememberedidps" cookie should be set | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
| And I start a new browser session | ||
| When I log in at "Remembering-SP" | ||
| And I pass through EngineBlock | ||
| Then the url should not match "authentication/proxy/wayf" | ||
| And the url should match "Dummy-IdP/sso" | ||
| When I pass through the IdP | ||
| When I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
|
|
||
| Scenario: The remembered choice is scoped per SP | ||
| Given a Service Provider named "Other-Remembering-SP" | ||
| And SP "Other-Remembering-SP" allows remembering the WAYF choice | ||
| When I log in at "Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF and remember my choice | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| Then the "rememberedidps" cookie should be set | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
| And I start a new browser session | ||
| When I log in at "Other-Remembering-SP" | ||
| And I select "Second-IdP" on the WAYF | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Other-Remembering-SP/acs" | ||
|
|
||
| Scenario: An SP without the coin never gets the choice remembered | ||
| When I log in at "Non-Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF and remember my choice | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| Then the "rememberedidps" cookie should not be set | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Non-Remembering-SP/acs" | ||
| And I start a new browser session | ||
| When I log in at "Non-Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Non-Remembering-SP/acs" | ||
|
|
||
| Scenario: The reset endpoint clears a remembered choice | ||
| When I log in at "Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF and remember my choice | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| Then the "rememberedidps" cookie should be set | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
| When I go to Engineblock URL "/reset-remember-wayf" | ||
| Then the "rememberedidps" cookie should not be set | ||
| And I start a new browser session | ||
| When I log in at "Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
|
|
||
| Scenario: The cookie removal page lists and removes the remembered choice | ||
| When I log in at "Remembering-SP" | ||
| And I select "Dummy-IdP" on the WAYF and remember my choice | ||
| And I pass through EngineBlock | ||
| And I pass through the IdP | ||
| Then the "rememberedidps" cookie should be set | ||
| When I give my consent | ||
| And I pass through EngineBlock | ||
| Then the url should match "functional-testing/Remembering-SP/acs" | ||
| When I go to Engineblock URL "/authentication/idp/remove-cookies" | ||
| Then the response should contain 'rememberedidps' | ||
| When I press "remove_rememberedidps" | ||
| Then the "rememberedidps" cookie should not be set | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/e2e/cypress/integration/shared/cookieRemoval.a11y.spec.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without a existing session in EB.
I mean: This feature could be easily mistaken for the other 'remember my choice' & the test flows could be mistake if you do not clear your EB session cookie, which this new remember my choice feature is specifically for.