Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 12f107b

Browse files
committed
fixed cypress test
1 parent e9d2989 commit 12f107b

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

cypress/integration/register_spec.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ describe('The register Page', () => {
3636
cy.get(".btn.btn-primary").contains("Submit").click()
3737
cy.get("span.navbar-link-description").contains("Main").click()
3838

39-
40-
41-
cy.get(".btn.btn-primary").contains("Logout").click()
42-
39+
cy.logout()
4340

4441
cy.get('input[id=formBasicUsername]').type(username)
4542

cypress/support/commands.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// -- This is a parent command --
1313
Cypress.Commands.add('loginWithUrl', (path) => {
14-
const user = {username:"admin",password:"admin"}
14+
const user = {username:"Admin",password:"admin"}
1515

1616
cy.visit(path)
1717
cy.get('input[id=formBasicUsername]')
@@ -21,6 +21,13 @@ Cypress.Commands.add('loginWithUrl', (path) => {
2121
.type(`${user.password}{enter}`)
2222
})
2323

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+
2431
//
2532
//
2633
// -- This is a child command --

src/components/basicElements/topArea/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function Header(props: PropsFromRedux): ReactElement {
105105
logout();
106106
}}
107107
>
108-
Logout1
108+
Logout
109109
</NavDropdown.Item>
110110
</NavDropdown>
111111
</Nav>

0 commit comments

Comments
 (0)