<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Flows in GitLab QA > 原文:[https://docs.gitlab.com/ee/development/testing_guide/end_to_end/flows.html](https://docs.gitlab.com/ee/development/testing_guide/end_to_end/flows.html) # Flows in GitLab QA[](#flows-in-gitlab-qa "Permalink") 流是經常使用的動作序列. 它們是比頁面對象更高的抽象級別. 流可以包含多個頁面對象或任何其他相關代碼. 例如,登錄流封裝了每個瀏覽器 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 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) user2 = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_2, Runtime::Env.gitlab_qa_password_2) 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 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看