-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Megre consortium to master
- Loading branch information
Showing
338 changed files
with
29,355 additions
and
365 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
cypress/e2e/consortia/affiliation-in-central-tenant-is-automatically-added.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Permissions from '../../support/dictionary/permissions'; | ||
import Affiliations, { tenantNames } from '../../support/dictionary/affiliations'; | ||
import Users from '../../support/fragments/users/users'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import ConsortiumManager from '../../support/fragments/settings/consortium-manager/consortium-manager'; | ||
import getRandomPostfix, { getTestEntityValue } from '../../support/utils/stringTools'; | ||
import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; | ||
import UsersCard from '../../support/fragments/users/usersCard'; | ||
|
||
describe('Consortia', () => { | ||
const createUserData = () => ({ | ||
username: getTestEntityValue('username'), | ||
barcode: getRandomPostfix(), | ||
personal: { | ||
firstName: getTestEntityValue('firstname'), | ||
preferredFirstName: getTestEntityValue('prefname'), | ||
middleName: getTestEntityValue('midname'), | ||
lastName: getTestEntityValue('lastname'), | ||
email: 'test@folio.org', | ||
}, | ||
patronGroup: 'undergrad (Undergraduate Student)', | ||
userType: 'Staff', | ||
}); | ||
const testUser = createUserData(); | ||
|
||
let user; | ||
|
||
before('Create users, data', () => { | ||
cy.getAdminToken(); | ||
|
||
cy.createTempUser([ | ||
Permissions.consortiaSettingsConsortiaAffiliationsEdit.gui, | ||
Permissions.uiUsersPermissions.gui, | ||
Permissions.uiUsersCreate.gui, | ||
Permissions.uiUsersPermissionsView.gui, | ||
Permissions.uiUsersView.gui, | ||
]) | ||
.then((userProperties) => { | ||
user = userProperties; | ||
}) | ||
.then(() => { | ||
cy.assignAffiliationToUser(Affiliations.College, user.userId); | ||
cy.setTenant(Affiliations.College); | ||
cy.assignPermissionsToExistingUser(user.userId, [ | ||
Permissions.consortiaSettingsConsortiaAffiliationsEdit.gui, | ||
Permissions.uiUsersPermissions.gui, | ||
Permissions.uiUsersCreate.gui, | ||
Permissions.uiUsersPermissionsView.gui, | ||
Permissions.uiUsersView.gui, | ||
]); | ||
cy.login(user.username, user.password, { | ||
path: TopMenu.usersPath, | ||
waiter: Users.waitLoading, | ||
}); | ||
ConsortiumManager.switchActiveAffiliation(tenantNames.college); | ||
}); | ||
}); | ||
|
||
after('Delete users, data', () => { | ||
cy.resetTenant(); | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
Users.deleteViaApi(testUser.id); | ||
}); | ||
|
||
it( | ||
'C387512 Affiliation in central tenant is automatically added after creating user in the member tenant (consortia) (thunderjet)', | ||
{ tags: ['smokeECS', 'thunderjet'] }, | ||
() => { | ||
Users.createViaUi(testUser).then((id) => { | ||
testUser.id = id; | ||
}); | ||
ConsortiumManager.switchActiveAffiliation(tenantNames.central); | ||
UsersSearchPane.searchByUsername(testUser.username); | ||
Users.verifyUserDetailsPane(); | ||
UsersCard.verifyAffiliationsQuantity('2'); | ||
UsersCard.expandAffiliationsAccordion(); | ||
UsersCard.verifyAffiliationsDetails('College', 2, 'Central Office'); | ||
}, | ||
); | ||
}); |
47 changes: 47 additions & 0 deletions
47
cypress/e2e/consortia/can-not-view-a-users-affiliations-accordion.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}, | ||
); | ||
}); |
36 changes: 36 additions & 0 deletions
36
cypress/e2e/consortia/check-logging-right-into-member-tenant.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import Permissions from '../../support/dictionary/permissions'; | ||
import Affiliations, { tenantNames } from '../../support/dictionary/affiliations'; | ||
import Users from '../../support/fragments/users/users'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import ConsortiumManager from '../../support/fragments/settings/consortium-manager/consortium-manager'; | ||
|
||
describe('Consortia', () => { | ||
let user; | ||
|
||
before('Create users, data', () => { | ||
cy.getAdminToken(); | ||
cy.setTenant(Affiliations.College); | ||
cy.createTempUser([Permissions.uiUsersView.gui]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
cy.login(user.username, user.password, { | ||
path: TopMenu.usersPath, | ||
waiter: Users.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('Delete users, data', () => { | ||
cy.resetTenant(); | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
}); | ||
|
||
it( | ||
'C387506 User created in Member tenant is logging right into Member tenant (consortia) (thunderjet)', | ||
{ tags: ['smokeECS', 'thunderjet'] }, | ||
() => { | ||
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); | ||
}, | ||
); | ||
}); |
99 changes: 99 additions & 0 deletions
99
...a/consortium-manager/central-and-member-tenant-has-access-to-consortium-manager-app.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import Arrays from '../../../support/utils/arrays'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import ConsortiumManager, { | ||
settingsItems, | ||
} from '../../../support/fragments/consortium-manager/consortiumManagerApp'; | ||
import SelectMembers from '../../../support/fragments/consortium-manager/modal/select-members'; | ||
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; | ||
import Affiliations, { tenantNames } from '../../../support/dictionary/affiliations'; | ||
|
||
describe('Consortia', () => { | ||
describe('Consortium manager', () => { | ||
let userData; | ||
const settingsList = Object.values(settingsItems); | ||
|
||
const verifyFoundMembersAndTotalSelected = (members, total, tenants) => { | ||
SelectMembers.verifyMembersFound(members); | ||
SelectMembers.verifyTotalSelected(total); | ||
SelectMembers.verifyAvailableTenants(tenants); | ||
}; | ||
|
||
before('Create users data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([Permissions.consortiaSettingsConsortiumManagerView.gui]).then( | ||
(userProperties) => { | ||
userData = userProperties; | ||
cy.assignAffiliationToUser(Affiliations.College, userData.userId); | ||
cy.login(userData.username, userData.password); | ||
}, | ||
); | ||
}); | ||
|
||
after('Delete users data', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(userData.userId); | ||
}); | ||
|
||
it( | ||
'C397335 User with "Consortium manager: Can share settings to all members" permission and active affiliations in "Central" and "Member" tenants has access to "Consortium manager" app (consortia) (thunderjet)', | ||
{ tags: ['criticalPathECS', 'thunderjet'] }, | ||
() => { | ||
TopMenuNavigation.navigateToApp('Consortium manager'); | ||
ConsortiumManager.verifyStatusOfConsortiumManager(); | ||
ConsortiumManager.clickSelectMembers(); | ||
SelectMembers.verifyStatusOfSelectMembersModal(); | ||
|
||
SelectMembers.changeSelectAllCheckbox('check'); | ||
verifyFoundMembersAndTotalSelected(2, 2, [tenantNames.central, tenantNames.college]); | ||
SelectMembers.searchTenant(tenantNames.central); | ||
verifyFoundMembersAndTotalSelected(1, 2, [tenantNames.central]); | ||
|
||
SelectMembers.selectMembers(tenantNames.central); | ||
SelectMembers.verifyMembersFound(1); | ||
SelectMembers.verifyTotalSelected(1); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.central, false); | ||
|
||
SelectMembers.saveAndClose(); | ||
ConsortiumManager.verifyStatusOfConsortiumManager(1); | ||
|
||
const randomSetting = Arrays.getRandomElement(settingsList); | ||
ConsortiumManager.chooseSettingsItem(randomSetting); | ||
ConsortiumManager.verifyMembersSelected(1); | ||
ConsortiumManager.verifySelectMembersButton(); | ||
|
||
ConsortiumManager.clickSelectMembers(); | ||
verifyFoundMembersAndTotalSelected(2, 1, [tenantNames.central, tenantNames.college]); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.central, false); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.college, true); | ||
SelectMembers.verifyModalCloseButtonEnabled(); | ||
SelectMembers.verifyModalCancelButtonEnabled(); | ||
SelectMembers.verifyModalSaveButtonEnabled(); | ||
|
||
SelectMembers.selectMembers(tenantNames.central); | ||
SelectMembers.selectMembers(tenantNames.college); | ||
verifyFoundMembersAndTotalSelected(2, 1, [tenantNames.central, tenantNames.college]); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.central, true); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.college, false); | ||
SelectMembers.verifyModalCloseButtonEnabled(); | ||
SelectMembers.verifyModalCancelButtonEnabled(); | ||
SelectMembers.verifyModalSaveButtonEnabled(); | ||
|
||
SelectMembers.saveAndClose(); | ||
ConsortiumManager.waitLoading(); | ||
ConsortiumManager.verifySettingPaneIsDisplayed(); | ||
ConsortiumManager.verifyPaneIncludesSettings(); | ||
ConsortiumManager.verifyMembersSelected(1); | ||
ConsortiumManager.verifySelectMembersButton(); | ||
|
||
cy.logout(); | ||
cy.login(userData.username, userData.password); | ||
TopMenuNavigation.navigateToApp('Consortium manager'); | ||
ConsortiumManager.verifyStatusOfConsortiumManager(1); | ||
ConsortiumManager.clickSelectMembers(); | ||
SelectMembers.verifyStatusOfSelectMembersModal(2, 1); | ||
SelectMembers.verifyMemberIsSelected(tenantNames.central, true); | ||
}, | ||
); | ||
}); | ||
}); |
81 changes: 81 additions & 0 deletions
81
...2e/consortia/consortium-manager/central-tenant-has-access-to-consortium-manager-app.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
import Arrays from '../../../support/utils/arrays'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import ConsortiumManager, { | ||
settingsItems, | ||
} from '../../../support/fragments/consortium-manager/consortiumManagerApp'; | ||
import SelectMembers from '../../../support/fragments/consortium-manager/modal/select-members'; | ||
import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; | ||
import { tenantNames } from '../../../support/dictionary/affiliations'; | ||
|
||
describe('Consortia', () => { | ||
describe('Consortium manager', () => { | ||
let userData; | ||
const settingsList = Object.values(settingsItems); | ||
|
||
const chooseSettingItem = (setting, members) => { | ||
ConsortiumManager.chooseSettingsItem(setting); | ||
ConsortiumManager.verifyMembersSelected(members); | ||
ConsortiumManager.verifySelectMembersButton(); | ||
}; | ||
const verifyFoundMembersAndTotalSelected = (members, total) => { | ||
SelectMembers.verifyMembersFound(members); | ||
SelectMembers.verifyTotalSelected(total); | ||
SelectMembers.verifyAvailableTenants([tenantNames.central]); | ||
}; | ||
const checkConsortiumManagerAfterSelectMembersSave = (setting, members) => { | ||
SelectMembers.saveAndClose(); | ||
ConsortiumManager.waitLoading(); | ||
ConsortiumManager.verifySettingPaneIsDisplayed(); | ||
ConsortiumManager.verifySelectedSettingIsDisplayed(setting); | ||
ConsortiumManager.verifyMembersSelected(members); | ||
ConsortiumManager.verifySelectMembersButton(); | ||
}; | ||
|
||
before('Create users data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([Permissions.consortiaSettingsConsortiumManagerView.gui]).then( | ||
(userProperties) => { | ||
userData = userProperties; | ||
cy.login(userData.username, userData.password); | ||
}, | ||
); | ||
}); | ||
|
||
after('Delete users data', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(userData.userId); | ||
}); | ||
|
||
it( | ||
'C397333 User with "Consortium manager: Can view existing settings" permission and active affiliation in "Central" tenant has access to "Consortium manager" app (consortia) (thunderjet)', | ||
{ tags: ['criticalPathECS', 'thunderjet'] }, | ||
() => { | ||
TopMenuNavigation.navigateToApp('Consortium manager'); | ||
ConsortiumManager.verifyStatusOfConsortiumManager(); | ||
ConsortiumManager.verifyMembersSelected(); | ||
ConsortiumManager.verifyPaneIncludesSettings(settingsList.sort()); | ||
const randomSetting = Arrays.getRandomElement(settingsList); | ||
chooseSettingItem(randomSetting, 1); | ||
ConsortiumManager.clickSelectMembers(); | ||
SelectMembers.changeSelectAllCheckbox('check'); | ||
SelectMembers.verifyStatusOfSelectMembersModal(1); | ||
verifyFoundMembersAndTotalSelected(1, 1); | ||
SelectMembers.changeSelectAllCheckbox('uncheck'); | ||
verifyFoundMembersAndTotalSelected(1, 0); | ||
checkConsortiumManagerAfterSelectMembersSave(randomSetting, 0); | ||
|
||
cy.logout(); | ||
cy.login(userData.username, userData.password); | ||
TopMenuNavigation.navigateToApp('Consortium manager'); | ||
ConsortiumManager.verifyStatusOfConsortiumManager(0); | ||
ConsortiumManager.verifyMembersSelected(0); | ||
chooseSettingItem(randomSetting, 0); | ||
ConsortiumManager.clickSelectMembers(); | ||
SelectMembers.verifyStatusOfSelectMembersModal(0); | ||
verifyFoundMembersAndTotalSelected(1, 0); | ||
checkConsortiumManagerAfterSelectMembersSave(randomSetting, 0); | ||
}, | ||
); | ||
}); | ||
}); |
Oops, something went wrong.