Skip to content

Commit 34e751b

Browse files
committed
Cover the cookie removal page and per-SP-only mock WAYF
# Why is this change needed? Prior to this change, the cookie removal page was not tested in the per-SP mode, and no Cypress test rendered the per-SP checkbox without also passing rememberChoiceFeature. The comment in cookieRemoval.a11y.spec.js also only mentioned the global flag. # How does it address the issue? This change adds a Behat scenario that lists and removes the rememberedidps cookie on /authentication/idp/remove-cookies, a Cypress test for rememberChoicePerIdp=true on its own, and updates the comment.
1 parent ecb1e08 commit 34e751b

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

‎src/OpenConext/EngineBlockFunctionalTestingBundle/Features/RememberWayfChoice.feature‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,17 @@ Feature:
8888
When I give my consent
8989
And I pass through EngineBlock
9090
Then the url should match "functional-testing/Remembering-SP/acs"
91+
92+
Scenario: The cookie removal page lists and removes the remembered choice
93+
When I log in at "Remembering-SP"
94+
And I select "Dummy-IdP" on the WAYF and remember my choice
95+
And I pass through EngineBlock
96+
And I pass through the IdP
97+
Then the "rememberedidps" cookie should be set
98+
When I give my consent
99+
And I pass through EngineBlock
100+
Then the url should match "functional-testing/Remembering-SP/acs"
101+
When I go to Engineblock URL "/authentication/idp/remove-cookies"
102+
Then the response should contain 'rememberedidps'
103+
When I press "remove_rememberedidps"
104+
Then the "rememberedidps" cookie should not be set

‎tests/e2e/cypress/integration/shared/cookieRemoval.a11y.spec.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* This doesn't run in CI, which is why it's skipped. You can run it locally by setting the wayf.remember_choice flag to true in parameters.yaml.
2+
* This doesn't run in CI, which is why it's skipped. You can run it locally by setting either the wayf.remember_choice flag or the feature_enable_wayf_remember_choice_per_idp flag to true in parameters.yaml.
33
*/
44
context.skip('Cookie removal page verify a11y', () => {
55
beforeEach(() => {

‎tests/e2e/cypress/integration/skeune/wayf/wayf.general.spec.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ context('WAYF behaviour not tied to mouse / keyboard navigation', () => {
221221
cy.get(rememberChoiceTooltipToggleSelector).should('exist');
222222
});
223223

224+
it('Renders the per-SP checkbox when only rememberChoicePerIdp is passed', () => {
225+
cy.visit('https://engine.dev.openconext.local/functional-testing/wayf?connectedIdps=5&rememberChoicePerIdp=true');
226+
cy.get(`.${rememberChoicePerIdpClass}`).should('exist');
227+
cy.onPage('Remember my choice');
228+
});
229+
224230
it('Hides the tooltip content until the toggle is activated', () => {
225231
cy.visit('https://engine.dev.openconext.local/functional-testing/wayf?connectedIdps=5&rememberChoiceFeature=true&rememberChoicePerIdp=true');
226232
cy.get(rememberChoiceTooltipValueSelector).should('not.be.visible');

0 commit comments

Comments
 (0)