Flows in GitLab QA

    Flows in GitLab QA

    1. # QA::Flow::Login
    2. def while_signed_in(as: nil)
    3. Page::Main::Menu.perform(&:sign_out_if_signed_in)
    4. sign_in(as: as)
    5. Page::Main::Menu.perform(&:sign_out)
    6. end
    7. # When used in a test
    8. it 'performs a test as one user and verifies as another' do
    9. user1 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1)
    10. Flow::Login.while_signed_in(as: user1) do
    11. # Perform some setup as user1
    12. end
    13. Flow::Login.sign_in(as: user2)
    14. # Perform the rest of the test as user2