Skip to content

Commit

Permalink
Implementing of FAT-10876 (#3155)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorBohdan committed Feb 5, 2024
1 parent 04b121e commit 8241203
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import permissions from '../../support/dictionary/permissions';
import TopMenu from '../../support/fragments/topMenu';
import Users from '../../support/fragments/users/users';
import UsersCard from '../../support/fragments/users/usersCard';
import UsersSearchPane from '../../support/fragments/users/usersSearchPane';

describe('Consortia', () => {
let firstUser;
let secondUser;

before(() => {
cy.getAdminToken();

cy.createTempUser([]).then((userProperties) => {
firstUser = userProperties;
});

cy.createTempUser([permissions.uiUsersView.gui]).then((secondUserProperties) => {
secondUser = secondUserProperties;
cy.login(secondUser.username, secondUser.password, {
path: TopMenu.usersPath,
waiter: Users.waitLoading,
});
});
});

after(() => {
cy.getAdminToken();
Users.deleteViaApi(firstUser.userId);
Users.deleteViaApi(secondUser.userId);
});

it(
'C380507 A user without appropriate permission can not view a users affiliations accordion (consortia) (thunderjet)',
{ tags: ['criticalPathECS', 'thunderjet'] },
() => {
UsersSearchPane.searchByUsername(firstUser.username);
UsersSearchPane.selectUserFromList(firstUser.username);
UsersCard.varifyUserCardOpened();
UsersCard.affiliationsAccordionIsAbsent();
UsersSearchPane.searchByUsername(secondUser.username);
UsersSearchPane.selectUserFromList(secondUser.username);
UsersCard.varifyUserCardOpened();
UsersCard.affiliationsAccordionIsAbsent();
},
);
});
4 changes: 4 additions & 0 deletions cypress/support/fragments/users/usersCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export default {
cy.do(affiliationsSection.find(affiliationsButton).click());
},

affiliationsAccordionIsAbsent() {
cy.expect(affiliationsSection.absent());
},

expandLoansSection(openLoans, returnedLoans) {
cy.do(loansSection.clickHeader());

Expand Down

0 comments on commit 8241203

Please sign in to comment.