Skip to content

Commit eedfb5e

Browse files
committed
fix(commands.js): start non-UI login
adds cy-localstorage-commands see #378 #400
1 parent 17fe3b2 commit eedfb5e

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

cypress/support/commands.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
// ***********************************************
1010
//
1111
//
12+
import "cypress-localstorage-commands"
13+
1214
// -- This is a parent command --
13-
// Cypress.Commands.add("login", (email, password) => { ... })
15+
Cypress.Commands.add("connect", (email, password) => {
16+
// see https://stackoverflow.com/questions/56431316/set-local-storage-in-cypress
17+
// connections {"admin@http://localhost:8080":{"name":"localhost","server":"http://localhost:8080","username":"admin","password":"","users":[],"groups":[]}}
18+
cy.clearLocalStorage()
19+
cy.request('http://localhost:8080/exist/restxq/fusiondb')
20+
21+
})
1422
//
1523
//
1624
// -- This is a child command --

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@4tw/cypress-drag-drop": "https://github.com/ccheraa/cypress-drag-drop",
2121
"chai": "^4.3.4",
2222
"cypress": "7.3.0",
23+
"cypress-localstorage-commands": "^1.4.4",
2324
"lerna": "4.0.0",
2425
"mocha": "^8.4.0",
2526
"node-sass": "5.0.0",

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5616,6 +5616,11 @@ cyclist@^1.0.1:
56165616
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-1.0.1.tgz#596e9698fd0c80e12038c2b82d6eb1b35b6224d9"
56175617
integrity sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=
56185618

5619+
cypress-localstorage-commands@^1.4.4:
5620+
version "1.4.4"
5621+
resolved "https://registry.yarnpkg.com/cypress-localstorage-commands/-/cypress-localstorage-commands-1.4.4.tgz#96ebce71b78895bd34a96c6d424b5de18a257b82"
5622+
integrity sha512-j502dbaQxTkz8iXYPClpYn2AIFyMZvvODNNHVZVoKBSkKOEuWAx3/RT4RvH0naV4/T05oUw2O9Cm5VxeZbyxiw==
5623+
56195624
cypress@7.3.0:
56205625
version "7.3.0"
56215626
resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.3.0.tgz#17345b8d18681c120f033e7d8fd0f0271e9d0d51"

0 commit comments

Comments
 (0)