-
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.
Merge branch 'master' into eureka-test-snapshot
- Loading branch information
Showing
14 changed files
with
744 additions
and
12 deletions.
There are no files selected for viewing
486 changes: 486 additions & 0 deletions
486
...p/bulk-edit-in-app-holdings-electronic-access-replace-with-action-in-central-tenant.cy.js
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
100 changes: 100 additions & 0 deletions
100
cypress/e2e/inventory/instance/edit-instance-date-fields-length-validation.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,100 @@ | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit'; | ||
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import { INSTANCE_DATE_TYPES } from '../../../support/constants'; | ||
import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
|
||
describe('Inventory', () => { | ||
describe('Instance', () => { | ||
const testData = { | ||
instanceTitle: `C552531 Auto ${getRandomPostfix()}`, | ||
date1set: ['1999u', '1', '12', '12b', '12b6', '12b6', '12b6'], | ||
date2set: ['20b27', '9', '199u', '199u', '19', '199', '199u'], | ||
dateType: INSTANCE_DATE_TYPES.RANGE, | ||
}; | ||
|
||
before('Login', () => { | ||
cy.createTempUser([Permissions.uiInventoryViewCreateEditInstances.gui]).then( | ||
(userProperties) => { | ||
testData.user = userProperties; | ||
InventoryInstance.createInstanceViaApi({ instanceTitle: testData.instanceTitle }).then( | ||
({ instanceData }) => { | ||
testData.instanceId = instanceData.instanceId; | ||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
InventoryInstances.searchByTitle(testData.instanceId); | ||
InventoryInstances.selectInstanceById(testData.instanceId); | ||
}, | ||
); | ||
}, | ||
); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken(); | ||
InventoryInstance.deleteInstanceViaApi(testData.instanceId); | ||
Users.deleteViaApi(testData.user.userId); | ||
}); | ||
|
||
it( | ||
'C552531 Cannot update Instance with more or less than 4 characters in "Date 1" and "Date 2" fields (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire', 'C552531'] }, | ||
() => { | ||
InstanceRecordView.verifyInstancePaneExists(); | ||
InstanceRecordView.edit(); | ||
InstanceRecordEdit.waitLoading(); | ||
InstanceRecordEdit.verifyDateFieldsValues(); | ||
InstanceRecordEdit.fillDates( | ||
testData.date1set[0], | ||
testData.date2set[0], | ||
testData.dateType, | ||
true, | ||
); | ||
InstanceRecordEdit.clickSaveAndKeepEditingButton(); | ||
InstanceRecordEdit.verifySuccessfulMessage(); | ||
InstanceRecordEdit.waitLoading(); | ||
InstanceRecordEdit.verifyDateFieldsValues( | ||
testData.date1set[0].slice(0, 4), | ||
testData.date2set[0].slice(0, 4), | ||
testData.dateType, | ||
); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[1], testData.date2set[1]); | ||
InstanceRecordEdit.clickSaveAndCloseButton(); | ||
InstanceRecordEdit.verifyDateFieldsValidationErrors(true, true); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[2], testData.date2set[2]); | ||
InstanceRecordEdit.clickSaveAndCloseButton(); | ||
InstanceRecordEdit.verifyDateFieldsValidationErrors(true, false); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[3], testData.date2set[3]); | ||
InstanceRecordEdit.clickSaveAndCloseButton(); | ||
InstanceRecordEdit.verifyDateFieldsValidationErrors(true, false); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[4], testData.date2set[4]); | ||
InstanceRecordEdit.clickSaveAndCloseButton(); | ||
InstanceRecordEdit.verifyDateFieldsValidationErrors(false, true); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[5], testData.date2set[5]); | ||
InstanceRecordEdit.clickSaveAndCloseButton(); | ||
InstanceRecordEdit.verifyDateFieldsValidationErrors(false, true); | ||
|
||
InstanceRecordEdit.fillDates(testData.date1set[6], testData.date2set[6]); | ||
InstanceRecordEdit.saveAndClose(); | ||
InstanceRecordEdit.verifySuccessfulMessage(); | ||
InstanceRecordView.verifyInstanceIsOpened(testData.instanceTitle); | ||
InstanceRecordView.verifyDates( | ||
testData.date1set[6], | ||
testData.date2set[6], | ||
testData.dateType, | ||
); | ||
}, | ||
); | ||
}); | ||
}); |
60 changes: 60 additions & 0 deletions
60
cypress/e2e/inventory/instance/edit-instance-no-date2.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,60 @@ | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
import InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit'; | ||
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import { INSTANCE_DATE_TYPES } from '../../../support/constants'; | ||
import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import Permissions from '../../../support/dictionary/permissions'; | ||
|
||
describe('Inventory', () => { | ||
describe('Instance', () => { | ||
const testData = { | ||
instanceTitle: `C552528 Auto ${getRandomPostfix()}`, | ||
date1: '0981', | ||
dateType: INSTANCE_DATE_TYPES.QUESTIONABLE, | ||
}; | ||
|
||
before('Login', () => { | ||
cy.createTempUser([Permissions.uiInventoryViewCreateEditInstances.gui]).then( | ||
(userProperties) => { | ||
testData.user = userProperties; | ||
InventoryInstance.createInstanceViaApi({ instanceTitle: testData.instanceTitle }).then( | ||
({ instanceData }) => { | ||
testData.instanceId = instanceData.instanceId; | ||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
InventoryInstances.searchByTitle(testData.instanceId); | ||
InventoryInstances.selectInstanceById(testData.instanceId); | ||
}, | ||
); | ||
}, | ||
); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.getAdminToken(); | ||
InventoryInstance.deleteInstanceViaApi(testData.instanceId); | ||
Users.deleteViaApi(testData.user.userId); | ||
}); | ||
|
||
it( | ||
'C552528 Edit Instance with selected "Date type" and field "Date 1" filled only (spitfire)', | ||
{ tags: ['criticalPath', 'spitfire', 'C552528'] }, | ||
() => { | ||
InstanceRecordView.verifyInstancePaneExists(); | ||
InstanceRecordView.edit(); | ||
InstanceRecordEdit.waitLoading(); | ||
InstanceRecordEdit.verifyDateFieldsValues(); | ||
InstanceRecordEdit.fillDates(testData.date1, undefined, testData.dateType); | ||
InstanceRecordEdit.saveAndClose(); | ||
InstanceRecordEdit.verifySuccessfulMessage(); | ||
InstanceRecordView.verifyInstanceIsOpened(testData.instanceTitle); | ||
InstanceRecordView.verifyDates(testData.date1, undefined, testData.dateType); | ||
}, | ||
); | ||
}); | ||
}); |
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
37 changes: 37 additions & 0 deletions
37
...consortium-manager/inventory/instances-holdings-items/urlRelationshipConsortiumManager.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,37 @@ | ||
import uuid from 'uuid'; | ||
import { REQUEST_METHOD } from '../../../../constants'; | ||
|
||
const id = uuid(); | ||
|
||
export default { | ||
createViaApi(type) { | ||
return cy.getConsortiaId().then((consortiaId) => { | ||
cy.okapiRequest({ | ||
method: REQUEST_METHOD.POST, | ||
path: `consortia/${consortiaId}/sharing/settings`, | ||
body: { | ||
url: '/electronic-access-relationships', | ||
settingId: id, | ||
payload: { | ||
id, | ||
name: type.payload.name, | ||
}, | ||
}, | ||
}).then(() => { | ||
type.url = '/electronic-access-relationships'; | ||
type.settingId = id; | ||
return type; | ||
}); | ||
}); | ||
}, | ||
|
||
deleteViaApi(type) { | ||
cy.getConsortiaId().then((consortiaId) => { | ||
cy.okapiRequest({ | ||
method: REQUEST_METHOD.DELETE, | ||
path: `consortia/${consortiaId}/sharing/settings/${type.settingId}`, | ||
body: type, | ||
}); | ||
}); | ||
}, | ||
}; |
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
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
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
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
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
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