Commit bf6bbf7a authored by Dan Davison's avatar Dan Davison

Merge branch 'qa-rewrite-link-to-line-in-web-ide' into 'master'

Rewrite link_line method for Web IDE E2E

See merge request gitlab-org/gitlab!61651
parents 4adda745 00a6bd2c
......@@ -8,8 +8,6 @@ const createAnchor = (href) => {
const fragment = new DocumentFragment();
const el = document.createElement('a');
el.classList.add('link-anchor');
el.setAttribute('data-qa-selector', 'line_link');
el.setAttribute('data-qa-number', href);
el.href = href;
fragment.appendChild(el);
el.addEventListener('contextmenu', (e) => {
......
......@@ -108,10 +108,6 @@ module QA
element :file_to_commit_content
end
view 'app/assets/javascripts/editor/extensions/editor_lite_extension_base.js' do
element :line_link
end
def has_file?(file_name)
within_element(:file_list) do
has_element?(:file_name_content, file_name: file_name)
......@@ -319,11 +315,15 @@ module QA
end
def link_line(line_number)
previous_url = page.current_url
wait_for_animated_element(:editor_container)
within_element(:editor_container) do
find('.line-numbers', text: line_number).hover
find_element(:line_link, number: "#L#{line_number}")['href'].to_s
find('.line-numbers', text: line_number).hover.click
end
wait_until(max_duration: 5, reload: false) do
page.current_url != previous_url
end
page.current_url.to_s
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment