Download the PHP package ubc-web-services/cypress-d10-test without Composer

On this page you can find all versions of the php package ubc-web-services/cypress-d10-test. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cypress-d10-test

Cypress D10 Testing

Below, you can find instructions on how to set up the Cypress D10 test suite for your project, and how to write tests in Cypress.

These instructions are also found on Confluence. However, these two documents are not kept in sync with each other, and this README should be considered the most up-to-date version.

Minimal setup:

  1. Run composer require ubc-web-services/cypress-d10-test
  2. Start up lando as per normal local development
  3. In project root, run npm install --save-dev cypress && npm install --save-dev cypress-real-events (should be version 13+, otherwise it should prompt for an update)
  4. To start Cypress, run npx cypress open
  5. If prompted, follow the migration steps by accepting all changes (this is if an older version of cypress was already installed)
  6. Overwrite the current cypress.config.js/cypress.json file that is in root with cp -f vendor/ubc-web-services/cypress-d10-test/cypress.config.js . 
  7. At this point, we don't need the cypress folder that is in root. Either delete the folder, or rename to cypress_custom so cypress.config.js sees the tests in there.
  8. Change cypress.config.js baseUrl to the URL of the lando site (e.g. https://exampleitubcca.lndo.site)

How to write Cypress tests

A good basic tutorial can be found here: https://docs.cypress.io/guides/end-to-end-testing/writing-your-first-end-to-end-test

Cypress has made example tests for reference: https://github.com/cypress-io/cypress-example-recipes

You can also use the tests in vendor/ubc-web-services/cypress-d10-test/e2e as a reference for your own test writing.

Here is a simple example of a .cy.js file:

How to add your test as a custom test

Inside cypress.config.js, there is the option 'specPattern', which specifies where tests can be found.

A path for "cypress_custom" has already been added, meaning tests placed inside that folder will be recognized by Cypress (e.g. cypress_custom/test.cy.js or cypress_custom/test/hello.cy.js).

You can also append a path to 'specPattern' to a directory of your choice.

How to ignore a test

Similar to 'specPattern', inside cypress.config.js there is the option 'excludeSpecPattern', which ignores tests that match a particular path.

There is a path to a file containing helper functions already included, which can be used as reference.

How to write "good" tests

I don't know!!! However, there are some good resources:

https://cypress.tips/

https://docs.cypress.io/guides/core-concepts/introduction-to-cypress

In general, the docs are quite easy to read: https://docs.cypress.io/guides/

How to avoid committing sensitive parameters to the repository

See https://docs.cypress.io/guides/guides/environment-variables#Option-2-cypressenvjson on how to add environment variables.

Project links

Cypress smoke tests ("default" repo): https://github.com/ubc-web-services/cypress-d10-test

Repo from previous co-op student on testing with Cypress: https://github.com/ubc-web-services/cypress-test#introduction

Automation post-mortem: https://github.com/ubc-web-services/cypress-d10-test/blob/master/automation-post-mortem.md


All versions of cypress-d10-test with dependencies

PHP Build Version
Package Version
Requires drupal/core Version ^9 || ^10
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ubc-web-services/cypress-d10-test contains the following files

Loading the files please wait ....