{"id":15552214,"url":"https://github.com/bahmutov/todomvc-with-delay","last_synced_at":"2025-09-26T12:30:58.842Z","repository":{"id":37029111,"uuid":"147760332","full_name":"bahmutov/todomvc-with-delay","owner":"bahmutov","description":"TodoMVC app that starts with a delay, and how to test it using Cypress","archived":false,"fork":false,"pushed_at":"2024-12-17T20:44:56.000Z","size":563,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-27T20:12:09.408Z","etag":null,"topics":["cypress","cypress-io","example"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bahmutov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-07T02:35:20.000Z","updated_at":"2023-09-05T20:12:40.000Z","dependencies_parsed_at":"2023-09-28T00:23:36.708Z","dependency_job_id":"291192bf-4371-44c0-bedd-bc382473e0f5","html_url":"https://github.com/bahmutov/todomvc-with-delay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodomvc-with-delay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodomvc-with-delay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodomvc-with-delay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bahmutov%2Ftodomvc-with-delay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bahmutov","download_url":"https://codeload.github.com/bahmutov/todomvc-with-delay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234309751,"owners_count":18811947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","cypress-io","example"],"created_at":"2024-10-02T14:12:38.776Z","updated_at":"2025-09-26T12:30:58.389Z","avatar_url":"https://github.com/bahmutov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# todomvc-with-delay [![CircleCI][ci-badge]][ci-url] [![renovate-app badge][renovate-badge]][renovate-app]\n\n[![Cypress.io tests](https://img.shields.io/badge/cypress.io-tests-green.svg?style=flat-square)](https://dashboard.cypress.io/#/projects/94q1qt/runs)\n\n## Requirements ⚙️\n\n- Any computer: Mac, Windows, Linux\n- [Node 6+](https://nodejs.org/)\n- [git](https://git-scm.com)\n\nIn order to get the code and install dependencies\n\n```shell\ngit clone git@github.com:bahmutov/todomvc-with-delay.git\ncd todomvc-with-delay\nnpm install\n```\n\n## Application 💾\n\n[Vue.js](https://vuejs.org/) + [Vuex](https://vuex.vuejs.org/) + REST server application that we are going to test is in the folder `todomvc`. This application and its full testing is described in [this blog post](https://www.cypress.io/blog/2017/11/28/testing-vue-web-application-with-vuex-data-store-and-rest-backend/).\n\nThe application starts several seconds _AFTER_ the page loads to simulate slowly loading app, see [todomvc/app.js#L154](todomvc/app.js#L154). When the app is finally ready to start, it is added to the `window` object, but only for Cypress tests\n\n```js\n// app code\nif (window.Cypress) {\n  window.app = app\n  console.log('app has started')\n}\n```\n\nTo start running the tests only after `window.app` property appears, we can add an automatically retried assertion, see [cypress/integration/spec.js](cypress/integration/spec.js)\n\n```js\n// spec\nbeforeEach(() =\u003e {\n  cy.visit('/')\n  cy.window().should('have.property', 'app')\n})\n```\n\nSimilarly, if the \"ready\" flag property exists, but then is flipped, we should assert its value\n\n```js\n// app code\nif (window.Cypress) {\n  window.appReady = true\n  console.log('app has started')\n}\n```\n\n```js\n// spec\nbeforeEach(() =\u003e {\n  cy.visit('/')\n  cy.window().should('have.property', 'appReady', true)\n})\n```\n\nFor more examples of automatically waiting for a property, or its value, see [this commit](https://github.com/cypress-io/cypress-example-recipes/commit/9d75842c18535d691f7c717186b5a855e004674e#diff-1f0349eb597d2c41384216c1ffb4c517)\n\n[ci-badge]: https://circleci.com/gh/bahmutov/todomvc-with-delay.svg?style=svg\n[ci-url]: https://circleci.com/gh/bahmutov/todomvc-with-delay\n[renovate-badge]: https://img.shields.io/badge/renovate-app-blue.svg\n[renovate-app]: https://renovateapp.com/\n\n### Small print\n\nAuthor: Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt; \u0026copy; 2018\n\n* [@bahmutov](https://twitter.com/bahmutov)\n* [glebbahmutov.com](https://glebbahmutov.com)\n* [blog](https://glebbahmutov.com/blog)\n\nLicense: MIT - do anything with the code, but don't blame me if it does not work.\n\nSupport: if you find any problems with this module, email / tweet /\n[open issue](https://github.com/bahmutov/todomvc-with-delay/issues) on Github\n\n## MIT License\n\nCopyright (c) 2018 Gleb Bahmutov \u0026lt;gleb.bahmutov@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftodomvc-with-delay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbahmutov%2Ftodomvc-with-delay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbahmutov%2Ftodomvc-with-delay/lists"}