Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
HejdaJakub committed Sep 11, 2023
2 parents 3fec9d3 + 316df47 commit 3799c07
Show file tree
Hide file tree
Showing 37 changed files with 1,281 additions and 2,182 deletions.
62 changes: 51 additions & 11 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,57 @@
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "feat", "hidden": false },
{ "type": "fix", "hidden": false },
{ "type": "perf", "hidden": false },
{ "type": "revert", "hidden": false },
{ "type": "docs", "hidden": true },
{ "type": "style", "hidden": true },
{ "type": "chore", "hidden": true },
{ "type": "refactor", "hidden": true },
{ "type": "test", "hidden": true },
{ "type": "build", "hidden": true },
{ "type": "ci", "hidden": true }
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Performance Improvements"
},
{
"type": "revert",
"section": "Reverts"
},
{
"type": "docs",
"section": "Documentation",
"hidden": true
},
{
"type": "style",
"section": "Code style",
"hidden": true
},
{
"type": "chore",
"section": "Others",
"hidden": true
},
{
"type": "refactor",
"section": "Refactoring",
"hidden": true
},
{
"type": "test",
"section": "Tests",
"hidden": true
},
{
"type": "build",
"section": "Build",
"hidden": true
},
{
"type": "ci",
"section": "CI",
"hidden": true
}
],
"issuePrefixes": ["ST"],
"issueUrlFormat": "https://perunaai.atlassian.net/browse/{{prefix}}{{id}}"
Expand Down
2 changes: 1 addition & 1 deletion apps/admin-gui-e2e/src/e2e/admin/perun-admin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Perun admin management with role Perun admin', () => {
.get(`[data-cy=${dbServiceName2.toLowerCase()}-name-td]`)
.click()
.get('[data-cy=service-edit-button]')
.click()
.click({force: true})
.get('[data-cy=service-name-input]')
.clear()
.type(dbServiceName2 + 'edit', {force: true})
Expand Down
113 changes: 56 additions & 57 deletions apps/admin-gui-e2e/src/e2e/facilities/facility-admin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,63 +176,62 @@ describe('Facility management with role Facility admin', () => {
.should('not.exist');
});

it('test add facility manager', () => {
cy.intercept('**/facilitiesManager/getEnrichedFacilities')
.as('getEnrichedFacilities')
.intercept('**/usersManager/findRichUsersWithAttributes?**')
.as('findRichUsers')
// .wait('@getEnrichedFacilities')
.get('[data-cy=filter-input]')
.type(dbFacilityName2, {force: true})
.get(`[data-cy=${dbFacilityName2}]`)
.click()
.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=managers]')
.click()
.get('[data-cy=add-manager-button]')
.click()
.get('[data-cy=search-manager-input]')
.type(addManagerUser, {force: true})
.get('[data-cy=search-manager-button]')
.click()
.wait('@findRichUsers')
.get(`[data-cy=${addManagerUser}-checkbox]`)
.click()
.get('[data-cy=add-manager-button-dialog]')
.click()
.intercept('**/authzResolver/getRichAdmins?**')
.as('getRichAdmins')
.wait('@getRichAdmins')
// assert that manager was added
.get(`[data-cy=${addManagerUser}-checkbox]`)
.should('exist');
});
context('Advanced settings', () => {

it('test remove facility manager', () => {
cy.intercept('**/facilitiesManager/getEnrichedFacilities')
.as('getEnrichedFacilities')
// .wait('@getEnrichedFacilities')
.get('[data-cy=filter-input]')
.type(dbFacilityName2, {force: true})
.get(`[data-cy=${dbFacilityName2}]`)
.click()
.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=managers]')
.click()
.get(`[data-cy=${removeManagerUser}-checkbox]`)
.click()
.get('[data-cy=remove-manager-button]')
.should('have.attr', 'color', 'warn') // check if the button is enabled (due to the force click below)
.click({ force: true })
.get('[data-cy=remove-manager-button-dialog]')
.click()
.intercept('**/authzResolver/getRichAdmins?**')
.as('getRichAdmins')
.wait('@getRichAdmins')
// assert that manager doesn't exist
.get(`[data-cy=${removeManagerUser}-checkbox]`)
.should('not.exist');
it('test add facility manager', () => {
cy.intercept('**/facilitiesManager/getEnrichedFacilities')
.as('getEnrichedFacilities')
.intercept('**/usersManager/findRichUsersWithAttributes?**')
.as('findRichUsers')
// .wait('@getEnrichedFacilities')
.get('[data-cy=filter-input]')
.type(dbFacilityName2, {force: true})
.get(`[data-cy=${dbFacilityName2}]`)
.click()
.get('[data-cy=managers]')
.click()
.get('[data-cy=add-manager-button]')
.click()
.get('[data-cy=search-manager-input]')
.type(addManagerUser, {force: true})
.get('[data-cy=search-manager-button]')
.click()
.wait('@findRichUsers')
.get(`[data-cy=${addManagerUser}-checkbox]`)
.click()
.get('[data-cy=add-manager-button-dialog]')
.click()
.intercept('**/authzResolver/getRichAdmins?**')
.as('getRichAdmins')
.wait('@getRichAdmins')
// assert that manager was added
.get(`[data-cy=${addManagerUser}-checkbox]`)
.should('exist');
});

it('test remove facility manager', () => {
cy.intercept('**/facilitiesManager/getEnrichedFacilities')
.as('getEnrichedFacilities')
// .wait('@getEnrichedFacilities')
.get('[data-cy=filter-input]')
.type(dbFacilityName2, {force: true})
.get(`[data-cy=${dbFacilityName2}]`)
.click()
.get('[data-cy=managers]')
.click()
.get(`[data-cy=${removeManagerUser}-checkbox]`)
.click()
.get('[data-cy=remove-manager-button]')
.should('have.attr', 'color', 'warn') // check if the button is enabled (due to the force click below)
.click({ force: true })
.get('[data-cy=remove-manager-button-dialog]')
.click()
.intercept('**/authzResolver/getRichAdmins?**')
.as('getRichAdmins')
.wait('@getRichAdmins')
// assert that manager doesn't exist
.get(`[data-cy=${removeManagerUser}-checkbox]`)
.should('not.exist');
});
});
});
43 changes: 18 additions & 25 deletions apps/admin-gui-e2e/src/e2e/facilities/facility-observer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ describe('Facility management with role Facility observer', () => {
.should('exist')
});

//FIXME: same problem as in the test below
it.skip('test list assigned users', () => {
it('test list assigned users', () => {
cy.get('[data-cy=assigned-users]')
.click()
.get('[data-cy=filter-input]')
Expand All @@ -49,12 +48,7 @@ describe('Facility management with role Facility observer', () => {
.should('exist')
});

//FIXME: this test often fails when it is executed from command line (but NOT from UI)
// There is problem with policies - test sometimes fails with error "You are not
// authorized to perform this action", but according to getPerunPrincipal() method
// there should be the privilege for given facility and called method (getAllowedGroups).
// For the correct run in CI this test was skipped for this moment
it.skip('test list allowed groups', () => {
it('test list allowed groups', () => {
cy.get('[data-cy=allowed-groups]')
.click()
.reload()
Expand Down Expand Up @@ -103,23 +97,22 @@ describe('Facility management with role Facility observer', () => {
.should('exist')
});

it('test list owners', () => {
cy.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=owners]')
.click()
.get('[data-cy=filter-input]')
.type(dbOwnerName, {force: true})
.get(`[data-cy=${dbOwnerName}]`)
.should('exist')
});
context('Advanced settings', () => {

it('test list managers', () => {
cy.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=managers]')
.click()
.get(`[data-cy=${dbManagerFirstName}-firstName-td]`)
.should('exist')
it('test list owners', () => {
cy.get('[data-cy=owners]')
.click()
.get('[data-cy=filter-input]')
.type(dbOwnerName, {force: true})
.get(`[data-cy=${dbOwnerName}]`)
.should('exist')
});

it('test list managers', () => {
cy.get('[data-cy=managers]')
.click()
.get(`[data-cy=${dbManagerFirstName}-firstName-td]`)
.should('exist')
});
});
});
13 changes: 4 additions & 9 deletions apps/admin-gui-e2e/src/e2e/groups/group-admin.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ describe('Group management with role Group admin', () => {
.get('[data-cy=attributes]')
.click()
.get('[data-cy=add-attributes]')
.click()
.should('be.enabled')
.click({force: true})
.get('.mat-mdc-dialog-container')
.find('[data-cy=filter-input]') // finds the data-cy attribute inside the dialog container
.type('footer', {force: true})
Expand Down Expand Up @@ -176,13 +177,8 @@ describe('Group management with role Group admin', () => {
});

context('Advanced settings', () => {
beforeEach(() => {
cy.get('[data-cy=advanced-settings]')
.click();
});

// TODO fix - randomly failing due to a bug with privileges
it.skip('test create group application form item', () => {
it('test create group application form item', () => {
cy.intercept('**/registrarManager/updateFormItems/**')
.as('addFormItem')
.get('[data-cy=application-form]')
Expand All @@ -209,8 +205,7 @@ describe('Group management with role Group admin', () => {
.should('exist');
});

// TODO fix - randomly failing due to a bug with privileges
it.skip('test delete group application form item', () => {
it('test delete group application form item', () => {
cy.intercept('**/registrarManager/updateFormItems/**')
.as('deleteFormItem')
.get('[data-cy=application-form]')
Expand Down
57 changes: 25 additions & 32 deletions apps/admin-gui-e2e/src/e2e/groups/group-observer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,9 @@ describe('Group management with role Group observer', () => {
.should('exist')
});

it('test list managers', () => {
cy.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=managers]')
.click()
.get(`[data-cy=${dbGroupAdmin}-firstName-td]`)
.should('exist')
});

it('test list extsources', () => {
cy.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=external-sources]')
.click()
.get('[data-cy=filter-input]')
.type(dbExtsource, {force: true})
.get(`[data-cy=${dbExtsource}-name-td]`)
.should('exist')
});

it('test list vo members', () => {
cy.get('[data-cy=vo-link]')
.click({force: true})
//FIXME: this is just a quick fix to reload the page cause there is a problem with policies otherwise
// this problem occurs only during the test not in real usage of admin-gui application
.reload()
.get('[data-cy=members]')
.click()
.get('[data-cy=filter-input]')
Expand All @@ -79,15 +56,6 @@ describe('Group management with role Group observer', () => {
.should('exist')
});

it('test get application form', () => {
cy.get('[data-cy=advanced-settings]')
.click()
.get('[data-cy=application-form]')
.click()
.get(`[data-cy=${dbApplicationItemTextFieldName}-shortname-td]`)
.should('exist')
});

it('test list applications', () => {
cy.get('[data-cy=applications]')
.click()
Expand All @@ -97,4 +65,29 @@ describe('Group management with role Group observer', () => {
.should('exist')
});

context('Advanced settings', () => {

it('test list managers', () => {
cy.get('[data-cy=managers]')
.click()
.get(`[data-cy=${dbGroupAdmin}-firstName-td]`)
.should('exist')
});

it('test list extsources', () => {
cy.get('[data-cy=external-sources]')
.click()
.get('[data-cy=filter-input]')
.type(dbExtsource, {force: true})
.get(`[data-cy=${dbExtsource}-name-td]`)
.should('exist')
});

it('test get application form', () => {
cy.get('[data-cy=application-form]')
.click()
.get(`[data-cy=${dbApplicationItemTextFieldName}-shortname-td]`)
.should('exist')
});
});
});
Loading

0 comments on commit 3799c07

Please sign in to comment.