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
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
844
Issues
844
List
Boards
Labels
Service Desk
Milestones
Merge Requests
41
Merge Requests
41
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
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
Commits
e14475ec
Commit
e14475ec
authored
3 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): add e2e for cypress
parent
ecd429b9
No related merge requests found
Pipeline
#74218664
passed with stage
in 6 minutes and 19 seconds
Changes
8
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
352 additions
and
330 deletions
+352
-330
.gitlab-ci.yml
.gitlab-ci.yml
+220
-205
blogs.spec.js
cypress/integration/blogs.spec.js
+2
-2
discovery.spec.js
cypress/integration/discovery.spec.js
+0
-1
groups.spec.js
cypress/integration/groups.spec.js
+6
-5
login.spec.js
cypress/integration/login.spec.js
+2
-2
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+8
-113
topbar.spec.js
cypress/integration/topbar.spec.js
+105
-0
commands.js
cypress/support/commands.js
+9
-2
No files found.
.gitlab-ci.yml
View file @
e14475ec
This diff is collapsed.
Click to expand it.
cypress/integration/blogs.spec.js
View file @
e14475ec
...
...
@@ -46,7 +46,7 @@ context('Blogs', () => {
// click on hashtags dropdown
cy
.
get
(
'
.m-category-info m-hashtags-selector .m-dropdown--label-container
'
).
click
();
// select #ART
cy
.
get
(
'
.m-category-info m-dropdown m-form-tags-input > div
:nth-child(1)
> span
'
).
contains
(
'
#art
'
).
click
();
cy
.
get
(
'
.m-category-info m-dropdown m-form-tags-input > div > span
'
).
contains
(
'
#art
'
).
click
();
// type in another hashtag manually
cy
.
get
(
'
.m-category-info m-hashtags-selector m-form-tags-input input
'
).
type
(
'
hashtag{enter}
'
).
click
();
...
...
@@ -88,7 +88,7 @@ context('Blogs', () => {
//open dropdown
cy
.
get
(
'
m-post-menu button.minds-more
'
).
click
();
cy
.
get
(
'
m-post-menu ul.minds-dropdown-menu li
:nth-child(3)
'
).
contains
(
'
Delete
'
).
click
();
cy
.
get
(
'
m-post-menu ul.minds-dropdown-menu li
'
).
contains
(
'
Delete
'
).
click
();
cy
.
get
(
'
m-post-menu m-modal-confirm .mdl-button--colored
'
).
click
();
})
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/discovery.spec.js
View file @
e14475ec
...
...
@@ -57,7 +57,6 @@ context('Discovery', () => {
.
click
()
.
should
(
'
have.css
'
,
'
color
'
,
'
rgb(70, 144, 223)
'
);
// selected color
cy
.
get
(
'
.m-newsfeed__entity .m-owner-block a > span:nth-child(1)
'
);
cy
.
url
().
should
(
'
include
'
,
'
/latest
'
);
});
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/groups.spec.js
View file @
e14475ec
context
(
'
Groups
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
login
(
true
);
cy
.
wait
(
1000
);
})
it
(
'
should create and edit a group
'
,
()
=>
{
...
...
@@ -20,7 +21,7 @@ context('Groups', () => {
// click on hashtags dropdown
cy
.
get
(
'
m-hashtags-selector .m-dropdown--label-container
'
).
click
();
// select #ART
cy
.
get
(
'
m-hashtags-selector m-dropdown m-form-tags-input > div
:nth-child(1)
> span
'
).
contains
(
'
#art
'
).
click
();
cy
.
get
(
'
m-hashtags-selector m-dropdown m-form-tags-input > div > span
'
).
contains
(
'
#art
'
).
click
();
// type in another hashtag manually
cy
.
get
(
'
m-hashtags-selector m-form-tags-input input
'
).
type
(
'
hashtag{enter}
'
).
click
();
// click away
...
...
@@ -54,9 +55,9 @@ context('Groups', () => {
})
it
(
'
should be able to toggle conversation and comment on it
'
,
()
=>
{
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(2)
'
).
contains
(
'
test group
'
).
click
();
cy
.
wait
(
1000
);
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(3)
'
).
contains
(
'
test group
'
).
click
();
// toggle the conversation
cy
.
get
(
'
.m-groupGrid__right
'
).
should
(
'
be.visible
'
);
...
...
@@ -88,7 +89,7 @@ context('Groups', () => {
})
it
(
'
should post an activity inside the group and record the view when scrolling
'
,
()
=>
{
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(
2
)
'
).
contains
(
'
test group
'
).
click
();
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(
3
)
'
).
contains
(
'
test group
'
).
click
();
cy
.
wait
(
1000
);
...
...
@@ -122,7 +123,7 @@ context('Groups', () => {
});
it
(
'
should delete a group
'
,
()
=>
{
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(
2
)
'
).
contains
(
'
test group
'
).
click
();
cy
.
get
(
'
m-group--sidebar-markers li:nth-child(
3
)
'
).
contains
(
'
test group
'
).
click
();
cy
.
wait
(
1000
);
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/login.spec.js
View file @
e14475ec
...
...
@@ -4,7 +4,7 @@ context('Login', () => {
})
it
(
'
should login
'
,
()
=>
{
cy
.
get
(
'
.m-
btn--login
'
).
click
();
cy
.
get
(
'
.m-
v2-topbar__Container__LoginWrapper > a
'
).
click
();
cy
.
location
(
'
pathname
'
).
should
(
'
eq
'
,
'
/login
'
);
...
...
@@ -21,7 +21,7 @@ context('Login', () => {
})
it
(
'
should fail to login because of incorrect password
'
,
()
=>
{
cy
.
get
(
'
.m-
btn--login
'
).
click
();
cy
.
get
(
'
.m-
v2-topbar__Container__LoginWrapper > a
'
).
click
();
cy
.
location
(
'
pathname
'
).
should
(
'
eq
'
,
'
/login
'
);
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/newsfeed.spec.js
View file @
e14475ec
...
...
@@ -4,6 +4,7 @@ context('Newsfeed', () => {
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
'
);
...
...
@@ -13,7 +14,7 @@ context('Newsfeed', () => {
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector .m-dropdown--label-container
'
).
click
();
// select #ART
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector m-dropdown m-form-tags-input > div
:nth-child(1)
> span
'
).
contains
(
'
#art
'
).
click
();
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector m-dropdown m-form-tags-input > div > span
'
).
contains
(
'
#art
'
).
click
();
// type in another hashtag manually
cy
.
get
(
'
minds-newsfeed-poster m-hashtags-selector m-form-tags-input input
'
).
type
(
'
hashtag{enter}
'
).
click
();
...
...
@@ -127,10 +128,10 @@ context('Newsfeed', () => {
})
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
'
)
cy
.
get
(
'
.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:
nth-child(2)
span
'
)
.
contains
(
'
Upgrade to Plus
'
);
cy
.
get
(
'
.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:
first-child
'
).
should
(
'
have.attr
'
,
'
href
'
,
'
/plus
'
)
cy
.
get
(
'
.m-page--sidebar--navigation a.m-page--sidebar--navigation--item:
nth-child(2)
'
).
should
(
'
have.attr
'
,
'
href
'
,
'
/plus
'
)
.
click
();
cy
.
location
(
'
pathname
'
).
should
(
'
eq
'
,
'
/plus
'
);
...
...
@@ -155,7 +156,7 @@ context('Newsfeed', () => {
})
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
'
);
cy
.
get
(
'
minds-newsfeed-poster textarea
'
).
type
(
'
thegreatmigration
'
);
// TODO: fix UX issue when hashtag element is overlapping input
const
stub
=
cy
.
stub
();
cy
.
on
(
'
window:confirm
'
,
stub
);
...
...
@@ -167,7 +168,7 @@ context('Newsfeed', () => {
cy
.
location
(
'
pathname
'
).
should
(
'
eq
'
,
'
/blog/edit/new
'
);
cy
.
get
(
'
m-inline-editor .medium-editor-element.medium-editor-insert-plugin p
'
).
contains
(
'
#
thegreatmigration
'
);
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
'
,
()
=>
{
...
...
@@ -182,6 +183,8 @@ context('Newsfeed', () => {
cy
.
scrollTo
(
0
,
'
20px
'
);
cy
.
wait
(
600
);
cy
.
wait
(
'
@view
'
,
{
requestTimeout
:
2000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
).
to
.
deep
.
equal
({
status
:
'
success
'
});
...
...
@@ -201,112 +204,4 @@ context('Newsfeed', () => {
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/integration/topbar.spec.js
0 → 100644
View file @
e14475ec
context
(
'
Newsfeed
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
login
(
true
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
5000
}).
should
(
'
eq
'
,
'
/newsfeed/subscriptions
'
);
})
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
'
)
.
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
'
)
.
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
'
)
.
contains
(
'
Boost Console
'
)
.
click
();
// TOFIX: no boost redirects to create
// 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
'
)
.
contains
(
'
Help Desk
'
)
.
click
();
cy
.
location
(
'
pathname
'
).
should
(
'
eq
'
,
'
/help
'
);
})
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
'
)
.
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
'
)
.
contains
(
'
Dark Mode
'
)
.
click
();
cy
.
get
(
'
body.m-theme__dark
'
).
should
(
'
be.visible
'
);
cy
.
get
(
'
m-user-menu .m-user-menu__Dropdown li
'
)
.
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 @
e14475ec
...
...
@@ -24,7 +24,14 @@
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
// Staging requires cookie to be set
Cypress
.
Cookies
.
defaults
({
whitelist
:
'
staging
'
});
Cypress
.
Commands
.
add
(
'
login
'
,
(
canary
)
=>
{
cy
.
setCookie
(
'
staging
'
,
"
1
"
);
// Run in stagin mode. Note: does not impact review sites
cy
.
visit
(
'
/login
'
);
cy
.
get
(
'
.m-btn--login
'
).
click
();
...
...
@@ -39,7 +46,7 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
cy
.
get
(
selector
).
then
((
subject
)
=>
{
cy
.
fixture
(
fileName
,
'
base64
'
).
then
((
content
)
=>
{
const
el
=
subject
[
0
];
const
blob
=
cy
.
visit
(
'
/newsfeed/global/top
'
);
b64toBlob
(
content
,
type
);
const
blob
=
b64toBlob
(
content
,
type
);
cy
.
window
().
then
((
win
)
=>
{
const
testFile
=
new
win
.
File
([
blob
],
fileName
,
{
type
});
const
dataTransfer
=
new
DataTransfer
();
...
...
@@ -53,7 +60,7 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
});
Cypress
.
Commands
.
add
(
'
post
'
,
(
message
)
=>
{
cy
.
get
(
'
m
wl-text-input
-autocomplete-container textarea
'
).
type
(
message
);
cy
.
get
(
'
m
-text-input-
-autocomplete-container textarea
'
).
type
(
message
);
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
});
...
...
This diff is collapsed.
Click to expand it.
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