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
861
Issues
861
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
4dcd1920
Commit
4dcd1920
authored
23 hours ago
by
Marcelo Rivera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): blogs tests
parent
79c1eb43
fix/e2e-tests-issues
1 merge request
!489
WIP: (fix): e2e tests
Pipeline
#75638375
passed with stages
in 42 minutes and 54 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
blogs.spec.js
cypress/integration/blogs.spec.js
+13
-17
commands.js
cypress/support/commands.js
+3
-1
edit.html
src/app/modules/blogs/edit/edit.html
+1
-1
No files found.
cypress/integration/blogs.spec.js
View file @
4dcd1920
// import 'cypress-file-upload';
context
(
'
Blogs
'
,
()
=>
{
beforeEach
(()
=>
{
cy
.
login
(
true
);
...
...
@@ -24,7 +26,8 @@ context('Blogs', () => {
cy
.
get
(
'
.m-blog--edit--error
'
).
contains
(
'
Error: You must upload a banner
'
);
})
it
(
"
should not be able to create a new blog if the channel doesn't have an avatar
"
,
()
=>
{
// TODO: remove the x when we run tests in new users each time
xit
(
"
should not be able to create a new blog if the channel doesn't have an avatar
"
,
()
=>
{
cy
.
visit
(
'
/blog/edit/new
'
);
cy
.
uploadFile
(
'
minds-banner #file
'
,
'
../fixtures/international-space-station-1776401_1920.jpg
'
,
'
image/jpg
'
);
...
...
@@ -33,16 +36,6 @@ context('Blogs', () => {
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
'
);
cy
.
wait
(
1000
);
cy
.
server
();
...
...
@@ -69,18 +62,18 @@ context('Blogs', () => {
// create blog
cy
.
visit
(
'
/blog/edit/new
'
);
cy
.
uploadFile
(
'
minds-banner #file
'
,
'
../fixtures/international-space-station-1776401_1920.jpg
'
,
'
image/jpg
'
);
cy
.
uploadFile
(
'
.minds-banner input[type=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
();
//
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
();
//
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
'
);
//
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
'
);
...
...
@@ -113,9 +106,12 @@ context('Blogs', () => {
cy
.
get
(
'
.m-mature-info a
'
).
click
();
cy
.
get
(
'
.m-mature-info a span
'
).
contains
(
'
Mature content
'
);
cy
.
wait
(
1000
);
cy
.
get
(
'
.m-button--submit
'
).
click
({
force
:
true
});
// TODO: Investigate why disabled flag is being detected
cy
.
clock
();
cy
.
clock
().
then
((
clock
)
=>
{
clock
.
tick
(
1000
);
});
cy
.
wait
(
1000
);
cy
.
location
(
'
pathname
'
,
{
timeout
:
30000
})
.
should
(
'
contains
'
,
`/
${
Cypress
.
env
().
username
}
/blog`
);
...
...
This diff is collapsed.
Click to expand it.
cypress/support/commands.js
View file @
4dcd1920
...
...
@@ -53,10 +53,12 @@ Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
dataTransfer
.
items
.
add
(
testFile
);
el
.
files
=
dataTransfer
.
files
;
// return cy.wrap(subject).trigger('change', {force: true});
});
});
});
cy
.
get
(
selector
).
trigger
(
'
change
'
,
{
force
:
true
});
//
cy.get(selector).trigger('change', { force: true });
});
Cypress
.
Commands
.
add
(
'
post
'
,
(
message
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/blogs/edit/edit.html
View file @
4dcd1920
<header
*ngIf=
"blog"
>
<minds-banner
[object]=
"blog"
editMode
=
"true"
[editMode]
=
"true"
(added)=
"add_banner($event)"
[done]=
"banner_prompt"
></minds-banner>
...
...
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