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
431806e2
Commit
431806e2
authored
May 13, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
d723b1cf
3061eee6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
33 deletions
+34
-33
app/views/projects/branches/_branch.html.haml
app/views/projects/branches/_branch.html.haml
+1
-1
qa/qa/page/base.rb
qa/qa/page/base.rb
+4
-4
qa/qa/page/project/branches/show.rb
qa/qa/page/project/branches/show.rb
+3
-13
qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
...r_ui/3_create/repository/add_list_delete_branches_spec.rb
+2
-4
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+13
-9
qa/qa/support/waiter.rb
qa/qa/support/waiter.rb
+3
-1
qa/spec/page/logging_spec.rb
qa/spec/page/logging_spec.rb
+8
-1
No files found.
app/views/projects/branches/_branch.html.haml
View file @
431806e2
...
...
@@ -10,7 +10,7 @@
.branch-info
.branch-title
=
sprite_icon
(
'fork'
,
size:
12
)
=
link_to
project_tree_path
(
@project
,
branch
.
name
),
class:
'item-title str-truncated-100 ref-name prepend-left-8'
do
=
link_to
project_tree_path
(
@project
,
branch
.
name
),
class:
'item-title str-truncated-100 ref-name prepend-left-8
qa-branch-name
'
do
=
branch
.
name
-
if
branch
.
name
==
@repository
.
root_ref
%span
.badge.badge-primary.prepend-left-5
default
...
...
qa/qa/page/base.rb
View file @
431806e2
...
...
@@ -113,8 +113,8 @@ module QA
has_css?
(
element_selector_css
(
name
),
wait:
wait
,
text:
text
)
end
def
has_no_element?
(
name
,
wait:
Capybara
.
default_max_wait_time
)
has_no_css?
(
element_selector_css
(
name
),
wait:
wait
)
def
has_no_element?
(
name
,
text:
nil
,
wait:
Capybara
.
default_max_wait_time
)
has_no_css?
(
element_selector_css
(
name
),
wait:
wait
,
text:
text
)
end
def
has_text?
(
text
)
...
...
@@ -129,8 +129,8 @@ module QA
has_no_css?
(
'.fa-spinner'
,
wait:
Capybara
.
default_max_wait_time
)
end
def
within_element
(
name
)
page
.
within
(
element_selector_css
(
name
))
do
def
within_element
(
name
,
text:
nil
)
page
.
within
(
element_selector_css
(
name
)
,
text:
text
)
do
yield
end
end
...
...
qa/qa/page/project/branches/show.rb
View file @
431806e2
...
...
@@ -7,6 +7,7 @@ module QA
class
Show
<
Page
::
Base
view
'app/views/projects/branches/_branch.html.haml'
do
element
:remove_btn
element
:branch_name
end
view
'app/views/projects/branches/_panel.html.haml'
do
element
:all_branches
...
...
@@ -27,11 +28,9 @@ module QA
finished_loading?
end
def
has_
branch_title?
(
branch_titl
e
)
def
has_
no_branch?
(
branch_nam
e
)
within_element
(
:all_branches
)
do
within
(
".item-title"
)
do
has_text?
(
branch_title
)
end
has_no_element?
(
:branch_name
,
text:
branch_name
,
wait:
Support
::
Waiter
::
DEFAULT_MAX_WAIT_TIME
)
end
end
...
...
@@ -48,15 +47,6 @@ module QA
click_element
(
:delete_merged_branches
)
end
end
def
wait_for_texts_not_to_be_visible
(
texts
)
text_not_visible
=
wait
do
texts
.
all?
do
|
text
|
has_no_text?
(
text
)
end
end
raise
"Expected text(s)
#{
texts
}
not to be visible"
unless
text_not_visible
end
end
end
end
...
...
qa/qa/specs/features/browser_ui/3_create/repository/add_list_delete_branches_spec.rb
View file @
431806e2
...
...
@@ -73,10 +73,9 @@ module QA
Page
::
Project
::
Branches
::
Show
.
perform
do
|
branches_view
|
branches_view
.
delete_branch
(
third_branch
)
expect
(
branches_view
).
to
have_no_branch
(
third_branch
)
end
expect
(
page
).
not_to
have_content
(
third_branch
)
Page
::
Project
::
Branches
::
Show
.
perform
(
&
:delete_merged_branches
)
expect
(
page
).
to
have_content
(
...
...
@@ -85,8 +84,7 @@ module QA
page
.
refresh
Page
::
Project
::
Branches
::
Show
.
perform
do
|
branches_view
|
branches_view
.
wait_for_texts_not_to_be_visible
([
commit_message_of_second_branch
])
expect
(
branches_view
).
not_to
have_branch_title
(
second_branch
)
expect
(
branches_view
).
to
have_no_branch
(
second_branch
)
end
end
end
...
...
qa/qa/support/page/logging.rb
View file @
431806e2
...
...
@@ -76,23 +76,18 @@ module QA
super
end
def
has_element?
(
name
,
text:
nil
,
wait:
Capybara
.
default_max_wait_time
)
def
has_element?
(
name
,
**
kwargs
)
found
=
super
msg
=
[
"has_element? :
#{
name
}
"
]
msg
<<
%Q(with text "
#{
text
}
")
if
text
msg
<<
"(wait:
#{
wait
}
)"
msg
<<
"returned:
#{
found
}
"
log
(
msg
.
compact
.
join
(
' '
))
log_has_element_or_not
(
'has_element?'
,
name
,
found
,
**
kwargs
)
found
end
def
has_no_element?
(
name
,
wait:
Capybara
.
default_max_wait_time
)
def
has_no_element?
(
name
,
**
kwargs
)
found
=
super
log
(
"has_no_element? :
#{
name
}
returned
#{
found
}
"
)
log
_has_element_or_not
(
'has_no_element?'
,
name
,
found
,
**
kwargs
)
found
end
...
...
@@ -149,6 +144,15 @@ module QA
def
log
(
msg
)
QA
::
Runtime
::
Logger
.
debug
(
msg
)
end
def
log_has_element_or_not
(
method
,
name
,
found
,
**
kwargs
)
msg
=
[
"
#{
method
}
:
#{
name
}
"
]
msg
<<
%Q(with text "
#{
kwargs
[
:text
]
}
")
if
kwargs
[
:text
]
msg
<<
"(wait:
#{
kwargs
[
:wait
]
||
Capybara
.
default_max_wait_time
}
)"
msg
<<
"returned:
#{
found
}
"
log
(
msg
.
compact
.
join
(
' '
))
end
end
end
end
...
...
qa/qa/support/waiter.rb
View file @
431806e2
...
...
@@ -3,9 +3,11 @@
module
QA
module
Support
module
Waiter
DEFAULT_MAX_WAIT_TIME
=
60
module_function
def
wait
(
max:
60
,
interval:
0.1
)
def
wait
(
max:
DEFAULT_MAX_WAIT_TIME
,
interval:
0.1
)
QA
::
Runtime
::
Logger
.
debug
(
"with wait: max
#{
max
}
; interval
#{
interval
}
"
)
start
=
Time
.
now
...
...
qa/spec/page/logging_spec.rb
View file @
431806e2
...
...
@@ -93,7 +93,14 @@ describe QA::Support::Page::Logging do
allow
(
page
).
to
receive
(
:has_no_css?
).
and_return
(
true
)
expect
{
subject
.
has_no_element?
(
:element
)
}
.
to
output
(
/has_no_element\? :element returned true/
).
to_stdout_from_any_process
.
to
output
(
/has_no_element\? :element \(wait: 2\) returned: true/
).
to_stdout_from_any_process
end
it
'logs has_no_element? with text'
do
allow
(
page
).
to
receive
(
:has_no_css?
).
and_return
(
true
)
expect
{
subject
.
has_no_element?
(
:element
,
text:
"more text"
)
}
.
to
output
(
/has_no_element\? :element with text \"more text\" \(wait: 2\) returned: true/
).
to_stdout_from_any_process
end
it
'logs has_text?'
do
...
...
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