{"id":15023179,"url":"https://github.com/nextcloud-libraries/nextcloud-cypress","last_synced_at":"2025-03-30T00:30:29.974Z","repository":{"id":39490422,"uuid":"506694702","full_name":"nextcloud-libraries/nextcloud-cypress","owner":"nextcloud-libraries","description":"Nextcloud cypress commands, utils and selectors library https://npmjs.org/@nextcloud/cypress","archived":false,"fork":false,"pushed_at":"2024-10-29T21:12:33.000Z","size":11853,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-29T23:37:12.900Z","etag":null,"topics":["javascript-library"],"latest_commit_sha":null,"homepage":"https://nextcloud-libraries.github.io/nextcloud-cypress/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud-libraries.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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-23T15:30:03.000Z","updated_at":"2024-10-29T21:12:37.000Z","dependencies_parsed_at":"2023-07-29T00:02:42.876Z","dependency_job_id":"f027faac-c950-448c-98c8-df324060f150","html_url":"https://github.com/nextcloud-libraries/nextcloud-cypress","commit_stats":{"total_commits":608,"total_committers":9,"mean_commits":67.55555555555556,"dds":"0.13157894736842102","last_synced_commit":"8bc6aa32808d5b3e88bad72e6e7e5b7f1cdae4ed"},"previous_names":["nextcloud-libraries/nextcloud-cypress","nextcloud/nextcloud-cypress"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-cypress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-cypress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-cypress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-cypress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/nextcloud-cypress/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262490,"owners_count":20749170,"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":["javascript-library"],"created_at":"2024-09-24T19:58:48.199Z","updated_at":"2025-03-30T00:30:29.958Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":"TypeScript","readme":"\u003c!--\n  - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: AGPL-3.0-or-later\n--\u003e\n# \\@nextcloud/cypress\n\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-cypress)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-cypress) [![npm last version](https://img.shields.io/npm/v/@nextcloud/cypress.svg?style=flat-square)](https://www.npmjs.com/package/@nextcloud/cypress) ![Codecov](https://img.shields.io/codecov/c/github/nextcloud/nextcloud-cypress?style=flat-square)\n\nNextcloud cypress helpers for Nextcloud apps and libraries\n\n## New package available\n\n`@nextcloud/e2e-test-server` is a more generic version of `@nextcloud/cypress`\nthat will work nicely with both cypress and playwright.\n\nIt will eventually superseed `@nextcloud/cypress`.\nWhen starting a new project we recommend using `@nextcloud/e2e-test-server`.\n\n## Commands\n\nYou can import individual commands or all at once\nYou can find [the list of all available commands here](https://nextcloud.github.io/nextcloud-cypress/modules/commands.html) \n\n```js\n// cypress/support/commands.js\nimport { addCommands } from '@nextcloud/cypress'\n\naddCommands()\n```\n\n```js\n// cypress/support/commands.js\nimport { getNc } from '@nextcloud/cypress/commands'\n\nCypress.Commands.add('getNc', getNc)\n```\n\n## Selectors\n\nYou can find [the list of all available selectors here](https://nextcloud.github.io/nextcloud-cypress/modules/selectors.html) \n\n```js\nimport { UploadPicker as UploadPickerComponent} from '../../dist/index.js'\nimport { UploadPicker, UploadPickerInput } from '@nextcloud/cypress/selectors'\n\ndescribe('UploadPicker rendering', () =\u003e {\n\tit('Renders default UploadPicker', () =\u003e {\n\t\tcy.mount(UploadPickerComponent)\n\t\tcy.getNc(UploadPicker).should('exist')\n\t\t\t.should('have.class', 'upload-picker')\n\t\tcy.getNc(UploadPickerInput).should('exist')\n\t})\n})\n```\n\n## Starting Nextcloud Docker container\n\nIt is possible to automatically start a docker container providing a Nextcloud instance for testing.\nTherefor adjust your `cypress.config.ts` (or `.js`):\n\n```js\nimport { configureNextcloud,  startNextcloud,  stopNextcloud, waitOnNextcloud } from '@nextcloud/cypress/docker'\n\nexport default defineConfig({\n// ...\n\te2e: {\n\t\t// other configuration\n\n\t\tsetupNodeEvents(on, config) {\n\t\t\t// Remove container after run\n\t\t\ton('after:run', () =\u003e {\n\t\t\t\tstopNextcloud()\n\t\t\t})\n\n\t\t\t// starting Nextcloud testing container with specified server branch\n\t\t\treturn startNextcloud(process.env.BRANCH)\n\t\t\t\t.then((ip) =\u003e {\n\t\t\t\t\t// Setting container's IP as base Url\n\t\t\t\t\tconfig.baseUrl = `http://${ip}/index.php`\n\t\t\t\t\treturn ip\n\t\t\t\t})\n\t\t\t\t.then(waitOnNextcloud)\n\t\t\t\t// configure Nextcloud, also install and enable the `viewer` app\n\t\t\t\t.then(() =\u003e configureNextcloud(['viewer']))\n\t\t\t\t.then(() =\u003e {\n\t\t\t\t\treturn config\n\t\t\t\t})\n\t\t},\n\t},\n})\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-cypress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-cypress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-cypress/lists"}