Skip to content

Commit

Permalink
fixed after block
Browse files Browse the repository at this point in the history
  • Loading branch information
TetianaParanich committed Sep 25, 2024
1 parent 45279e9 commit 86258b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ describe('Reading Room Access', () => {

after('Deleting created entities', () => {
cy.getAdminToken();
Users.deleteViaApi(userNotAllowedInReadingRoom.user.userId);
Users.deleteViaApi(userAllowedInReadingRoom.user.userId);
UserEdit.changeServicePointPreferenceViaApi(userNotAllowedInReadingRoom.user.userId, [
userNotAllowedInReadingRoom.servicePoint.id,
]);
ServicePoints.deleteViaApi(userNotAllowedInReadingRoom.servicePoint.id);
Users.deleteViaApi(userNotAllowedInReadingRoom.user.userId);
UserEdit.changeServicePointPreferenceViaApi(userAllowedInReadingRoom.user.userId, [
userAllowedInReadingRoom.servicePoint.id,
]);
ServicePoints.deleteViaApi(userAllowedInReadingRoom.servicePoint.id);
Users.deleteViaApi(userAllowedInReadingRoom.user.userId);
SettingsReadingRoom.deleteReadingRoomViaApi(readingRoomId);
});

Expand Down
8 changes: 5 additions & 3 deletions cypress/support/fragments/reading-room/readingRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ function fillInPatronCard(userBarcode) {
cy.do(TextField({ id: 'patronBarcode' }).fillIn(userBarcode));
}

function clickenterButton() {
function clickEnterButton() {
cy.do(Button({ type: 'submit' }).click());
}

export default {
fillInPatronCard,
clickenterButton,
clickEnterButton,
waitLoading() {
cy.expect(Pane({ id: 'reading-room' }).exists());
},
scanUser(userBarcode) {
fillInPatronCard(userBarcode);
clickenterButton();
cy.wait(1000);
clickEnterButton();
},
clickNotAllowedButton() {
cy.wait(1500);
cy.do(Button({ id: 'deny-access' }).click());
},

verifyUserIsScanned(userfirstName) {
cy.wait(5000);
cy.get('[class^="borrowerDetails-"]').contains(userfirstName).should('be.visible');
},
verifyUserInformation(userInfo) {
Expand Down

0 comments on commit 86258b9

Please sign in to comment.