Static site with Cypress examples tested right from the Markdown sources
Static site with Cypress examples tested right from the Markdown sources
Live site glebbahmutov.com/cypress-examples/
The following blog posts explain how I write Cypress demo tests using Markdown in this repository
You can see the cypress.config.js and plugins.js to learn how cypress-markdown-preprocessor is set tup.
<script>
tags that need to be live, otherwise Markdown escapes =>
arrows?!<style>
section, put it at the start of the block, otherwise it might get lostYou can run the exported spec files.
$ npm i -D @bahmutov/cypress-examples
node_modules
$ npx cypress open --project node_modules/\@bahmutov/cypress-examples/
There is a difference between running Markdown files and testing fully exported specs against the built site. To do this all in a single command locally run
npm run dev:export
This command builds the static site, exports the Markdown specs into JavaScript specs, starts local server, and when it responds, starts Cypress.
You can also export all Markdown files into JavaScript, run them locally, and run all E2E tests using the JS specs with:
npm run run:exported