Skip to content

Commit

Permalink
refactor: cleanup (eclipse-edc#129)
Browse files Browse the repository at this point in the history
* refactor: cleanup

* add test on asset creation
  • Loading branch information
ndr-brt authored and farhin23 committed Mar 5, 2024
1 parent ff6d8d4 commit 88033e8
Show file tree
Hide file tree
Showing 53 changed files with 54 additions and 3,286 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'

- run: |
npm install
npm run cy
- run: npm install

- run: npm run cy

- name: Print docker logs
if: failure()
Expand Down
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,6 @@ EDC Data Dashboard is a dev frontend application for [EDC Management API](https:

Developer documentation can be found under [docs/developer](docs/developer/), where the main concepts and decisions are captured as [decision records](docs/developer/decision-records/).

## Generate client code for EDC REST APIs

1. [optional] copy the current version of EDC's `management-api.yaml` file to `openapi/`. There is one checked in, so this is not required.
2. in a shell execute
```shell
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i /local/openapi/management-api.yaml -g typescript-angular -o /local/src/modules/edc-dmgmt-client/
```
This re-generates the service and model classes.

> Please note that some of the client classes were edited manually after generation. When regenerating the classes for the API update be careful especially not to overwrite service `constructor` methods using the generator!
## Running the frontend locally
Should you want to run the frontend on your development machine, you'll have to configure some backend values. Those are stored in `app.config.json`, and
by default contain the following:
Expand Down
3 changes: 2 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
baseUrl: 'http://localhost:18080',
supportFile: false
supportFile: false,
experimentalStudio: true
},
env: {
consumerUrl: 'http//localhost:18080',
Expand Down
28 changes: 25 additions & 3 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
describe('end-to-end', () => {
it('should be accessible', () => {
const consumerUrl = Cypress.env('consumerUrl')
const providerUrl = Cypress.env('providerUrl')
const uuid = () => Cypress._.random(0, 1e6)
const consumerUrl = Cypress.env('consumerUrl')
const providerUrl = Cypress.env('providerUrl')

it('should be accessible', () => {
cy.visit(consumerUrl);

cy.visit(providerUrl);
})

it('should create an asset and view it on provider side', function() {
cy.visit(providerUrl);

const id = uuid()
const name = `asset-${id}`

cy.get('[href="/my-assets"]').as('assets-menu-item').click();
cy.get('#mat-input-0').as('asset-filter')
cy.get('.container').contains('Create asset').as('open-new-asset-dialog').click();
cy.get('#mat-input-1').as('asset-id-field').clear();
cy.get('@asset-id-field').type(id);
cy.get('#mat-input-2').as('asset-name-field').clear('ra');
cy.get('@asset-name-field').type(name);
cy.get('mat-dialog-actions').click().contains('Create').as('confirm-create-asset').click();

cy.get('@asset-filter').click({force: true}).type(name);

cy.get('[fxLayout="row wrap"]').as('assets-list').find('mat-card').should('have.length', 1)
});

})
Loading

0 comments on commit 88033e8

Please sign in to comment.