Skip to content

Commit

Permalink
temporarily removed cypress to simplifiy the nuxt transition
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Mar 14, 2024
1 parent 22cc955 commit 736c549
Show file tree
Hide file tree
Showing 40 changed files with 95 additions and 79,851 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/webclient-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,6 @@ on:
workflow_dispatch:

jobs:
webclient-e2e-test:
strategy:
matrix:
browser:
- chrome
- firefox
runs-on: ubuntu-latest
container:
image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
options: --user 1001
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: pnpm/[email protected]
with:
version: 8
package_json_file: webclient/package.json
- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run dev
wait-on: "http://localhost:3000"
browser: ${{ matrix.browser }}
working-directory: webclient
webclient-linting:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 0 additions & 4 deletions webclient/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ dist-ssr
coverage
*.local

# cypress saves screenshots and videos here when running `npm run test`
/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
Expand Down
50 changes: 1 addition & 49 deletions webclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,57 +125,9 @@ For this part of the project, the tests consist mainly of hot-path e2e tests and
PRs improving the coverage are very likely to be accepted.
The reason behind these tests is that they fundamentally increase the future productivity by allowing faster review cycles.

### Running Tests

There are a few ways of running cypress

#### e2e tests

For running e2e tests, it is assumed, that you

- are on a normal machine (not a mac)
- have [Chrome](https://www.google.com/intl/de/chrome/) + [Firefox Developer Edition](https://www.mozilla.org/de/firefox/developer/) installed.
- have the webclient running on `http://localhost:3000` (i.e. `npm run dev`)

The interface for interacting with cypress can be opened via

```bash
pnpm run cy:open
```

##### Running headless

```bash
pnpm run test
```

There are also some subtargets preconfigured like `cy:run:chrome` and `cy:run:firefox`, but likely for debugging you want the second mode.

#### component tests

```bash
pnpm run test:components
```

Currently, these are not run in CI, as I could not get cypress to behave in [#892](https://github.com/TUM-Dev/NavigaTUM/pull/892)

#### Running headed

### Writing Tests

Our Cypress test suite is located in the cypress directory, organized into different files and folders based on the features and components being tested.
Each test file follows the naming convention `<name>.spec.ts`.

Cypress provides a comprehensive API for interacting with and asserting against elements on the web page.
You can find detailed documentation and examples in the official Cypress documentation: <https://docs.cypress.io>

When writing new tests, please ensure to follow our established conventions and guidelines to maintain consistency across the codebase.
Additionally, make sure to write descriptive test cases that cover different scenarios and edge cases to thoroughly validate the functionality of our frontend.

### Continuous Integration

We have integrated Cypress tests into our CI/CD pipeline to ensure that all changes to the frontend are thoroughly tested before deployment.
Every push and pull request triggers a build that runs the Cypress tests automatically.
Every push and pull request triggers a build that runs linting issues (cypress is currently temporarily disabled to help in the nuxt transition).
This helps us catch any regressions or issues early in the development process.

### Reporting Issues
Expand Down
12 changes: 0 additions & 12 deletions webclient/cypress.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions webclient/cypress.d.ts

This file was deleted.

46 changes: 0 additions & 46 deletions webclient/cypress/e2e/feedback.cy.ts

This file was deleted.

26 changes: 0 additions & 26 deletions webclient/cypress/e2e/frontpage.cy.ts

This file was deleted.

45 changes: 0 additions & 45 deletions webclient/cypress/e2e/search.cy.ts

This file was deleted.

1 change: 0 additions & 1 deletion webclient/cypress/fixtures/feedback/feedback.json

This file was deleted.

3 changes: 0 additions & 3 deletions webclient/cypress/fixtures/feedback/get_token.json

This file was deleted.

Loading

0 comments on commit 736c549

Please sign in to comment.