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
b1ef1d06
Commit
b1ef1d06
authored
Feb 26, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky wiki specs by waiting for the SVG to be loaded first
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
117e2614
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
10 deletions
+25
-10
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+8
-4
spec/features/projects/wiki/user_views_wiki_page_spec.rb
spec/features/projects/wiki/user_views_wiki_page_spec.rb
+11
-5
spec/support/helpers/wiki_helpers.rb
spec/support/helpers/wiki_helpers.rb
+5
-0
spec/support/shared_examples/features/wiki_file_attachments_shared_examples.rb
...xamples/features/wiki_file_attachments_shared_examples.rb
+1
-1
No files found.
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
View file @
b1ef1d06
...
...
@@ -3,6 +3,8 @@
require
"spec_helper"
describe
"User creates wiki page"
do
include
WikiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:wiki
)
{
ProjectWiki
.
new
(
project
,
user
)
}
let
(
:project
)
{
create
(
:project
)
}
...
...
@@ -14,9 +16,11 @@ describe "User creates wiki page" do
end
context
"when wiki is empty"
do
before
do
before
do
|
example
|
visit
(
project_wikis_path
(
project
))
wait_for_svg_to_be_loaded
(
example
)
click_link
"Create your first page"
end
...
...
@@ -45,7 +49,7 @@ describe "User creates wiki page" do
expect
(
page
).
to
have_content
(
"Create New Page"
)
end
it
"shows non-escaped link in the pages list"
,
:quarantine
do
it
"shows non-escaped link in the pages list"
do
fill_in
(
:wiki_title
,
with:
"one/two/three-test"
)
page
.
within
(
".wiki-form"
)
do
...
...
@@ -163,7 +167,7 @@ describe "User creates wiki page" do
expect
(
page
).
to
have_link
(
'Link to Home'
,
href:
"/
#{
project
.
full_path
}
/-/wikis/home"
)
end
it_behaves_like
'wiki file attachments'
,
:quarantine
it_behaves_like
'wiki file attachments'
end
context
"in a group namespace"
,
:js
do
...
...
@@ -175,7 +179,7 @@ describe "User creates wiki page" do
expect
(
page
).
to
have_field
(
"wiki[message]"
,
with:
"Create home"
)
end
it
"creates a page from the home page"
,
:quarantine
do
it
"creates a page from the home page"
do
page
.
within
(
".wiki-form"
)
do
fill_in
(
:wiki_content
,
with:
"My awesome wiki!"
)
...
...
spec/features/projects/wiki/user_views_wiki_page_spec.rb
View file @
b1ef1d06
...
...
@@ -19,9 +19,12 @@ describe 'User views a wiki page' do
sign_in
(
user
)
end
context
'when wiki is empty'
do
context
'when wiki is empty'
,
:js
do
before
do
visit
(
project_wikis_path
(
project
))
visit
project_wikis_path
(
project
)
wait_for_svg_to_be_loaded
click_link
"Create your first page"
fill_in
(
:wiki_title
,
with:
'one/two/three-test'
)
...
...
@@ -32,7 +35,7 @@ describe 'User views a wiki page' do
end
end
it
'shows the history of a page that has a path'
,
:js
do
it
'shows the history of a page that has a path'
do
expect
(
current_path
).
to
include
(
'one/two/three-test'
)
first
(
:link
,
text:
'three'
).
click
...
...
@@ -45,7 +48,7 @@ describe 'User views a wiki page' do
end
end
it
'shows an old version of a page'
,
:js
do
it
'shows an old version of a page'
do
expect
(
current_path
).
to
include
(
'one/two/three-test'
)
expect
(
find
(
'.wiki-pages'
)).
to
have_content
(
'three'
)
...
...
@@ -162,9 +165,12 @@ describe 'User views a wiki page' do
end
it
'opens a default wiki page'
,
:js
do
visit
(
project_path
(
project
)
)
visit
project_path
(
project
)
find
(
'.shortcuts-wiki'
).
click
wait_for_svg_to_be_loaded
click_link
"Create your first page"
expect
(
page
).
to
have_content
(
'Create New Page'
)
...
...
spec/support/helpers/wiki_helpers.rb
View file @
b1ef1d06
...
...
@@ -3,6 +3,11 @@
module
WikiHelpers
extend
self
def
wait_for_svg_to_be_loaded
(
example
=
nil
)
# Ensure the SVG is loaded first before clicking the button
find
(
'.svg-content .js-lazy-loaded'
)
if
example
.
nil?
||
example
.
metadata
.
key?
(
:js
)
end
def
upload_file_to_wiki
(
project
,
user
,
file_name
)
opts
=
{
file_name:
file_name
,
...
...
spec/support/shared_examples/features/wiki_file_attachments_shared_examples.rb
View file @
b1ef1d06
...
...
@@ -42,7 +42,7 @@ RSpec.shared_examples 'wiki file attachments' do
end
end
context
'uploading is complete'
,
:quarantine
do
context
'uploading is complete'
do
it
'shows "Attach a file" button on uploading complete'
do
attach_with_dropzone
wait_for_requests
...
...
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