-
Notifications
You must be signed in to change notification settings - Fork 21
Log-in step occasionally fails. #47
Comments
This isn't new: stephenharris/WordPressBehatExtension#10 The problem appears to be the same. I can't find the screenshot of an instance of this bug, but it too showed the password entered into the username field. |
Try to fix a bug with Behat entering both user/password into username field by explicitly setting focus on the fields before entering values. See #47
This is pretty crazy. |
For unknown reasons, Behat/Mink seems to have problems logging into WordPress on an occassional and intermittent basis. A common failure is that Mink does not enter the username or password into the correct elements on the log-in form, or leaves one blank. We've iterated fixes several times -- some environment specific, e.g. Travis-CI -- and this commit spins the wheel once more. My local testing, and on Travis-CI, suggests this change improves the reliability of entering data into the log-in form. The idea is clearing the field values prior to data entry works around some sort of quirk in WebDriver/Selenium. See #47.
Issue still exists for me when running tests locally or using Circle.CI. |
It appears that I am getting log in error:
|
There is definitely something wrong going on with |
I think there’s some bug in Selenium that causes this. There are reports of similar issues with Mink and Selenium across the web, but they’re infrequent and very hard to find. That whole stack is very complex and it looks so hard to debug I haven’t tried.
I think it’s safe to say until someone comes up with a reliable workaround or a fix, this is going to persist. The nearby calls to setFocus() were an attempt at this.
My lead theory is because the log-in step is usually the first thing done in a new web browser session, if Selenium sometimes tries to send commands to the browser before it is ready, it might cause this sort of failure.
As I write this, I wonder about logIn() — if it fails, try to log-in twice, as a workaround. I wonder if it might have any impact. It would prove whether this sort of failure is unique to the *first* command in a session or not. (Because the second attempt would be the second command)
…---
Paul Gibbs
On 7 Feb 2018, at 19:21, Vadym Myrgorod ***@***.***> wrote:
There is definitely something wrong going on with setValue() method in logIn(). I called getValue() right after setValue() and it appears that the value is set improperly: a username is corrupted: in instead of myadmin, and empty string instead of a password.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Adding extra Here is my patch:
|
@paulgibbs just saw your comment. I tried to alter all tests with a background condition to load homepage first, but that didn't affect on the log in errors. Hope it helps. |
I think we tried duplicating the setValue calls in login() before and it did not permanently fix issue, so I’m skeptical.
If you want to PR your change, the CI will build it and I can then run that multiple times to check how reliability it runs over multiple runs. Otherwise, I’ll make the PR, but this won’t be until next week.
…---
Paul Gibbs
On 8 Feb 2018, at 03:57, Vadym Myrgorod ***@***.***> wrote:
@paulgibbs just saw your comment. I tried to alter all tests with a background condition to load homepage first, but that didn't affect on the log in errors. Hope it helps.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Latest attempt at fixing log-in step glitches. See #47
I've decided to merge it. I couldn't break it on Travis-CI, and I don't think it will hurt. I suspect whatever the very first step is, it might be occasionally prone to similar glitching, but without understanding the root cause more somehow, I've no better idea at the moment. :) |
Unsurprisingly, the latest commit here does not fix this problem. It lives on! |
Brought in from Drupal Extension: jhedstrom/drupalextension#379 Hoping this might help address #47
Brought in from Drupal Extension: jhedstrom/drupalextension#379 See #201 I'm hoping this might help address #47
@paulgibbs it looks like this issue still exists. It does not happen quite often, but for a large amount of tests, it happens nearly in 30% of runs of test suites. |
Thanks for letting me know. What version are you testing with (or, what’s the the most recent version that causes this behaviour)?
…---
Paul Gibbs
On 11 Jun 2018, at 23:22, Vadym Myrgorod ***@***.***> wrote:
@paulgibbs it looks like this issue is still exists. It does not happen quite often, but for a large amount of tests, it happens nearly in 30% of builds.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Latest attempted fix (with JS) and more information about the potential bug in Mink is detailed in #230. |
… session. We believe this to be a cause of form field manipulation intermittently failing, causing the log-in step to fail -- as "Given I am logged in as a user" is often the the first line in a scenario! See Behat/MinkExtension#286 This is the latest attempt in a long line of fixes to make Behat user log-in reliable. See #47 for the history.
Going to close this for now -- #247 is the latest stab. Will re-open if it is still not more reliable etc. |
… session. We believe this to be a cause of form field manipulation intermittently failing, causing the log-in step to fail -- as "Given I am logged in as a user" is often the the first line in a scenario! See Behat/MinkExtension#286 This is the latest attempt in a long line of fixes to make Behat user log-in reliable. See #47 for the history.
The "Given I am logged in as an " test scenario occasionally fails on Travis-CI with a "The user could not be logged-in" error.
Expected behavior
That the test passes all the time.
Current behavior
The test fails occasionally. No pattern has been observed yet.
Known failing instances:
Steps to reproduce (for bugs)
The failure happens occasionally. Let's use the above table to identify instances.
The text was updated successfully, but these errors were encountered: