File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 1
1
describe ( 'Repo' , ( ) => {
2
2
beforeEach ( ( ) => {
3
- // Log in with default admin user
4
- cy . visit ( '/login' ) ;
5
-
6
- cy . intercept ( 'GET' , '**/api/auth/me' ) . as ( 'getUser' ) ;
7
-
8
- cy . get ( '[data-test="username"]' ) . type ( 'admin' ) ;
9
- cy . get ( '[data-test="password"]' ) . type ( 'admin' ) ;
10
- cy . get ( '[data-test="login"]' ) . click ( ) ;
11
-
12
- cy . wait ( '@getUser' ) ;
3
+ cy . login ( 'admin' , 'admin' ) ;
13
4
14
5
cy . visit ( '/dashboard/repo' ) ;
15
6
Original file line number Diff line number Diff line change 29
29
Cypress . Commands . add ( 'login' , ( username , password ) => {
30
30
cy . session ( [ username , password ] , ( ) => {
31
31
cy . visit ( '/login' ) ;
32
+ cy . intercept ( 'GET' , '**/api/auth/me' ) . as ( 'getUser' ) ;
33
+
32
34
cy . get ( '[data-test=username]' ) . type ( username ) ;
33
35
cy . get ( '[data-test=password]' ) . type ( password ) ;
34
36
cy . get ( '[data-test=login]' ) . click ( ) ;
35
- cy . url ( ) . should ( 'contain' , '/admin/profile' ) ;
37
+
38
+ cy . wait ( '@getUser' ) ;
39
+ cy . url ( ) . should ( 'include' , '/dashboard/repo' ) ;
36
40
} ) ;
37
41
} ) ;
You can’t perform that action at this time.
0 commit comments