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
845
Issues
845
List
Boards
Labels
Service Desk
Milestones
Merge Requests
46
Merge Requests
46
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
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
e3b7e2a9
Commit
e3b7e2a9
authored
1 hour ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added data attributes.
parent
bbd3d77a
feat/registration-e2e-1638
1 merge request
!483
[Sprint/KiltedKoala](feat): Added e2e test for registration
Pipeline
#82022599
passed with stages
in 49 minutes and 53 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
30 deletions
+68
-30
registration.spec.js
cypress/integration/registration.spec.js
+67
-30
register.html
src/app/modules/forms/register/register.html
+1
-0
No files found.
cypress/integration/registration.spec.js
View file @
e3b7e2a9
import
generateRandomId
from
'
../support/utilities
'
;
context
(
'
Registration
'
,
()
=>
{
const
username
=
Math
.
random
().
toString
(
36
).
replace
(
'
0.
'
,
''
);
const
username
=
generateRandomId
();
const
password
=
`
${
generateRandomId
()}
0oA!`
;
const
email
=
'
test@minds.com
'
;
const
password
=
`
${
Math
.
random
().
toString
(
36
).
replace
(
'
0.
'
,
''
)}
0oA!`
;
const
noSymbolPass
=
'
Passw0rd
'
;
const
welcomeText
=
"
Welcome to Minds!
"
;
...
...
@@ -13,12 +15,8 @@ context('Registration', () => {
const
emailField
=
'
minds-form-register #email
'
;
const
passwordField
=
'
minds-form-register #password
'
;
const
password2Field
=
'
minds-form-register #password2
'
;
const
checkbox
=
'
minds-form-register label:nth-child(2) .mdl-ripple--center
'
;
const
checkbox
=
'
[data-cy=data-minds-accept-tos-input]
'
;
const
submitButton
=
'
minds-form-register .mdl-card__actions button
'
;
const
errorContainer
=
'
div:nth-child(2) > minds-form-register > div > div
'
;
before
(()
=>
{
});
beforeEach
(()
=>
{
cy
.
visit
(
'
/login
'
);
...
...
@@ -36,60 +34,99 @@ context('Registration', () => {
it
(
'
should allow a user to register
'
,
()
=>
{
//type values
cy
.
get
(
usernameField
).
focus
().
type
(
username
);
cy
.
get
(
emailField
).
focus
().
type
(
email
);
cy
.
get
(
passwordField
).
focus
().
type
(
password
);
cy
.
get
(
usernameField
)
.
focus
()
.
type
(
username
);
cy
.
get
(
emailField
)
.
focus
()
.
type
(
email
);
cy
.
get
(
passwordField
)
.
focus
()
.
type
(
password
);
cy
.
wait
(
500
);
cy
.
get
(
password2Field
).
focus
().
type
(
password
);
cy
.
get
(
checkbox
).
click
();
cy
.
get
(
password2Field
)
.
focus
()
.
type
(
password
);
cy
.
get
(
checkbox
)
.
click
({
force
:
true
});
//submit
cy
.
get
(
submitButton
).
click
()
cy
.
get
(
submitButton
)
.
click
()
.
wait
(
'
@register
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
//onboarding modal shown
cy
.
get
(
'
m-onboarding--topics > div > h2:nth-child(1)
'
)
.
contains
(
welcomeText
);
cy
.
contains
(
welcomeText
);
});
it
(
'
should display an error if password is invalid
'
,
()
=>
{
cy
.
get
(
usernameField
).
focus
().
type
(
Math
.
random
().
toString
(
36
).
replace
(
'
0.
'
,
''
));
cy
.
get
(
emailField
).
focus
().
type
(
email
);
cy
.
get
(
passwordField
).
focus
().
type
(
noSymbolPass
);
cy
.
get
(
usernameField
)
.
focus
()
.
type
(
generateRandomId
());
cy
.
get
(
emailField
)
.
focus
()
.
type
(
email
);
cy
.
get
(
passwordField
)
.
focus
()
.
type
(
noSymbolPass
);
cy
.
wait
(
500
);
cy
.
get
(
password2Field
).
focus
().
type
(
noSymbolPass
);
cy
.
get
(
checkbox
).
click
();
cy
.
get
(
password2Field
)
.
focus
()
.
type
(
noSymbolPass
);
cy
.
get
(
checkbox
)
.
click
({
force
:
true
});
//submit
cy
.
get
(
submitButton
).
click
()
cy
.
get
(
submitButton
)
.
click
()
.
wait
(
'
@register
'
).
then
((
xhr
)
=>
{
expect
(
xhr
.
status
).
to
.
equal
(
200
);
});
cy
.
scrollTo
(
'
top
'
);
cy
.
get
(
errorContainer
)
.
contains
(
passwordInvalid
);
cy
.
contains
(
passwordInvalid
);
});
it
(
'
should display an error if passwords do not match
'
,
()
=>
{
cy
.
get
(
usernameField
).
focus
().
type
(
Math
.
random
().
toString
(
36
).
replace
(
'
0.
'
,
''
));
cy
.
get
(
emailField
).
focus
().
type
(
email
);
cy
.
get
(
'
minds-form-register #password
'
).
focus
().
type
(
password
);
cy
.
get
(
usernameField
)
.
focus
()
.
type
(
generateRandomId
());
cy
.
get
(
emailField
)
.
focus
()
.
type
(
email
);
cy
.
get
(
'
minds-form-register #password
'
)
.
focus
()
.
type
(
password
);
cy
.
wait
(
500
);
cy
.
get
(
password2Field
).
focus
().
type
(
password
+
'
!
'
);
cy
.
get
(
checkbox
).
click
();
cy
.
get
(
password2Field
)
.
focus
()
.
type
(
password
+
'
!
'
);
cy
.
get
(
checkbox
)
.
click
({
force
:
true
});
//submit
cy
.
get
(
submitButton
).
click
();
cy
.
scrollTo
(
'
top
'
);
cy
.
get
(
errorContainer
)
.
contains
(
passwordDontMatch
);
cy
.
contains
(
passwordDontMatch
);
});
})
This diff is collapsed.
Click to expand it.
src/app/modules/forms/register/register.html
View file @
e3b7e2a9
...
...
@@ -125,6 +125,7 @@
type=
"checkbox"
class=
"mdl-checkbox__input"
formControlName=
"tos"
data-cy=
"data-minds-accept-tos-input"
/>
<span
...
...
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