Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: remove Cypress #2535

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,3 @@ updates:
include: "scope"
labels:
- "dependencies"
- package-ecosystem: "npm"
directory: "/tests/cypress" # Cypress testing
schedule:
interval: "daily"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "dependencies"
6 changes: 1 addition & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@ jobs:
uses: ./.github/workflows/tests-pytest.yml
if: github.ref_type == 'tag'

tests-cypress:
uses: ./.github/workflows/tests-cypress.yml
if: github.ref_type == 'tag'

check-migrations-and-messages:
uses: ./.github/workflows/check-migrations-and-messages.yml
if: github.ref_type == 'tag'

deploy:
runs-on: ubuntu-latest
needs:
[tests-ui, tests-pytest, tests-cypress, check-migrations-and-messages]
[tests-ui, tests-pytest, check-migrations-and-messages]
if: (!cancelled())
environment: ${{ github.ref_type != 'tag' && github.ref_name || contains(github.ref, '-rc') && 'test' || 'prod' }}

Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/tests-cypress.yml

This file was deleted.

9 changes: 0 additions & 9 deletions bin/test_start.sh

This file was deleted.

13 changes: 0 additions & 13 deletions docs/configuration/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,6 @@ The number of seconds `requests` will wait for the client to establish a connect

The number of seconds the client will wait for the server to send a response. Defaults to 1 second.

## Cypress tests

!!! tldr "Cypress docs"

[`CYPRESS_*` variables](https://docs.cypress.io/guides/guides/environment-variables#Option-3-CYPRESS_)

### `CYPRESS_baseUrl`

The base URL for the (running) application, against which all Cypress `.visit()` etc. commands are run.

When Cypress is running inside the devcontainer, this should be `http://localhost:8000`. When Cypress is running outside the
devcontainer, check the [`DJANGO_LOCAL_PORT`](#django_local_port).

## Sentry

### `SENTRY_DSN`
Expand Down
55 changes: 0 additions & 55 deletions docs/tests/automated-tests.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
# Automated tests

## Cypress

Feature and user interface tests are implemented with [`cypress`](https://www.cypress.io/) and can be found in the
[`tests/cypress`](https://github.com/cal-itp/benefits/tree/main/tests/cypress) directory in the repository.

See the [`cypress` Command Line](https://docs.cypress.io/guides/guides/command-line) guide for more information.

### Running

These are instructions for running `cypress` locally on your machine, _without_ the [devcontainer](../development/README.md#vs-code-with-devcontainers). These steps
will install `cypress` and its dependencies on your machine. Make sure to run these commands in a Terminal.

1. Ensure you have Node.js and NPM available on your local machine:

```bash
node -v
npm -v
```

If not, [install Node.js](https://nodejs.org/en/download/) locally.

1. Start the local eligibility verification server:

```bash
docker compose up --detach server
```

1. Start the the application:

```bash
docker compose run --detach --service-ports client bin/test_start.sh
```

1. Change into the `cypress` directory:

```bash
cd tests/cypress
```

1. Install all packages and `cypress`. Verify `cypress` installation succeeds:

```bash
npm install
```

1. Run `cypress` with test environment variables and configuration variables:

```bash
CYPRESS_baseUrl=http://localhost:8000 npm run cypress:open
```

See `tests/cypress/package.json` for more cypress scripts.

As of Cypress 12.5.1 with Firefox 109, there is a CSRF issue that prevents the tests from passing; unclear if this is a bug in Cypress or what. Use one of the other browser options.

## Pytest

The tests done at a request/unit level are run via [pytest-django](https://pytest-django.readthedocs.io/en/latest/index.html).
Expand Down
3 changes: 0 additions & 3 deletions tests/cypress/.gitignore

This file was deleted.

19 changes: 0 additions & 19 deletions tests/cypress/cypress.config.js

This file was deleted.

1 change: 0 additions & 1 deletion tests/cypress/fixtures/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions tests/cypress/fixtures/transit-agencies.js

This file was deleted.

10 changes: 0 additions & 10 deletions tests/cypress/fixtures/users.json

This file was deleted.

Loading
Loading