first commit
This commit is contained in:
19
ui/tests/e2e/support/commands.js
Normal file
19
ui/tests/e2e/support/commands.js
Normal file
@@ -0,0 +1,19 @@
|
||||
// Create custom Cypress commands and overwrite existing ones.
|
||||
// https://on.cypress.io/custom-commands
|
||||
|
||||
import { getStore } from './utils'
|
||||
|
||||
Cypress.Commands.add(
|
||||
'logIn',
|
||||
({ username = 'admin', password = 'password' } = {}) => {
|
||||
// Manually log the user in
|
||||
cy.location('pathname').then((pathname) => {
|
||||
if (pathname === 'blank') {
|
||||
cy.visit('/')
|
||||
}
|
||||
})
|
||||
getStore().then((store) =>
|
||||
store.dispatch('auth/logIn', { username, password })
|
||||
)
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user