-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
5c4b610
to
063de42
Compare
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)) { |
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.
if (($isTestOrDev && $_SERVER['HTTP_USER_AGENT'] === 'Symfony BrowserKit') || ($isTestOrDev && $hasTestCookie)) { | |
if ($isTestOrDev && ($_SERVER['HTTP_USER_AGENT'] === 'Symfony BrowserKit' || $hasTestCookie)) { |
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.
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'); |
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.
is it possible to use more descriptive naming? For example: 'isBehatTest'
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.
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.
063de42
to
2ed27e9
Compare
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
We might not want to change this behavior for the 4.2 release?