Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
idatt2106_2024_03_frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Scrum_Team_3
idatt2106_2024_03_frontend
Commits
c7429a9a
Commit
c7429a9a
authored
11 months ago
by
Sverre Frogner Haugen
Browse files
Options
Downloads
Patches
Plain Diff
Wrote e2e test for login view
parent
7a107b4a
No related branches found
Branches containing commit
No related tags found
1 merge request
!71
Wrote e2e test for login view
Pipeline
#281287
passed
11 months ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cypress/e2e/LogIn.cy.ts
+26
-0
26 additions, 0 deletions
cypress/e2e/LogIn.cy.ts
src/views/FrontPage/LoginView.vue
+10
-4
10 additions, 4 deletions
src/views/FrontPage/LoginView.vue
with
36 additions
and
4 deletions
cypress/e2e/LogIn.cy.ts
0 → 100644
+
26
−
0
View file @
c7429a9a
describe
(
'
Login spec
'
,
()
=>
{
it
(
'
Can log in
'
,
()
=>
{
cy
.
visit
(
'
/login
'
)
cy
.
get
(
'
[data-testid="LogInButton"]
'
).
should
(
'
be.disabled
'
)
cy
.
get
(
'
[data-testid="NameInput"]
'
).
type
(
"
JohnSmith12
"
)
cy
.
get
(
'
[data-testid="NameInput"]
'
).
should
(
'
have.value
'
,
"
JohnSmith12
"
)
cy
.
get
(
'
[data-testid="LogInButton"]
'
).
should
(
'
be.disabled
'
)
cy
.
get
(
'
[data-testid="PasswordInput"]
'
).
type
(
"
password
"
)
cy
.
get
(
'
[data-testid="PasswordInput"]
'
).
should
(
'
have.value
'
,
"
password
"
)
cy
.
get
(
'
[data-testid="LogInButton"]
'
).
should
(
'
be.enabled
'
)
cy
.
get
(
'
[data-testid="LogInButton"]
'
).
click
()
cy
.
url
().
should
(
'
include
'
,
'
/homepage
'
)
})
it
(
'
Can navigate to new user
'
,
()
=>
{
cy
.
visit
(
'
/login
'
)
cy
.
get
(
'
[data-testid="NewUserLink"]
'
).
click
()
cy
.
url
().
should
(
'
include
'
,
'
/signup
'
)
})
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/views/FrontPage/LoginView.vue
+
10
−
4
View file @
c7429a9a
...
...
@@ -36,15 +36,21 @@ async function login() {
<div
id=
"LoginFields"
>
<div
id=
"UserDiv"
>
<h2
id=
"Username"
>
Brukernavn
</h2>
<input
id=
"NameField"
placeholder=
"Skriv inn dit brukernavn"
v-model=
"username"
>
<input
id=
"NameField"
placeholder=
"Skriv inn dit brukernavn"
v-model=
"username"
data-testid=
"NameInput"
>
</div>
<div
id=
"PasswordDiv"
>
<h2
id=
"Password"
>
Passord
</h2>
<input
id=
"PasswordField"
type=
"password"
placeholder=
"Skriv inn dit passord"
v-model=
"password"
>
<input
id=
"PasswordField"
type=
"password"
placeholder=
"Skriv inn dit passord"
v-model=
"password"
data-testid=
"PasswordInput"
>
</div>
</div>
<button
id=
"LogInButton"
@
click=
"login"
:disabled=
"!username || password.length
<
8"
:class=
"
{ 'disabled-button': !username || password.length
<
8
}"
>
LogIn
</button>
<h2
@
click=
"navigateToNewUser()"
id=
"NewUser"
>
Ny til Sparesti? Trykk her for å lage en profil!
</h2>
<button
id=
"LogInButton"
@
click=
"login"
:disabled=
"!username || password.length
<
8"
:class=
"
{ 'disabled-button': !username || password.length
<
8
}"
data-testid=
"LogInButton"
>
LogIn
</button>
<h2
@
click=
"navigateToNewUser()"
id=
"NewUser"
data-testid=
"NewUserLink"
>
Ny til Sparesti? Trykk her for å lage en profil!
</h2>
</div>
</
template
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment