use ts cypress reset
This commit is contained in:
parent
757f149dea
commit
4af28412a0
8 changed files with 310 additions and 40 deletions
16
frontend/rabbi_gerzi/cypress/support/commands.ts
Normal file
16
frontend/rabbi_gerzi/cypress/support/commands.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
/// <reference types="cypress" />
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
|
||||
declare global {
|
||||
namespace Cypress {
|
||||
interface Chainable {
|
||||
resetDb(): Chainable<null>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cypress.Commands.add('resetDb', function () {
|
||||
return cy.task<null>('db:reset')
|
||||
})
|
||||
|
||||
export {}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
import './commands'
|
||||
|
||||
beforeEach(() => {
|
||||
cy.task('resetDatabase')
|
||||
cy.resetDb()
|
||||
cy.clearCookies()
|
||||
cy.clearLocalStorage()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue