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
7f1ecd2e
Commit
7f1ecd2e
authored
Jan 10, 2018
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Runtime::Browser.visit to allow omitting `page`
parent
bdefb879
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
60 deletions
+46
-60
qa/qa/page/main/home.rb
qa/qa/page/main/home.rb
+0
-11
qa/qa/runtime/browser.rb
qa/qa/runtime/browser.rb
+2
-6
qa/qa/specs/features/ee/geo/rename_replication_spec.rb
qa/qa/specs/features/ee/geo/rename_replication_spec.rb
+44
-43
No files found.
qa/qa/page/main/home.rb
deleted
100644 → 0
View file @
bdefb879
module
QA
module
Page
module
Main
class
Home
<
Page
::
Base
def
self
.
path
'/'
end
end
end
end
end
qa/qa/runtime/browser.rb
View file @
7f1ecd2e
...
@@ -23,18 +23,14 @@ module QA
...
@@ -23,18 +23,14 @@ module QA
# In case of an address that is a symbol we will try to guess address
# In case of an address that is a symbol we will try to guess address
# based on `Runtime::Scenario#something_address`.
# based on `Runtime::Scenario#something_address`.
#
#
def
visit
(
address
,
page
,
&
block
)
def
visit
(
address
,
page
=
nil
,
&
block
)
Browser
::
Session
.
new
(
address
,
page
).
perform
(
&
block
)
Browser
::
Session
.
new
(
address
,
page
).
perform
(
&
block
)
end
end
def
self
.
visit
(
address
,
page
,
&
block
)
def
self
.
visit
(
address
,
page
=
nil
,
&
block
)
new
.
visit
(
address
,
page
,
&
block
)
new
.
visit
(
address
,
page
,
&
block
)
end
end
def
self
.
url_for
(
instance
,
page
)
Runtime
::
Scenario
.
send
(
"
#{
instance
}
_address"
)
+
page
&
.
path
end
def
self
.
configure!
def
self
.
configure!
return
if
Capybara
.
drivers
.
include?
(
:chrome
)
return
if
Capybara
.
drivers
.
include?
(
:chrome
)
...
...
qa/qa/specs/features/ee/geo/rename_replication_spec.rb
View file @
7f1ecd2e
...
@@ -21,66 +21,67 @@ module QA
...
@@ -21,66 +21,67 @@ module QA
end
end
# check it exists on the other machine
# check it exists on the other machine
visit
(
Runtime
::
Browser
.
url_for
(
:geo_secondary
,
QA
::
Page
::
Main
::
Login
))
Runtime
::
Browser
.
visit
(
:geo_secondary
,
QA
::
Page
::
Main
::
Login
)
do
Page
::
Main
::
OAuth
.
act
do
Page
::
Main
::
OAuth
.
act
do
authorize!
if
needs_authorization?
authorize!
if
needs_authorization?
end
end
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node'
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node'
Page
::
Menu
::
Main
.
perform
do
|
menu
|
Page
::
Menu
::
Main
.
perform
do
|
menu
|
menu
.
go_to_projects
menu
.
go_to_projects
expect
(
page
).
to
have_content
(
geo_project_name
)
expect
(
page
).
to
have_content
(
geo_project_name
)
end
end
sleep
10
# wait for repository replication
sleep
10
# wait for repository replication
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
dashboard
.
go_to_project
(
geo_project_name
)
dashboard
.
go_to_project
(
geo_project_name
)
end
end
Page
::
Project
::
Show
.
perform
do
Page
::
Project
::
Show
.
perform
do
expect
(
page
).
to
have_content
'README.md'
expect
(
page
).
to
have_content
'README.md'
expect
(
page
).
to
have_content
'This is Geo project!'
expect
(
page
).
to
have_content
'This is Geo project!'
end
end
# rename the project
# rename the project
visit
(
Runtime
::
Browser
.
url_for
(
:geo_primary
,
QA
::
Page
::
Main
::
Home
)
)
Runtime
::
Browser
.
visit
(
:geo_primary
)
Page
::
Menu
::
Main
.
act
{
go_to_projects
}
Page
::
Menu
::
Main
.
act
{
go_to_projects
}
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
dashboard
.
go_to_project
(
geo_project_name
)
dashboard
.
go_to_project
(
geo_project_name
)
end
end
Page
::
Menu
::
Side
.
act
{
go_to_settings
}
Page
::
Menu
::
Side
.
act
{
go_to_settings
}
geo_project_newname
=
"geo-after-rename-
#{
SecureRandom
.
hex
(
8
)
}
"
geo_project_newname
=
"geo-after-rename-
#{
SecureRandom
.
hex
(
8
)
}
"
Page
::
Project
::
Settings
::
Main
.
perform
do
|
page
|
Page
::
Project
::
Settings
::
Main
.
perform
do
|
page
|
page
.
expand_advanced_settings
page
.
expand_advanced_settings
page
.
rename_to
(
geo_project_newname
)
page
.
rename_to
(
geo_project_newname
)
end
end
sleep
2
# wait for replication
sleep
2
# wait for replication
# check renamed project exist on secondary node
# check renamed project exist on secondary node
visit
(
Runtime
::
Browser
.
url_for
(
:geo_secondary
,
QA
::
Page
::
Main
::
Home
)
)
Runtime
::
Browser
.
visit
(
:geo_secondary
)
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node'
expect
(
page
).
to
have_content
'You are on a secondary (read-only) Geo node'
Page
::
Menu
::
Main
.
perform
do
|
menu
|
Page
::
Menu
::
Main
.
perform
do
|
menu
|
menu
.
go_to_projects
menu
.
go_to_projects
expect
(
page
).
to
have_content
(
geo_project_newname
)
expect
(
page
).
to
have_content
(
geo_project_newname
)
end
end
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
Page
::
Dashboard
::
Projects
.
perform
do
|
dashboard
|
dashboard
.
go_to_project
(
geo_project_newname
)
dashboard
.
go_to_project
(
geo_project_newname
)
end
end
Page
::
Project
::
Show
.
perform
do
Page
::
Project
::
Show
.
perform
do
expect
(
page
).
to
have_content
'README.md'
expect
(
page
).
to
have_content
'README.md'
expect
(
page
).
to
have_content
'This is Geo project!'
expect
(
page
).
to
have_content
'This is Geo project!'
end
end
end
end
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