Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Håvard Farestveit
tdt4242-base
Commits
141510b0
Commit
141510b0
authored
Mar 08, 2021
by
Håvard Farestveit
Browse files
Refactored boundary test for user registration
Refactored boundary tests
parent
36d70178
Pipeline
#114759
failed with stage
in 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
frontend/cypress/integration/boundary_test_user_registration.js
View file @
141510b0
...
...
@@ -119,63 +119,63 @@ describe("Register new user", () => {
cy
.
get
(
"
.alert
"
).
contains
(
"
Registration failed!
"
);
});
it
(
"
Checking for boundary error wi
th country
"
,
()
=>
{
it
(
"
Valid max leng
th country
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
cy
.
get
(
'
input[name="email"]
'
).
type
(
"
test@mail.it
"
);
cy
.
get
(
'
input[name="password"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="password1"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="country"]
'
).
type
(
"
x
"
.
repeat
(
5
1
));
cy
.
get
(
'
input[name="country"]
'
).
type
(
"
x
"
.
repeat
(
5
0
));
cy
.
get
(
'
input[name="city"]
'
).
type
(
"
Testheim
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
Testing street
"
);
});
cy
.
get
(
"
#btn-create-account
"
).
click
();
cy
.
contains
(
"
Registration failed!
"
);
cy
.
url
().
should
(
"
include
"
,
"
/workouts.html
"
);
});
it
(
"
Checking for boundry error with street
"
,
()
=>
{
it
(
"
Too long country
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
cy
.
get
(
'
input[name="email"]
'
).
type
(
"
test@mail.it
"
);
cy
.
get
(
'
input[name="password"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="password1"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
x
"
.
repeat
(
51
));
cy
.
get
(
'
input[name="country"]
'
).
type
(
"
x
"
.
repeat
(
51
));
cy
.
get
(
'
input[name="city"]
'
).
type
(
"
Testheim
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
Testing street
"
);
});
cy
.
get
(
"
#btn-create-account
"
).
click
();
cy
.
contains
(
"
Registration failed!
"
);
});
it
(
"
Checking for m
ax len
g
th
boundary for country
"
,
()
=>
{
it
(
"
Valid M
ax lenth
street
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
cy
.
get
(
'
input[name="email"]
'
).
type
(
"
test@mail.it
"
);
cy
.
get
(
'
input[name="password"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="password1"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="country"]
'
).
type
(
"
x
"
.
repeat
(
50
));
cy
.
get
(
'
input[name="city"]
'
).
type
(
"
Testheim
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
Testing street
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
x
"
.
repeat
(
50
));
});
cy
.
get
(
"
#btn-create-account
"
).
click
();
cy
.
contains
(
"
View W
orkouts
"
);
cy
.
url
().
should
(
"
include
"
,
"
/w
orkouts
.html
"
);
});
it
(
"
Checking for max boundary with
street
"
,
()
=>
{
it
(
"
Too long
street
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
cy
.
get
(
'
input[name="email"]
'
).
type
(
"
test@mail.it
"
);
cy
.
get
(
'
input[name="password"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="password1"]
'
).
type
(
"
123456789
"
);
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
x
"
.
repeat
(
5
0
));
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
x
"
.
repeat
(
5
1
));
});
cy
.
get
(
"
#btn-create-account
"
).
click
();
cy
.
contains
(
"
View Workouts
"
);
cy
.
contains
(
"
Registration failed!
"
);
});
it
(
"
Checking for boundry error with
phone number
"
,
()
=>
{
it
(
"
Too long
phone number
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
...
...
@@ -188,7 +188,7 @@ describe("Register new user", () => {
cy
.
contains
(
"
Registration failed!
"
);
});
it
(
"
Checking for max length boundary wi
th phone number
"
,
()
=>
{
it
(
"
Valid max leng
th phone number
"
,
()
=>
{
cy
.
register
();
cy
.
get
(
"
#form-register-user
"
).
within
((
$form
)
=>
{
cy
.
get
(
'
input[name="username"]
'
).
type
(
"
testUser
"
+
Date
.
now
());
...
...
@@ -198,6 +198,6 @@ describe("Register new user", () => {
cy
.
get
(
'
input[name="street_address"]
'
).
type
(
"
x
"
.
repeat
(
50
));
});
cy
.
get
(
"
#btn-create-account
"
).
click
();
cy
.
contains
(
"
View W
orkouts
"
);
cy
.
url
().
should
(
"
include
"
,
"
/w
orkouts
.html
"
);
});
});
Write
Preview
Supports
Markdown
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