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
871
Issues
871
List
Boards
Labels
Service Desk
Milestones
Merge Requests
55
Merge Requests
55
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
a3357f1a
Commit
a3357f1a
authored
1 hour ago
by
Brian Hatchet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests up to groups
parent
851177c8
feat/closed-channels-602
1 merge request
!499
Feat/closed channels 602
Pipeline
#77420589
passed with stages
in 45 minutes and 52 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
86 additions
and
70 deletions
+86
-70
blogs.spec.js
cypress/integration/blogs.spec.js
+6
-1
boost-console.spec.js
cypress/integration/boost/boost-console.spec.js
+2
-1
boost-impressions.spec.js
cypress/integration/boost/boost-impressions.spec.js
+5
-1
channel.spec.js
cypress/integration/channel/channel.spec.js
+6
-2
comment-threads.spec.js
cypress/integration/comment-threads.spec.js
+49
-54
discovery.spec.js
cypress/integration/discovery.spec.js
+5
-1
commands.js
cypress/support/commands.js
+12
-7
index.js
cypress/support/index.js
+1
-3
No files found.
cypress/integration/blogs.spec.js
View file @
a3357f1a
...
...
@@ -2,14 +2,19 @@
context
(
'
Blogs
'
,
()
=>
{
before
(()
=>
{
cy
.
clearCookies
();
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
return
cy
.
login
(
true
);
}
});
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
});
it
(
'
should not be able to create a new blog if no title or banner are specified
'
,
()
=>
{
cy
.
visit
(
'
/blog/edit/new
'
);
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/boost/boost-console.spec.js
View file @
a3357f1a
...
...
@@ -5,13 +5,14 @@ context('Boost Console', () => {
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
return
cy
.
login
(
true
);
}
});
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
cy
.
visit
(
'
/newsfeed/subscribed
'
);
newBoost
(
postContent
,
100
);
});
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/boost/boost-impressions.spec.js
View file @
a3357f1a
...
...
@@ -4,7 +4,7 @@ context('Boost Impressions', () => {
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
return
cy
.
login
(
true
);
}
});
cy
.
visit
(
'
/newsfeed/subscriptions
'
);
...
...
@@ -12,6 +12,10 @@ context('Boost Impressions', () => {
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
});
it
(
'
should register views on scroll
'
,
()
=>
{
//stub endpoint
cy
.
server
();
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/channel/channel.spec.js
View file @
a3357f1a
...
...
@@ -3,11 +3,15 @@ context('Channel', () => {
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
return
cy
.
login
(
true
);
}
});
cy
.
visit
(
`/
${
Cypress
.
env
().
username
}
`
);
})
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
});
it
(
'
should change channel mode to public
'
,
()
=>
{
cy
.
get
(
'
.m-channel-mode-selector--dropdown
'
)
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/comment-threads.spec.js
View file @
a3357f1a
/**
* @author Ben Hayward
* @author Ben Hayward
* @create date 2019-08-09 14:42:51
* @modify date 2019-08-09 14:42:51
* @desc Spec tests for comment threads.
...
...
@@ -12,25 +12,19 @@ context('Comment Threads', () => {
3
:
'
test tier 3
'
,
};
const
hamburgerMenu
=
'
.m-v2-topbar__UserMenu > m-user-menu > div.m-user-menu.m-dropdown > a
'
;
const
logoutButton
=
'
.m-user-menu.m-dropdown > ul > li:nth-child(11) > a
'
;
const
postMenu
=
'
minds-activity:nth-child(2) > div > m-post-menu > button > i
'
;
const
deletePostOption
=
'
minds-activity:nth-child(2) m-post-menu > ul > li:nth-child(4)
'
;
const
deletePostButton
=
'
m-modal-confirm div:nth-child(1) > div > button.mdl-button--colored
'
;
const
postMenu
=
'
minds-activity:first > div > m-post-menu > button > i
'
;
const
deletePostOption
=
"
m-post-menu > ul > li:visible:contains('Delete')
"
;
const
deletePostButton
=
"
.m-modal-confirm-buttons > button:contains('Delete')
"
;
const
channelButton
=
'
.m-v2-topbar__Top > div > a > minds-avatar > div
'
;
const
postCommentButton
=
'
m-comment__poster > div > div.minds-body > div > div > a.m-post-button
'
;
const
thumbsUpButtons
=
'
.m-comment__toolbar minds-button-thumbs-up
'
;
const
thumbsDownButtons
=
'
.m-comment__toolbar minds-button-thumbs-down
'
;
const
thumbsUpCounters
=
'
.m-comment__toolbar > div > minds-button-thumbs-up > a > span
'
;
const
thumbsDownCounters
=
'
.m-comment__toolbar > div > minds-button-thumbs-down > a > span
'
;
// pass in tier / tree depth.
const
replyButton
=
(
index
)
=>
`minds-activity:nth-child(
${
index
}
)
.m-comment__toolbar > div > span`
;
const
commentButton
=
(
index
)
=>
`minds-activity:nth-child(
${
index
}
)
minds-button-comment`
;
const
commentInput
=
(
index
)
=>
`minds-activity:nth-child(
${
index
}
)
m-text-input--autocomplete-container > minds-textarea > div`
;
const
commentContent
=
(
index
)
=>
`minds-activity:nth-child(
${
index
}
)
m-comments__tree .m-comment__bubble > p`
;
const
replyButton
=
`minds-activity:first
.m-comment__toolbar > div > span`
;
const
commentButton
=
`minds-activity:first
minds-button-comment`
;
const
commentInput
=
`minds-activity:first
m-text-input--autocomplete-container > minds-textarea > div`
;
const
commentContent
=
`minds-activity:first
m-comments__tree .m-comment__bubble > p`
;
before
(()
=>
{
//make a post new.
...
...
@@ -46,61 +40,62 @@ context('Comment Threads', () => {
.
should
(
'
eq
'
,
`/newsfeed/subscriptions`
);
cy
.
post
(
'
test post
'
);
cy
.
get
(
commentButton
(
1
)).
click
(
);
}
);
beforeEach
(()
=>
{
cy
.
preserveCookies
();
});
/*
after(() => {
after
(()
=>
{
//delete the post
cy.wait(1000);
cy
.
get
(
postMenu
).
click
();
cy
.
get
(
deletePostOption
).
click
();
cy
.
get
(
deletePostButton
).
click
();
});*/
it
(
'
should allow a user to post a tier 1 comment
'
,
()
=>
{
cy
.
get
(
commentInput
(
1
)).
type
(
testMessage
[
1
]);
cy
.
get
(
postCommentButton
).
click
();
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
1
]);
});
it
(
'
should allow a user to post a tier 2 comment
'
,
()
=>
{
//expand top comment, then top reply button.
cy
.
get
(
replyButton
(
1
)).
click
();
cy
.
get
(
commentInput
(
1
)).
first
().
type
(
testMessage
[
2
]);
cy
.
get
(
postCommentButton
).
first
().
click
();
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
2
]);
});
it
(
'
should post three tiers of comments
'
,
()
=>
{
//Reveal the conversation
cy
.
get
(
commentButton
).
click
();
it
(
'
should allow a user to post a tier 3 comment
'
,
()
=>
{
cy
.
get
(
'
minds-activity:nth-child(1)
'
)
.
find
(
'
m-comments__tree m-comments__thread m-comment
'
)
.
find
(
'
m-comments__thread m-comment:nth-child(2) .m-comment__toolbar > div > span
'
).
last
().
click
(
);
//Add the first level of comments
cy
.
get
(
commentInput
).
type
(
testMessage
[
1
]);
cy
.
get
(
postCommentButton
).
click
();
cy
.
get
(
commentContent
).
contains
(
testMessage
[
1
]
);
//expand top comment, then top reply button.
// cy.get(replyButton(1)).click();
cy
.
wait
(
1000
);
//Add the second level of comments
cy
.
get
(
replyButton
).
click
();
cy
.
get
(
commentInput
)
.
first
()
.
type
(
testMessage
[
2
]);
cy
.
get
(
postCommentButton
)
.
first
()
.
click
();
cy
.
get
(
commentContent
).
contains
(
testMessage
[
2
])
//check the comments.
cy
.
get
(
commentInput
(
1
)).
first
().
type
(
testMessage
[
3
]);
cy
.
get
(
postCommentButton
).
first
().
click
();
cy
.
get
(
commentContent
(
1
)).
contains
(
testMessage
[
3
]);
});
it
(
'
should allow the user to vote up and down comments
'
,
()
=>
{
//expand top comment, then top reply button.
cy
.
get
(
replyButton
(
1
)).
click
();
cy
.
wait
(
1000
);
//Add the third level of comments
cy
.
get
(
'
minds-activity:first
'
)
.
find
(
'
m-comments__tree m-comments__thread m-comment
'
)
.
find
(
'
m-comments__thread m-comment:nth-child(2) .m-comment__toolbar > div > span
'
)
.
last
()
.
click
();
cy
.
get
(
commentInput
)
.
first
()
.
type
(
testMessage
[
3
]);
cy
.
get
(
postCommentButton
)
.
first
()
.
click
();
cy
.
get
(
commentContent
).
contains
(
testMessage
[
3
]);
//there are two reply buttons now, use the last one.
cy
.
get
(
replyButton
(
1
)).
last
().
click
();
cy
.
wait
(
1000
);
//click thumbs up and down
cy
.
get
(
thumbsDownButtons
).
click
({
multiple
:
true
});
cy
.
get
(
thumbsUpButtons
).
click
({
multiple
:
true
});
cy
.
get
(
'
.m-comment__toolbar
'
)
.
find
(
'
minds-button-thumbs-up
'
)
.
click
({
multiple
:
true
});
cy
.
get
(
'
.m-comment__toolbar
'
)
.
find
(
'
minds-button-thumbs-down
'
)
.
click
({
multiple
:
true
});
// check the values
cy
.
get
(
thumbsUpCounters
)
...
...
This diff is collapsed.
Click to expand it.
cypress/integration/discovery.spec.js
View file @
a3357f1a
...
...
@@ -3,12 +3,16 @@ context('Discovery', () => {
cy
.
getCookie
(
'
minds_sess
'
)
.
then
((
sessionCookie
)
=>
{
if
(
sessionCookie
===
null
)
{
cy
.
login
(
true
);
return
cy
.
login
(
true
);
}
});
cy
.
visit
(
'
/newsfeed/global/top
'
);
});
beforeEach
(()
=>
{
cy
.
preserveCookies
();
});
it
(
'
should allow a user to post on the discovery page
'
,
()
=>
{
cy
.
post
(
"
test!!
"
);
});
...
...
This diff is collapsed.
Click to expand it.
cypress/support/commands.js
View file @
a3357f1a
...
...
@@ -24,22 +24,27 @@
// -- 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
();
cy
.
server
();
cy
.
route
(
"
POST
"
,
"
/api/v1/authenticate
"
).
as
(
"
postLogin
"
);
cy
.
get
(
'
minds-form-login .m-login-box .mdl-cell:first-child input
'
).
type
(
Cypress
.
env
().
username
);
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
();
cy
.
wait
(
'
@postLogin
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
expect
(
xhr
.
response
.
body
.
status
).
to
.
equal
(
'
success
'
);
});
});
Cypress
.
Commands
.
add
(
'
preserveCookies
'
,
()
=>
{
Cypress
.
Cookies
.
preserveOnce
(
'
staging
'
,
'
minds_sess
'
,
'
mwa
'
,
'
XSRF-TOKEN
'
);
});
Cypress
.
Commands
.
add
(
'
uploadFile
'
,
(
selector
,
fileName
,
type
=
''
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
cypress/support/index.js
View file @
a3357f1a
...
...
@@ -19,6 +19,4 @@ import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')
Cypress
.
Cookies
.
defaults
({
whitelist
:
[
'
minds_sess
'
,
'
mwa
'
,
'
XSRF-TOKEN
'
]
})
Cypress
.
Cookies
.
debug
(
true
);
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