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
a544c64a
Commit
a544c64a
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 test for index page display
parent
9c8129b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
3 deletions
+107
-3
app/views/shared/snippets/_snippet.html.haml
app/views/shared/snippets/_snippet.html.haml
+2
-2
qa/qa/page/dashboard/snippet/index.rb
qa/qa/page/dashboard/snippet/index.rb
+22
-0
qa/qa/resource/snippet.rb
qa/qa/resource/snippet.rb
+1
-1
qa/qa/specs/features/browser_ui/3_create/snippet/snippet_index_page_spec.rb
...es/browser_ui/3_create/snippet/snippet_index_page_spec.rb
+82
-0
No files found.
app/views/shared/snippets/_snippet.html.haml
View file @
a544c64a
...
...
@@ -8,7 +8,7 @@
=
link_to
gitlab_snippet_path
(
snippet
)
do
=
snippet
.
title
%ul
.controls
%ul
.controls
{
data:
{
qa_selector:
'snippet_file_count_content'
,
qa_snippet_files:
snippet
.
statistics
&
.
file_count
}
}
%li
=
snippet_file_count
(
snippet
)
%li
...
...
@@ -16,7 +16,7 @@
=
sprite_icon
(
'comments'
,
css_class:
'gl-vertical-align-text-bottom'
)
=
notes_count
%li
%span
.sr-only
%span
.sr-only
{
data:
{
qa_selector:
'snippet_visibility_content'
,
qa_snippet_visibility:
visibility_level_label
(
snippet
.
visibility_level
)
}
}
=
visibility_level_label
(
snippet
.
visibility_level
)
=
visibility_level_icon
(
snippet
.
visibility_level
)
...
...
qa/qa/page/dashboard/snippet/index.rb
View file @
a544c64a
...
...
@@ -10,10 +10,32 @@ module QA
element
:global_new_snippet_link
end
view
'app/views/shared/snippets/_snippet.html.haml'
do
element
:snippet_link
element
:snippet_visibility_content
element
:snippet_file_count_content
end
def
go_to_new_snippet_page
click_element
:new_menu_toggle
click_element
:global_new_snippet_link
end
def
has_snippet_title?
(
snippet_title
)
has_element?
(
:snippet_link
,
snippet_title:
snippet_title
)
end
def
has_visibility_level?
(
snippet_title
,
visibility
)
within_element
(
:snippet_link
,
snippet_title:
snippet_title
)
do
has_element?
(
:snippet_visibility_content
,
snippet_visibility:
visibility
)
end
end
def
has_number_of_files?
(
snippet_title
,
number
)
within_element
(
:snippet_link
,
snippet_title:
snippet_title
)
do
has_element?
(
:snippet_file_count_content
,
snippet_files:
number
)
end
end
end
end
end
...
...
qa/qa/resource/snippet.rb
View file @
a544c64a
...
...
@@ -3,7 +3,7 @@
module
QA
module
Resource
class
Snippet
<
Base
attr_accessor
:title
,
:description
,
:file_content
,
:visibility
,
:file_name
attr_accessor
:title
,
:description
,
:file_content
,
:visibility
,
:file_name
,
:files
attribute
:id
attribute
:http_url_to_repo
...
...
qa/qa/specs/features/browser_ui/3_create/snippet/snippet_index_page_spec.rb
0 → 100644
View file @
a544c64a
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Create'
do
describe
'Snippet index page'
do
let
(
:personal_snippet_with_single_file
)
do
Resource
::
Snippet
.
fabricate_via_api!
do
|
snippet
|
snippet
.
title
=
"Personal snippet with one file-
#{
SecureRandom
.
hex
(
8
)
}
"
snippet
.
visibility
=
'Public'
end
end
let
(
:personal_snippet_with_multiple_files
)
do
Resource
::
Snippet
.
fabricate_via_api!
do
|
snippet
|
snippet
.
title
=
"Personal snippet with multiple files-
#{
SecureRandom
.
hex
(
8
)
}
"
snippet
.
visibility
=
'Private'
snippet
.
file_name
=
'First file name'
snippet
.
file_content
=
'first file content'
snippet
.
add_files
do
|
files
|
files
.
append
(
name:
'Second file name'
,
content:
'second file content'
)
files
.
append
(
name:
'Third file name'
,
content:
'third file content'
)
end
end
end
let
(
:project_snippet_with_single_file
)
do
Resource
::
ProjectSnippet
.
fabricate_via_api!
do
|
snippet
|
snippet
.
title
=
"Project snippet with one file-
#{
SecureRandom
.
hex
(
8
)
}
"
snippet
.
visibility
=
'Private'
end
end
let
(
:project_snippet_with_multiple_files
)
do
Resource
::
ProjectSnippet
.
fabricate_via_api!
do
|
snippet
|
snippet
.
title
=
"Project snippet with multiple files-
#{
SecureRandom
.
hex
(
8
)
}
"
snippet
.
visibility
=
'Public'
snippet
.
file_name
=
'First file name'
snippet
.
file_content
=
'first file content'
snippet
.
add_files
do
|
files
|
files
.
append
(
name:
'Second file name'
,
content:
'second file content'
)
files
.
append
(
name:
'Third file name'
,
content:
'third file content'
)
end
end
end
before
do
Flow
::
Login
.
sign_in
end
after
do
personal_snippet_with_single_file
.
remove_via_api!
personal_snippet_with_multiple_files
.
remove_via_api!
project_snippet_with_single_file
.
remove_via_api!
project_snippet_with_multiple_files
.
remove_via_api!
end
shared_examples
'displaying details on index page'
do
|
snippet_type
|
it
"shows correct details of
#{
snippet_type
}
including file number"
do
send
(
snippet_type
)
Page
::
Main
::
Menu
.
perform
do
|
menu
|
menu
.
go_to_more_dropdown_option
(
:snippets_link
)
end
Page
::
Dashboard
::
Snippet
::
Index
.
perform
do
|
snippet
|
aggregate_failures
'file content verification'
do
expect
(
snippet
).
to
have_snippet_title
(
send
(
snippet_type
).
title
)
expect
(
snippet
).
to
have_visibility_level
(
send
(
snippet_type
).
title
,
send
(
snippet_type
).
visibility
)
expect
(
snippet
).
to
have_number_of_files
(
send
(
snippet_type
).
title
,
send
(
snippet_type
).
files
.
count
)
end
end
end
end
it_behaves_like
'displaying details on index page'
,
:personal_snippet_with_single_file
it_behaves_like
'displaying details on index page'
,
:personal_snippet_with_multiple_files
it_behaves_like
'displaying details on index page'
,
:project_snippet_with_single_file
it_behaves_like
'displaying details on index page'
,
:project_snippet_with_multiple_files
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