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
162964e1
Commit
162964e1
authored
Nov 09, 2020
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and un-quarantines import GitHub e2e spec
parent
4987712a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
35 deletions
+39
-35
qa/qa/page/base.rb
qa/qa/page/base.rb
+4
-4
qa/qa/page/project/import/github.rb
qa/qa/page/project/import/github.rb
+3
-1
qa/qa/resource/project_imported_from_github.rb
qa/qa/resource/project_imported_from_github.rb
+1
-0
qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb
...es/browser_ui/1_manage/project/import_github_repo_spec.rb
+30
-29
qa/qa/support/page/logging.rb
qa/qa/support/page/logging.rb
+1
-1
No files found.
qa/qa/page/base.rb
View file @
162964e1
...
@@ -38,15 +38,15 @@ module QA
...
@@ -38,15 +38,15 @@ module QA
assert_no_selector
(
element_selector_css
(
name
))
assert_no_selector
(
element_selector_css
(
name
))
end
end
def
refresh
def
refresh
(
skip_finished_loading_check:
false
)
page
.
refresh
page
.
refresh
wait_for_requests
wait_for_requests
(
skip_finished_loading_check:
skip_finished_loading_check
)
end
end
def
wait_until
(
max_duration:
60
,
sleep_interval:
0.1
,
reload:
true
,
raise_on_failure:
true
)
def
wait_until
(
max_duration:
60
,
sleep_interval:
0.1
,
reload:
true
,
raise_on_failure:
true
,
skip_finished_loading_check_on_refresh:
false
)
Support
::
Waiter
.
wait_until
(
max_duration:
max_duration
,
sleep_interval:
sleep_interval
,
raise_on_failure:
raise_on_failure
)
do
Support
::
Waiter
.
wait_until
(
max_duration:
max_duration
,
sleep_interval:
sleep_interval
,
raise_on_failure:
raise_on_failure
)
do
yield
||
(
reload
&&
refresh
&&
false
)
yield
||
(
reload
&&
refresh
(
skip_finished_loading_check:
skip_finished_loading_check_on_refresh
)
&&
false
)
end
end
end
end
...
...
qa/qa/page/project/import/github.rb
View file @
162964e1
...
@@ -67,7 +67,9 @@ module QA
...
@@ -67,7 +67,9 @@ module QA
end
end
def
wait_for_success
def
wait_for_success
wait_until
(
max_duration:
60
,
sleep_interval:
1.0
,
reload:
false
)
do
# TODO: set reload:false and remove skip_finished_loading_check_on_refresh when
# https://gitlab.com/gitlab-org/gitlab/-/issues/231542 is fixed
wait_until
(
max_duration:
60
,
sleep_interval:
5.0
,
reload:
true
,
skip_finished_loading_check_on_refresh:
true
)
do
page
.
has_content?
(
'Done'
,
wait:
1.0
)
page
.
has_content?
(
'Done'
,
wait:
1.0
)
end
end
end
end
...
...
qa/qa/resource/project_imported_from_github.rb
View file @
162964e1
...
@@ -6,6 +6,7 @@ module QA
...
@@ -6,6 +6,7 @@ module QA
module
Resource
module
Resource
class
ProjectImportedFromGithub
<
Resource
::
Project
class
ProjectImportedFromGithub
<
Resource
::
Project
def
fabricate!
def
fabricate!
self
.
import
=
true
super
super
group
.
visit!
group
.
visit!
...
...
qa/qa/specs/features/browser_ui/1_manage/project/import_github_repo_spec.rb
View file @
162964e1
# frozen_string_literal: true
# frozen_string_literal: true
module
QA
module
QA
RSpec
.
describe
'Manage'
,
:github
,
quarantine:
{
issue:
'https://gitlab.com/gitlab-org/gitlab/issues/26952'
,
type: :bug
}
do
RSpec
.
describe
'Manage'
,
:github
,
:requires_admin
do
describe
'Project import from GitHub'
do
describe
'Project import'
do
let!
(
:user
)
do
Resource
::
User
.
fabricate_via_api!
do
|
resource
|
resource
.
api_client
=
Runtime
::
API
::
Client
.
as_admin
end
end
let
(
:group
)
{
Resource
::
Group
.
fabricate_via_api!
}
let
(
:imported_project
)
do
let
(
:imported_project
)
do
Resource
::
ProjectImportedFromGithub
.
fabricate!
do
|
project
|
Resource
::
ProjectImportedFromGithub
.
fabricate
_via_browser_ui
!
do
|
project
|
project
.
name
=
'imported-project'
project
.
name
=
'imported-project'
project
.
personal_access_token
=
Runtime
::
Env
.
github_access_token
project
.
group
=
group
project
.
github_repository_path
=
'gitlab-qa/test-project'
project
.
github_personal_access_token
=
Runtime
::
Env
.
github_access_token
project
.
github_repository_path
=
'gitlab-qa-github/test-project'
end
end
end
end
after
do
before
do
# We need to delete the imported project because it's impossible to import
group
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
# the same GitHub project twice for a given user.
end
api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
delete_project_request
=
Runtime
::
API
::
Request
.
new
(
api_client
,
"/projects/
#{
CGI
.
escape
(
"
#{
Runtime
::
Namespace
.
path
}
/
#{
imported_project
.
name
}
"
)
}
"
)
delete
delete_project_request
.
url
expect_status
(
202
)
Page
::
Main
::
Menu
.
perform
(
&
:sign_out_if_signed_in
)
after
do
user
.
remove_via_api!
end
end
it
'
user
imports a GitHub repo'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/385'
do
it
'imports a GitHub repo'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/385'
do
Flow
::
Login
.
sign_in
Flow
::
Login
.
sign_in
(
as:
user
)
imported_project
# import the project
imported_project
# import the project
...
@@ -55,14 +60,14 @@ module QA
...
@@ -55,14 +60,14 @@ module QA
click_link
'This is a sample issue'
click_link
'This is a sample issue'
expect
(
page
).
to
have_content
(
'
We should populate this project with issues, pull requests and wiki pages.
'
)
expect
(
page
).
to
have_content
(
'
This is a sample first comment
'
)
# Comments
# Comments
comment_text
=
'This is a comment from @
rymai.
'
comment_text
=
'This is a comment from @
sliaquat
'
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue_page
|
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue_page
|
expect
(
issue_page
).
to
have_comment
(
comment_text
)
expect
(
issue_page
).
to
have_comment
(
comment_text
)
expect
(
issue_page
).
to
have_label
(
'
enhancement
'
)
expect
(
issue_page
).
to
have_label
(
'
custom new label
'
)
expect
(
issue_page
).
to
have_label
(
'help wanted'
)
expect
(
issue_page
).
to
have_label
(
'help wanted'
)
expect
(
issue_page
).
to
have_label
(
'good first issue'
)
expect
(
issue_page
).
to
have_label
(
'good first issue'
)
end
end
...
@@ -71,26 +76,22 @@ module QA
...
@@ -71,26 +76,22 @@ module QA
def
verify_merge_requests_import
def
verify_merge_requests_import
Page
::
Project
::
Menu
.
perform
(
&
:click_merge_requests
)
Page
::
Project
::
Menu
.
perform
(
&
:click_merge_requests
)
expect
(
page
).
to
have_content
(
'Improve
README.md
'
)
expect
(
page
).
to
have_content
(
'Improve
readme
'
)
click_link
'Improve
README.md
'
click_link
'Improve
readme
'
expect
(
page
).
to
have_content
(
'This improves the README file a bit.'
)
expect
(
page
).
to
have_content
(
'This improves the README file a bit.'
)
# Review comment are not supported yet
expect
(
page
).
not_to
have_content
(
'Really nice change.'
)
# Comments
# Comments
expect
(
page
).
to
have_content
(
'
Nice work! This is a comment from @rymai.
'
)
expect
(
page
).
to
have_content
(
'
[PR comment by @sliaquat] Nice work!
'
)
# Diff comments
# Diff comments
expect
(
page
).
to
have_content
(
'[Review comment] I like that!'
)
expect
(
page
).
to
have_content
(
'[Single diff comment] Good riddance'
)
expect
(
page
).
to
have_content
(
'[Review comment] Nice blank line.'
)
expect
(
page
).
to
have_content
(
'[Single diff comment] Nice addition'
)
expect
(
page
).
to
have_content
(
'[Single diff comment] Much better without this line!'
)
Page
::
MergeRequest
::
Show
.
perform
do
|
merge_request
|
Page
::
MergeRequest
::
Show
.
perform
do
|
merge_request
|
expect
(
merge_request
).
to
have_label
(
'bug'
)
expect
(
merge_request
).
to
have_label
(
'bug'
)
expect
(
merge_request
).
to
have_label
(
'
enhancement
'
)
expect
(
merge_request
).
to
have_label
(
'
documentation
'
)
end
end
end
end
...
...
qa/qa/support/page/logging.rb
View file @
162964e1
...
@@ -10,7 +10,7 @@ module QA
...
@@ -10,7 +10,7 @@ module QA
super
super
end
end
def
refresh
def
refresh
(
skip_finished_loading_check:
false
)
log
(
"refreshing
#{
current_url
}
"
)
log
(
"refreshing
#{
current_url
}
"
)
super
super
...
...
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