npx create-next-app@latest --ts cypress-testing-app
cd cypress-testing-app
npm install cypress --save-dev
npm install @testing-library/cypress --save-dev
"scripts": {
......
"cy:open": "cypress open",
"cy:run": "cypress run"
},
あらかじめ実行しておきます
npm run dev
最初に一度起動します
npm run cy:run
cypress\e2e\0-my-tests\0-my-sample.cy.js
describe('example to-do app', () => {
it('ルートパスに訪問できるか', () => {
cy.visit('http://localhost:3000/')
})
})
npm run cy:open
npm run cy:run