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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
07d39ac0
Commit
07d39ac0
authored
Sep 07, 2016
by
Phil Hughes
Committed by
Jacob Schatz
Sep 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests
Added wait for vue helper
parent
23303990
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
22 deletions
+24
-22
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+13
-22
spec/features/boards/keyboard_shortcut_spec.rb
spec/features/boards/keyboard_shortcut_spec.rb
+4
-0
spec/support/wait_for_vue_resource.rb
spec/support/wait_for_vue_resource.rb
+7
-0
No files found.
spec/features/boards/boards_spec.rb
View file @
07d39ac0
...
@@ -2,6 +2,7 @@ require 'rails_helper'
...
@@ -2,6 +2,7 @@ require 'rails_helper'
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
describe
'Issue Boards'
,
feature:
true
,
js:
true
do
include
WaitForAjax
include
WaitForAjax
include
WaitForVueResource
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:project
)
{
create
(
:empty_project
,
:public
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
...
@@ -187,13 +188,13 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -187,13 +188,13 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_content
(
'Showing 20 of 56 issues'
)
expect
(
page
).
to
have_content
(
'Showing 20 of 56 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_content
(
'Showing 40 of 56 issues'
)
expect
(
page
).
to
have_content
(
'Showing 40 of 56 issues'
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.card'
,
count:
56
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
56
)
expect
(
page
).
to
have_content
(
'Showing all issues'
)
expect
(
page
).
to
have_content
(
'Showing all issues'
)
...
@@ -372,7 +373,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -372,7 +373,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.dropdown-menu-author'
do
page
.
within
'.dropdown-menu-author'
do
click_link
(
user2
.
name
)
click_link
(
user2
.
name
)
end
end
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
find
(
'.js-author-search'
)).
to
have_content
(
user2
.
name
)
expect
(
find
(
'.js-author-search'
)).
to
have_content
(
user2
.
name
)
end
end
...
@@ -398,7 +399,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -398,7 +399,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.dropdown-menu-assignee'
do
page
.
within
'.dropdown-menu-assignee'
do
click_link
(
user
.
name
)
click_link
(
user
.
name
)
end
end
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user
.
name
)
end
end
...
@@ -424,7 +425,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -424,7 +425,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.milestone-filter'
do
page
.
within
'.milestone-filter'
do
click_link
(
milestone
.
title
)
click_link
(
milestone
.
title
)
end
end
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
end
end
...
@@ -449,7 +450,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -449,7 +450,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
find
(
'.dropdown-menu-close'
).
click
find
(
'.dropdown-menu-close'
).
click
end
end
end
end
...
@@ -478,7 +479,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -478,7 +479,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
find
(
'.dropdown-menu-close'
).
click
find
(
'.dropdown-menu-close'
).
click
end
end
end
end
...
@@ -509,9 +510,9 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -509,9 +510,9 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.dropdown-menu-labels'
))
do
page
.
within
(
find
(
'.dropdown-menu-labels'
))
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
click_link
(
bug
.
title
)
click_link
(
bug
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
find
(
'.dropdown-menu-close'
).
click
find
(
'.dropdown-menu-close'
).
click
end
end
end
end
...
@@ -536,7 +537,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -536,7 +537,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
"No Label"
)
click_link
(
"No Label"
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
find
(
'.dropdown-menu-close'
).
click
find
(
'.dropdown-menu-close'
).
click
end
end
end
end
...
@@ -559,7 +560,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -559,7 +560,7 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
find
(
'.card'
,
match: :first
)).
to
have_content
(
bug
.
title
)
expect
(
find
(
'.card'
,
match: :first
)).
to
have_content
(
bug
.
title
)
click_button
(
bug
.
title
)
click_button
(
bug
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
end
end
wait_for_vue_resource
wait_for_vue_resource
...
@@ -584,7 +585,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -584,7 +585,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.card'
,
match: :first
))
do
page
.
within
(
find
(
'.card'
,
match: :first
))
do
click_button
(
bug
.
title
)
click_button
(
bug
.
title
)
end
end
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
...
@@ -647,14 +648,4 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -647,14 +648,4 @@ describe 'Issue Boards', feature: true, js: true do
wait_for_vue_resource
wait_for_vue_resource
end
end
def
wait_for_vue_resource
(
spinner:
true
)
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
page
.
evaluate_script
(
'Vue.activeResources'
).
zero?
end
if
spinner
expect
(
find
(
'.boards-list'
)).
not_to
have_selector
(
'.fa-spinner'
)
end
end
end
end
spec/features/boards/keyboard_shortcut_spec.rb
View file @
07d39ac0
require
'rails_helper'
require
'rails_helper'
describe
'Issue Boards shortcut'
,
feature:
true
,
js:
true
do
describe
'Issue Boards shortcut'
,
feature:
true
,
js:
true
do
include
WaitForVueResource
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
before
do
before
do
...
@@ -16,5 +18,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
...
@@ -16,5 +18,7 @@ describe 'Issue Boards shortcut', feature: true, js: true do
it
'takes user to issue board index'
do
it
'takes user to issue board index'
do
find
(
'body'
).
native
.
send_keys
(
'gl'
)
find
(
'body'
).
native
.
send_keys
(
'gl'
)
expect
(
page
).
to
have_selector
(
'.boards-list'
)
expect
(
page
).
to
have_selector
(
'.boards-list'
)
wait_for_vue_resource
end
end
end
end
spec/support/wait_for_vue_resource.rb
0 → 100644
View file @
07d39ac0
module
WaitForVueResource
def
wait_for_vue_resource
(
spinner:
true
)
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
page
.
evaluate_script
(
'Vue.activeResources'
).
zero?
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