> For the complete documentation index, see [llms.txt](https://docs.codeforlife.education/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codeforlife.education/software-developer-guide/front-end/testing-strategy.md). Agents can also search and read this documentation through its [MCP server](https://docs.codeforlife.education/~gitbook/mcp).

# Testing Strategy

How we test our front end

When a PR is submitted, a series of tests will be run with Github actions. It is fine to just submit your PR and let the tests run on Github. However, if the tests fail, you may need to run the tests locally to investigate what's going on, then either fix the tests, or fix your code.

## Running Cypress tests locally

[Cypress](https://www.cypress.io/) is a frontend test framework that is used on part of Portal.

To run Cypress tests locally, you need two shell windows.

**Shell #1**

The following will run the portal/game on local server.

```
./run
```

**Shell #2**&#x20;

This will run the Cypress tests in the terminal.

```
yarn run cypress run
```

If you want to view the tests as they run using Cypress' test runner window, you can run:

```
yarn run cypress open
```

## Running Selenium tests locally

Selenium is a frontend test framework that is **used in Rapid Router and in Portal**. We aim to gradually migrate Selenium tests to Cypress.

**To run Selenium tests you need to install chromedriver**. Please check here on [how to install](https://chromedriver.chromium.org/getting-started) for your OS.

Similar with Cypress, it will launch a browser windows and you should be able to see a series of frontend actions.
