Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
403295de
Commit
403295de
authored
May 07, 2021
by
Anastasia McDonald
Committed by
Sanad Liaquat
May 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E to link a line in Web IDE
parent
77a544a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
3 deletions
+68
-3
app/assets/javascripts/editor/extensions/editor_lite_extension_base.js
...vascripts/editor/extensions/editor_lite_extension_base.js
+2
-0
qa/qa/page/project/show.rb
qa/qa/page/project/show.rb
+1
-1
qa/qa/page/project/web_ide/edit.rb
qa/qa/page/project/web_ide/edit.rb
+22
-2
qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb
...owser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb
+43
-0
No files found.
app/assets/javascripts/editor/extensions/editor_lite_extension_base.js
View file @
403295de
...
...
@@ -7,6 +7,8 @@ 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
)
=>
{
...
...
qa/qa/page/project/show.rb
View file @
403295de
...
...
@@ -147,7 +147,7 @@ module QA
end
def
open_web_ide!
click_element
:web_ide_button
click_element
(
:web_ide_button
)
end
def
has_edit_fork_button?
...
...
qa/qa/page/project/web_ide/edit.rb
View file @
403295de
...
...
@@ -18,8 +18,8 @@ module QA
end
view
'app/assets/javascripts/ide/components/ide_tree.vue'
do
element
:new_file_button
element
:new_directory_button
element
:new_file_button
,
required:
true
element
:new_directory_button
,
required:
true
end
view
'app/assets/javascripts/ide/components/ide_tree_list.vue'
do
...
...
@@ -108,6 +108,10 @@ 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
)
...
...
@@ -305,6 +309,22 @@ module QA
def
switch_to_commit_tab
click_element
(
:commit_mode_tab
)
end
def
select_file
(
file_name
)
# wait for the list of files to load
wait_until
(
reload:
true
)
do
has_element?
(
:file_name_content
,
file_name:
file_name
)
end
click_element
(
:file_name_content
,
file_name:
file_name
)
end
def
link_line
(
line_number
)
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
end
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/web_ide/link_to_line_in_web_ide_spec.rb
0 → 100644
View file @
403295de
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Create'
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/quality/testcases/-/issues/1102'
do
project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:open_web_ide!
)
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment