Skip to content

Fail if a test leaves the browser logged in

Mark Lapierre requested to merge ml-qa-log-out-after-tests into master

What does this MR do?

All QA tests expect to be able to log in at the start of the test.

That's not possible if a test leaves the browser logged in when it finishes. Normally this isn't a problem because Capybara resets the session after each test. But it does that in an after block, so when a test logs in in an after(:all) block, the browser returns to a logged in state after Capybara has logged it out. And then the next test will fail.

E.g.: #34736 (closed)

This adds a config.after(:context) block to fail if a test leaves the browser logged in, and updates the best practices doc.

Does this MR meet the acceptance criteria?

Conformity

Edited by Mark Lapierre

Merge request reports