diff options
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | cypress.json | 1 | ||||
| -rw-r--r-- | cypress/e2e/smoke.cy.ts | 25 | ||||
| -rw-r--r-- | scripts/apidoc.ts | 2 |
4 files changed, 24 insertions, 7 deletions
@@ -91,3 +91,6 @@ REVISION .yarn/ package-lock.json yarn.lock + +cypress/screenshots +cypress/videos diff --git a/cypress.json b/cypress.json index fd984a2b..011099fd 100644 --- a/cypress.json +++ b/cypress.json @@ -1,6 +1,7 @@ { "video": false, "e2e": { + "chromeWebSecurity": false, "baseUrl": "http://localhost:5000", "integrationFolder": "cypress/e2e", "testFiles": "**/*.cy.*", diff --git a/cypress/e2e/smoke.cy.ts b/cypress/e2e/smoke.cy.ts index 6b3bc06b..eb3cf1fb 100644 --- a/cypress/e2e/smoke.cy.ts +++ b/cypress/e2e/smoke.cy.ts @@ -1,11 +1,26 @@ describe('Smoke Test', () => { - it('compiles the guide page', () => { + beforeEach(() => { cy.visit('/guide/'); + cy.get('a[href="/api/animal.html"]').as('firstSectionLink'); + }); + + it('compiles the guide page', () => { cy.contains('Getting Started'); }); - // it('compiles the playground page', () => { - // cy.visit('/playground/'); - // cy.contains('Playground under construction'); - // }); + it('renders this last code example in the code', () => { + // Click on any section in the sidebar + cy.get('@firstSectionLink') + .click() + // Make sure the number of code examples is the same between reloads + .get('.container pre code') + .then(($codeBlocks) => { + // Trigger a reload + cy.reload() + // Give the runtime a chance to update/fail + .wait(500) + .get('.container pre code') + .should('have.length', $codeBlocks.length); + }); + }); }); diff --git a/scripts/apidoc.ts b/scripts/apidoc.ts index 2d180095..3d972c95 100644 --- a/scripts/apidoc.ts +++ b/scripts/apidoc.ts @@ -102,8 +102,6 @@ async function build(): Promise<void> { <!-- This file is automatically generated. --> <!-- Run '${scriptCommand}' to update --> - [[toc]] - ::: v-pre ${toBlock(module.comment)} |
