A11y demo page - BAD
13 |some text that is hard to read
14 |├── .circleci
└── config.yml
├── .eslintignore
├── .eslintrc
├── .gitignore
├── .node-version
├── .npmrc
├── .vscode
└── settings.json
├── Development.md
├── README.md
├── examples
├── blogs__a11y
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── failing-spec.cy.js
│ │ │ └── passing-spec.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── images
│ │ └── failing.png
│ ├── index-bad.html
│ ├── index.html
│ └── package.json
├── blogs__application-actions
│ ├── .env
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── spec.cy.js
│ │ │ └── utils.cy.js
│ │ ├── fixtures
│ │ │ └── 3-todos.json
│ │ └── support
│ │ │ ├── commands.js
│ │ │ ├── e2e.js
│ │ │ └── index.d.ts
│ ├── index.html
│ ├── js
│ │ ├── app.jsx
│ │ ├── footer.jsx
│ │ ├── todoItem.jsx
│ │ ├── todoModel.js
│ │ └── utils.js
│ ├── package.json
│ └── vendor
│ │ ├── css
│ │ ├── base.css
│ │ └── index.css
│ │ └── js
│ │ ├── JSXTransformer.js
│ │ ├── base.js
│ │ ├── director.js
│ │ └── react-with-addons.js
├── blogs__assertion-counting
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── errors.cy.js
│ │ │ └── spec.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── images
│ │ ├── confirm.gif
│ │ ├── fail-test-on-unhandled-promise-rejection.gif
│ │ ├── plan.gif
│ │ └── without-delay.png
│ ├── index.html
│ └── package.json
├── blogs__class-decorator
│ ├── .babelrc
│ ├── .eslintrc.json
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── app-decorator.png
│ ├── package-lock.json
│ ├── package.json
│ └── src
│ │ ├── actions
│ │ ├── index.cy-spec.js
│ │ ├── index.js
│ │ └── index.spec.js
│ │ ├── components
│ │ ├── App.jsx
│ │ ├── Footer.jsx
│ │ ├── Header.jsx
│ │ ├── Link.jsx
│ │ ├── MainSection.jsx
│ │ ├── TodoItem.jsx
│ │ ├── TodoList.jsx
│ │ └── TodoTextInput.jsx
│ │ ├── constants
│ │ ├── ActionTypes.js
│ │ └── TodoFilters.js
│ │ ├── containers
│ │ ├── FilterLink.js
│ │ ├── Header.js
│ │ ├── MainSection.js
│ │ └── VisibleTodoList.js
│ │ ├── decorators
│ │ └── index.js
│ │ ├── index.html
│ │ ├── index.jsx
│ │ ├── reducers
│ │ ├── index.js
│ │ ├── todos.js
│ │ ├── todos.spec.js
│ │ └── visibilityFilter.js
│ │ ├── selectors
│ │ └── index.js
│ │ └── store.jsx
├── blogs__codepen-demo
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── img
│ │ └── all-tests.png
│ └── package.json
├── blogs__dayjs
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── spec.cy.js
│ │ │ └── spec2.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── index.html
│ └── package.json
├── blogs__e2e-api-testing
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── example_spec.cy.js
│ ├── db.json
│ ├── img
│ │ └── demo.png
│ └── package.json
├── blogs__e2e-snapshots
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── api-spec.cy.js
│ │ │ ├── store-spec.cy.js
│ │ │ ├── ui-spec.cy.js
│ │ │ └── unit-spec.cy.js
│ │ ├── fixtures
│ │ │ └── example.json
│ │ └── support
│ │ │ ├── commands.js
│ │ │ ├── e2e.js
│ │ │ └── utils.js
│ ├── index.html
│ ├── package.json
│ ├── reset-db.js
│ └── snapshots.js
├── blogs__element-coverage
│ ├── .env
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ ├── fixtures
│ │ │ └── example.json
│ │ └── support
│ │ │ ├── commands.js
│ │ │ └── e2e.js
│ ├── img
│ │ └── elements.png
│ ├── package.json
│ ├── public
│ │ └── index.html
│ └── src
│ │ ├── actions
│ │ ├── index.js
│ │ └── index.spec.js
│ │ ├── components
│ │ ├── App.js
│ │ ├── App.spec.js
│ │ ├── Footer.js
│ │ ├── Footer.spec.js
│ │ ├── Header.js
│ │ ├── Header.spec.js
│ │ ├── Link.js
│ │ ├── Link.spec.js
│ │ ├── MainSection.js
│ │ ├── MainSection.spec.js
│ │ ├── TodoItem.js
│ │ ├── TodoItem.spec.js
│ │ ├── TodoList.js
│ │ ├── TodoList.spec.js
│ │ ├── TodoTextInput.js
│ │ └── TodoTextInput.spec.js
│ │ ├── constants
│ │ ├── ActionTypes.js
│ │ └── TodoFilters.js
│ │ ├── containers
│ │ ├── FilterLink.js
│ │ ├── Header.js
│ │ ├── MainSection.js
│ │ └── VisibleTodoList.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── index.js
│ │ ├── todos.js
│ │ ├── todos.spec.js
│ │ └── visibilityFilter.js
│ │ └── selectors
│ │ └── index.js
├── blogs__form-submit
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── html
│ │ └── index.html
│ └── package.json
├── blogs__iframes
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── button-spec.cy.js
│ │ │ ├── custom-command-spec.cy.js
│ │ │ ├── first-spec.cy.js
│ │ │ ├── plugin-spec.cy.js
│ │ │ ├── single-its-spec.cy.js
│ │ │ ├── spy-on-fetch-spec.cy.js
│ │ │ └── xhr-spec.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── index.html
│ └── package.json
├── blogs__notification
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ ├── cannot-use-spy.png
│ │ ├── enable-cypress-notifications.png
│ │ ├── enabled.png
│ │ ├── spying-via-workaround.png
│ │ └── tests.png
│ ├── index.html
│ └── package.json
├── blogs__testing-redux-store
│ ├── .env
│ ├── .gitignore
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── __snapshots__
│ │ │ │ └── spec.js.snap
│ │ │ └── spec.cy.js
│ │ ├── fixtures
│ │ │ └── 3-todos.json
│ │ └── support
│ │ │ ├── commands.js
│ │ │ └── e2e.js
│ ├── package.json
│ ├── public
│ │ └── index.html
│ └── src
│ │ ├── actions
│ │ ├── index.js
│ │ └── index.spec.js
│ │ ├── components
│ │ ├── App.js
│ │ ├── App.spec.js
│ │ ├── Footer.js
│ │ ├── Footer.spec.js
│ │ ├── Header.js
│ │ ├── Header.spec.js
│ │ ├── Link.js
│ │ ├── Link.spec.js
│ │ ├── MainSection.js
│ │ ├── MainSection.spec.js
│ │ ├── TodoItem.js
│ │ ├── TodoItem.spec.js
│ │ ├── TodoList.js
│ │ ├── TodoList.spec.js
│ │ ├── TodoTextInput.js
│ │ └── TodoTextInput.spec.js
│ │ ├── constants
│ │ ├── ActionTypes.js
│ │ └── TodoFilters.js
│ │ ├── containers
│ │ ├── FilterLink.js
│ │ ├── Header.js
│ │ ├── MainSection.js
│ │ └── VisibleTodoList.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── index.js
│ │ ├── todos.js
│ │ ├── todos.spec.js
│ │ └── visibilityFilter.js
│ │ └── selectors
│ │ └── index.js
├── blogs__use-react-devtools
│ ├── .env
│ ├── 4.28.0_0
│ │ ├── _metadata
│ │ │ ├── computed_hashes.json
│ │ │ └── verified_contents.json
│ │ ├── build
│ │ │ ├── 52.chunk.js
│ │ │ ├── backendManager.js
│ │ │ ├── background.js
│ │ │ ├── importFile.worker.worker.js
│ │ │ ├── installHook.js
│ │ │ ├── main.js
│ │ │ ├── panel.js
│ │ │ ├── parseHookNames.chunk.js
│ │ │ ├── parseSourceAndMetadata.worker.worker.js
│ │ │ ├── prepareInjection.js
│ │ │ ├── proxy.js
│ │ │ ├── react_devtools_backend_compact.js
│ │ │ ├── react_devtools_backend_compact.js.map
│ │ │ └── renderer.js
│ │ ├── icons
│ │ │ ├── 128-deadcode.png
│ │ │ ├── 128-development.png
│ │ │ ├── 128-disabled.png
│ │ │ ├── 128-outdated.png
│ │ │ ├── 128-production.png
│ │ │ ├── 128-restricted.png
│ │ │ ├── 128-unminified.png
│ │ │ ├── 16-deadcode.png
│ │ │ ├── 16-development.png
│ │ │ ├── 16-disabled.png
│ │ │ ├── 16-outdated.png
│ │ │ ├── 16-production.png
│ │ │ ├── 16-restricted.png
│ │ │ ├── 16-unminified.png
│ │ │ ├── 32-deadcode.png
│ │ │ ├── 32-development.png
│ │ │ ├── 32-disabled.png
│ │ │ ├── 32-outdated.png
│ │ │ ├── 32-production.png
│ │ │ ├── 32-restricted.png
│ │ │ ├── 32-unminified.png
│ │ │ ├── 48-deadcode.png
│ │ │ ├── 48-development.png
│ │ │ ├── 48-disabled.png
│ │ │ ├── 48-outdated.png
│ │ │ ├── 48-production.png
│ │ │ ├── 48-restricted.png
│ │ │ ├── 48-unminified.png
│ │ │ ├── deadcode.svg
│ │ │ ├── development.svg
│ │ │ ├── disabled.svg
│ │ │ ├── outdated.svg
│ │ │ ├── production.svg
│ │ │ └── restricted.svg
│ │ ├── main.html
│ │ ├── manifest.fingerprint
│ │ ├── manifest.json
│ │ ├── panel.html
│ │ └── popups
│ │ │ ├── deadcode.html
│ │ │ ├── development.html
│ │ │ ├── disabled.html
│ │ │ ├── outdated.html
│ │ │ ├── production.html
│ │ │ ├── restricted.html
│ │ │ ├── shared.css
│ │ │ ├── shared.js
│ │ │ └── unminified.html
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ ├── fixtures
│ │ │ └── example.json
│ │ └── support
│ │ │ └── e2e.js
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── robots.txt
│ └── src
│ │ ├── index.css
│ │ └── index.js
├── blogs__vue-vuex-rest
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── api-spec.cy.js
│ │ │ ├── speed-spec.cy.js
│ │ │ ├── store-spec.cy.js
│ │ │ └── ui-spec.cy.js
│ │ ├── fixtures
│ │ │ ├── example.json
│ │ │ └── todos.json
│ │ └── support
│ │ │ └── utils.js
│ ├── img
│ │ ├── speed-spec.png
│ │ └── vue-vuex-rest.png
│ ├── index.html
│ ├── package.json
│ └── reset-db.js
├── extending-cypress__chai-assertions
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── extending-chai-assertion-plugins-spec.cy.js
│ │ └── support
│ │ │ ├── e2e.js
│ │ │ └── index.d.ts
│ ├── images
│ │ └── custom-assertion-intellisense.png
│ └── package.json
├── file-upload-react
│ ├── cypress.config.js
│ └── cypress
│ │ ├── e2e
│ │ ├── csv-file-spec.cy.js
│ │ ├── spec.cy.js
│ │ ├── upload-plugin-spec.cy.js
│ │ └── upload-via-app-spec.cy.js
│ │ └── support
│ │ └── e2e.js
├── fundamentals__add-custom-command-ts
│ ├── README.md
│ ├── cypress.config.ts
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── async-command.cy.ts
│ │ │ └── spec.ts
│ │ └── support
│ │ │ ├── e2e.ts
│ │ │ └── index.d.ts
│ ├── images
│ │ └── data-cy.png
│ ├── index.html
│ ├── package.json
│ └── tsconfig.json
├── fundamentals__add-custom-command
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── async-command.cy.js
│ │ │ └── spec.cy.js
│ │ └── support
│ │ │ ├── e2e.js
│ │ │ └── index.d.ts
│ ├── images
│ │ ├── async-add.png
│ │ ├── custom-command-found.png
│ │ ├── custom-command-not-found.png
│ │ └── wait-until.png
│ ├── index.html
│ └── package.json
├── fundamentals__chrome-remote-debugging
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── example.png
│ ├── index.html
│ └── package.json
├── fundamentals__custom-browsers
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ └── plugins
│ │ │ ├── brave.js
│ │ │ └── tasks.js
│ ├── images
│ │ ├── brave.png
│ │ └── only-chrome.png
│ └── package.json
├── fundamentals__cy-events
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── cy-on-spec.cy.js
│ │ │ └── cypress-on-spec.cy.js
│ ├── index.html
│ └── package.json
├── fundamentals__dynamic-tests-from-api
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── users-spec.cy.js
│ ├── images
│ │ └── users.png
│ ├── index.html
│ └── package.json
├── fundamentals__dynamic-tests-from-csv
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── csv-spec.cy.js
│ │ └── plugins
│ │ │ └── users.csv
│ ├── images
│ │ └── csv.png
│ ├── index.html
│ └── package.json
├── fundamentals__dynamic-tests
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── fixture-spec.cy.js
│ │ │ ├── list-spec.cy.js
│ │ │ ├── request-spec.cy.js
│ │ │ ├── subdomains-spec.cy.js
│ │ │ ├── task-spec.cy.js
│ │ │ ├── user-spec.cy.js
│ │ │ └── viewports-spec.cy.js
│ │ ├── fixtures
│ │ │ └── colors.json
│ │ └── support
│ │ │ └── e2e.js
│ ├── images
│ │ └── users.png
│ └── package.json
├── fundamentals__errors
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── app-error.cy.js
│ │ │ ├── test-fails.cy.js
│ │ │ ├── unhandled-promise-in-test.cy.js
│ │ │ ├── unhandled-promise.cy.js
│ │ │ └── unhandled-promise2.cy.js
│ ├── images
│ │ ├── app-error.gif
│ │ └── test-error.gif
│ ├── index.html
│ └── package.json
├── fundamentals__fixtures
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── list-spec.cy.js
│ │ │ ├── load-fixtures-spec.cy.js
│ │ │ ├── multiple-fixtures-spec.cy.js
│ │ │ ├── require-fixtures-spec.cy.js
│ │ │ ├── sanity-js-spec.cy.js
│ │ │ └── single-fixture-spec.cy.js
│ │ ├── fixtures
│ │ │ ├── city.json
│ │ │ ├── country.json
│ │ │ ├── names.js
│ │ │ └── users.json
│ │ └── support
│ │ │ └── e2e.js
│ └── package.json
├── fundamentals__module-api-wrap
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── package.json
│ └── run-me.js
├── fundamentals__module-api
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── first-spec.cy.js
│ │ │ ├── second-spec.cy.js
│ │ │ └── third-spec.cy.js
│ │ └── support
│ │ │ ├── commands.js
│ │ │ ├── e2e.js
│ │ │ └── utils
│ │ │ ├── append_key.js
│ │ │ └── get_selector.js
│ ├── e2e-tests.js
│ └── package.json
├── fundamentals__node-modules
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── es2015-commonjs-modules-spec.cy.js
│ │ └── support
│ │ │ ├── e2e.js
│ │ │ └── utils
│ │ │ ├── append_key.js
│ │ │ └── get_selector.js
│ └── package.json
├── fundamentals__timeout
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── all-tests-spec.cy.js
│ │ │ ├── spec.cy.js
│ │ │ └── timeout.cy.js
│ ├── images
│ │ └── test-is-too-long.png
│ └── package.json
├── fundamentals__typescript
│ ├── README.Md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── tests.spec.cy.ts
│ │ ├── fixtures
│ │ │ └── test.html
│ │ ├── support
│ │ │ ├── commands.ts
│ │ │ └── e2e.js
│ │ └── types.d.ts
│ ├── package.json
│ └── tsconfig.json
├── fundamentals__window-size
│ ├── 200px.png
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── page.png
│ ├── index.html
│ └── package.json
├── logging-in__basic-auth
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── login.png
│ ├── package.json
│ ├── public
│ │ ├── app.css
│ │ ├── app.js
│ │ └── index.html
│ └── server.js
├── logging-in__csrf-tokens
│ ├── README.md
│ ├── csrf.hbs
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── logging-in-csrf-tokens-spec.cy.js
│ ├── dashboard.hbs
│ ├── images
│ │ ├── csrf.png
│ │ └── tests.png
│ ├── login.hbs
│ ├── package.json
│ └── server.js
├── logging-in__html-web-forms
│ ├── README.md
│ ├── admin.hbs
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── logging-in-html-web-form-spec.cy.js
│ ├── dashboard.hbs
│ ├── images
│ │ └── login.png
│ ├── login.hbs
│ ├── package.json
│ ├── server.js
│ ├── unauthorized.hbs
│ └── users.hbs
├── logging-in__jwt
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── spec.cy.js
│ │ │ └── using-ui-spec.cy.js
│ ├── images
│ │ ├── get-users.png
│ │ └── jwt.png
│ ├── package.json
│ ├── server
│ │ ├── _helpers
│ │ │ ├── error-handler.js
│ │ │ └── jwt.js
│ │ ├── config.json
│ │ ├── index.js
│ │ └── users
│ │ │ ├── user.service.js
│ │ │ └── users.controller.js
│ ├── src
│ │ ├── _helpers
│ │ │ ├── auth-header.js
│ │ │ ├── fake-backend.js
│ │ │ ├── index.js
│ │ │ └── router.js
│ │ ├── _services
│ │ │ ├── index.js
│ │ │ └── user.service.js
│ │ ├── _store
│ │ │ ├── alert.module.js
│ │ │ ├── authentication.module.js
│ │ │ ├── index.js
│ │ │ └── users.module.js
│ │ ├── app
│ │ │ └── App.vue
│ │ ├── home
│ │ │ └── HomePage.vue
│ │ ├── index.html
│ │ ├── index.js
│ │ └── login
│ │ │ └── LoginPage.vue
│ └── webpack.config.js
├── logging-in__single-sign-on
│ ├── README.md
│ ├── app_server.js
│ ├── auth_server.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── logging-in-single-sign-on-spec.cy.js
│ │ └── support
│ │ │ ├── commands.js
│ │ │ └── e2e.js
│ ├── dashboard.hbs
│ ├── index.hbs
│ ├── package.json
│ └── unauthorized.hbs
├── logging-in__using-app-code
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── login.png
│ ├── package.json
│ ├── server
│ │ ├── _helpers
│ │ │ ├── error-handler.js
│ │ │ └── jwt.js
│ │ ├── config.json
│ │ ├── index.js
│ │ └── users
│ │ │ ├── user.service.js
│ │ │ └── users.controller.js
│ ├── src
│ │ ├── _helpers
│ │ │ ├── auth-header.js
│ │ │ ├── fake-backend.js
│ │ │ ├── index.js
│ │ │ └── router.js
│ │ ├── _services
│ │ │ ├── index.js
│ │ │ └── user.service.js
│ │ ├── _store
│ │ │ ├── alert.module.js
│ │ │ ├── authentication.module.js
│ │ │ ├── index.js
│ │ │ └── users.module.js
│ │ ├── app
│ │ │ └── App.vue
│ │ ├── home
│ │ │ └── HomePage.vue
│ │ ├── index.html
│ │ ├── index.js
│ │ └── login
│ │ │ └── LoginPage.vue
│ └── webpack.config.js
├── logging-in__xhr-web-forms
│ ├── README.md
│ ├── admin.hbs
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── custom-command-spec.cy.js
│ │ │ ├── logging-in-xhr-web-form-spec.cy.js
│ │ │ ├── logging-via-request-spec.cy.js
│ │ │ └── slow-login-spec.cy.js
│ ├── dashboard.hbs
│ ├── images
│ │ └── tests.png
│ ├── login-slow.hbs
│ ├── login.hbs
│ ├── package.json
│ ├── server.js
│ └── users.hbs
├── preprocessors__flow-browserify
│ ├── .flowconfig
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ ├── fixtures
│ │ │ └── example.json
│ │ └── support
│ │ │ ├── add.js
│ │ │ ├── commands.js
│ │ │ └── e2e.js
│ └── package.json
├── preprocessors__grep
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── feature-a.cy.js
│ │ │ └── feature-b.cy.js
│ ├── images
│ │ └── grep-admin.png
│ └── package.json
├── preprocessors__typescript-browserify
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.ts
│ │ └── support
│ │ │ └── add.ts
│ ├── package.json
│ └── tsconfig.json
├── preprocessors__typescript-webpack
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.ts
│ │ └── support
│ │ │ ├── add.ts
│ │ │ ├── commands.ts
│ │ │ └── e2e.ts
│ ├── img
│ │ ├── cy-type-definitions.png
│ │ ├── cy-without-type-definition.png
│ │ ├── gui.png
│ │ └── source-map.png
│ ├── package.json
│ ├── tsconfig.json
│ ├── tslint.json
│ └── webpack.config.js
├── server-communication__bootstrapping-your-app
│ ├── README.md
│ ├── app.js
│ ├── bootstrap.hbs
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── bootstrapping_your_app_spec.cy.js
│ │ └── fixtures
│ │ │ └── bootstrap.json
│ ├── package.json
│ ├── server.js
│ └── xhr.hbs
├── server-communication__env-variables
│ ├── .env
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ └── package.json
├── server-communication__offline
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── offline-spec.cy.js
│ ├── images
│ │ └── offline.gif
│ ├── index.html
│ ├── offline.js
│ ├── package.json
│ └── styles.css
├── server-communication__pass-value-between-specs
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── first-spec.cy.js
│ │ │ └── second-spec.cy.js
│ └── package.json
├── server-communication__request
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── index.js
│ └── package.json
├── server-communication__seeding-database-in-node
│ ├── .gitignore
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── seeding_database_in_node_spec.cy.js
│ │ └── fixtures
│ │ │ └── seed.json
│ ├── index.html
│ ├── package.json
│ └── server
│ │ ├── db.js
│ │ ├── index.js
│ │ └── routes.js
├── server-communication__server-timing
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── README.md
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ ├── limit.png
│ │ ├── log.png
│ │ └── print.png
│ ├── index.js
│ └── package.json
├── server-communication__stream-tests
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── images
│ │ ├── how-it-works.png
│ │ └── tests.png
│ ├── index.js
│ └── package.json
├── server-communication__visit-2nd-domain
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── using-file-spec.cy.js
│ │ │ └── using-task-spec.cy.js
│ ├── img
│ │ └── screenshot.png
│ └── package.json
├── server-communication__wait-for-api
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── ready.png
│ ├── package.json
│ ├── public
│ │ └── index.html
│ └── server.js
├── server-communication__xhr-assertions
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── clock-control.cy.js
│ │ │ ├── multiple-requests.cy.js
│ │ │ ├── spec.cy.js
│ │ │ ├── spok-spec.cy.js
│ │ │ ├── wait-vs-get.cy.js
│ │ │ └── xml-spec.cy.js
│ ├── images
│ │ ├── assertions.png
│ │ ├── clock.gif
│ │ ├── cy-get-example.png
│ │ ├── cy-wait-example.png
│ │ ├── log-xhr.png
│ │ ├── multiple.png
│ │ ├── re-run.gif
│ │ └── spok.png
│ ├── index.html
│ ├── package.json
│ └── server.js
├── stubbing-spying__console
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── console-example.png
│ ├── index.html
│ └── package.json
├── stubbing-spying__functions
│ ├── README.md
│ ├── api.js
│ ├── auth.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── unit-test-stubbing-dependencies-spec.cy.js
│ ├── package.json
│ └── util.js
├── stubbing-spying__google-analytics
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── ga-method-stubbing.cy.js
│ │ │ └── ga-network-stubbing.cy.js
│ ├── images
│ │ ├── actions.png
│ │ ├── blocked.png
│ │ ├── calls.png
│ │ └── network.png
│ ├── index.html
│ └── package.json
├── stubbing-spying__intercept
│ ├── README.md
│ ├── app-jsonp.js
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── control-clock-spec.cy.js
│ │ │ ├── count-spec.cy.js
│ │ │ ├── form-spec.cy.js
│ │ │ ├── glob-matching-intercept-url.spec.cy.js
│ │ │ ├── header-spec.cy.js
│ │ │ ├── html-css-spec.cy.js
│ │ │ ├── image-spec.cy.js
│ │ │ ├── intercept-events.spec.cy.js
│ │ │ ├── intercept-force404.spec.cy.js
│ │ │ ├── jsonp-spec.cy.js
│ │ │ ├── loading-element-spec.cy.js
│ │ │ ├── matching-spec.cy.js
│ │ │ ├── middleware-intercept.spec.cy.js
│ │ │ ├── ping-spec.cy.js
│ │ │ ├── redirect-spec.cy.js
│ │ │ ├── repeat-spec.cy.js
│ │ │ ├── spy-on-fetch-spec.cy.js
│ │ │ ├── stub-fetch-spec.cy.js
│ │ │ ├── stubbed-api-spec.cy.js
│ │ │ └── times-spec.cy.js
│ │ └── fixtures
│ │ │ ├── fruits.json
│ │ │ ├── roo.jpg
│ │ │ └── users.json
│ ├── form.html
│ ├── fruits-jsonp.html
│ ├── fruits.html
│ ├── fruits.json
│ ├── headers.html
│ ├── images
│ │ ├── add-type-column.png
│ │ ├── tiger.jpg
│ │ └── type.png
│ ├── index.html
│ ├── local-api.html
│ ├── package.json
│ ├── page2.html
│ ├── pics.html
│ ├── redirect-example.html
│ ├── server.js
│ ├── styles.css
│ └── users.json
├── stubbing-spying__navigator
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── navigator-cookie-enabled-stub.png
│ ├── index.html
│ └── package.json
├── stubbing-spying__window-fetch
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ ├── control-clock-spec.cy.js
│ │ │ ├── spy-on-fetch-spec.cy.js
│ │ │ └── stub-fetch-spec.cy.js
│ │ └── support
│ │ │ ├── commands.js
│ │ │ └── e2e.js
│ ├── fruits.json
│ ├── images
│ │ ├── add-type-column.png
│ │ └── type.png
│ ├── index.html
│ ├── package.json
│ ├── page2.html
│ ├── server.js
│ └── styles.css
├── stubbing-spying__window-print
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ ├── print-dialog.png
│ │ └── stub-print.png
│ ├── index.html
│ └── package.json
├── stubbing-spying__window
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── spec.cy.js
│ │ │ └── spy-before-load.cy.js
│ ├── images
│ │ ├── spy-before-load.png
│ │ └── window-open-stub.png
│ ├── index.html
│ ├── package.json
│ └── page1.html
├── stubbing__resources
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ └── fixtures
│ │ │ └── picture.png
│ ├── images
│ │ ├── example.png
│ │ └── rose.png
│ ├── index.html
│ └── package.json
├── testing-dom__clipboard
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── permissions-spec.cy.js
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── copy-paste.gif
│ ├── index.html
│ └── package.json
├── testing-dom__csv-table
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ ├── all-tests.png
│ │ ├── rows.png
│ │ └── timings.png
│ ├── index.html
│ ├── package.json
│ └── records.csv
├── testing-dom__download
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ ├── form-submission-spec.cy.js
│ │ │ ├── local-download-spec.cy.js
│ │ │ ├── location-href-spec.cy.js
│ │ │ ├── remote-download-spec.cy.js
│ │ │ └── utils.js
│ ├── document-utils
│ │ ├── read-excel.js
│ │ └── read-pdf.js
│ ├── images
│ │ ├── chrome.png
│ │ └── firefox.png
│ ├── package.json
│ └── public
│ │ ├── app.js
│ │ ├── files.zip
│ │ ├── index.html
│ │ ├── logo.png
│ │ ├── people.xlsx
│ │ ├── records.csv
│ │ ├── robots.txt
│ │ └── why-cypress.pdf
├── testing-dom__drag-drop
│ ├── README.md
│ ├── basketball.html
│ ├── basketball.png
│ ├── cypress-logo.png
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── drag_n_drop_spec.cy.js
│ ├── package.json
│ ├── puzzle.html
│ ├── server.js
│ └── styles.css
├── testing-dom__form-interactions
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── form-interactions-spec.cy.js
│ ├── images
│ │ └── range-input.png
│ ├── index.html
│ ├── package.json
│ ├── server.js
│ └── styles.css
├── testing-dom__hover-hidden-elements
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── hover-hidden-elements-spec.cy.js
│ ├── hidden.html
│ ├── images
│ │ └── hidden.png
│ ├── index.html
│ ├── mouse.html
│ ├── package.json
│ └── server.js
├── testing-dom__lit-element
│ ├── .eslintrc.json
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── .eslintrc.json
│ │ └── e2e
│ │ │ └── shadow-tests.cy.ts
│ ├── elements.js
│ ├── index.html
│ ├── package.json
│ └── tsconfig.json
├── testing-dom__page-reloads
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── lucky-7.gif
│ ├── package.json
│ └── public
│ │ ├── index.html
│ │ └── style.css
├── testing-dom__page-source
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── html-text.gif
│ └── package.json
├── testing-dom__pagination
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── last-page.png
│ ├── package.json
│ └── public
│ │ ├── index.html
│ │ ├── pagination.css
│ │ └── pagination.js
├── testing-dom__performance-metrics
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ ├── cypress-bw.png
│ │ └── performance-example.png
│ ├── index.html
│ └── package.json
├── testing-dom__responsive-image
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── picture.gif
│ ├── package.json
│ └── responsive-images
│ │ ├── elva-480w-close-portrait.jpg
│ │ ├── elva-800w.jpg
│ │ ├── elva-fairy-320w.jpg
│ │ ├── elva-fairy-480w.jpg
│ │ ├── elva-fairy-640w.jpg
│ │ ├── elva-fairy-800w.jpg
│ │ ├── elva-fairy-original.jpg
│ │ ├── elva-original.jpg
│ │ ├── header.jpg
│ │ ├── img-srcset.html
│ │ ├── not-responsive.html
│ │ ├── picture.html
│ │ └── srcset-resolutions.html
├── testing-dom__root-style
│ ├── README.md
│ ├── app.css
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── red.gif
│ ├── index.html
│ └── package.json
├── testing-dom__select2
│ ├── README.md
│ ├── app.js
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ └── fixtures
│ │ │ ├── clem.json
│ │ │ └── query.json
│ ├── images
│ │ └── demo.gif
│ ├── index.html
│ └── package.json
├── testing-dom__shadow-dom
│ └── README.md
├── testing-dom__sorting-table
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── spec.cy.js
│ ├── images
│ │ └── sorted-prices.png
│ ├── index.html
│ ├── main.js
│ └── package.json
├── testing-dom__tab-handling-links
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ └── e2e
│ │ │ └── tab_handling_anchor_links_spec.cy.js
│ ├── index.html
│ ├── package.json
│ ├── server.js
│ └── users.html
├── testing-dom__wait-for-resource
│ ├── README.md
│ ├── cypress.config.js
│ ├── cypress
│ │ ├── README.md
│ │ ├── e2e
│ │ │ └── spec.cy.js
│ │ └── support
│ │ │ └── e2e.js
│ ├── images
│ │ ├── delayed-script.png
│ │ ├── natural-width.gif
│ │ └── wait-for-image.gif
│ ├── package.json
│ └── public
│ │ ├── a-script.js
│ │ ├── app.css
│ │ ├── base.css
│ │ ├── cypress-logo.png
│ │ └── index.html
└── unit-testing__application-code
│ ├── README.md
│ ├── async-methods.js
│ ├── cypress.config.js
│ ├── cypress
│ ├── e2e
│ │ ├── async-tests.cy.js
│ │ ├── unit_test_application_code_spec.cy.js
│ │ ├── wait-for-object-property-spec.cy.js
│ │ └── wait-for-window-property-spec.cy.js
│ └── fixtures
│ │ └── string.txt
│ ├── fizzbuzz.js
│ ├── index.html
│ ├── math.js
│ └── package.json
├── nodemon.json
├── package-lock.json
├── package.json
├── renovate.json
├── test-examples.js
└── test-repeat.js
/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@cypress/dev"
4 | ],
5 | "extends": [
6 | "plugin:@cypress/dev/general",
7 | "plugin:@cypress/dev/tests"
8 | ],
9 | "env": {
10 | "node": true
11 | },
12 | "globals": {
13 | "cy": true,
14 | "Cypress": true
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .tmp
3 | .sass-cache
4 | .DS_Store
5 | npm-debug.log
6 | tmp
7 | .projects
8 | *.orig
9 |
10 | screenshots
11 | videos
12 | out.js
13 | examples/*/cypress/logs
14 | examples/*/cypress/downloads
15 | snapshots.js
16 | .nyc_output
17 | coverage
18 | dist
19 | test-data.json
20 | examples/stubbing-spying__intercept/users5.json
21 | **/.parcel-cache
22 | examples/*/data.json
23 |
--------------------------------------------------------------------------------
/.node-version:
--------------------------------------------------------------------------------
1 | 22.13.0
2 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | save-exact=true
2 | package-lock=true
3 | legacy-peer-deps=true
4 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "git.ignoreLimitWarning": true,
3 | "eslint.enable": true,
4 | "eslint.alwaysShowStatus": true,
5 | "standard.enable": false,
6 | "workbench.colorCustomizations": {},
7 | "editor.codeActionsOnSave": {
8 | "source.fixAll": "explicit"
9 | }
10 | }
--------------------------------------------------------------------------------
/examples/blogs__a11y/cypress.config.js:
--------------------------------------------------------------------------------
1 | const { defineConfig } = require('cypress')
2 |
3 | module.exports = defineConfig({
4 | e2e: {},
5 | })
6 |
--------------------------------------------------------------------------------
/examples/blogs__a11y/cypress/e2e/failing-spec.cy.js:
--------------------------------------------------------------------------------
1 | ///
some text that is hard to read
14 |This page should pass A11y checks
15 |Click on the button, should show Window confirm dialog
6 | 7 |
14 | This page doesn’t appear to be using React.
15 |
16 | If this seems wrong, follow the troubleshooting instructions.
17 |
14 | This page is using the production build of React. ✅
15 |
16 | Open the developer tools, and "Components" and "Profiler" tabs will appear to the right.
17 |
11 | This is a restricted browser page.
12 |
13 | React devtools cannot access this page.
14 |
6 | Click on the button to file "analytics" event 7 | 8 |
9 |6 | Click on the button to cause application error 7 | 8 |
9 | 10 |11 | This button tells the application to create an unhandled rejected promise 12 | 13 |
14 |You are logged in
9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/logging-in__csrf-tokens/images/csrf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/logging-in__csrf-tokens/images/csrf.png -------------------------------------------------------------------------------- /examples/logging-in__csrf-tokens/images/tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/logging-in__csrf-tokens/images/tests.png -------------------------------------------------------------------------------- /examples/logging-in__csrf-tokens/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "logging-in-csrf-tokens", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "cypress:run:record": "../../node_modules/.bin/cypress run --record", 9 | "dev": "../../node_modules/.bin/start-test 7076 cypress:open", 10 | "start": "node server.js --port 7076", 11 | "test:ci": "../../node_modules/.bin/start-test 7076 cypress:run", 12 | "test:ci:record": "../../node_modules/.bin/start-test 7076 cypress:run:record" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/logging-in__html-web-forms/admin.hbs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |element with our data 7 | $('pre').text(JSON.stringify(data)) 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /examples/server-communication__bootstrapping-your-app/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | e2e: { 5 | baseUrl: 'http://localhost:7070', 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/server-communication__bootstrapping-your-app/cypress/fixtures/bootstrap.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": "test", 3 | "api": "https://test-api.company.com" 4 | } -------------------------------------------------------------------------------- /examples/server-communication__env-variables/.env: -------------------------------------------------------------------------------- 1 | # these variables will be read by the `setupNodeEvents` function in the Cypress configuration 2 | FOO=42 3 | BAR=baz 4 | USER_NAME=aTester 5 | # these variables will be read automatically 6 | # CYPRESS_ part will be removed 7 | # access them with Cypress.env("ping"), Cypress.env("HOST") 8 | CYPRESS_ping=123 9 | CYPRESS_HOST=laura.dev.local 10 | cypress_api_server=http://localhost:8888/api/v1/ 11 | -------------------------------------------------------------------------------- /examples/server-communication__offline/README.md: -------------------------------------------------------------------------------- 1 | # Offline network test 2 | 3 | NOTE: This test has known issues related to bug in Chrome where "Offline Mode" does not impact websockets. 4 | This execution is not recommended and will be refactored to use cy.intercept() at a later date. 5 | 6 | - [offline-spec.cy.js](cypress/e2e/offline-spec.cy.js) emulates offline network connection using Chrome Debugger Protocol and tests how the application handles it 7 | 8 |  9 | -------------------------------------------------------------------------------- /examples/server-communication__offline/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportWidth: 500, 6 | viewportHeight: 400, 7 | defaultCommandTimeout: 8000, 8 | e2e: { 9 | baseUrl: 'http://localhost:7080', 10 | supportFile: false, 11 | }, 12 | }) 13 | -------------------------------------------------------------------------------- /examples/server-communication__offline/images/offline.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/server-communication__offline/images/offline.gif -------------------------------------------------------------------------------- /examples/server-communication__offline/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Offline 5 | 6 | 7 | 8 |Users
9 |click the button to load user list
10 |
3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/stubbing-spying__intercept/images/add-type-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__intercept/images/add-type-column.png -------------------------------------------------------------------------------- /examples/stubbing-spying__intercept/images/tiger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__intercept/images/tiger.jpg -------------------------------------------------------------------------------- /examples/stubbing-spying__intercept/images/type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__intercept/images/type.png -------------------------------------------------------------------------------- /examples/stubbing-spying__intercept/pics.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Spy / Stub / Clock 5 | 6 | 7 | 8 |Below is a picture of a tiger
9 |10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/stubbing-spying__intercept/redirect-example.html: -------------------------------------------------------------------------------- 1 | 2 |
Redirect example
3 | 4 |5 | Click Log out to be redirected to "/" 6 |
7 | 8 |9 | Click Get out to be redirected to another domain 10 |
11 | 12 | -------------------------------------------------------------------------------- /examples/stubbing-spying__navigator/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/stubbing-spying__navigator/images/navigator-cookie-enabled-stub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__navigator/images/navigator-cookie-enabled-stub.png -------------------------------------------------------------------------------- /examples/stubbing-spying__navigator/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |Stubbing Navigator 7 | 8 | 9 | 10 |My Application
11 |12 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/stubbing-spying__navigator/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stubbing-spying__navigator", 3 | "version": "1.0.0", 4 | "description": "Stubbing navigator in Cypress.io", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci": "npm run cypress:run", 9 | "test:ci:record": "npm run cypress:run -- --record" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | experimentalFetchPolyfill: true, 6 | e2e: { 7 | baseUrl: 'http://localhost:7080', 8 | excludeSpecPattern: 'deferred.js', 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/images/add-type-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window-fetch/images/add-type-column.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/images/type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window-fetch/images/type.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Spy / Stub / Clock 5 | 6 | 7 | 8 |Favorite Fruits
9 |10 | Go to page 2 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "spy-stub-clock", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "cypress:run:record": "../../node_modules/.bin/cypress run --record", 9 | "dev": "../../node_modules/.bin/start-test 7080 cypress:open", 10 | "start": "node server.js --port 7080", 11 | "test:ci": "../../node_modules/.bin/start-test 7080 cypress:run", 12 | "test:ci:record": "../../node_modules/.bin/start-test 7080 cypress:run:record" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-fetch/page2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
Spy / Stub / Clock 6 | 7 | 8 | 9 | 10 |Favorite Fruits: Page 2
11 |12 | Go back 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/README.md: -------------------------------------------------------------------------------- 1 | # Stubbing `window.print` 2 | 3 | This is an example showing how to stub `window.print` method call 4 | 5 | ## The application 6 | 7 | The page [index.html](index.html) calls `window.print` on button click. Without stubbing, the test would click and then a system print dialog would block the rest of the test. 8 | 9 |  10 | 11 | By stubbing the `window.print` the [spec.cy.js](cypress/e2e/spec.cy.js) can confirm the call has happened. 12 | 13 |  14 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/app.js: -------------------------------------------------------------------------------- 1 | /* eslint-env browser */ 2 | document.getElementById('print-window') 3 | .addEventListener('click', () => { 4 | window.print() 5 | }) 6 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/cypress/e2e/spec.cy.js: -------------------------------------------------------------------------------- 1 | ///
2 | 3 | describe('window.print', () => { 4 | it('can be stubbed', () => { 5 | cy.visit('index.html') 6 | cy.window().then((win) => { 7 | cy.stub(win, 'print').as('print') 8 | }) 9 | 10 | cy.contains('button', 'Print').click() 11 | cy.get('@print').should('have.been.calledOnce') 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/images/print-dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window-print/images/print-dialog.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/images/stub-print.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window-print/images/stub-print.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Stubbing Window Print 6 | 7 | 8 |Application
9 |10 |
14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window-print/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stubbing-window-print", 3 | "version": "1.0.0", 4 | "description": "Stubbing window.print from test", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci": "npm run cypress:run", 9 | "test:ci:record": "npm run cypress:run -- --record" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/cypress/e2e/spec.cy.js: -------------------------------------------------------------------------------- 1 | ///- 11 | 12 |
13 |2 | describe('window open', function () { 3 | it('opens a new window with page1', function () { 4 | // window.open is called on click 5 | // thus we can create method stub after the cy.visit 6 | // but before cy.click 7 | cy.visit('/index.html') 8 | cy.window().then((win) => { 9 | cy.stub(win, 'open').as('windowOpen') 10 | }) 11 | 12 | cy.get('#open-window').click() 13 | cy.get('@windowOpen').should('be.calledWith', 'page1.html') 14 | }) 15 | }) 16 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/cypress/e2e/spy-before-load.cy.js: -------------------------------------------------------------------------------- 1 | /// 2 | describe('application', function () { 3 | beforeEach(function () { 4 | // application prints "hello" to the console 5 | // during the page load, thus we need to create 6 | // our spy as soon as the window object is created but 7 | // before the page loads 8 | cy.visit('/index.html', { 9 | onBeforeLoad (win) { 10 | cy.spy(win.console, 'log').as('console.log') 11 | }, 12 | }) 13 | }) 14 | 15 | it('prints hello on load', function () { 16 | cy.get('@console.log').should('be.calledWith', 'hello') 17 | }) 18 | }) 19 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/images/spy-before-load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window/images/spy-before-load.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window/images/window-open-stub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing-spying__window/images/window-open-stub.png -------------------------------------------------------------------------------- /examples/stubbing-spying__window/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Stubbing Window 6 | 7 | 8 |My Application
9 |10 |
14 | 15 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stubbing-window", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "start": "echo", 9 | "test:ci": "npm run cypress:run", 10 | "test:ci:record": "npm run cypress:run -- --record" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/stubbing-spying__window/page1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |- 11 | 12 |
13 |Stubbing Window 6 | 7 | 8 |Page 1
9 | 10 | 11 | -------------------------------------------------------------------------------- /examples/stubbing__resources/README.md: -------------------------------------------------------------------------------- 1 | # Stubbing Resources 2 | 3 | The spec file [cypress/e2e/spec.cy.js](cypress/e2e/spec.cy.js) shows how to stub resources that are loaded e.g. by `img` tag. This works by observing DOM mutations and changing the `src` attribute. 4 | 5 | When clicking onto the button in the `index.html`, a new `img` tag is created that is supposed to load [images/rose.png](images/rose.png). Instead we load a red image from the fixture file [cypress/fixtures/picture.png](cypress/fixtures/picture.png). 6 | 7 |  8 | -------------------------------------------------------------------------------- /examples/stubbing__resources/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: 'cypress/fixtures', 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/stubbing__resources/cypress/fixtures/picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing__resources/cypress/fixtures/picture.png -------------------------------------------------------------------------------- /examples/stubbing__resources/images/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing__resources/images/example.png -------------------------------------------------------------------------------- /examples/stubbing__resources/images/rose.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/stubbing__resources/images/rose.png -------------------------------------------------------------------------------- /examples/stubbing__resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |6 |7 | 8 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/stubbing__resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stubbing-resources", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci": "npm run cypress:run", 9 | "test:ci:record": "npm run cypress:run -- --record" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/testing-dom__clipboard/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportWidth: 400, 6 | viewportHeight: 300, 7 | e2e: { 8 | supportFile: false, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/testing-dom__clipboard/images/copy-paste.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__clipboard/images/copy-paste.gif -------------------------------------------------------------------------------- /examples/testing-dom__csv-table/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportWidth: 500, 6 | viewportHeight: 1000, 7 | e2e: { 8 | supportFile: false, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/testing-dom__csv-table/images/all-tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__csv-table/images/all-tests.png -------------------------------------------------------------------------------- /examples/testing-dom__csv-table/images/rows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__csv-table/images/rows.png -------------------------------------------------------------------------------- /examples/testing-dom__csv-table/images/timings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__csv-table/images/timings.png -------------------------------------------------------------------------------- /examples/testing-dom__csv-table/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "csv-table", 3 | "version": "1.0.0", 4 | "description": "Loads CSV file and checks HTML table to have the text content matching the loaded CSV records", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "start": "echo nothing to start", 9 | "test:ci": "npm run cypress:run", 10 | "test:ci:record": "npm run cypress:run -- --record" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/testing-dom__download/document-utils/read-excel.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const readXlsxFile = require('read-excel-file/node') 3 | 4 | const readExcelFile = (filename) => { 5 | // we must read the Excel file using Node library 6 | // and can return the parsed list to the browser 7 | // for the spec code to validate it 8 | console.log('reading Excel file %s', filename) 9 | console.log('from cwd %s', process.cwd()) 10 | 11 | return readXlsxFile(filename) 12 | } 13 | 14 | module.exports = { readExcelFile } 15 | -------------------------------------------------------------------------------- /examples/testing-dom__download/document-utils/read-pdf.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | 3 | const { readFileSync } = require('fs') 4 | const pdf = require('pdf-parse') 5 | 6 | const readPdf = (filename) => { 7 | console.log('reading PDF file %s', filename) 8 | 9 | const dataBuffer = readFileSync(filename) 10 | 11 | return pdf(dataBuffer).then(function (data) { 12 | return { 13 | numpages: data.numpages, 14 | text: data.text, 15 | } 16 | }) 17 | } 18 | 19 | module.exports = { readPdf } 20 | 21 | if (!module.parent) { 22 | const filename = './public/why-cypress.pdf' 23 | 24 | readPdf(filename).then(console.log) 25 | } 26 | -------------------------------------------------------------------------------- /examples/testing-dom__download/images/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/images/chrome.png -------------------------------------------------------------------------------- /examples/testing-dom__download/images/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/images/firefox.png -------------------------------------------------------------------------------- /examples/testing-dom__download/public/app.js: -------------------------------------------------------------------------------- 1 | /* global document */ 2 | /* eslint-disable no-console */ 3 | document.querySelector('[data-cy=download-csv-href]').addEventListener('click', () => { 4 | console.log('about to download CSV file') 5 | document.location.href = 'records.csv' 6 | }) 7 | 8 | document.querySelector('[data-cy=download-pdf-href]').addEventListener('click', () => { 9 | console.log('about to download PDF file') 10 | document.location.href = 'why-cypress.pdf' 11 | }) 12 | -------------------------------------------------------------------------------- /examples/testing-dom__download/public/files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/public/files.zip -------------------------------------------------------------------------------- /examples/testing-dom__download/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/public/logo.png -------------------------------------------------------------------------------- /examples/testing-dom__download/public/people.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/public/people.xlsx -------------------------------------------------------------------------------- /examples/testing-dom__download/public/records.csv: -------------------------------------------------------------------------------- 1 | "First name","Last name","Occupation","Age","City","State" 2 | "Joe","Smith","student",20,"Boston","MA" 3 | "Mary","Sue","driver",21,"New York","NY" 4 | "Adam","Brown","plumber",22,"Miami","FL" 5 | -------------------------------------------------------------------------------- /examples/testing-dom__download/public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /ja/ 3 | Disallow: /zh-cn/ 4 | Disallow: /pt-br/ 5 | Disallow: /ru/ 6 | Disallow: /fonts/ 7 | -------------------------------------------------------------------------------- /examples/testing-dom__download/public/why-cypress.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__download/public/why-cypress.pdf -------------------------------------------------------------------------------- /examples/testing-dom__drag-drop/README.md: -------------------------------------------------------------------------------- 1 | # drag-n-drop 2 | 3 | > Performing Drag & Drop by triggering mouse and drag events 4 | 5 | See test file [cypress/e2e/drag_n_drop_spec.cy.js](cypress/e2e/drag_n_drop_spec.cy.js) that shows how to simulate drag & drop behavior using 6 | 7 | - mouse events 8 | - drag events 9 | 10 | In both cases, the tests use [`cy.trigger`](https://on.cypress.io/trigger) command. 11 | 12 | Alternatively use [`.selectFile()`](https://on.cypress.io/selectfile) if you are testing the dragging and dropping of files. 13 | -------------------------------------------------------------------------------- /examples/testing-dom__drag-drop/basketball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__drag-drop/basketball.png -------------------------------------------------------------------------------- /examples/testing-dom__drag-drop/cypress-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__drag-drop/cypress-logo.png -------------------------------------------------------------------------------- /examples/testing-dom__drag-drop/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | baseUrl: 'http://localhost:7071', 7 | supportFile: false, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__drag-drop/server.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const minimist = require('minimist') 3 | const express = require('express') 4 | const app = express() 5 | 6 | // get port from passed in args from scripts/start.js 7 | const port = minimist(process.argv.slice(2)).port 8 | 9 | app.use(express.static('.')) 10 | app.use('/node_modules', express.static(path.join(__dirname, '..', '..', 'node_modules'))) 11 | 12 | app.listen(port) 13 | -------------------------------------------------------------------------------- /examples/testing-dom__form-interactions/README.md: -------------------------------------------------------------------------------- 1 | # form-interactions 2 | 3 | > Shows how to change the value of a range input 4 | 5 | - Use [`.invoke()`](https://on.cypress.io/invoke) and [`.trigger()`](https://on.cypress.io/trigger) to test a range input (slider). 6 | 7 | The test triggers `change` event on an `` form element and asserts the value does get changed. 8 | 9 |  10 | 11 | ## See 12 | 13 | - [cypress/e2e/form-interactions-spec.cy.js](cypress/e2e/form-interactions-spec.cy.js) 14 | - [`cy.trigger`](https://on.cypress.io/trigger) 15 | -------------------------------------------------------------------------------- /examples/testing-dom__form-interactions/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | baseUrl: 'http://localhost:7072', 7 | supportFile: false, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__form-interactions/images/range-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__form-interactions/images/range-input.png -------------------------------------------------------------------------------- /examples/testing-dom__form-interactions/server.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const minimist = require('minimist') 3 | const express = require('express') 4 | const app = express() 5 | 6 | // get port from passed in args from scripts/start.js 7 | const port = minimist(process.argv.slice(2)).port 8 | 9 | app.use(express.static('.')) 10 | app.use('/node_modules', express.static(path.join(__dirname, '..', '..', 'node_modules'))) 11 | 12 | app.listen(port) 13 | -------------------------------------------------------------------------------- /examples/testing-dom__hover-hidden-elements/README.md: -------------------------------------------------------------------------------- 1 | # hover-hidden-elements 2 | > Interact with elements that are hidden by CSS 3 | 4 | See [cypress/e2e/hover-hidden-elements-spec.cy.js](cypress/e2e/hover-hidden-elements-spec.cy.js) to find how to get around Cypress' lack of `.hover()` command. 5 | 6 | - Interact with elements that are hidden by CSS. 7 | - Use [`.invoke()`](https://on.cypress.io/invoke) and [`.trigger()`](https://on.cypress.io/trigger) to simulate hovering. 8 | - Trigger `mouseover`, `mouseout`, `mouseenter`, `mouseleave` events. 9 | - Get around the lack of a `.hover()` command. 10 | 11 |  12 | -------------------------------------------------------------------------------- /examples/testing-dom__hover-hidden-elements/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | baseUrl: 'http://localhost:7073', 7 | supportFile: false, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__hover-hidden-elements/images/hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__hover-hidden-elements/images/hidden.png -------------------------------------------------------------------------------- /examples/testing-dom__hover-hidden-elements/index.html: -------------------------------------------------------------------------------- 1 | 2 | See "hidden.html" and "mouse.html" documents. 3 | 4 | -------------------------------------------------------------------------------- /examples/testing-dom__hover-hidden-elements/server.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const minimist = require('minimist') 3 | const express = require('express') 4 | const app = express() 5 | 6 | // get port from passed in args from scripts/start.js 7 | const port = minimist(process.argv.slice(2)).port 8 | 9 | app.use(express.static('.')) 10 | app.use('/node_modules', express.static(path.join(__dirname, '..', '..', 'node_modules'))) 11 | 12 | app.listen(port) 13 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@cypress/dev" 4 | ], 5 | "extends": [ 6 | "plugin:@cypress/dev/general" 7 | ], 8 | "env": { 9 | "browser": true 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/README.md: -------------------------------------------------------------------------------- 1 | # lit-element 2 | > Testing page with lit-element components that use Shadow DOM 3 | 4 | - Test simple shadow DOM assertions in [lit-elements](https://lit-element.polymer-project.org/) 5 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/cypress/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "@cypress/dev" 4 | ], 5 | "extends": [ 6 | "plugin:@cypress/dev/tests" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |8 | 9 |13 | 14 | 15 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unit-test-lit-element", 3 | "version": "1.0.0", 4 | "description": "Load and unit test lit-element projects", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "start": "echo there is no web server to start in this project", 9 | "test:ci": "npm run cypress:run", 10 | "test:ci:firefox": "npm run cypress:run -- --browser firefox", 11 | "test:ci:record": "npm run cypress:run -- --record" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/testing-dom__lit-element/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": ["*.ts"] 3 | } 4 | -------------------------------------------------------------------------------- /examples/testing-dom__page-reloads/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportHeight: 100, 6 | viewportWidth: 100, 7 | e2e: { 8 | supportFile: false, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/testing-dom__page-reloads/images/lucky-7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__page-reloads/images/lucky-7.gif -------------------------------------------------------------------------------- /examples/testing-dom__page-reloads/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "page-reloads", 3 | "version": "1.0.0", 4 | "description": "The test reloads the page until an expected text appears", 5 | "private": true, 6 | "scripts": { 7 | "cypress:open": "../../node_modules/.bin/cypress open", 8 | "cypress:run": "../../node_modules/.bin/cypress run" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/testing-dom__page-reloads/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 15 | 16 | -------------------------------------------------------------------------------- /examples/testing-dom__page-reloads/public/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | display: flex; 3 | justify-content: center; 4 | align-items: center; 5 | font-size: 4em; 6 | } 7 | -------------------------------------------------------------------------------- /examples/testing-dom__page-source/README.md: -------------------------------------------------------------------------------- 1 | # Page source 2 | > Get the source of the page under test 3 | 4 |  5 | 6 | You can get the current document's HTML using `document.documentElement.outerHTML` property. Then you can validate / sanitize the HTML. You can even write it back as text into the current browser to see it, as [spec.cy.js](./cypress/e2e/spec.cy.js) shows. 7 | -------------------------------------------------------------------------------- /examples/testing-dom__page-source/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | baseUrl: 'https://www.cypress.io/', 7 | supportFile: false, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__page-source/images/html-text.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__page-source/images/html-text.gif -------------------------------------------------------------------------------- /examples/testing-dom__page-source/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "page-source", 3 | "version": "1.0.0", 4 | "description": "Get the source of the page under test", 5 | "private": true, 6 | "scripts": { 7 | "cypress:open": "../../node_modules/.bin/cypress open", 8 | "cypress:run": "../../node_modules/.bin/cypress run", 9 | "start": "echo nothing to start", 10 | "test:ci": "npm run cypress:run" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/testing-dom__pagination/README.md: -------------------------------------------------------------------------------- 1 | # Pagination 2 | > The test clicks the "Next" link until it gets to the last page 3 | 4 |  5 | 6 | See the [cypress/e2e/spec.cy.js](./cypress/e2e/spec.cy.js) file. 7 | -------------------------------------------------------------------------------- /examples/testing-dom__pagination/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportHeight: 500, 6 | viewportWidth: 500, 7 | e2e: { 8 | supportFile: false, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/testing-dom__pagination/images/last-page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__pagination/images/last-page.png -------------------------------------------------------------------------------- /examples/testing-dom__pagination/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pagination", 3 | "version": "1.0.0", 4 | "description": "The test clicks the Next link until it gets to the last page", 5 | "private": true, 6 | "scripts": { 7 | "cypress:open": "../../node_modules/.bin/cypress open", 8 | "cypress:run": "../../node_modules/.bin/cypress run" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/README.md: -------------------------------------------------------------------------------- 1 | # Utilize window.performance 2 | 3 | The spec file [cypress/e2e/spec.cy.js](cypress/e2e/spec.cy.js) shows how you can utilize [cypress](https://cypress.io) to monitor your website. 4 | 5 |  6 | 7 | ## Learn more 8 | 9 | - [`cy.visit()`](https://on.cypress.io/visit) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/images/cypress-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__performance-metrics/images/cypress-bw.png -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/images/performance-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__performance-metrics/images/performance-example.png -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |10 | 12 |Testing 123
11 |Performance metrics
5 |6 | 7 | -------------------------------------------------------------------------------- /examples/testing-dom__performance-metrics/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "performance-metrics", 3 | "version": "1.0.0", 4 | "description": "Shows how to evaluate some performance metrics", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci:firefox": "../../node_modules/.bin/cypress run --browser firefox" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/images/picture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/images/picture.gif -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "responsive-image", 3 | "version": "1.0.0", 4 | "description": "Testing how the browser loads images depending on viewport", 5 | "private": true, 6 | "scripts": { 7 | "cypress:open": "../../node_modules/.bin/cypress open", 8 | "cypress:run": "../../node_modules/.bin/cypress run", 9 | "start": "echo nothing to start", 10 | "test:ci": "npm run cypress:run" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-480w-close-portrait.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-480w-close-portrait.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-800w.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-800w.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-fairy-320w.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-fairy-320w.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-fairy-480w.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-fairy-480w.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-fairy-640w.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-fairy-640w.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-fairy-800w.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-fairy-800w.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-fairy-original.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-fairy-original.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/elva-original.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/elva-original.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__responsive-image/responsive-images/header.jpg -------------------------------------------------------------------------------- /examples/testing-dom__responsive-image/responsive-images/srcset-resolutions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
Responsive HTML images demo 7 | 14 | 15 | 16 | 17 | 18 |22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/README.md: -------------------------------------------------------------------------------- 1 | # Testing how the app sets the root document style variable 2 | 3 | The application in [index.html](index.html) uses `` to set the CSS variable that controls the background style, see [app.css](app.css) 4 | 5 |  6 | 7 | Find tests in [cypress/e2e/spec.cy.js](cypress/e2e/spec.cy.js) file. 8 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/app.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --main-color: #fff; 3 | --background-color: #000; 4 | } 5 | body { 6 | color: var(--main-color); 7 | background-color: var(--background-color); 8 | font-size: xx-large; 9 | } 10 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/app.js: -------------------------------------------------------------------------------- 1 | /* eslint-env browser */ 2 | /* eslint-disable no-console */ 3 | document.querySelector('input[type=color]').addEventListener('change', (e) => { 4 | console.log('setting new background color to: %s', e.target.value) 5 | document.documentElement.style.setProperty('--background-color', e.target.value) 6 | }) 7 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | viewportWidth: 300, 6 | viewportHeight: 300, 7 | e2e: { 8 | supportFile: false, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/images/red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__root-style/images/red.gif -------------------------------------------------------------------------------- /examples/testing-dom__root-style/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This is the body of the document 6 |
Change color using this color input 7 | 8 |9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /examples/testing-dom__root-style/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "root-style", 3 | "version": "1.0.0", 4 | "description": "Tests how the app changes CSS variable using input color element", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci": "npm run cypress:run", 9 | "test:ci:record": "npm run cypress:run -- --record" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/testing-dom__select2/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | defaultCommandTimeout: 3000, 5 | retries: { 6 | runMode: 5, 7 | }, 8 | e2e: { 9 | supportFile: false, 10 | }, 11 | }) 12 | -------------------------------------------------------------------------------- /examples/testing-dom__select2/images/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__select2/images/demo.gif -------------------------------------------------------------------------------- /examples/testing-dom__select2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "select2-recipe", 3 | "version": "1.0.0", 4 | "description": "Testing Select2 widgets", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "test:ci": "npm run cypress:run", 9 | "test:ci:record": "npm run cypress:run -- --record" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /examples/testing-dom__sorting-table/README.md: -------------------------------------------------------------------------------- 1 | # Sorting Table 2 | 3 | Ag-Grid table in [index.html](index.html) taken from [plain JavaScript documentation](https://www.ag-grid.com/javascript-grid/) example available at [plnkr.co](https://plnkr.co/edit/nmWxAxWONarW5gj2). 4 | 5 | See [cypress/e2e/spec.cy.js](cypress/e2e/spec.cy.js) that confirms the table can be sorted by price. Read the blog post [Sorting the Table](https://www.cypress.io/blog/2020/07/27/sorting-the-table/) 6 | 7 |  8 | -------------------------------------------------------------------------------- /examples/testing-dom__sorting-table/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | supportFile: false, 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /examples/testing-dom__sorting-table/images/sorted-prices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__sorting-table/images/sorted-prices.png -------------------------------------------------------------------------------- /examples/testing-dom__sorting-table/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |Ag-Grid Basic Example 6 | 7 | 8 | 9 | 10 | 11 |Ag-Grid Table
12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /examples/testing-dom__sorting-table/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sorting-table", 3 | "version": "1.0.0", 4 | "description": "Sorting Ag-Grid table", 5 | "private": true, 6 | "scripts": { 7 | "cypress:open": "../../node_modules/.bin/cypress open", 8 | "cypress:run": "../../node_modules/.bin/cypress run", 9 | "test:ci": "npm run cypress:run", 10 | "test:ci:record": "npm run cypress:run -- --record" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /examples/testing-dom__tab-handling-links/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | fixturesFolder: false, 5 | e2e: { 6 | baseUrl: 'http://localhost:7078', 7 | supportFile: false, 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__tab-handling-links/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testing-dom__tab-handling-links", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "cypress:run:record": "../../node_modules/.bin/cypress run --record", 9 | "dev": "../../node_modules/.bin/start-test 7078 cypress:open", 10 | "start": "node server.js --port 7078", 11 | "test:ci": "../../node_modules/.bin/start-test 7078 cypress:run", 12 | "test:ci:record": "../../node_modules/.bin/start-test 7078 cypress:run:record" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/testing-dom__tab-handling-links/server.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const minimist = require('minimist') 3 | const express = require('express') 4 | const app = express() 5 | 6 | // get port from passed in args from scripts/start.js 7 | const port = minimist(process.argv.slice(2)).port 8 | 9 | app.use(express.static('.')) 10 | app.use('/node_modules', express.static(path.join(__dirname, '..', '..', 'node_modules'))) 11 | 12 | app.listen(port) 13 | -------------------------------------------------------------------------------- /examples/testing-dom__tab-handling-links/users.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |Tab Handling and Anchor Links - Users 5 | 6 | 7 |Users
8 | 9 | 10 | -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | viewportHeight: 600, 5 | viewportWidth: 300, 6 | e2e: { 7 | baseUrl: 'http://localhost:4500', 8 | }, 9 | }) 10 | -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/images/delayed-script.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__wait-for-resource/images/delayed-script.png -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/images/natural-width.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__wait-for-resource/images/natural-width.gif -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/images/wait-for-image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__wait-for-resource/images/wait-for-image.gif -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/public/a-script.js: -------------------------------------------------------------------------------- 1 | // typical JavaScript 2 | /* eslint-disable no-console */ 3 | console.log('a-script.js has loaded') 4 | -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/public/app.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | color: red; 3 | } 4 | -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/public/base.css: -------------------------------------------------------------------------------- 1 | main { 2 | font-size: x-large; 3 | padding: 1em; 4 | } 5 | -------------------------------------------------------------------------------- /examples/testing-dom__wait-for-resource/public/cypress-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cypress-io/cypress-example-recipes/b432cc7f9cf55855cbeda5f318e3bc0a5266e51b/examples/testing-dom__wait-for-resource/public/cypress-logo.png -------------------------------------------------------------------------------- /examples/unit-testing__application-code/cypress.config.js: -------------------------------------------------------------------------------- 1 | const { defineConfig } = require('cypress') 2 | 3 | module.exports = defineConfig({ 4 | e2e: { 5 | supportFile: false, 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/cypress/e2e/wait-for-window-property-spec.cy.js: -------------------------------------------------------------------------------- 1 | ///2 | 3 | context('waiting for a property of an object', () => { 4 | it('waits for a variable to be set on application\'s Window object', () => { 5 | cy.visit('./index.html') 6 | // similar to above examples, cy.window() yields application's Window 7 | // object and we tell Cypress to retry until that object has property "AppReady" 8 | // and its value is `true`. 9 | cy.window().should('have.property', 'AppReady', true) 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/cypress/fixtures/string.txt: -------------------------------------------------------------------------------- 1 | brown fox 2 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/fizzbuzz.js: -------------------------------------------------------------------------------- 1 | module.exports = (num) => { 2 | if (num % 3 === 0 && num % 5 === 0) { 3 | return 'fizzbuzz' 4 | } 5 | 6 | if (num % 3 === 0) { 7 | return 'fizz' 8 | } 9 | 10 | if (num % 5 === 0) { 11 | return 'buzz' 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/index.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/math.js: -------------------------------------------------------------------------------- 1 | export default { 2 | add: (a, b) => { 3 | return a + b 4 | }, 5 | 6 | subtract: (a, b) => { 7 | return a - b 8 | }, 9 | 10 | divide: (a, b) => { 11 | return a / b 12 | }, 13 | 14 | multiply: (a, b) => { 15 | return a * b 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /examples/unit-testing__application-code/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "unit-test-application-code", 3 | "version": "1.0.0", 4 | "description": "Load and unit test application code without loading a web page", 5 | "scripts": { 6 | "cypress:open": "../../node_modules/.bin/cypress open", 7 | "cypress:run": "../../node_modules/.bin/cypress run", 8 | "start": "echo there is no web server to start in this project", 9 | "test:ci": "npm run cypress:run", 10 | "test:ci:firefox": "npm run cypress:run -- --browser firefox", 11 | "test:ci:record": "npm run cypress:run -- --record" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignore": [ 3 | "cypress/integration/*.js", 4 | "db.json" 5 | ] 6 | } 7 | --------------------------------------------------------------------------------