cypress-fiddle
cypress-fiddle copied to clipboard
Quickly generates Cypress tests from HTML and JS code
So we can vary depending on the desired screenshot
For example, if we want to capture the entire runner ```js cy.screenshot('hello-world', { capture: 'runner', log: true, }) ``` We get right now and it shows the `#live` selector
for reusability
Still lots of undecided questions, but hopefully we could just test a component from the Markdown file
For example using `cypress-react-unit-test` preprocessor? We would need to compose the Markdown preprocessor with next Webpack preprocessor
We should be able to hide the fiddle's code completely by hiding it in the HTML comment block Instead of ```js cy.visit('/') cy.get('input').should('be.visible') cy.screenshot('initial') ``` Do
This way we get the best of both worlds - changing markdown converts to specs, which run against the real site
Example: we mount the DOM markup in a div, while some tests might assume they use the full iframe ```js // By default, root is the document cy.root().should('match', 'html') ```...
Need to cover Markdown fiddle parsing logic with unit tests
Have to manually reload the test runner when source Markdown file changes