{"id":16175925,"url":"https://github.com/elaichenkov/cypress-delete-downloads-folder","last_synced_at":"2025-03-19T01:30:32.681Z","repository":{"id":105032669,"uuid":"460919780","full_name":"elaichenkov/cypress-delete-downloads-folder","owner":"elaichenkov","description":"Custom cypress commands and hooks to delete downloads folder before or after tests execution","archived":false,"fork":false,"pushed_at":"2025-03-11T00:38:43.000Z","size":1585,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T01:27:52.491Z","etag":null,"topics":["cypress","cypress-custom-command","cypress-io","cypress-plugin","cypress-tests","e2e","e2e-testing","e2e-tests","javascript","library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elaichenkov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-02-18T16:12:06.000Z","updated_at":"2025-03-11T00:38:40.000Z","dependencies_parsed_at":"2024-01-28T14:09:25.972Z","dependency_job_id":"5507f983-90f3-40a2-9c0b-ebaa2a1e3767","html_url":"https://github.com/elaichenkov/cypress-delete-downloads-folder","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"723cc002fd725f7112f9e9865639ae14c1e4ea49"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaichenkov%2Fcypress-delete-downloads-folder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaichenkov%2Fcypress-delete-downloads-folder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaichenkov%2Fcypress-delete-downloads-folder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaichenkov%2Fcypress-delete-downloads-folder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elaichenkov","download_url":"https://codeload.github.com/elaichenkov/cypress-delete-downloads-folder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244336081,"owners_count":20436764,"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-custom-command","cypress-io","cypress-plugin","cypress-tests","e2e","e2e-testing","e2e-tests","javascript","library"],"created_at":"2024-10-10T04:46:48.842Z","updated_at":"2025-03-19T01:30:32.382Z","avatar_url":"https://github.com/elaichenkov.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cypress-delete-downloads-folder ![tests](https://github.com/elaichenkov/cypress-delete-downloads-folder/actions/workflows/test.yml/badge.svg) [![Total npm downloads](https://img.shields.io/npm/dt/cypress-delete-downloads-folder.svg)](https://www.npmjs.com/package/cypress-delete-downloads-folder)\n\nCypress custom commands and hooks to delete `Cypress.config('downloadsFolder')` folder\n\n## Installation\n\n```shell\nnpm i -D cypress-delete-downloads-folder\n```\n\n## Usage\n\ncypress-delete-downloads-folder extends Cypress' cy command.\n\nSo, if you want to use custom `cy.deleteDownloadsFolder()` command then you need to add this line to your project's `cypress/support/commands.js`:\n\n```javascript\nrequire('cypress-delete-downloads-folder').addCustomCommand();\n```\n\nAnd add the following lines to your project's `cypress/plugins/index.js`:\n\n```javascript\nconst { removeDirectory } = require('cypress-delete-downloads-folder');\n\nmodule.exports = (on, config) =\u003e {\n  on('task', { removeDirectory })\n}\n```\n\nThen, in your test, you can use it like this:\n\n```javascript\ncy.deleteDownloadsFolder();\n```\n\nAlso, you can use custom hooks to delete downloads folder before or after tests execution:\n\n```javascript\nconst { deleteDownloadsFolderBeforeAll } = require('cypress-delete-downloads-folder');\n\ndescribe('delete downloads folder before all', () =\u003e {\n  deleteDownloadsFolderBeforeAll()\n\n  it('should work', () =\u003e {})\n})\n```\n\n```javascript\nconst { deleteDownloadsFolderBeforeEach } = require('cypress-delete-downloads-folder');\n\ndescribe('delete downloads folder before each', () =\u003e {\n  deleteDownloadsFolderBeforeEach()\n\n  it('should work', () =\u003e {})\n})\n```\n\n```javascript\nconst { deleteDownloadsFolderAfterAll } = require('cypress-delete-downloads-folder');\n\ndescribe('delete downloads folder after all', () =\u003e {\n  deleteDownloadsFolderAfterAll()\n\n  it('should work', () =\u003e {})\n})\n```\n\n```javascript\nconst { deleteDownloadsFolderAfterEach } = require('cypress-delete-downloads-folder');\n\ndescribe('delete downloads folder after each', () =\u003e {\n  deleteDownloadsFolderAfterEach()\n\n  it('should work', () =\u003e {})\n})\n```\n\n## Types\n\nTo enable IntelliSense information and autocomplete you have to include types in the `tsconfig.json` file:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"cypress\", \"cypress-delete-downloads-folder\"]\n  }\n}\n```\n\n## Author\n\nYevhen Laichenkov \u003celaichenkov@gmail.com\u003e\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaichenkov%2Fcypress-delete-downloads-folder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felaichenkov%2Fcypress-delete-downloads-folder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaichenkov%2Fcypress-delete-downloads-folder/lists"}