• Mark Lapierre's avatar
    Raise error if test leaves browser logged in · 4146fcd6
    Mark Lapierre authored
    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, like this one, 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.: https://gitlab.com/gitlab-org/gitlab/issues/34736
    
    This adds a `config.after(:context)` block to fail if a test
    leaves the browser logged in.
    4146fcd6
best_practices.md 5.76 KB