Skip to content

Commit 1009635

Browse files
authored
Merge pull request #97 from eclipse-mnestix/staging
Release 1.4.0
2 parents e13022d + 773d28f commit 1009635

File tree

110 files changed

+4326
-3944
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+4326
-3944
lines changed

.env.local

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ APPLICATION_ID_URI: 'api://mnestix-test-web-api/'
22
LOCK_TIMESERIES_PERIOD_FEATURE_FLAG: true
33
COMPARISON_FEATURE_FLAG: true
44
AAS_LIST_FEATURE_FLAG: true
5-
AAS_LIST_V2_FEATURE_FLAG: false
65
TRANSFER_FEATURE_FLAG: false
76
AAS_REPO_API_URL: 'http://localhost:5064/repo'
87
SUBMODEL_REPO_API_URL: 'http://localhost:5064/repo'

.github/workflows/docker-build.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
IMAGE_NAME: mnestix-browser
1717
IMAGE_TAG: latest
1818
# Update the version manually
19-
IMAGE_TAG_VERSION: 1.3.3
19+
IMAGE_TAG_VERSION: 1.4.0
2020
REGISTRY_USER: ${{ secrets.DOCKER_USERNAME }}
2121
REGISTRY_PASS: ${{ secrets.DOCKER_API_TOKEN }}
2222

@@ -80,15 +80,15 @@ jobs:
8080
with:
8181
name: mnestix-browser
8282

83-
- name: Load mnestix-browser image
84-
run: docker load -i mnestix-browser.tar
85-
8683
# image too big to be reused
8784
- name: prepare tests
8885
run: |
8986
docker compose -f compose.yml -f docker-compose/compose.test.yml --profile tests build cypress-test
9087
docker compose -f compose.yml -f docker-compose/compose.test.yml --profile tests pull
9188
89+
- name: Load mnestix-browser image
90+
run: docker load -i mnestix-browser.tar
91+
9292
- name: Run e2e tests
9393
id: test
9494
run: |
@@ -97,6 +97,8 @@ jobs:
9797
env:
9898
SPLIT: ${{ strategy.job-total }}
9999
SPLIT_INDEX: ${{ strategy.job-index }}
100+
TEST_ADMIN_USER_PASSWORD: ${{ secrets.TEST_ADMIN_USER_PASSWORD }}
101+
TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}
100102

101103
- name: E2E test collect artifact
102104
id: test_artifact
@@ -105,6 +107,10 @@ jobs:
105107
name: cypress-artifacts-${{ matrix.containers }}
106108
path: cypress-artifacts/
107109

110+
- name: Fail if e2e tests failed
111+
if: ${{ failure() }}
112+
run: exit 1
113+
108114
push-image:
109115
name: Push image to registry
110116
needs: [ 'build-browser-image', 'unit-tests', 'e2e-tests' ]

.github/workflows/publish-wiki.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Publish wiki
2+
on:
3+
push:
4+
branches: [ main ]
5+
paths:
6+
- wiki/**
7+
- .github/workflows/publish-wiki.yml
8+
concurrency:
9+
group: publish-wiki
10+
cancel-in-progress: true
11+
permissions:
12+
contents: write
13+
jobs:
14+
publish-wiki:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: Andrew-Chen-Wang/github-wiki-action@v4

README.md

Lines changed: 6 additions & 680 deletions
Large diffs are not rendered by default.

compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ services:
2525
MNESTIX_BACKEND_API_URL: 'http://mnestix-api:5064'
2626
MNESTIX_BACKEND_API_KEY: ${MNESTIX_BACKEND_API_KEY:-verySecureApiKey}
2727
AAS_LIST_FEATURE_FLAG: "true"
28-
AAS_LIST_V2_FEATURE_FLAG: "false"
2928
TRANSFER_FEATURE_FLAG: "false"
3029
COMPARISON_FEATURE_FLAG: "true"
3130
AUTHENTICATION_FEATURE_FLAG: "false"
@@ -42,7 +41,7 @@ services:
4241
- mnestix-database:/app/prisma/database
4342

4443
mnestix-api:
45-
image: mnestix/mnestix-api:1.2.5
44+
image: mnestix/mnestix-api:1.3.0
4645
container_name: mnestix-api
4746
profiles: [ "", "backend", "tests" ]
4847
ports:

cypress.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,10 @@ export default defineConfig({
3333
MNESTIX_BACKEND_API_URL: 'http://localhost:5064',
3434
AAS_DISCOVERY_API_URL: 'http://localhost:5064/discovery',
3535
MNESTIX_API_KEY: process.env.MNESTIX_BACKEND_API_KEY,
36+
TEST_ADMIN_USER_LOGIN: process.env.TEST_ADMIN_USER_LOGIN,
37+
TEST_ADMIN_USER_PASSWORD: process.env.TEST_ADMIN_USER_PASSWORD,
38+
TEST_USER_LOGIN: process.env.TEST_USER_LOGIN,
39+
TEST_USER_PASSWORD: process.env.TEST_USER_PASSWORD,
40+
KEYCLOAK_ISSUER: process.env.KEYCLOAK_ISSUER,
3641
},
3742
});

cypress/e2e/dnsRedirectTest.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Test the DNS Redirect', function () {
88
cy.postTestAas();
99
});
1010
it('Visits the "/asset/URLEncodedAssetID" page and gets redirected to the corresponding viewer page', function () {
11-
cy.intercept({ method: 'POST', url: `/en/viewer/*` }).as('redirectedViewer');
11+
cy.intercept({ method: 'POST', url: '/en/viewer/*' }).as('redirectedViewer');
1212
let encodedUrl = encodeURIComponent(testAssetId);
1313

1414
cy.visit('/asset?assetId=' + encodedUrl);

cypress/e2e/listAasPageTest.spec.js

Lines changed: 49 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -9,77 +9,60 @@ describe('Test all Aas List features (Resolution 1920 x 1080)', function () {
99
cy.setResolution(resolutions[0]);
1010
cy.visit('/list');
1111
});
12-
it('should redirect to aas list when pressing the aas list button on the homepage', function () {
13-
cy.visit('/');
14-
cy.getByTestId('aasList-Button-Home').click();
15-
cy.url().should('contain', '/list');
16-
});
17-
it('should redirect to the viewer page when clicking on an aas list entry', function () {
18-
cy.getByTestId('list-to-detailview-button').first().click();
19-
cy.wait(100);
20-
cy.url().should('contain', '/viewer/');
21-
});
22-
it('should show the selected aas in the comparison list and enable the button', function () {
23-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
24-
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
25-
cy.getByTestId('compare-button').should('not.be.disabled');
26-
});
27-
it('should remove the aas from the comparison list when deselected and disable the button', function () {
28-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
29-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
30-
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
31-
cy.getByTestId('compare-button').should('be.disabled');
32-
});
33-
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
34-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
35-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
36-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
37-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
38-
.findByTestId('list-checkbox')
39-
.parent()
40-
.click();
41-
cy.get('.MuiAlert-root').should('exist');
42-
});
43-
it('should redirect to the comparison page when one aas is selected and button is pressed', function () {
44-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
45-
cy.getByTestId('compare-button').click();
46-
cy.wait(100);
47-
cy.url().should('contain', '/compare');
48-
});
49-
it('should filter the aas list when a product class is selected', function () {
50-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');
51-
52-
cy.getByTestId('product-class-select').click();
53-
cy.getByTestId('product-class-select-Actuator').click();
5412

13+
it('should load the first list page of the default repository and display the data', function () {
5514
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
56-
.findByTestId('product-class-chip')
57-
.contains('Actuator');
58-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('not.exist');
59-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
60-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
61-
});
62-
it('should update the filtered aas list when another product class is selected', function () {
63-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');
64-
65-
cy.getByTestId('product-class-select').click();
66-
cy.getByTestId('product-class-select-Control-system').click();
15+
.findByTestId('list-aasId')
16+
.contains('https://mnestix.io/aas/listTest1');
17+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
18+
.findByTestId('list-assetId')
19+
.contains('https://mnestix.io/listTest1');
20+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
21+
.findByTestId('list-manufacturer-name')
22+
.contains('listTest1 Manufacturer Name');
23+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]')
24+
.findByTestId('list-product-designation')
25+
.contains('listTest1 Product Designation');
6726

68-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('not.exist');
69-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
70-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('not.exist');
71-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('not.exist');
27+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
28+
.findByTestId('list-aasId')
29+
.contains('https://mnestix.io/aas/listTest2');
30+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
31+
.findByTestId('list-assetId')
32+
.contains('https://mnestix.io/listTest2');
33+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
34+
.findByTestId('list-manufacturer-name')
35+
.contains('listTest2 Manufacturer Name');
36+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]')
37+
.findByTestId('list-product-designation')
38+
.contains('listTest2 Product Designation');
7239
});
73-
it('should show the full aas list when the product class is reset', function () {
74-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox');
75-
76-
cy.getByTestId('product-class-select').click();
77-
cy.getByTestId('product-class-select-all').click();
7840

79-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').should('exist');
80-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').should('exist');
81-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').should('exist');
82-
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]').should('exist');
41+
describe('comparison list', function () {
42+
it('should show the selected aas in the comparison list, and comparison button redirects to comparison', function () {
43+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
44+
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('exist');
45+
cy.getByTestId('compare-button').should('not.be.disabled');
46+
cy.getByTestId('compare-button').click();
47+
cy.wait(100);
48+
cy.url().should('contain', '/compare');
49+
});
50+
it('should remove the aas from the comparison list when deselected and disable the button', function () {
51+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
52+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
53+
cy.get('[data-testid="selected-https://mnestix.io/aas/listTest1').should('not.exist');
54+
cy.getByTestId('compare-button').should('be.disabled');
55+
});
56+
it('should disable checkboxes and show a warning when the user tries to select more than 3 aas', function () {
57+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest1"]').findByTestId('list-checkbox').click();
58+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest2"]').findByTestId('list-checkbox').click();
59+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest3"]').findByTestId('list-checkbox').click();
60+
cy.get('[data-testid="list-row-https://mnestix.io/aas/listTest4"]')
61+
.findByTestId('list-checkbox')
62+
.parent()
63+
.click();
64+
cy.get('.MuiAlert-root').should('exist');
65+
});
8366
});
8467

8568
after(function () {

cypress/e2e/loginKeycloak.spec.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
describe('Login Keycloak user roles', function () {
2+
const adminTestUser = {
3+
login: Cypress.env('TEST_ADMIN_USER_LOGIN'),
4+
password: Cypress.env('TEST_ADMIN_USER_PASSWORD'),
5+
};
6+
const testUser = {
7+
login: Cypress.env('TEST_USER_LOGIN'),
8+
password: Cypress.env('TEST_USER_PASSWORD'),
9+
};
10+
11+
beforeEach(function () {
12+
cy.visit('/');
13+
});
14+
it('should be possible to login', () => {
15+
cy.getByTestId('header-burgermenu').click();
16+
cy.getByTestId('login-button').should('exist');
17+
});
18+
19+
it('should not be able to access templates without login', () => {
20+
cy.visit('/templates');
21+
cy.getByTestId('authentication-prompt-lock').should('exist');
22+
});
23+
24+
it('should show correct admin user login and icon', () => {
25+
cy.keycloakLogin(adminTestUser.login, adminTestUser.password);
26+
cy.getByTestId('header-burgermenu').click();
27+
28+
cy.getByTestId('user-info-box').should('have.text', 'admin@test.com');
29+
cy.getByTestId('admin-icon').should('exist');
30+
cy.getByTestId('login-button').should('be.not.exist');
31+
cy.keycloakLogout();
32+
});
33+
34+
it('should navigate to settings when logged in as admin user', () => {
35+
cy.keycloakLogin(adminTestUser.login, adminTestUser.password);
36+
cy.getByTestId('header-burgermenu').click();
37+
38+
cy.getByTestId('settings-menu-icon').should('exist').click();
39+
cy.getByTestId('settings-route-page').should('exist');
40+
cy.getByTestId('settings-header').should('have.text', 'Settings');
41+
42+
cy.getByTestId('header-burgermenu').click();
43+
cy.keycloakLogout();
44+
});
45+
46+
it('should show correct user login and icon', () => {
47+
cy.keycloakLogin(testUser.login, testUser.password);
48+
cy.getByTestId('header-burgermenu').click();
49+
50+
cy.getByTestId('user-info-box').should('have.text', 'user@test.com');
51+
cy.getByTestId('user-icon').should('exist');
52+
cy.getByTestId('login-button').should('be.not.exist');
53+
cy.keycloakLogout();
54+
});
55+
56+
it('should navigate to template when logged in as a user', () => {
57+
cy.keycloakLogin(testUser.login, testUser.password);
58+
59+
cy.visit('/templates');
60+
cy.getByTestId('templates-route-page').should('exist');
61+
cy.getByTestId('templates-header').should('include.text', 'Templates');
62+
63+
cy.getByTestId('header-burgermenu').click();
64+
cy.keycloakLogout();
65+
});
66+
67+
it('should block settings route when logged in as s user', () => {
68+
cy.keycloakLogin(testUser.login, testUser.password);
69+
70+
cy.visit('/settings');
71+
cy.getByTestId('not-allowed-prompt-lock').should('exist');
72+
73+
cy.getByTestId('header-burgermenu').click();
74+
cy.getByTestId('settings-menu-icon').should('not.exist');
75+
76+
cy.keycloakLogout();
77+
});
78+
});

0 commit comments

Comments
 (0)