Skip to content

Commit

Permalink
Feat(listv2 as default) (#74)
Browse files Browse the repository at this point in the history
* removed all v1 list files

* e2e list test adaption to new list

* e2e list test adaption to new list

* filter out configuration aas

* ts-ignore

* missing translation string

* missing translation string

* get artifacts back

* use the current branch image

* pipeline should fail when e2e tests are failing

* pipeline should fail when e2e tests are failing

* fix
  • Loading branch information
GailMelanie authored Jan 22, 2025
1 parent c330cc9 commit 37f8654
Show file tree
Hide file tree
Showing 31 changed files with 417 additions and 1,177 deletions.
1 change: 0 additions & 1 deletion .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ APPLICATION_ID_URI: 'api://mnestix-test-web-api/'
LOCK_TIMESERIES_PERIOD_FEATURE_FLAG: true
COMPARISON_FEATURE_FLAG: true
AAS_LIST_FEATURE_FLAG: true
AAS_LIST_V2_FEATURE_FLAG: false
TRANSFER_FEATURE_FLAG: false
AAS_REPO_API_URL: 'http://localhost:5064/repo'
SUBMODEL_REPO_API_URL: 'http://localhost:5064/repo'
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ jobs:
with:
name: mnestix-browser

- name: Load mnestix-browser image
run: docker load -i mnestix-browser.tar

# image too big to be reused
- name: prepare tests
run: |
docker compose -f compose.yml -f docker-compose/compose.test.yml --profile tests build cypress-test
docker compose -f compose.yml -f docker-compose/compose.test.yml --profile tests pull
- name: Load mnestix-browser image
run: docker load -i mnestix-browser.tar

- name: Run e2e tests
id: test
run: |
Expand All @@ -105,6 +105,10 @@ jobs:
name: cypress-artifacts-${{ matrix.containers }}
path: cypress-artifacts/

- name: Fail if e2e tests failed
if: ${{ failure() }}
run: exit 1

push-image:
name: Push image to registry
needs: [ 'build-browser-image', 'unit-tests', 'e2e-tests' ]
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ implementation of standardized digital twins. It opens the way for use cases suc
You can find a demo [here](https://mnestix-prod.azurewebsites.net/).
Some screenshots can be found in the [screenshots folder](screenshots).

### **If you need support feel free to contact us through our website [here](https://xitaso.com/kompetenzen/mnestix/#support).**
### **If you need support feel free to contact us through our
website [here](https://xitaso.com/kompetenzen/mnestix/#support).**

## Quickstart

Expand Down Expand Up @@ -145,7 +146,8 @@ NEXTAUTH_SECRET: '<<YOUR_SECRET>>'
**Mnestix Browser on port 3000 - http://localhost:3000**
<br><br>
- **docker-compose/compose.frontend.yml** - runs Mnestix Browser with a Basyx environment (AAS-Environment with MongoDB, Discovery Service, AAS/Submodel Registry) but without the Mnestix-API.<br>
- **docker-compose/compose.frontend.yml** - runs Mnestix Browser with a Basyx environment (AAS-Environment with MongoDB,
Discovery Service, AAS/Submodel Registry) but without the Mnestix-API.<br>
**Mnestix Browser on port 3000 - http://localhost:3000**
- **docker-compose/compose.dev.yml** - override file to run Mnestix Browser in a development environment. A development
Expand Down Expand Up @@ -283,8 +285,7 @@ Mnestix provides the following configuration options. You can adapt the values i
| `AAS_REPO_API_URL` | | Default AAS Repository to display when AAS Id is not in AAS Registry | required |
| `SUBMODEL_REPO_API_URL` | | Default Submodel Repository to display when Submodel Id is not in Submodel Registry | required |
| `MNESTIX_BACKEND_API_URL` | | Mnestix Backend with a lot of business comfort features like the Repository-Proxy or the Template builder | optional |
| `AAS_LIST_FEATURE_FLAG` | false | Enables or disables the AasList in the frontend. This only works in combination with `Features__AllowRetrievingAllShellsAndSubmodels` being set to `true` (Needs the Mnestix Backend to work) | optional |
| `AAS_LIST_V2_FEATURE_FLAG` | false | The functionality controlled by this flag is under active development and may change without notice. Please see [details](#aas-list-v2-feature-details) | optional |
| `AAS_LIST_FEATURE_FLAG` | true | Enables or disables the AasList in the frontend. This only works in combination with `Features__AllowRetrievingAllShellsAndSubmodels` being set to `true` | optional |
| `TRANSFER_FEATURE_FLAG` | false | Enables or disables the Transfer Feature in the frontend. If enabled, it is possible to import a viewed AAS to a configured repository. This feature is currently being developed. | optional |
| `AUTHENTICATION_FEATURE_FLAG` | false | Enable or disable the authentication in the frontend. (Needs the Mnestix Backend to work) | optional |
| `COMPARISON_FEATURE_FLAG` | false | Enables or disables the comparison feature. | optional |
Expand Down Expand Up @@ -419,7 +420,9 @@ MNESTIX_BACKEND_API_URL: '{{MNESTIX_BACKEND_API_URL}}'
This is the easiest configuration, for when you only want to visualize and browse through AAS.
If you choose to run the Mnestix Browser without the Mnestix API, the Feature Flags `AUTHENTICATION_FEATURE_FLAG`
and `AAS_LIST_FEATURE_FLAG` will be overwritten to `false` as these Features use the functionality of the API.
The other environment variables should be configured [as described](#frontend-configuration). If you want to run Mnestix Browser with an Basyx environment you can simply use the compose.frontend file which is described [here](#Docker-Compose-files).
The other environment variables should be configured [as described](#frontend-configuration). If you want to run Mnestix
Browser with an Basyx environment you can simply use the compose.frontend file which is
described [here](#Docker-Compose-files).

#### How to configure the BaSyx AAS Repository

Expand Down Expand Up @@ -733,4 +736,5 @@ For this purpose, issues which are particularly suitable for a first contributio
If this is your first time contributing to an eclipse project, we recommend having a look at this
guide: [Contributing to a Eclipse project](https://www.eclipse.org/contribute/).
We would be more than happy to have you on board. If there is anything you want to know, feel free to contact
us [mnestix@xitaso.com](mailto:mnestix@xitaso.com) or through our website [here](https://xitaso.com/kompetenzen/mnestix/#support).
us [mnestix@xitaso.com](mailto:mnestix@xitaso.com) or through our
website [here](https://xitaso.com/kompetenzen/mnestix/#support).
1 change: 0 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ services:
MNESTIX_BACKEND_API_URL: 'http://mnestix-api:5064'
MNESTIX_BACKEND_API_KEY: ${MNESTIX_BACKEND_API_KEY:-verySecureApiKey}
AAS_LIST_FEATURE_FLAG: "true"
AAS_LIST_V2_FEATURE_FLAG: "false"
TRANSFER_FEATURE_FLAG: "false"
COMPARISON_FEATURE_FLAG: "true"
AUTHENTICATION_FEATURE_FLAG: "false"
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/dnsRedirectTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Test the DNS Redirect', function () {
cy.postTestAas();
});
it('Visits the "/asset/URLEncodedAssetID" page and gets redirected to the corresponding viewer page', function () {
cy.intercept({ method: 'POST', url: `/en/viewer/*` }).as('redirectedViewer');
cy.intercept({ method: 'POST', url: '/en/viewer/*' }).as('redirectedViewer');
let encodedUrl = encodeURIComponent(testAssetId);

cy.visit('/asset?assetId=' + encodedUrl);
Expand Down
115 changes: 49 additions & 66 deletions cypress/e2e/listAasPageTest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,77 +9,60 @@ describe('Test all Aas List features (Resolution 1920 x 1080)', function () {
cy.setResolution(resolutions[0]);
cy.visit('/list');
});
it('should redirect to aas list when pressing the aas list button on the homepage', function () {
cy.visit('/');
cy.getByTestId('aasList-Button-Home').click();
cy.url().should('contain', '/list');
});
it('should redirect to the viewer page when clicking on an aas list entry', function () {
cy.getByTestId('list-to-detailview-button').first().click();
cy.wait(100);
cy.url().should('contain', '/viewer/');
});
it('should show the selected aas in the comparison list and enable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
cy.getByTestId('compare-button').should('not.be.disabled');
});
it('should remove the aas from the comparison list when deselected and disable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
cy.getByTestId('compare-button').should('be.disabled');
});
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
.findByTestId('list-checkbox')
.parent()
.click();
cy.get('.MuiAlert-root').should('exist');
});
it('should redirect to the comparison page when one aas is selected and button is pressed', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.getByTestId('compare-button').click();
cy.wait(100);
cy.url().should('contain', '/compare');
});
it('should filter the aas list when a product class is selected', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-Actuator').click();

it('should load the first list page of the default repository and display the data', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('product-class-chip')
.contains('Actuator');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
});
it('should update the filtered aas list when another product class is selected', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-Control-system').click();
.findByTestId('list-aasId')
.contains('https://mnestix.io/aas/listTest1');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-assetId')
.contains('https://mnestix.io/listTest1');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-manufacturer-name')
.contains('listTest1 Manufacturer Name');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
.findByTestId('list-product-designation')
.contains('listTest1 Product Designation');

cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-aasId')
.contains('https://mnestix.io/aas/listTest2');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-assetId')
.contains('https://mnestix.io/listTest2');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-manufacturer-name')
.contains('listTest2 Manufacturer Name');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
.findByTestId('list-product-designation')
.contains('listTest2 Product Designation');
});
it('should show the full aas list when the product class is reset', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');

cy.getByTestId('product-class-select').click();
cy.getByTestId('product-class-select-all').click();

cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('exist');
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('exist');
describe('comparison list', function () {
it('should show the selected aas in the comparison list, and comparison button redirects to comparison', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
cy.getByTestId('compare-button').should('not.be.disabled');
cy.getByTestId('compare-button').click();
cy.wait(100);
cy.url().should('contain', '/compare');
});
it('should remove the aas from the comparison list when deselected and disable the button', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
cy.getByTestId('compare-button').should('be.disabled');
});
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
.findByTestId('list-checkbox')
.parent()
.click();
cy.get('.MuiAlert-root').should('exist');
});
});

after(function () {
Expand Down
Loading

0 comments on commit 37f8654

Please sign in to comment.