Skip to content

Commit

Permalink
remove old acceptance tests (#10921)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScharfViktor authored May 16, 2024
1 parent 7644f2f commit 3701ca4
Show file tree
Hide file tree
Showing 89 changed files with 17 additions and 11,190 deletions.
408 changes: 14 additions & 394 deletions .drone.star

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ playwright-report

/.pnpm-store/

# acceptance test artifacts
logfile.txt
comments.file

# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml
.drone.yml

Expand All @@ -59,8 +55,6 @@ comments.file
tests/report/cucumber_report.json
tests/report/cucumber_report.html
.vscode/settings.json
tests/acceptance/report/cucumber_report.json
tests/acceptance/report/cucumber_report.html

# third party licenses
/third-party-licenses
Expand Down
9 changes: 0 additions & 9 deletions dev/docker/selenium.Dockerfile

This file was deleted.

38 changes: 0 additions & 38 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,44 +140,6 @@ services:
- ocis-federated-config:/etc/ocis
- ${OCIS_WEB_CONFIG:-./dev/docker/ocis.web-federated.config.json}:/web/config.json:ro

selenium:
build:
dockerfile: selenium.Dockerfile
context: ./dev/docker
args:
SELENIUM_IMAGE: ${SELENIUM_IMAGE:-selenium/standalone-chrome:104.0-20220812}
container_name: web_selenium
ports:
- 4444:4444
- 5900:5900
- 7900:7900
- 6080:7900
volumes:
- /dev/shm:/dev/shm
- uploads:/uploads:ro
extra_hosts:
- host.docker.internal:${DOCKER_HOST:-host-gateway}
environment:
VNC_NO_PASSWORD: 'true'

middleware-ocis:
image: owncloud/owncloud-test-middleware:latest
hostname: middleware
extra_hosts:
- host.docker.internal:${DOCKER_HOST:-host-gateway}
ports:
- '3000:3000'
volumes:
- uploads:/uploads
environment:
MIDDLEWARE_PORT: 3000
MIDDLEWARE_HOST: '0.0.0.0'
RUN_ON_OCIS: 'true'
NODE_TLS_REJECT_UNAUTHORIZED: '0'
BACKEND_HOST: 'https://host.docker.internal:9200'
REMOTE_UPLOAD_DIR: '/uploads'
TEST_WITH_GRAPH_API: 'true'

companion:
image: owncloud/uppy-companion:3.12.13-owncloud
extra_hosts:
Expand Down
9 changes: 2 additions & 7 deletions docs/development/repo-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,9 @@ Having these packages side by side within the `/packages` folder of the repo is

### tests Folder

For historic reasons, there are two end-to-end test collections in the ownCloud Web project. The older one lives in `/tests/acceptance`,
using [Nightwatch.js](https://nightwatchjs.org). The newer one lives in `/tests/e2e`, using [Playwright](https://playwright.dev).
We're slowly moving away from the nightwatch.js-based e2e tests. As our coverage with playwright based e2e tests grows continuously, it might
happen that you will not find the `/tests/acceptance` folder anymore. If that's the case at the time of reading this, those are happy times.
You're more than welcome to make a pull request and adjust this section of the docs accordingly. :-)

The rest of the folder contains helpers and configuration files for our automated testing infrastructure.
We're using the [Playwright](https://playwright.dev) for UI testing. The UI tests are located in the `/tests/e2e`

You're more than welcome to make a pull request and adjust this section of the docs accordingly. :-)
You can read more about testing in our [testing section]({{< ref "../testing/_index.md" >}})

### package.json File
Expand Down
58 changes: 1 addition & 57 deletions docs/testing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,70 +115,14 @@ $ pnpm lint --fix

If the lint problems are not fixed by `--fix` option, we have to manually fix the code.

### Acceptance Tests (Nightwatch)

{{< hint info >}}
We've decided to switch to playwright for end-to-end tests. As we steadily increase the coverage of our playwright
based e2e tests we keep the existing nightwatch based e2e tests maintained. However, we decided to not add new scenarios
to the nightwatch based e2e tests anymore.

In other words: only continue reading about our nightwatch based acceptance tests below if you need to debug a failing test.
{{< /hint >}}

At ownCloud, we have decided to adopt Docker as the main environment for developing our application. This also applies for running our acceptance tests.

#### Preparation

Please make sure you have installed all dependencies and started the server(s) as described in [tooling]({{< ref "tooling.md#development-setup" >}}).

#### Prepare & Start Web

Bundle the web frontend, which then gets mounted into the respective backends. It also gets recompiled on changes.

```shell
$ pnpm build:w
```

#### Start Docker

The acceptance tests need additional docker containers to be running.

```shell
$ docker compose up ocis selenium middleware-ocis
```

and make sure there are no conflicting ports and everything runs smoothly. You can check if everything has worked by opening [https://host.docker.internal:9200](https://host.docker.internal:9200) and logging in using the demo user (admin/admin).

If you're using a M1 Mac, you need to use `seleniarm/standalone-chromium:4.7.0-20221206`for now. To do so, export `SELENIUM_IMAGE=seleniarm/standalone-chromium:4.7.0-20221206`.

#### Run acceptance tests

- Change the directory to `tests/acceptance`
- Install all the test dependencies with `pnpm install` command
- Run the tests

```shell
$ pnpm test:acceptance:ocis features/path/to/test
```

#### Watch the Test Run

To watch the tests while running, open [http://host.docker.internal:7900/](http://host.docker.internal:7900/) in the browser to access your VNC client.

### Analyze the Test Report

The cucumber library is used as the test runner for both e2e and acceptance tests. The report generator script lives inside the `tests/e2e/cucumber/report` folder. If you want to create a report after the tests are done, run the command:
The cucumber library is used as the test runner for e2e tests. The report generator script lives inside the `tests/e2e/cucumber/report` folder. If you want to create a report after the tests are done, run the command:

```bash
node tests/e2e/cucumber/report --report-input=tests/e2e/cucumber/report/report.json
```

`--report-input` is the path to the report file generated by the test runner. If you want to generate a report for the acceptance tests, you can run the command

```bash
node tests/e2e/cucumber/report --report-input=tests/acceptance/report/report.json
```

By default, the report gets generated to reports/e2e/cucumber/releaseReport/cucumber_report.html.
The location can be changed by adding the `--report-location` flag.

Expand Down
63 changes: 0 additions & 63 deletions tests/acceptance/check-deleted-suites-in-expected-failure.sh

This file was deleted.

29 changes: 0 additions & 29 deletions tests/acceptance/customCommands/angryClick.js

This file was deleted.

20 changes: 0 additions & 20 deletions tests/acceptance/customCommands/clearValueWithEvent.js

This file was deleted.

3 changes: 0 additions & 3 deletions tests/acceptance/customCommands/clickElementAt.js

This file was deleted.

29 changes: 0 additions & 29 deletions tests/acceptance/customCommands/getClipBoardContent.js

This file was deleted.

43 changes: 0 additions & 43 deletions tests/acceptance/customCommands/initAjaxCounters.js

This file was deleted.

Loading

0 comments on commit 3701ca4

Please sign in to comment.