Skip to content

How to write an e2e Test for runtime

luzhuang edited this page Dec 22, 2023 · 16 revisions

Note: Install git-lfs

git-lfs (Install by official website)

1. Create a case page in the e2e/case directory.

You can refer to e2e/case/animator-play.ts.

2. Create test cases for your feature in the e2e/tests directory.

You can refer to e2e/case/animator.cy.ts.

3. Debug your test cases:

Launch the Case page:

npm run e2e:case

Debug the test cases:

After successfully launching the case page, run:

npm run e2e:debug

Open the Cypress client for debugging. Cypress will capture screenshots of your case pages. Review the screenshots, store them in the e2e/fixtures/originImage directory if there are no issues, then rerun the test cases. If the test cases pass, the debugging is complete.

4. Run the complete e2e tests:

npm run e2e

Note: The e2e testing framework for this project is Cypress. For detailed usage instructions, please refer to https://www.cypress.io/.