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
9c0db2b8
Commit
9c0db2b8
authored
Aug 17, 2021
by
Sanad Liaquat
Committed by
Natalia Tepluhina
Aug 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add e2e smoke test for create project under personal namespace
parent
e7762cd5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
20 deletions
+60
-20
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+1
-1
qa/qa/page/dashboard/projects.rb
qa/qa/page/dashboard/projects.rb
+8
-0
qa/qa/resource/project.rb
qa/qa/resource/project.rb
+9
-5
qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb
...s/api/3_create/repository/project_archive_compare_spec.rb
+1
-1
qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb
...atures/browser_ui/1_manage/project/create_project_spec.rb
+41
-13
No files found.
app/views/dashboard/_projects_head.html.haml
View file @
9c0db2b8
...
...
@@ -9,7 +9,7 @@
-
if
current_user
.
can_create_project?
.page-title-controls
=
link_to
_
(
"New project"
),
new_project_path
,
class:
"gl-button btn btn-confirm"
=
link_to
_
(
"New project"
),
new_project_path
,
class:
"gl-button btn btn-confirm"
,
data:
{
qa_selector:
'new_project_button'
}
.top-area.scrolling-tabs-container.inner-page-scroll-tabs
.fade-left
=
sprite_icon
(
'chevron-lg-left'
,
size:
12
)
...
...
qa/qa/page/dashboard/projects.rb
View file @
9c0db2b8
...
...
@@ -13,6 +13,10 @@ module QA
element
:user_role_content
end
view
'app/views/dashboard/_projects_head.html.haml'
do
element
:new_project_button
end
def
has_project_with_access_role?
(
project_name
,
access_role
)
within_element
(
:project_content
,
text:
project_name
)
do
has_element?
(
:user_role_content
,
text:
access_role
)
...
...
@@ -25,6 +29,10 @@ module QA
find_link
(
text:
name
).
click
end
def
click_new_project_button
click_element
(
:new_project_button
,
Page
::
Project
::
New
)
end
def
self
.
path
'/'
end
...
...
qa/qa/resource/project.rb
View file @
9c0db2b8
...
...
@@ -20,7 +20,7 @@ module QA
:name
,
:add_name_uuid
,
:description
,
:
standalon
e
,
:
personal_namespac
e
,
:runners_token
,
:visibility
,
:template_name
,
...
...
@@ -52,7 +52,7 @@ module QA
def
initialize
@add_name_uuid
=
true
@
standalon
e
=
false
@
personal_namespac
e
=
false
@description
=
'My awesome project'
@initialize_with_readme
=
false
@auto_devops_enabled
=
false
...
...
@@ -70,7 +70,9 @@ module QA
def
fabricate!
return
if
@import
unless
@standalone
if
@personal_namespace
Page
::
Dashboard
::
Projects
.
perform
(
&
:click_new_project_button
)
else
group
.
visit!
Page
::
Group
::
Show
.
perform
(
&
:go_to_new_project
)
end
...
...
@@ -85,13 +87,15 @@ module QA
Page
::
Project
::
New
.
perform
(
&
:click_blank_project_link
)
Page
::
Project
::
New
.
perform
do
|
new_page
|
new_page
.
choose_test_namespace
new_page
.
choose_test_namespace
unless
@personal_namespace
new_page
.
choose_name
(
@name
)
new_page
.
add_description
(
@description
)
new_page
.
set_visibility
(
@visibility
)
new_page
.
disable_initialize_with_readme
unless
@initialize_with_readme
new_page
.
create_new_project
end
@id
=
Page
::
Project
::
Show
.
perform
(
&
:project_id
)
end
def
fabricate_via_api!
...
...
@@ -219,7 +223,7 @@ module QA
auto_devops_enabled:
@auto_devops_enabled
}
unless
@
standalon
e
unless
@
personal_namespac
e
post_body
[
:namespace_id
]
=
group
.
id
post_body
[
:path
]
=
name
end
...
...
qa/qa/specs/features/api/3_create/repository/project_archive_compare_spec.rb
View file @
9c0db2b8
...
...
@@ -47,7 +47,7 @@ module QA
def
create_project
(
user
,
api_client
,
project_name
)
project
=
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
standalon
e
=
true
project
.
personal_namespac
e
=
true
project
.
add_name_uuid
=
false
project
.
name
=
project_name
project
.
path_with_namespace
=
"
#{
user
.
username
}
/
#{
project_name
}
"
...
...
qa/qa/specs/features/browser_ui/1_manage/project/create_project_spec.rb
View file @
9c0db2b8
...
...
@@ -2,24 +2,52 @@
module
QA
RSpec
.
describe
'Manage'
,
:smoke
do
describe
'Project creation'
do
it
'user creates a new project'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1857'
do
describe
'Project'
do
shared_examples
'successful project creation'
do
it
'creates a new project'
do
Page
::
Project
::
Show
.
perform
do
|
project
|
expect
(
project
).
to
have_content
(
project_name
)
expect
(
project
).
to
have_content
(
/Project \S?
#{
project_name
}
\S+ was successfully created/
)
expect
(
project
).
to
have_content
(
'create awesome project test'
)
expect
(
project
).
to
have_content
(
'The repository for this project is empty'
)
end
end
end
before
do
Flow
::
Login
.
sign_in
project
end
created_project
=
Resource
::
Project
.
fabricate_via_browser_ui!
do
|
project
|
project
.
name
=
'awesome-project'
project
.
description
=
'create awesome project test'
context
'in group'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1857'
do
let
(
:project_name
)
{
"project-in-group-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_browser_ui!
do
|
project
|
project
.
name
=
project_name
project
.
description
=
'create awesome project test'
end
end
Page
::
Project
::
Show
.
perform
do
|
project
|
expect
(
project
).
to
have_content
(
created_project
.
name
)
expect
(
project
).
to
have_content
(
/Project \S?awesome-project\S+ was successfully created/
)
expect
(
project
).
to
have_content
(
'create awesome project test'
)
expect
(
project
).
to
have_content
(
'The repository for this project is empty'
)
it_behaves_like
'successful project creation'
end
context
'in personal namespace'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1888'
do
let
(
:project_name
)
{
"project-in-personal-namespace-
#{
SecureRandom
.
hex
(
8
)
}
"
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_browser_ui!
do
|
project
|
project
.
name
=
project_name
project
.
description
=
'create awesome project test'
project
.
personal_namespace
=
true
end
end
it_behaves_like
'successful project creation'
end
after
do
project
.
remove_via_api!
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