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
13d31fb2
Commit
13d31fb2
authored
Jan 28, 2022
by
Sanad Liaquat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E: Fix follow user activity spec
parent
e37b3e45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb
...res/browser_ui/1_manage/user/follow_user_activity_spec.rb
+22
-15
No files found.
qa/qa/specs/features/browser_ui/1_manage/user/follow_user_activity_spec.rb
View file @
13d31fb2
...
@@ -5,21 +5,27 @@ module QA
...
@@ -5,21 +5,27 @@ module QA
describe
'User'
,
:requires_admin
do
describe
'User'
,
:requires_admin
do
let
(
:admin_api_client
)
{
Runtime
::
API
::
Client
.
as_admin
}
let
(
:admin_api_client
)
{
Runtime
::
API
::
Client
.
as_admin
}
let
(
:user
)
do
let
(
:followed_user_api_client
)
{
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
followed_user
)
}
let
(
:followed_user
)
do
Resource
::
User
.
fabricate_via_api!
do
|
user
|
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
name
=
"followed_user_
#{
SecureRandom
.
hex
(
8
)
}
"
user
.
api_client
=
admin_api_client
user
.
api_client
=
admin_api_client
end
end
end
end
let
(
:user_api_client
)
do
let
(
:following_user
)
do
Runtime
::
API
::
Client
.
new
(
:gitlab
,
user:
user
)
Resource
::
User
.
fabricate_via_api!
do
|
user
|
user
.
name
=
"following_user_
#{
SecureRandom
.
hex
(
8
)
}
"
user
.
api_client
=
admin_api_client
end
end
end
let
(
:group
)
do
let
(
:group
)
do
group
=
QA
::
Resource
::
Group
.
fabricate_via_api!
do
|
group
|
group
=
QA
::
Resource
::
Group
.
fabricate_via_api!
do
|
group
|
group
.
path
=
"group_for_follow_user_activity_
#{
SecureRandom
.
hex
(
8
)
}
"
group
.
path
=
"group_for_follow_user_activity_
#{
SecureRandom
.
hex
(
8
)
}
"
end
end
group
.
add_member
(
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
group
.
add_member
(
followed_
user
,
Resource
::
Members
::
AccessLevel
::
MAINTAINER
)
group
group
end
end
...
@@ -27,7 +33,7 @@ module QA
...
@@ -27,7 +33,7 @@ module QA
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-for-tags'
project
.
name
=
'project-for-tags'
project
.
initialize_with_readme
=
true
project
.
initialize_with_readme
=
true
project
.
api_client
=
user_api_client
project
.
api_client
=
followed_
user_api_client
project
.
group
=
group
project
.
group
=
group
end
end
end
end
...
@@ -35,14 +41,14 @@ module QA
...
@@ -35,14 +41,14 @@ module QA
let
(
:merge_request
)
do
let
(
:merge_request
)
do
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
mr
|
Resource
::
MergeRequest
.
fabricate_via_api!
do
|
mr
|
mr
.
project
=
project
mr
.
project
=
project
mr
.
api_client
=
user_api_client
mr
.
api_client
=
followed_
user_api_client
end
end
end
end
let
(
:issue
)
do
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
project
=
project
issue
.
project
=
project
issue
.
api_client
=
user_api_client
issue
.
api_client
=
followed_
user_api_client
end
end
end
end
...
@@ -51,19 +57,19 @@ module QA
...
@@ -51,19 +57,19 @@ module QA
project_issue_note
.
project
=
project
project_issue_note
.
project
=
project
project_issue_note
.
issue
=
issue
project_issue_note
.
issue
=
issue
project_issue_note
.
body
=
'This is a comment'
project_issue_note
.
body
=
'This is a comment'
project_issue_note
.
api_client
=
user_api_client
project_issue_note
.
api_client
=
followed_
user_api_client
end
end
end
end
before
do
before
do
# Create both tokens before logging in the first time so that we don't need to log out in the middle of the test
# Create both tokens before logging in the first time so that we don't need to log out in the middle of the test
admin_api_client
.
personal_access_token
admin_api_client
.
personal_access_token
user_api_client
.
personal_access_token
followed_
user_api_client
.
personal_access_token
end
end
it
'can be followed and their activity seen'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347678'
do
it
'can be followed and their activity seen'
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347678'
do
Flow
::
Login
.
sign_in
Flow
::
Login
.
sign_in
(
as:
following_user
)
page
.
visit
Runtime
::
Scenario
.
gitlab_address
+
"/
#{
user
.
username
}
"
page
.
visit
Runtime
::
Scenario
.
gitlab_address
+
"/
#{
followed_
user
.
username
}
"
Page
::
User
::
Show
.
perform
(
&
:click_follow_user_link
)
Page
::
User
::
Show
.
perform
(
&
:click_follow_user_link
)
expect
(
page
).
to
have_text
(
"No activities found"
)
expect
(
page
).
to
have_text
(
"No activities found"
)
...
@@ -76,7 +82,7 @@ module QA
...
@@ -76,7 +82,7 @@ module QA
Page
::
Main
::
Menu
.
perform
(
&
:click_user_profile_link
)
Page
::
Main
::
Menu
.
perform
(
&
:click_user_profile_link
)
Page
::
User
::
Show
.
perform
do
|
show
|
Page
::
User
::
Show
.
perform
do
|
show
|
show
.
click_following_link
show
.
click_following_link
show
.
click_user_link
(
user
.
username
)
show
.
click_user_link
(
followed_
user
.
username
)
aggregate_failures
do
aggregate_failures
do
expect
(
show
).
to
have_activity
(
'created project'
)
expect
(
show
).
to
have_activity
(
'created project'
)
...
@@ -88,9 +94,10 @@ module QA
...
@@ -88,9 +94,10 @@ module QA
end
end
after
do
after
do
project
.
api_client
=
admin_api_client
project
&
.
api_client
=
admin_api_client
project
.
remove_via_api!
project
&
.
remove_via_api!
user
.
remove_via_api!
followed_user
&
.
remove_via_api!
following_user
&
.
remove_via_api!
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