[MGNLTEST-142] Stop automatically logging the user out if already logged in Created: 15/Feb/21 Updated: 16/Nov/21 Resolved: 12/Nov/21 |
|
| Status: | Closed |
| Project: | Magnolia Test Framework |
| Component/s: | None |
| Affects Version/s: | 1.0.4 |
| Fix Version/s: | 1.2.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Christoph Meier |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | VN-Testing, artt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | 0.5d | ||
| Original Estimate: | Not Specified | ||
| Template: | |
| Acceptance criteria: |
Empty
|
| Task DoD: |
[X]*
Doc/release notes changes? Comment present?
[X]*
Downstream builds green?
[X]*
Solution information and context easily available?
[X]*
Tests
[X]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[X]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: | |
| Epic Link: | core-TF-features-bugs-improvements |
| Story Points: | 3 |
| Description |
|
Move the automagic logout on PageObjects#login, to a better suited place, such as an "after-each" callback on Selenium extension, so that it does not interfere with login logic. Making sure that the next test gets a new session. Additional context: the reason for automatic logout is because we already recycle the WebDriver instance between test-cases. Additional task: before re-introducing the logout in Selenium extension, verify via VNC if two consequent tests are presented with the login screen (despite no explicit logout). |
| Comments |
| Comment by Christoph Meier [ 04/Mar/21 ] |
|
I remember this one is a bit related to the effort of re-using webdriver(s). And I think I remember that during last grooming session, somebody was mentioning, that most tests are executed with the same user/persona. This said, it is really important to always logout at the end of a test!
|
| Comment by Christoph Meier [ 11/Oct/21 ] |
|
I wanted to ask whether this ticket is still valid. In PageObjects#loginPage we still do perform a logout - see in git Additionally, in Selenium#afterEach we call From my point of view that's all fine. I recoomend to close the ticket as obsolete. P.S. P.P.S we stumbled over this during grooming .
|
| Comment by Mikaël Geljić [ 21/Oct/21 ] |
|
Unearthed the original steps to reproduce from former description:
And indeed this is unexpected from any of the expect/PageObjects methods, as per its javadoc: none of them should have a state-changing effect, but should be limited to passive assertions and returning POs that can be interacted with. Given a scenario where we assert whether a resource is unaccessible, we would expect.loginPage, but if the assertion does this for us, then this test is void. |
| Comment by Maxime Michel [ 25/Oct/21 ] |
|
TODOs:
|
| Comment by Christoph Meier [ 27/Oct/21 ] |
|
UI tests in ce, dx-core and test-fwk are not relying on the removed logic of PageObjects#loginPage. Tests in PublicationWorkflowFunctionalTests originally relied on that logic, but that has been removed earlier, since subsequent login/logout/login didn't worked within one test method due to other reason. |
| Comment by Christoph Meier [ 27/Oct/21 ] |
|
About "see if automatic logging out needs to happen anywhere (or if WebDriver#quit is sufficient)": But I did a test to assert each UI-tests starts with a un-authenticated UI (and gets a new driver) |