InfoGrab DocsInfoGrab Docs

GitLab QA의 플로우

GitLab QA에서 자주 사용되는 액션 시퀀스인 플로우(Flow)의 개념과 사용 방법을 설명합니다.

플로우(Flow)는 자주 사용되는 액션 시퀀스입니다. 플로우는 페이지 오브젝트보다 높은 추상화 수준을 가집니다. 플로우는 여러 페이지 오브젝트 또는 기타 관련 코드를 포함할 수 있습니다. 예를 들어, 로그인 플로우는 모든 브라우저 UI 테스트에 포함되는 두 단계를 캡슐화합니다. # QA::Flow::Login def sign_in(as: nil) Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform { |login| login.sign_in_using_credentials(user: as) } end # When used in a test it 'performs a test after signing in as the default user' do Flow::Login.sign_in # Perform the test end QA::Flow::Login 은 테스트에서 사용자를 전환할 수 있도록 하는 더욱 유용한 플로우를 제공합니다. # QA::Flow::Login def while_signed_in(as: nil) Page::Main::Menu.perform(&:sign_out_if_signed_in) sign_in(as: as) yield Page::Main::Menu.perform(&:sign_out) end # When used in a test it 'performs a test as one user and verifies as another' do user1 = create(:user) user2 = create(:user) Flow::Login.while_signed_in(as: user1) do # Perform some setup as user1 end Flow::Login.sign_in(as: user2) # Perform the rest of the test as user2 end