PHPackages                             ubc-web-services/cypress-d10-test - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ubc-web-services/cypress-d10-test

ActiveCypress[Testing &amp; Quality](/categories/testing)

ubc-web-services/cypress-d10-test
=================================

A cypress test suite for UBC WS common components

v0.3.2(1y ago)02241GPL-2.0-or-laterJavaScript

Since Mar 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ubc-web-services/cypress-d10-test)[ Packagist](https://packagist.org/packages/ubc-web-services/cypress-d10-test)[ Docs](https://it.ubc.ca/services/web-servers-storage/websites)[ RSS](/packages/ubc-web-services-cypress-d10-test/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

Cypress D10 Testing
===================

[](#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](https://confluence.it.ubc.ca/display/WebServices/How+to+test+with+Cypress). 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:
--------------

[](#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. )

How to write Cypress tests
--------------------------

[](#how-to-write-cypress-tests)

A good basic tutorial can be found here:

Cypress has made example tests for reference:

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:

```
describe("[Generic] Test Suite - tests related to XYZ", () => {
    beforeEach(() => {
        cy.doLogin();	// triggers login custom helper function, which uses lando drush uli to login
        cy.visit('/admin/reports/dblog');
    })

    it("Checks that the title loaded (fails if whitescreen)", () => {
        // cy.get uses CSS selectors
        cy.get('#block-gin-page-title').should('contain', 'Recent log messages');

        // using .contains() or .find() are also great ways to "grab hold" of an element, especially if it has bad selector options
        // Alternative approach
        cy.contains("Recent log messages").should("exist");
    })
})

```

How to add your test as a custom test
-------------------------------------

[](#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
--------------------

[](#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
-------------------------

[](#how-to-write-good-tests)

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

In general, the docs are quite easy to read:

How to avoid committing sensitive parameters to the repository
--------------------------------------------------------------

[](#how-to-avoid-committing-sensitive-parameters-to-the-repository)

See  on how to add environment variables.

Project links
-------------

[](#project-links)

Cypress smoke tests ("default" repo):

Repo from previous co-op student on testing with Cypress:

Automation post-mortem:

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~26 days

Recently: every ~33 days

Total

7

Last Release

634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bb2057c95b72281166d1223f90909ff8440a29a5ee5f450cf0d71194563dda94?d=identicon)[occupant](/maintainers/occupant)

---

Top Contributors

[![vassilyp](https://avatars.githubusercontent.com/u/90280831?v=4)](https://github.com/vassilyp "vassilyp (17 commits)")[![gocaps](https://avatars.githubusercontent.com/u/3074378?v=4)](https://github.com/gocaps "gocaps (2 commits)")

### Embed Badge

![Health badge](/badges/ubc-web-services-cypress-d10-test/health.svg)

```
[![Health](https://phpackages.com/badges/ubc-web-services-cypress-d10-test/health.svg)](https://phpackages.com/packages/ubc-web-services-cypress-d10-test)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[pdepend/pdepend

Official version of pdepend to be handled with Composer

954110.9M814](/packages/pdepend-pdepend)[instaclick/php-webdriver

PHP WebDriver for Selenium 2

43761.8M22](/packages/instaclick-php-webdriver)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69417.9M511](/packages/spatie-phpunit-snapshot-assertions)[szepeviktor/phpstan-wordpress

WordPress extensions for PHPStan

3257.8M898](/packages/szepeviktor-phpstan-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
