-
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.
- Loading branch information
1 parent
d798e95
commit 2a3eb73
Showing
5 changed files
with
271 additions
and
100 deletions.
There are no files selected for viewing
85 changes: 0 additions & 85 deletions
85
cypress/e2e/permissions/view-reading-room-access-permission.cy.js
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
...an-assign-settings-tenant-can-create-edit-and-remove-reading-room-access-permission.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,71 @@ | ||
import uuid from 'uuid'; | ||
import Permissions from '../../support/dictionary/permissions'; | ||
import SettingsReadingRoom from '../../support/fragments/settings/tenant/general/readingRoom'; | ||
import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import UserEdit from '../../support/fragments/users/userEdit'; | ||
import Users from '../../support/fragments/users/users'; | ||
import UsersCard from '../../support/fragments/users/usersCard'; | ||
import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; | ||
|
||
describe('Reading Room Access', () => { | ||
const testData = { | ||
servicePoint: ServicePoints.getDefaultServicePoint(), | ||
readingRoomId: uuid(), | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken(); | ||
ServicePoints.createViaApi(testData.servicePoint) | ||
.then((servicePoint) => { | ||
testData.servicePoint.id = servicePoint.body.id; | ||
}) | ||
.then(() => SettingsReadingRoom.createReadingRoomViaApi( | ||
testData.servicePoint.id, | ||
testData.servicePoint.name, | ||
testData.readingRoomId, | ||
false, | ||
)); | ||
|
||
cy.createTempUser([]).then((userProperties) => { | ||
testData.userWithoutPermissions = userProperties; | ||
|
||
UserEdit.addServicePointViaApi( | ||
testData.servicePoint.id, | ||
userProperties.userId, | ||
testData.servicePoint.id, | ||
); | ||
}); | ||
|
||
cy.createTempUser([Permissions.uiUserCanAssignUnassignPermissions.gui]).then( | ||
(userProperties) => { | ||
testData.user = userProperties; | ||
|
||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.usersPath, | ||
waiter: UsersSearchPane.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
ServicePoints.deleteViaApi(testData.servicePoint.id); | ||
SettingsReadingRoom.deleteReadingRoomViaApi(testData.readingRoomId); | ||
Users.deleteViaApi(testData.user.userId); | ||
Users.deleteViaApi(testData.userWithoutPermissions.userId); | ||
}); | ||
|
||
it( | ||
'C466238 User can create edit and remove reading room access permission (volaris)', | ||
{ tags: ['smoke', 'volaris'] }, | ||
() => { | ||
UsersSearchPane.searchByUsername(testData.userWithoutPermissions.username); | ||
UsersSearchPane.waitLoading(); | ||
UserEdit.addPermissions([Permissions.uiSettingsTenantReadingRoomAll.gui]); | ||
UserEdit.saveAndClose(); | ||
UsersCard.verifyPermissions([Permissions.uiSettingsTenantReadingRoomAll.gui]); | ||
}, | ||
); | ||
}); |
72 changes: 72 additions & 0 deletions
72
...eading-room/user-can-assign-settings-tenant-can-view-reading-room-access-permission.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,72 @@ | ||
import uuid from 'uuid'; | ||
import Permissions from '../../support/dictionary/permissions'; | ||
import { ReadingRoom } from '../../support/fragments/settings/tenant/general'; | ||
import SettingsReadingRoom from '../../support/fragments/settings/tenant/general/readingRoom'; | ||
import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; | ||
import TopMenu from '../../support/fragments/topMenu'; | ||
import UserEdit from '../../support/fragments/users/userEdit'; | ||
import Users from '../../support/fragments/users/users'; | ||
import UsersCard from '../../support/fragments/users/usersCard'; | ||
import UsersSearchPane from '../../support/fragments/users/usersSearchPane'; | ||
|
||
describe('Reading Room Access', () => { | ||
const testData = { | ||
servicePoint: ServicePoints.getDefaultServicePoint(), | ||
readingRoomId: uuid(), | ||
}; | ||
|
||
before('Create test data and login', () => { | ||
cy.getAdminToken(); | ||
ServicePoints.createViaApi(testData.servicePoint) | ||
.then((servicePoint) => { | ||
testData.servicePoint.id = servicePoint.body.id; | ||
}) | ||
.then(() => SettingsReadingRoom.createReadingRoomViaApi( | ||
testData.servicePoint.id, | ||
testData.servicePoint.name, | ||
testData.readingRoomId, | ||
false, | ||
)); | ||
|
||
cy.createTempUser([]).then((userProperties) => { | ||
testData.userWithoutPermissions = userProperties; | ||
|
||
UserEdit.addServicePointViaApi( | ||
testData.servicePoint.id, | ||
userProperties.userId, | ||
testData.servicePoint.id, | ||
); | ||
}); | ||
|
||
cy.createTempUser([Permissions.uiUserCanAssignUnassignPermissions.gui]).then( | ||
(userProperties) => { | ||
testData.user = userProperties; | ||
|
||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.usersPath, | ||
waiter: UsersSearchPane.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
ServicePoints.deleteViaApi(testData.servicePoint.id); | ||
ReadingRoom.deleteReadingRoomViaApi(testData.readingRoomId); | ||
Users.deleteViaApi(testData.user.userId); | ||
Users.deleteViaApi(testData.userWithoutPermissions.userId); | ||
}); | ||
|
||
it( | ||
'C466237 User can view reading room access permission (volaris)', | ||
{ tags: ['smoke', 'volaris'] }, | ||
() => { | ||
UsersSearchPane.searchByUsername(testData.userWithoutPermissions.username); | ||
UsersSearchPane.waitLoading(); | ||
UserEdit.addPermissions([Permissions.uiSettingsTenantReadingRoom.gui]); | ||
UserEdit.saveAndClose(); | ||
UsersCard.verifyPermissions([Permissions.uiSettingsTenantReadingRoom.gui]); | ||
}, | ||
); | ||
}); |
77 changes: 77 additions & 0 deletions
77
cypress/e2e/reading-room/user-can-view-reading-room-access.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,77 @@ | ||
import uuid from 'uuid'; | ||
import Permissions from '../../support/dictionary/permissions'; | ||
import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; | ||
import SettingsMenu from '../../support/fragments/settingsMenu'; | ||
import Users from '../../support/fragments/users/users'; | ||
import SettingsReadingRoom from '../../support/fragments/settings/tenant/general/readingRoom'; | ||
import getRandomPostfix from '../../support/utils/stringTools'; | ||
|
||
describe('Reading Room Access', () => { | ||
const testData = { | ||
firstReadingRoomId: uuid(), | ||
firstReadingRoomName: `Autotest_Reading_Room${getRandomPostfix()}`, | ||
secondReadingRoomId: uuid(), | ||
thirdReadingRoomId: uuid(), | ||
}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken(); | ||
ServicePoints.createViaApi(ServicePoints.getDefaultServicePoint()).then((servicePoint) => { | ||
testData.firstServicePoint = servicePoint.body; | ||
|
||
SettingsReadingRoom.createReadingRoomViaApi( | ||
testData.firstServicePoint.id, | ||
testData.firstServicePoint.name, | ||
testData.firstReadingRoomId, | ||
false, | ||
testData.firstReadingRoomName, | ||
); | ||
}); | ||
ServicePoints.createViaApi(ServicePoints.getDefaultServicePoint()).then((servicePoint) => { | ||
testData.secondServicePoint = servicePoint.body; | ||
|
||
SettingsReadingRoom.createReadingRoomViaApi( | ||
testData.secondServicePoint.id, | ||
testData.secondServicePoint.name, | ||
testData.secondReadingRoomId, | ||
false, | ||
); | ||
}); | ||
ServicePoints.createViaApi(ServicePoints.getDefaultServicePoint()).then((servicePoint) => { | ||
testData.thirdServicePoint = servicePoint.body; | ||
|
||
SettingsReadingRoom.createReadingRoomViaApi( | ||
testData.thirdServicePoint.id, | ||
testData.thirdServicePoint.name, | ||
testData.thirdReadingRoomId, | ||
false, | ||
); | ||
}); | ||
|
||
cy.createTempUser([Permissions.uiSettingsTenantReadingRoom.gui]).then((userProperties) => { | ||
testData.user = userProperties; | ||
|
||
cy.login(testData.user.username, testData.user.password); | ||
}); | ||
}); | ||
|
||
after('Deleting created entities', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.user.userId); | ||
ServicePoints.deleteViaApi(testData.firstServicePoint.id); | ||
ServicePoints.deleteViaApi(testData.secondServicePoint.id); | ||
ServicePoints.deleteViaApi(testData.thirdServicePoint.id); | ||
SettingsReadingRoom.deleteReadingRoomViaApi(testData.firstReadingRoomId); | ||
SettingsReadingRoom.deleteReadingRoomViaApi(testData.secondReadingRoomId); | ||
SettingsReadingRoom.deleteReadingRoomViaApi(testData.thirdReadingRoomId); | ||
}); | ||
|
||
it('C466319 User can view reading room access (volaris)', { tags: ['smoke', 'volaris'] }, () => { | ||
cy.visit(SettingsMenu.tenantPath); | ||
SettingsReadingRoom.loadReadingRoomRecord(); | ||
SettingsReadingRoom.verifyColumns(); | ||
SettingsReadingRoom.verifyActionsButtonAbsent(); | ||
SettingsReadingRoom.verifyNewButtonAbsent(); | ||
SettingsReadingRoom.verifyPublicCheckboxIsDisabled(testData.firstReadingRoomName); | ||
}); | ||
}); |
Oops, something went wrong.