Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
876
Issues
876
List
Boards
Labels
Service Desk
Milestones
Merge Requests
51
Merge Requests
51
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
b3966e9f
Commit
b3966e9f
authored
1 hour ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat) e2e tests for scheduled activities
parent
ac65702a
epic/post-scheduler
1 merge request
!494
WIP: epic/post-scheduler
Pipeline
#78418806
passed with stages
in 31 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
158 additions
and
1 deletion
+158
-1
blogs.spec.js
cypress/integration/blogs.spec.js
+104
-1
newsfeed.spec.js
cypress/integration/newsfeed.spec.js
+54
-0
No files found.
cypress/integration/blogs.spec.js
View file @
b3966e9f
...
...
@@ -50,6 +50,8 @@ context('Blogs', () => {
cy
.
get
(
'
.m-button--submit
'
).
click
({
force
:
true
});
// TODO: Investigate why disabled flag is being detected
cy
.
wait
(
1000
);
cy
.
get
(
'
h1.m-blog--edit--error
'
).
contains
(
'
Error: Please ensure your channel has an avatar before creating a blog
'
);
});
...
...
@@ -131,6 +133,107 @@ context('Blogs', () => {
cy
.
get
(
'
m-post-menu button.minds-more
'
).
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
();
});
})
it
(
'
should be able to create a new scheduled blog
'
,
()
=>
{
// upload avatar first
cy
.
visit
(
`/
${
Cypress
.
env
().
username
}
`
);
cy
.
get
(
'
.m-channel--name .minds-button-edit button:first-child
'
).
click
();
cy
.
wait
(
100
);
cy
.
uploadFile
(
'
.minds-avatar input[type=file]
'
,
'
../fixtures/avatar.jpeg
'
,
'
image/jpg
'
);
cy
.
get
(
'
.m-channel--name .minds-button-edit button:last-child
'
).
click
();
// create blog
cy
.
visit
(
'
/blog/edit/new
'
);
cy
.
uploadFile
(
'
minds-banner #file
'
,
'
../fixtures/international-space-station-1776401_1920.jpg
'
,
'
image/jpg
'
);
cy
.
get
(
'
minds-textarea .m-editor
'
).
type
(
'
Title
'
);
cy
.
get
(
'
m-inline-editor .medium-editor-element
'
).
type
(
'
Content
\n
'
);
// click on plus button
cy
.
get
(
'
.medium-editor-element > .medium-insert-buttons > button.medium-insert-buttons-show
'
).
click
();
// click on camera
cy
.
get
(
'
ul.medium-insert-buttons-addons > li > button.medium-insert-action:first-child
'
).
contains
(
'
photo_camera
'
).
click
();
// upload the image
cy
.
uploadFile
(
'
.medium-media-file-input
'
,
'
../fixtures/international-space-station-1776401_1920.jpg
'
,
'
image/jpg
'
);
// open license dropdown & select first license
cy
.
get
(
'
.m-license-info select
'
).
select
(
'
All rights reserved
'
);
// 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 > 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
();
// click away
cy
.
get
(
'
.m-category-info m-hashtags-selector .minds-bg-overlay
'
).
click
();
// select visibility
cy
.
get
(
'
.m-visibility-info select
'
).
select
(
'
Loggedin
'
);
// open metadata form
cy
.
get
(
'
.m-blog-edit--toggle-wrapper .m-blog-edit--toggle
'
).
contains
(
'
Metadata
'
).
click
();
// set url slug
cy
.
get
(
'
.m-blog-edit--field input[name=slug]
'
).
type
(
'
123
'
);
// set meta title
cy
.
get
(
'
.m-blog-edit--field input[name=custom_meta_title]
'
).
type
(
'
Test
'
);
// set meta description
cy
.
get
(
'
.m-blog-edit--field textarea[name=custom_meta_description]
'
).
type
(
'
This is a test blog
'
);
// set meta author
cy
.
get
(
'
.m-blog-edit--field input[name=custom_meta_author]
'
).
type
(
'
Minds Test
'
);
// set as nsfw
cy
.
get
(
'
.m-mature-info a
'
).
click
();
cy
.
get
(
'
.m-mature-info a span
'
).
contains
(
'
Mature content
'
);
// set scheduled date
cy
.
get
(
'
.m-poster-date-selector--input
'
).
click
();
cy
.
get
(
'
td.c-datepicker__day-body.c-datepicker__day--selected + td
'
).
click
();
cy
.
get
(
'
a.c-btn.c-btn--flat.js-ok
'
).
click
();
// get setted date to compare
let
scheduledDate
;
cy
.
get
(
'
div.m-poster-date-selector--input div.m-tooltip--bubble
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
scheduledDate
=
text
;
});
cy
.
wait
(
1000
);
cy
.
get
(
'
.m-button--submit
'
).
click
({
force
:
true
});
// TODO: Investigate why disabled flag is being detected
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
contains
'
,
`/
${
Cypress
.
env
().
username
}
/blog`
);
cy
.
get
(
'
.m-blog--title
'
).
contains
(
'
Title
'
);
cy
.
get
(
'
.minds-blog-body p
'
).
contains
(
'
Content
'
);
cy
.
get
(
'
.m-license-info span
'
).
contains
(
'
all-rights-reserved
'
);
cy
.
wait
(
1000
);
// compare setted date with time_created
cy
.
get
(
'
div.m-blog-container div.mdl-grid div.minds-body span
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
const
time_created
=
new
Date
(
text
).
getTime
();
scheduledDate
=
new
Date
(
scheduledDate
).
getTime
();
expect
(
scheduledDate
).
to
.
equal
(
time_created
);
});
// cleanup
//open dropdown
cy
.
get
(
'
m-post-menu button.minds-more
'
).
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/newsfeed.spec.js
View file @
b3966e9f
...
...
@@ -38,6 +38,60 @@ context('Newsfeed', () => {
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu m-modal-confirm .mdl-button--colored
'
).
click
();
})
it
(
'
should post an activity picking a scheduled date
'
,
()
=>
{
cy
.
get
(
'
minds-newsfeed-poster
'
).
should
(
'
be.visible
'
);
cy
.
get
(
'
minds-newsfeed-poster textarea
'
).
type
(
'
This is a post
'
);
// set scheduled date
cy
.
get
(
'
.m-poster-date-selector--input
'
).
click
();
cy
.
get
(
'
td.c-datepicker__day-body.c-datepicker__day--selected + td
'
).
click
();
cy
.
get
(
'
a.c-btn.c-btn--flat.js-ok
'
).
click
();
// get setted date to compare
let
scheduledDate
;
cy
.
get
(
'
div.m-poster-date-selector--input div.m-tooltip--bubble
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
scheduledDate
=
text
;
});
cy
.
get
(
'
.m-posterActionBar__PostButton
'
).
click
();
cy
.
wait
(
100
);
// compare setted date with time_created
cy
.
get
(
'
.minds-list > minds-activity:first-child div.mdl-card__supporting-text > div.body > a.permalink > span
'
)
.
invoke
(
'
text
'
).
then
((
text
)
=>
{
const
time_created
=
new
Date
(
text
).
getTime
();
scheduledDate
=
new
Date
(
scheduledDate
).
getTime
();
expect
(
scheduledDate
).
to
.
equal
(
time_created
);
});
// cleanup
cy
.
get
(
'
.minds-list > minds-activity:first-child m-post-menu .minds-more
'
).
click
();
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
(
'
should list scheduled activies
'
,
()
=>
{
cy
.
server
();
cy
.
route
(
"
GET
"
,
'
**/api/v2/feeds/scheduled/**/count?
'
).
as
(
"
scheduledCount
"
);
cy
.
route
(
"
GET
"
,
'
**/api/v2/feeds/scheduled/**/activities?**
'
).
as
(
"
scheduledActivities
"
);
cy
.
visit
(
`/
${
Cypress
.
env
().
username
}
`
);
cy
.
wait
(
'
@scheduledCount
'
,
{
requestTimeout
:
2000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
,
'
feeds/scheduled/**/count request status
'
);
});
cy
.
get
(
'
div.m-mindsListTools__scheduled
'
).
click
();
cy
.
wait
(
'
@scheduledActivities
'
,
{
requestTimeout
:
2000
}).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
,
'
feeds/scheduled/**/activities request status
'
);
});
})
it
(
'
should post an activity with an image attachment
'
,
()
=>
{
cy
.
get
(
'
minds-newsfeed-poster
'
).
should
(
'
be.visible
'
);
...
...
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