Открыть боковую панель
nt_test121
nt_project_9da4a5yt9x4b
Коммиты
53d35ce0
Не подтверждена
Коммит
53d35ce0
создал
Авг 29, 2019
по автору
Mark Lapierre
Зафиксировано автором
Rémy Coutable
Сен 05, 2019
Просмотр файлов
CE backport of EE MR approvals E2E test
Includes API methods to add members to projects and groups
владелец
1c6aa98c
Изменения
7
Скрыть пробелы
Построчно
Рядом
doc/development/testing_guide/end_to_end/page_objects.md
Просмотр файла @
53d35ce0
...
...
@@ -167,6 +167,18 @@ There are two supported methods of defining elements within a view.
Any existing
`.qa-selector`
class should be considered deprecated
and we should prefer the
`data-qa-selector`
method of definition.
### Exceptions
In some cases it might not be possible or worthwhile to add a selector.
Some UI components use external libraries, including some maintained by third parties.
Even if a library is maintained by GitLab, the selector sanity test only runs
on code within the GitLab project, so it's not possible to specify the path for
the view for code in a library.
In such rare cases it's reasonable to use CSS selectors in page object methods,
with a comment explaining why an
`element`
can't be added.
## Running the test locally
During development, you can run the
`qa:selectors`
test by running
...
...
qa/qa/page/main/menu.rb
Просмотр файла @
53d35ce0
...
...
@@ -61,6 +61,10 @@ def sign_out
end
end
def
sign_out_if_signed_in
sign_out
if
has_personal_area?
(
wait:
0
)
end
def
click_settings_link
retry_until
(
reload:
false
)
do
within_user_menu
do
...
...
qa/qa/page/merge_request/new.rb
Просмотр файла @
53d35ce0
...
...
@@ -64,3 +64,5 @@ def assign_to_me
end
end
end
QA
::
Page
::
MergeRequest
::
New
.
prepend_if_ee
(
'QA::EE::Page::MergeRequest::New'
)
qa/qa/resource/group.rb
Просмотр файла @
53d35ce0
...
...
@@ -10,6 +10,7 @@ class Group < Base
end
attribute
:id
attribute
:name
def
initialize
@path
=
Runtime
::
Namespace
.
name
...
...
@@ -47,6 +48,11 @@ def fabricate_via_api!
super
end
def
add_member
(
user
,
access_level
=
'30'
)
# 30 = developer access
post
Runtime
::
API
::
Request
.
new
(
api_client
,
api_members_path
).
url
,
{
user_id:
user
.
id
,
access_level:
access_level
}
end
def
api_get_path
"/groups/
#{
CGI
.
escape
(
"
#{
sandbox
.
path
}
/
#{
path
}
"
)
}
"
end
...
...
qa/qa/resource/merge_request.rb
Просмотр файла @
53d35ce0
...
...
@@ -5,7 +5,8 @@
module
QA
module
Resource
class
MergeRequest
<
Base
attr_accessor
:id
,
attr_accessor
:approval_rules
,
:id
,
:title
,
:description
,
:source_branch
,
...
...
@@ -46,6 +47,7 @@ class MergeRequest < Base
end
def
initialize
@approval_rules
=
nil
@title
=
'QA test - merge request'
@description
=
'This is a test merge request'
@source_branch
=
"qa-test-feature-
#{
SecureRandom
.
hex
(
8
)
}
"
...
...
@@ -63,16 +65,17 @@ def fabricate!
project
.
visit!
Page
::
Project
::
Show
.
perform
(
&
:new_merge_request
)
Page
::
MergeRequest
::
New
.
perform
do
|
page
|
page
.
fill_title
(
@title
)
page
.
fill_description
(
@description
)
page
.
choose_milestone
(
@milestone
)
if
@milestone
page
.
assign_to_me
if
@assignee
==
'me'
Page
::
MergeRequest
::
New
.
perform
do
|
new
|
new
.
fill_title
(
@title
)
new
.
fill_description
(
@description
)
new
.
choose_milestone
(
@milestone
)
if
@milestone
new
.
assign_to_me
if
@assignee
==
'me'
labels
.
each
do
|
label
|
page
.
select_label
(
label
)
new
.
select_label
(
label
)
end
new
.
add_approval_rules
(
approval_rules
)
if
approval_rules
page
.
create_merge_request
new
.
create_merge_request
end
end
...
...
qa/qa/resource/project.rb
Просмотр файла @
53d35ce0
...
...
@@ -75,6 +75,11 @@ def fabricate_via_api!
super
end
def
add_member
(
user
,
access_level
=
'30'
)
# 30 = developer access
post
Runtime
::
API
::
Request
.
new
(
api_client
,
api_members_path
).
url
,
{
user_id:
user
.
id
,
access_level:
access_level
}
end
def
api_get_path
"/projects/
#{
CGI
.
escape
(
path_with_namespace
)
}
"
end
...
...
@@ -83,6 +88,10 @@ def api_get_archive_path(type = 'tar.gz')
"
#{
api_get_path
}
/repository/archive.
#{
type
}
"
end
def
api_members_path
"
#{
api_get_path
}
/members"
end
def
api_post_path
'/projects'
end
...
...
qa/qa/resource/user.rb
Просмотр файла @
53d35ce0
...
...
@@ -9,6 +9,7 @@ class User < Base
attr_writer
:username
,
:password
attr_accessor
:provider
,
:extern_uid
attribute
:id
attribute
:name
attribute
:email
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать