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

Repair the Selenium Behat tests #291

Merged
merged 2 commits into from
Aug 14, 2023
Merged

Repair the Selenium Behat tests #291

merged 2 commits into from
Aug 14, 2023

Conversation

MKodde
Copy link
Member

@MKodde MKodde commented Aug 10, 2023

The SFO multiple authentications feature was disabled a while ago. They have been re-instated in this PR

Test one and two have been fixed. The Yubikey and SMS tests could be enabled in the new (SSP based) test environment. The Tiqr variant could not yet be enabled as Tiqr is not functioning in that environment yet.

During enabling the SMS test, I found out that the SMS Bypass fix was not taken into account in the existing sfo test. That has been updated.

Commit 2 consists of a boyscout rule fix.

@pmeulen and or @phavekes

  1. Is this indeed the case at this point (does the WAYG page have an empty title?)
  2. Using the previously used title seemed the right thing to do.

We might not want to change this behavior for the 4.2 release?

@MKodde MKodde added the 4.2 label Aug 10, 2023
@MKodde MKodde requested a review from johanib August 10, 2023 13:10
public/index.php Outdated
// When running the selenium tests, a test cookie indicate if we should switch to the smoketest env
$hasTestCookie = (array_key_exists('testcookie', $_COOKIE) && $_COOKIE['testcookie'] === 'testcookie');

if (($isTestOrDev && $_SERVER['HTTP_USER_AGENT'] === 'Symfony BrowserKit') || ($isTestOrDev && $hasTestCookie)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (($isTestOrDev && $_SERVER['HTTP_USER_AGENT'] === 'Symfony BrowserKit') || ($isTestOrDev && $hasTestCookie)) {
if ($isTestOrDev && ($_SERVER['HTTP_USER_AGENT'] === 'Symfony BrowserKit' || $hasTestCookie)) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is more betterest, going to fix that up!

@@ -164,6 +168,8 @@ public function iOpenTwoBrowserTabsIdentifiedBy($numberOfTabs, $tabNames)
'Please identify all tabs you are opening in order to refer to them at a later stage'
);
}
// Set the testcookie ensuring the selenium tests run in the smoketest env
$this->getMink()->getSession()->setCookie('testcookie', 'testcookie');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible to use more descriptive naming? For example: 'isBehatTest'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good suggestion, but I choose to adhere to the way we called this cookie in OpenConext-engineblock. That way, we have feature parity between the projects.

Test one and two have been fixed. The Yubikey and SMS tests could be
enabled in the new (SSP based) test environment. The Tiqr variant could
not yet be enabled as Tiqr is not functioning in that environment yet.

During enabling the SMS test, I found out that the SMS Bypass fix was
not taken into account in the existing sfo test. That has been updated.
Previously the page_title block was rendered, but that was not set. The
application_name was set with the 'gateway.second_factor.choose_second_factor.title'
and using that on the page title made perfect sense to me.
@MKodde MKodde merged commit 3e96653 into develop Aug 14, 2023
2 checks passed
@MKodde MKodde deleted the maintenance/behat-repairs branch August 14, 2023 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants