This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
src/components/basicElements/topArea Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -36,10 +36,7 @@ describe('The register Page', () => {
36
36
cy . get ( ".btn.btn-primary" ) . contains ( "Submit" ) . click ( )
37
37
cy . get ( "span.navbar-link-description" ) . contains ( "Main" ) . click ( )
38
38
39
-
40
-
41
- cy . get ( ".btn.btn-primary" ) . contains ( "Logout" ) . click ( )
42
-
39
+ cy . logout ( )
43
40
44
41
cy . get ( 'input[id=formBasicUsername]' ) . type ( username )
45
42
Original file line number Diff line number Diff line change 11
11
//
12
12
// -- This is a parent command --
13
13
Cypress . Commands . add ( 'loginWithUrl' , ( path ) => {
14
- const user = { username :"admin " , password :"admin" }
14
+ const user = { username :"Admin " , password :"admin" }
15
15
16
16
cy . visit ( path )
17
17
cy . get ( 'input[id=formBasicUsername]' )
@@ -21,6 +21,13 @@ Cypress.Commands.add('loginWithUrl', (path) => {
21
21
. type ( `${ user . password } {enter}` )
22
22
} )
23
23
24
+ Cypress . Commands . add ( 'logout' , ( ) => {
25
+ const user = { username :"Admin" , password :"admin" }
26
+
27
+ cy . get ( "#basic-nav-dropdown" ) . contains ( user . username ) . click ( )
28
+ cy . get ( ".dropdown-item" ) . contains ( "Logout" ) . click ( )
29
+ } )
30
+
24
31
//
25
32
//
26
33
// -- This is a child command --
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function Header(props: PropsFromRedux): ReactElement {
105
105
logout ( ) ;
106
106
} }
107
107
>
108
- Logout1
108
+ Logout
109
109
</ NavDropdown . Item >
110
110
</ NavDropdown >
111
111
</ Nav >
You can’t perform that action at this time.
0 commit comments