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

Feature: set basic auth after session start and reset #810

Closed
petarbasic opened this issue Aug 31, 2021 · 3 comments
Closed

Feature: set basic auth after session start and reset #810

petarbasic opened this issue Aug 31, 2021 · 3 comments

Comments

@petarbasic
Copy link

petarbasic commented Aug 31, 2021

Testing sites with basic auth set became an issue for us after some extensions updates.
In particular, an extension was calling the session reset which effectively removes the pre-set basic auth credentials (header).

It would be nice if mink session would support setting basic auth credentials and use them if they are set after session start & reset.

I've created a PR that fixes the issue for us. Please take a look and let us know if it would make sense to support this.
PR: #809

@fago
Copy link

fago commented Aug 31, 2021

This came up at jhedstrom/drupalextension#597 but would make sense to fix in mink actually.

@stof
Copy link
Member

stof commented Sep 1, 2021

Well, the fact that resetting the session resets the basic auth is a feature, not a bug. This is what allows to keep Behat scenarios isolated without stopping the session entirely each time (which is costly in case of webdriver as it would stop and restart the browser for instance)

If the Drupal behat extension expects to be able to reset the session and having basic auth credentials preserved, I suggest that it stores them on its side and sets them again after the reset (according to the issue you linked, they seem to be doing that already for a cookie they want to keep).

@aik099
Copy link
Member

aik099 commented Sep 4, 2021

@fago , I agree with @stof on this.

The Behat extension is a good place to actually maintain the session state. The corresponding @beforeScenario and such hooks could come in handy to do this.

I'll also close associated PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants