Welcome to mirror list, hosted at ThFree Co, Russian Federation.

link_to_line_in_web_ide_spec.rb « web_ide « 3_create « browser_ui « features « specs « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 56cf2a08bd9c8aa5695ea835ffd8b4b28e26154d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# frozen_string_literal: true

module QA
  RSpec.describe 'Create', product_group: :editor do
    describe 'Link to line in Web IDE' do
      let(:user) { Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) }
      let(:project) do
        Resource::Project.fabricate_via_api! do |project|
          project.template_name = 'express'
        end
      end

      before do
        Flow::Login.sign_in
      end

      after do
        project.remove_via_api!
      end

      it 'can link to a specific line of code in Web IDE', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347676' do
        project.visit!

        # Open Web IDE by using a keyboard shortcut
        Page::Project::Show.perform(&:open_web_ide_via_shortcut)

        Page::Project::WebIDE::Edit.perform do |ide|
          ide.select_file('app.js')
          @link = ide.link_line('26')
        end

        Flow::Login.sign_in(as: user)

        page.visit(@link)

        Page::Project::WebIDE::Edit.perform do |ide|
          expect(ide).to have_file('app.js')
        end

        expect(page.driver.current_url).to include('app.js/#L26')
      end
    end
  end
end