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
39582078
Commit
39582078
authored
Oct 09, 2017
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add QA::Scenario::Gitlab::Group::Create
parent
348c6105
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
87 additions
and
59 deletions
+87
-59
qa/qa.rb
qa/qa.rb
+4
-0
qa/qa/page/dashboard/groups.rb
qa/qa/page/dashboard/groups.rb
+8
-40
qa/qa/page/group/new.rb
qa/qa/page/group/new.rb
+10
-11
qa/qa/page/group/show.rb
qa/qa/page/group/show.rb
+13
-1
qa/qa/scenario/gitlab/group/create.rb
qa/qa/scenario/gitlab/group/create.rb
+27
-0
qa/qa/scenario/gitlab/project/create.rb
qa/qa/scenario/gitlab/project/create.rb
+15
-2
qa/qa/scenario/gitlab/sandbox/prepare.rb
qa/qa/scenario/gitlab/sandbox/prepare.rb
+10
-5
No files found.
qa/qa.rb
View file @
39582078
...
@@ -31,6 +31,10 @@ module QA
...
@@ -31,6 +31,10 @@ module QA
# GitLab instance scenarios.
# GitLab instance scenarios.
#
#
module
Gitlab
module
Gitlab
module
Group
autoload
:Create
,
'qa/scenario/gitlab/group/create'
end
module
Project
module
Project
autoload
:Create
,
'qa/scenario/gitlab/project/create'
autoload
:Create
,
'qa/scenario/gitlab/project/create'
end
end
...
...
qa/qa/page/dashboard/groups.rb
View file @
39582078
...
@@ -3,53 +3,21 @@ module QA
...
@@ -3,53 +3,21 @@ module QA
module
Dashboard
module
Dashboard
class
Groups
<
Page
::
Base
class
Groups
<
Page
::
Base
def
filter_by_name
(
name
)
def
filter_by_name
(
name
)
# NOTE: The filter placeholder on the Subgroups page currently omits
fill_in
'Filter by name...'
,
with:
name
# the ellipsis.
#
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/38807
if
page
.
has_field?
(
'Filter by name...'
)
fill_in
'Filter by name...'
,
with:
name
elsif
page
.
has_field?
(
'Filter by name'
)
fill_in
'Filter by name'
,
with:
name
end
end
end
def
has_
test_namespace?
def
has_
group?
(
name
)
filter_by_name
(
name
space
.
name
)
filter_by_name
(
name
)
page
.
has_link?
(
name
space
.
name
)
page
.
has_link?
(
name
)
end
end
def
has_sandbox?
def
go_to_group
(
name
)
filter_by_name
(
namespace
.
sandbox_name
)
click_link
name
page
.
has_link?
(
namespace
.
sandbox_name
)
end
def
go_to_test_namespace
click_link
namespace
.
name
end
def
go_to_sandbox
click_link
namespace
.
sandbox_name
end
end
def
create_group
(
group_name
=
nil
,
group_description
=
nil
)
def
go_to_new_group
Page
::
Group
::
New
.
act
{
create_group
(
group_name
,
group_description
)
}
click_on
'New group'
end
def
prepare_test_namespace
if
has_test_namespace?
go_to_test_namespace
else
create_group
end
end
private
def
namespace
Runtime
::
Namespace
end
end
end
end
end
end
...
...
qa/qa/page/group/new.rb
View file @
39582078
...
@@ -2,20 +2,19 @@ module QA
...
@@ -2,20 +2,19 @@ module QA
module
Page
module
Page
module
Group
module
Group
class
New
<
Page
::
Base
class
New
<
Page
::
Base
def
create_group
(
group_name
=
nil
,
group_description
=
nil
)
def
set_path
(
path
)
if
page
.
has_content?
(
'New Subgroup'
)
fill_in
'group_path'
,
with:
path
click_on
'New Subgroup'
end
else
click_on
'New group'
end
group_name
||=
Runtime
::
Namespace
.
name
def
set_description
(
description
)
group_description
||=
"QA test run at
#{
Runtime
::
Namespace
.
name
}
"
fill_in
'group_description'
,
with:
description
end
fill_in
'group_path'
,
with:
group_name
def
set_visibility
(
visibility
)
fill_in
'group_description'
,
with:
group_description
choose
visibility
choose
'Private'
end
def
create
click_button
'Create group'
click_button
'Create group'
end
end
end
end
...
...
qa/qa/page/group/show.rb
View file @
39582078
...
@@ -6,8 +6,20 @@ module QA
...
@@ -6,8 +6,20 @@ module QA
click_link
'Subgroups'
click_link
'Subgroups'
end
end
def
go_to_subgroup
(
name
)
click_link
name
end
def
has_subgroup?
(
name
)
page
.
has_link?
(
name
)
end
def
go_to_new_subgroup
click_on
'New Subgroup'
end
def
go_to_new_project
def
go_to_new_project
click_
link
'New Project'
click_
on
'New Project'
end
end
end
end
end
end
...
...
qa/qa/scenario/gitlab/group/create.rb
0 → 100644
View file @
39582078
require
'securerandom'
module
QA
module
Scenario
module
Gitlab
module
Group
class
Create
<
Scenario
::
Template
attr_writer
:path
,
:description
def
initialize
@path
=
Runtime
::
Namespace
.
name
@description
=
"QA test run at
#{
Runtime
::
Namespace
.
time
}
"
end
def
perform
Page
::
Group
::
New
.
perform
do
|
group
|
group
.
set_path
(
@path
)
group
.
set_description
(
@description
)
group
.
set_visibility
(
'Private'
)
group
.
create
end
end
end
end
end
end
end
qa/qa/scenario/gitlab/project/create.rb
View file @
39582078
...
@@ -14,8 +14,21 @@ module QA
...
@@ -14,8 +14,21 @@ module QA
def
perform
def
perform
Scenario
::
Gitlab
::
Sandbox
::
Prepare
.
perform
Scenario
::
Gitlab
::
Sandbox
::
Prepare
.
perform
Page
::
Dashboard
::
Groups
.
act
{
prepare_test_namespace
}
Page
::
Group
::
Show
.
perform
do
|
page
|
Page
::
Group
::
Show
.
act
{
go_to_new_project
}
page
.
go_to_subgroups
if
page
.
has_subgroup?
(
Runtime
::
Namespace
.
name
)
page
.
go_to_subgroup
(
Runtime
::
Namespace
.
name
)
else
page
.
go_to_new_subgroup
Scenario
::
Gitlab
::
Group
::
Create
.
perform
do
|
group
|
group
.
path
=
Runtime
::
Namespace
.
name
end
end
page
.
go_to_new_project
end
Page
::
Project
::
New
.
perform
do
|
page
|
Page
::
Project
::
New
.
perform
do
|
page
|
page
.
choose_test_namespace
page
.
choose_test_namespace
...
...
qa/qa/scenario/gitlab/sandbox/prepare.rb
View file @
39582078
...
@@ -2,19 +2,24 @@ module QA
...
@@ -2,19 +2,24 @@ module QA
module
Scenario
module
Scenario
module
Gitlab
module
Gitlab
module
Sandbox
module
Sandbox
# Ensure we're in our sandbox namespace, either by navigating to it or
# by creating it if it doesn't yet exist
class
Prepare
<
Scenario
::
Template
class
Prepare
<
Scenario
::
Template
def
perform
def
perform
Page
::
Main
::
Menu
.
act
{
go_to_groups
}
Page
::
Main
::
Menu
.
act
{
go_to_groups
}
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
Page
::
Dashboard
::
Groups
.
perform
do
|
page
|
if
page
.
has_
sandbox?
if
page
.
has_
group?
(
Runtime
::
Namespace
.
sandbox_name
)
page
.
go_to_
sandbox
page
.
go_to_
group
(
Runtime
::
Namespace
.
sandbox_name
)
else
else
page
.
create_group
(
Runtime
::
Namespace
.
sandbox_name
,
"QA sandbox"
)
page
.
go_to_new_group
Scenario
::
Gitlab
::
Group
::
Create
.
perform
do
|
group
|
group
.
path
=
Runtime
::
Namespace
.
sandbox_name
group
.
description
=
'QA sandbox'
end
end
end
end
end
Page
::
Group
::
Show
.
act
{
go_to_subgroups
}
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