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
Jérome Perrin
gitlab-ce
Commits
be646ba0
Commit
be646ba0
authored
May 11, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper to disable css animation in rspec
parent
f154a9ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
37 deletions
+26
-37
spec/disable_css_animation.js
spec/disable_css_animation.js
+15
-0
spec/disable_css_animation_helper.rb
spec/disable_css_animation_helper.rb
+9
-0
spec/features/issues/form_spec.rb
spec/features/issues/form_spec.rb
+2
-37
No files found.
spec/disable_css_animation.js
0 → 100644
View file @
be646ba0
/* eslint-disable */
// Disable eslint because capybara does not know es6
var
disableAnimationStyles
=
'
-webkit-transition: none !important;
'
+
'
-moz-transition: none !important;
'
+
'
-ms-transition: none !important;
'
+
'
-o-transition: none !important;
'
+
'
transition: none !important;
'
window
.
onload
=
function
()
{
var
animationStyles
=
document
.
createElement
(
'
style
'
);
animationStyles
.
type
=
'
text/css
'
;
animationStyles
.
innerHTML
=
'
* {
'
+
disableAnimationStyles
+
'
}
'
;
document
.
head
.
appendChild
(
animationStyles
);
};
spec/disable_css_animation_helper.rb
0 → 100644
View file @
be646ba0
Capybara
.
register_driver
:poltergeist
do
|
app
|
opts
=
{
extensions:
[
"
#{
Rails
.
root
}
/spec/disable_css_animation.js"
]
# or wherever
}
Capybara
::
Poltergeist
::
Driver
.
new
(
app
,
opts
)
end
Capybara
.
javascript_driver
=
:poltergeist
spec/features/issues/form_spec.rb
View file @
be646ba0
require
'rails_helper'
require
'rails_helper'
require
'disable_css_animation_helper'
describe
'New/edit issue'
,
feature:
true
,
js:
true
do
describe
'New/edit issue'
,
feature:
true
,
js:
true
do
include
GitlabRoutingHelper
include
GitlabRoutingHelper
...
@@ -33,48 +34,12 @@ describe 'New/edit issue', feature: true, js: true do
...
@@ -33,48 +34,12 @@ describe 'New/edit issue', feature: true, js: true do
# TODO: Figure out a better way to wait for dropdown CSS hide
# TODO: Figure out a better way to wait for dropdown CSS hide
# animation to complete
# animation to complete
sleep
0.3
#
sleep 0.3
expect
(
page
.
find
(
'.dropdown-menu-user'
,
visible:
false
)).
not_to
be_visible
expect
(
page
.
find
(
'.dropdown-menu-user'
,
visible:
false
)).
not_to
be_visible
end
end
end
end
describe
'multiple assignees'
do
before
do
click_button
'Unassigned'
end
it
'unselects other assignees when unassigned is selected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user2
.
name
end
page
.
within
'.dropdown-menu-user'
do
click_link
'Unassigned'
end
page
.
within
'.js-assignee-search'
do
expect
(
page
).
to
have_content
'Unassigned'
end
expect
(
find
(
'input[name="issue[assignee_ids][]"]'
,
visible:
false
).
value
).
to
match
(
'0'
)
end
it
'toggles assign to me when current user is selected and unselected'
do
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
,
visible:
false
)).
not_to
be_visible
page
.
within
'.dropdown-menu-user'
do
click_link
user
.
name
end
expect
(
find
(
'a'
,
text:
'Assign to me'
)).
to
be_visible
end
end
it
'allows user to create new issue'
do
it
'allows user to create new issue'
do
fill_in
'issue_title'
,
with:
'title'
fill_in
'issue_title'
,
with:
'title'
fill_in
'issue_description'
,
with:
'title'
fill_in
'issue_description'
,
with:
'title'
...
...
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