테스트 결과를 리포트 하고 공유를 할때,
npm i --save-dev cypress-mochawesome-reporter
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: "cypress-mochawesome-reporter",
video: false,
reporterOptions: {
charts: true,
reportPageTitle: "Cypress Inline Reporter",
embeddedScreenshots: true,
inlineAssets: true, //Adds the asserts inline
},
e2e: {
setupNodeEvents(on, config) {
require("cypress-mochawesome-reporter/plugin")(on);
},
},
});
import "cypress-mochawesome-reporter/register";
따로 테스트하고 싶은 항목만을 체크하고 싶은데 그 방법은 모르겠다
아래 명령으로 모든 테스트가 실행된다.
npx cypress run --e2e
실행결과는 report/html의 index.tml으로 리포팅된다.
오류는 screenshots에 나오고 실행영상은 videos에 녹화된다.
index.html 실행하여 확인
생각
mocha를 사용해야 하는것 같은데 사실 무슨말인지 몰라서 여기까지 시간이 좀 걸렸다ㅎ
우선 여기까지만 되어도 훌륭하게 사용할 수 있을것 같은 느낌이다.