cypress runner
This commit is contained in:
parent
41f55c0920
commit
b2bad5f64c
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -0,0 +1,2 @@
|
|||
screenshots
|
||||
videos
|
|
@ -0,0 +1,41 @@
|
|||
function createNote(options = {}) {
|
||||
Object.assign(options, {
|
||||
text: `Revaluation battle selfish derive suicide revaluation society love superiority salvation spirit virtues revaluation. Aversion sexuality play burying mountains intentions battle reason strong burying war insofar inexpedient war. Fearful intentions selfish madness suicide.`,
|
||||
})
|
||||
cy.visit('http://localhost:5000')
|
||||
const text = options.text
|
||||
cy.get('[data-testid=input-note]').type(text)
|
||||
cy.get('[data-testid=button-create]').click()
|
||||
cy.wait(500)
|
||||
return cy
|
||||
.get('[data-testid=note-share-link]')
|
||||
.invoke('val')
|
||||
.then((link) => {
|
||||
return [link, text]
|
||||
})
|
||||
}
|
||||
|
||||
describe('Basics', () => {
|
||||
it('Share note', () => {
|
||||
createNote().then(([link, text]) => {
|
||||
cy.visit(link)
|
||||
cy.get('[data-testid=button-show]').click()
|
||||
cy.wait(250)
|
||||
cy.get('[data-testid=note-result]').should('have.text', text)
|
||||
})
|
||||
})
|
||||
|
||||
it('Check destroyed', () => {
|
||||
createNote().then(([link, text]) => {
|
||||
// Check the first time
|
||||
cy.visit(link)
|
||||
cy.get('[data-testid=button-show]').click()
|
||||
cy.wait(250)
|
||||
cy.get('[data-testid=note-result]').should('have.text', text)
|
||||
|
||||
// Should not exists anymore
|
||||
cy.visit(link)
|
||||
cy.get('[data-testid=note-not-found]').should('exist')
|
||||
})
|
||||
})
|
||||
})
|
|
@ -15,4 +15,4 @@ services:
|
|||
depends_on:
|
||||
- memcached
|
||||
ports:
|
||||
- 80:5000
|
||||
- 5000:5000
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,9 +3,14 @@
|
|||
"dev:docker": "docker-compose up memcached",
|
||||
"dev:backend": "cargo watch -x 'run --bin cryptgeon'",
|
||||
"dev:front": "npm --prefix client run dev",
|
||||
"dev": "run-p dev:*"
|
||||
"dev": "run-p dev:*",
|
||||
"test:server": "docker compose up --build",
|
||||
"test:cypress": "cypress run --headless",
|
||||
"test:run": "start-server-and-test test:server http://localhost:5000 test:cypress"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npm-run-all": "^4.1.5"
|
||||
"cypress": "^7.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"start-server-and-test": "^1.12.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue