Skip to content

Commit

Permalink
Merge pull request #502 from geonetwork/e2e
Browse files Browse the repository at this point in the history
E2E: Write a first cypress end-to-end test for the Datahub
  • Loading branch information
cmoinier authored Jul 27, 2023
2 parents 4fc39cc + 31e2864 commit 0c53597
Show file tree
Hide file tree
Showing 112 changed files with 71,617 additions and 1,359 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ Lastly, even if authenticated requests were cleared regarding CORS rules, it wou

### Tests

#### Unit tests

Run `npm test` to execute the affected unit tests via Jest.
Affected code is compared to origin/main.

Expand All @@ -179,6 +181,35 @@ npx nx test (lib_name)
npx nx test --test-match=/data/dev/gn/ui/libs/common/src/lib/services/bootstrap.service.spec.ts
```

#### End-to-end-tests

You can test the datahub app by page :

- home page
- search page
- organisations page
- dataset pages

##### To run the tests with the interface :

Start docker from 'support-services', and then in the 'geonetwork-ui' folder :

```shell script
npx nx e2e appname --watch
```

Then select the file(s) you want to test in the interface.

##### To run the tests without interface :

Start docker from 'support-services', and then in the 'geonetwork-ui' folder :

--> ALl tests :

```shell script
npx nx e2e appname
```

## Project structure

The GeoNetwork UI project was generated using [Nx](https://nx.dev) and is composed of:
Expand Down
18 changes: 0 additions & 18 deletions apps/data-platform-e2e/.eslintrc.json

This file was deleted.

11 changes: 0 additions & 11 deletions apps/data-platform-e2e/jest.config.ts

This file was deleted.

22 changes: 0 additions & 22 deletions apps/data-platform-e2e/project.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/data-platform-e2e/src/data-platform/data-platform.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/data-platform-e2e/src/support/global-setup.ts

This file was deleted.

7 changes: 0 additions & 7 deletions apps/data-platform-e2e/src/support/global-teardown.ts

This file was deleted.

10 changes: 0 additions & 10 deletions apps/data-platform-e2e/src/support/test-setup.ts

This file was deleted.

Empty file.
13 changes: 0 additions & 13 deletions apps/data-platform-e2e/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions apps/data-platform-e2e/tsconfig.spec.json

This file was deleted.

17 changes: 0 additions & 17 deletions apps/datafeeder-e2e/.eslintrc.json

This file was deleted.

12 changes: 0 additions & 12 deletions apps/datafeeder-e2e/cypress.json

This file was deleted.

30 changes: 0 additions & 30 deletions apps/datafeeder-e2e/project.json

This file was deleted.

4 changes: 0 additions & 4 deletions apps/datafeeder-e2e/src/fixtures/example.json

This file was deleted.

13 changes: 0 additions & 13 deletions apps/datafeeder-e2e/src/integration/app.spec.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/datafeeder-e2e/src/plugins/index.js

This file was deleted.

1 change: 0 additions & 1 deletion apps/datafeeder-e2e/src/support/app.po.ts

This file was deleted.

33 changes: 0 additions & 33 deletions apps/datafeeder-e2e/src/support/commands.ts

This file was deleted.

19 changes: 0 additions & 19 deletions apps/datafeeder-e2e/tsconfig.e2e.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/datafeeder-e2e/tsconfig.json

This file was deleted.

7 changes: 0 additions & 7 deletions apps/datahub-e2e/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["src/plugins/index.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"no-undef": "off"
}
}
]
}
10 changes: 10 additions & 0 deletions apps/datahub-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'cypress'
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset'

export default defineConfig({
e2e: {
...nxE2EPreset(__dirname),
video: false,
downloadsFolder: 'cypress/downloads',
},
})
12 changes: 0 additions & 12 deletions apps/datahub-e2e/cypress.json

This file was deleted.

Loading

0 comments on commit 0c53597

Please sign in to comment.