Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
832
Issues
832
List
Boards
Labels
Service Desk
Milestones
Merge Requests
52
Merge Requests
52
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
e9bbf747cb408177956c48c853f448778e866fd0...68a0878921968ba97f5b734acb11e6a7a524b0cb
Source
68a0878921968ba97f5b734acb11e6a7a524b0cb
Select Git revision
...
Target
e9bbf747cb408177956c48c853f448778e866fd0
Select Git revision
Compare
Commits (2)
[Sprint/DapperDingo] (feat): newsfeed e2e tests
· ddcfd4f7
Marcelo Rivera
authored
1 hour ago
ddcfd4f7
Merge branch 'sprint/DapperDingo.feat.newsfeed-e2e-tests' into 'master'
· 68a08789
Mark Harding
authored
1 hour ago
[Sprint/DapperDingo] (feat): newsfeed e2e tests See merge request
!299
68a08789
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
165 additions
and
4 deletions
+165
-4
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+165
-3
commands.js
cypress/support/commands.js
+0
-1
No files found.
cypress/integration/newsfeed.spec.js
View file @
68a08789
context
(
'
Login
'
,
()
=>
{
context
(
'
Newsfeed
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
login
(
true
);
})
cy
.
location
(
'pathname'
,
{
timeout
:
5000
}).
should
(
'eq'
,
'/newsfeed/subscriptions'
);
})
it
(
'should post an activity picking hashtags from the dropdown'
,
()
=>
{
cy
.
get
(
'minds-newsfeed-poster'
).
should
(
'be.visible'
);
...
...
@@ -125,7 +126,51 @@ context('Login', () => {
cy
.
get
(
'.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored'
).
click
();
})
it
(
'should record a view when the user scrolls and an activity is visible'
,
async
()
=>
{
it
(
'should have an "Upgrade to Plus" button and it should redirect to /plus'
,
()
=>
{
cy
.
get
(
'.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:first-child span'
)
.
contains
(
'Upgrade to Plus'
);
cy
.
get
(
'.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:first-child'
).
should
(
'have.attr'
,
'href'
,
'/plus'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/plus'
);
})
it
(
'should have a "Buy Tokens" button and it should redirect to /token'
,
()
=>
{
cy
.
get
(
'.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:last-child span'
)
.
contains
(
'Buy Tokens'
);
cy
.
get
(
'.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:last-child'
).
should
(
'have.attr'
,
'href'
,
'/tokens'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/token'
);
})
it
(
'"create blog" button in poster should redirect to /blog/edit/new'
,
()
=>
{
cy
.
get
(
'minds-newsfeed-poster .m-posterActionBar__CreateBlog'
)
.
contains
(
'Create blog'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/blog/edit/new'
);
})
it
(
'clicking on "create blog" button in poster should prompt a confirm dialog and open a new blog with the currently inputted text'
,
()
=>
{
cy
.
get
(
'minds-newsfeed-poster textarea'
).
type
(
'#thegreatmigration'
);
const
stub
=
cy
.
stub
();
cy
.
on
(
'window:confirm'
,
stub
);
cy
.
get
(
'minds-newsfeed-poster .m-posterActionBar__CreateBlog'
)
.
contains
(
'Create blog'
).
click
()
.
then
(()
=>
{
expect
(
stub
.
getCall
(
0
)).
to
.
be
.
calledWith
(
'Are you sure? The content will be moved to the blog editor.'
)
});
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/blog/edit/new'
);
cy
.
get
(
'm-inline-editor .medium-editor-element.medium-editor-insert-plugin p'
).
contains
(
'#thegreatmigration'
);
})
it
(
'should record a view when the user scrolls and an activity is visible'
,
()
=>
{
cy
.
server
();
cy
.
route
(
"POST"
,
"**/api/v2/analytics/views/activity/*"
).
as
(
"view"
);
// create the post
...
...
@@ -147,4 +192,121 @@ context('Login', () => {
cy
.
get
(
'.minds-list > minds-activity:first-child m-post-menu .minds-dropdown-menu .mdl-menu__item:nth-child(4)'
).
click
();
cy
.
get
(
'.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored'
).
click
();
})
it
(
'clicking on the plus button on the sidebar should redirect the user to /groups/create'
,
()
=>
{
cy
.
get
(
'm-group--sidebar-markers .m-groupSidebarMarkers__list li:first-child'
)
.
contains
(
'add'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/groups/create'
);
})
it
(
"clicking on the dropdown on the right should allow to go to the user's channel"
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(1)'
)
.
contains
(
'View Channel'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
`/
${
Cypress
.
env
().
username
}
`
);
})
it
(
'clicking on the dropdown on the right should allow to go to settings'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(2)'
)
.
contains
(
'Settings'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/settings/general'
);
})
it
(
'clicking on the dropdown on the right should allow to go to the boost console'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(3)'
)
.
contains
(
'Boost Console'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/boost/console/newsfeed/history'
);
})
it
(
'clicking on the dropdown on the right should allow to go to the boost console'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(4)'
)
.
contains
(
'Help Desk'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/help'
);
})
it
(
'clicking on the dropdown on the right should allow to view the whitepaper'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(5)'
)
.
contains
(
'Whitepaper'
);
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(5) a'
)
.
should
(
'have.attr'
,
'href'
)
.
and
(
'include'
,
'/assets/documents/Whitepaper-v0.3.pdf'
);
})
it
(
'clicking on the dropdown on the right should redirect to /canary'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(6)'
)
.
contains
(
'Canary'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/canary'
);
})
it
(
'clicking on the dropdown on the right should allow to toggle Dark Mode'
,
()
=>
{
// open the menu
cy
.
get
(
'm-user-menu .m-user-menu__Anchor'
).
click
();
cy
.
get
(
'body.m-theme__light'
).
should
(
'be.visible'
);
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(7)'
)
.
contains
(
'Dark Mode'
)
.
click
();
cy
.
get
(
'body.m-theme__dark'
).
should
(
'be.visible'
);
cy
.
get
(
'm-user-menu .m-user-menu__Dropdown li:nth-child(7)'
)
.
contains
(
'Light Mode'
)
.
click
();
cy
.
get
(
'body.m-theme__light'
).
should
(
'be.visible'
);
})
it
(
'clicking on the bulb on the topbar should redirect to /newsfeed/subscriptions'
,
()
=>
{
cy
.
get
(
'.m-v2-topbarNavItem__Logo img'
).
should
(
'be.visible'
);
cy
.
get
(
'.m-v2-topbarNavItem__Logo'
).
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/newsfeed/subscriptions'
);
})
it
(
'clicking on the bell should open the notifications dropdown, and allow to view all notifications by redirecting to /notifications'
,
()
=>
{
cy
.
get
(
'.m-v2-topbar__UserMenu m-notifications--flyout'
).
should
(
'not.be.visible'
);
cy
.
get
(
'.m-v2-topbar__UserMenu a.m-notifications--topbar-toggle--icon'
)
.
should
(
'be.visible'
)
.
click
();
cy
.
get
(
'.m-v2-topbar__UserMenu m-notifications--flyout'
).
should
(
'be.visible'
);
cy
.
get
(
'.m-notifications--flyout--bottom-container a'
)
.
click
();
cy
.
location
(
'pathname'
).
should
(
'eq'
,
'/notifications'
);
})
})
This diff is collapsed.
Click to expand it.
cypress/support/commands.js
View file @
68a08789
...
...
@@ -33,7 +33,6 @@ Cypress.Commands.add('login', (canary) => {
cy
.
get
(
'minds-form-login .m-login-box .mdl-cell:last-child input'
).
type
(
Cypress
.
env
().
password
);
cy
.
get
(
'minds-form-login .m-btn--login'
).
click
();
});
Cypress
.
Commands
.
add
(
'uploadFile'
,
(
selector
,
fileName
,
type
=
''
)
=>
{
...
...
This diff is collapsed.
Click to expand it.