csspin_frontend.cypress

The csspin_frontend.cypress plugin provides a way to run the cypress frontend testing tool in the context of csspin to execute pre-implemented cypress tests for CONTACT Elements instances.

It provides the cypress and cypress:open tasks which either run the cypress test suite or opens the browser for interactive exploration.

How to setup the csspin_frontend.cypress plugin?

For using the csspin_frontend.cypress plugin, a project’s spinfile.yaml must at least contain the following configuration.

Minimal configuration of spinfile.yaml to use csspin_frontend.cypress
plugin_packages:
    - csspin-java     # required by spin-ce
    - csspin-ce       # required for creating a CE instance
    - csspin-python
    - csspin-frontend
plugins:
    - csspin_frontend.cypress
python:
    version: '3.11.9'
    index_url: <URL to retrieve CE packages from>
node:
    version: '18.17.1'
java:
    version: '17'

The provisioning of the required virtual environment as well as the plugins dependencies can be done via the well-known spin provision-command.

How to run cypress tests using csspin_frontend.cypress?

The cypress-task requires an existing CONTACT Elements instance, which can be created by using the csspin_ce.mkinstance plugin (see create new instance).

Running Cypress tests against a CE instance using the cypress
spin cypress

How to run Cypress tests as part of the “cept” workflow?

Since Cypress tests are considered as acceptance tests, and they are part of the “cept” workflow. Leveraging the workflow requires adding adding the csspin-workflows plugin-package and activating the stdworkflows plugin (see csspin_workflows.stdworkflows).

Adding the csspin-workflows plugin-package to the spinfile.yaml
 plugin_packages:
     - csspin-workflows
     ...
 plugins:
     - csspin_workflows.stdworkflows
     ...

The cept workflow can be executed by running the following command after provision and creation of a CE instance:

Running the “cept” workflow
spin cept

csspin_frontend.cypress schema reference

cypress: 'object'

Configuration of the cypress plugin.

cypress.version: 'str'

Cypress version

cypress.base_url: 'str'

The URL to connect Cypress with

cypress.browser: 'str'

The browser to run Cypress in

cypress.schema: 'object'
cypress.requires: 'object'
cypress.requires.spin: 'list'
cypress.requires.npm: 'list'
cypress._requires: 'list'