Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
176
Merge Requests
13
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Commits
83a9aa31
Commit
83a9aa31
authored
3 hours ago
by
Martin Santangelo
Browse files
Options
Download
(feat) improve login e2e
parent
eb2a9249
feat/more-relaiable-login-e2e
1 merge request
!427
More reliable login e2e
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
e2e/login.spec.js
View file @
83a9aa31
import
login
from
"
./actions/login
"
;
import
sleep
from
'
../src/common/helpers/sleep
'
;
describe
(
'
Login Flow
'
,
()
=>
{
beforeEach
(
async
()
=>
{
...
...
@@ -12,13 +11,18 @@ describe('Login Flow', () => {
});
it
(
'
should show error
'
,
async
()
=>
{
// should login successfully
await
expect
(
element
(
by
.
id
(
'
usernameInput
'
))).
toBeVisible
();
// login should be visible
await
waitFor
(
element
(
by
.
id
(
'
usernameInput
'
)))
.
toBeVisible
()
.
withTimeout
(
10000
);
// we moved the login logic to an action to avoid code duplication
await
login
(
'
bad
'
,
'
credentials
'
);
await
sleep
(
1000
);
// wait for the message
await
waitFor
(
element
(
by
.
id
(
'
loginMsg
'
)))
.
toBeVisible
()
.
withTimeout
(
2000
);
// it should show the error message
// according to the detox docs it should be toHaveText but it only works with toHaveLabel
...
...
@@ -26,8 +30,10 @@ describe('Login Flow', () => {
});
it
(
'
should login successfully
'
,
async
()
=>
{
// should login successfully
await
expect
(
element
(
by
.
id
(
'
usernameInput
'
))).
toBeVisible
();
// login should be visible
await
waitFor
(
element
(
by
.
id
(
'
usernameInput
'
)))
.
toBeVisible
()
.
withTimeout
(
10000
);
// we moved the login logic to an action to avoid code duplication
await
login
(
process
.
env
.
loginUser
,
process
.
env
.
loginPass
);
...
...
This diff is collapsed.
Please
register
or
sign in
to comment