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

Why does the persona name get reused as the browser name? #136

Closed
ThrawnCA opened this issue Jun 14, 2023 · 4 comments
Closed

Why does the persona name get reused as the browser name? #136

ThrawnCA opened this issue Jun 14, 2023 · 4 comments

Comments

@ThrawnCA
Copy link

Why does given_a_persona in behaving/personas/steps.py reuse the persona name as the name of the browser to load? It makes no sense to me.

@ggozad
Copy link
Owner

ggozad commented Jun 16, 2023

Hey,
Not sure I understand the question. Personas are essentially browser sessions with the ability to hold some values. So switching personas back and forth will start or re-use a browser session.

@ThrawnCA
Copy link
Author

Is that really the only way they're meant to be used? It's not our approach.

We define a persona for each test user in the system, with their credentials, email, etc, and then each test uses "Given X as the persona" to have the login details ready. There's no inherent tie to the browser session, although in a lot of cases they'll be correlated.

@ggozad
Copy link
Owner

ggozad commented Jun 19, 2023

Is that really the only way they're meant to be used? It's not our approach.

We define a persona for each test user in the system, with their credentials, email, etc, and then each test uses "Given X as the persona" to have the login details ready. There's no inherent tie to the browser session, although in a lot of cases they'll be correlated.

Well isn't that exactly the case behaving covers? In each test when you say "Given Foo as the persona" you will start a session for Foo. All cookies, session storage whatever will be tied to Foo. If you happen to start another session for "Bar" in the same test it will not carry the credentials of Foo.

@ThrawnCA
Copy link
Author

Well, we do have tests that try logging out as one user and then logging in as another.

This has primarily been a nuisance when we've had to manually create a Browser instance due to version conflicts between Selenium vs Behaving vs Splinter vs Python, though, so maybe it won't really be an issue longer term.

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

No branches or pull requests

2 participants