Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ describe('eHoldings', () => {
const testData = {
resourcePath: '/resources/38-467-103587',
titleName: 'Fashion Theory',
noneProxy: 'Inherited - None',
noneProxy: 'None',
defaultProxy: null,
firstProxy: null,
};

before('Create user and login', () => {
cy.getAdminToken();
cy.getEholdingsProxiesViaAPI().then((proxies) => {
testData.defaultProxy = proxies.find((proxy) => proxy.includes('Inherited'));
});
cy.createTempUser([
Permissions.uieHoldingsRecordsEdit.gui,
Permissions.uieHoldingsPackageTitleSelectUnselect.gui,
Expand Down Expand Up @@ -58,17 +63,20 @@ describe('eHoldings', () => {
cy.wait(1000);

EHoldingsResourceView.verifyProxy(testData.firstProxy);
EHoldingsResourceView.verifyProxiedURL();

EHoldingsResourceView.verifyProxiedURLLink();
if (testData.firstProxy.includes(testData.noneProxy)) EHoldingsResourceView.verifyProxiedURLNotDisplayed();
else {
EHoldingsResourceView.verifyProxiedURL();
EHoldingsResourceView.verifyProxiedURLLink();
}
});

EHoldingsResourceView.removeTitleFromHolding();
cy.wait(1000);
EHoldingsResourceView.checkHoldingStatus('Not selected');
EHoldingsResourceView.verifyResourceSettingsAccordion();
EHoldingsResourceView.verifyProxy(testData.noneProxy);
EHoldingsResourceView.verifyProxiedURLNotDisplayed();
EHoldingsResourceView.verifyProxy(testData.defaultProxy);
if (testData.defaultProxy.includes(testData.noneProxy)) EHoldingsResourceView.verifyProxiedURLNotDisplayed();
else EHoldingsResourceView.verifyProxiedURL();
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ describe('Eureka', () => {
cy.login(testUser.username, testUser.password);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.USERS);
Users.waitLoading();
cy.reload();
Users.waitLoading();
}, 20_000);
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
Users.waitLoading();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ describe('Inventory', () => {
InventorySearchAndFilter.toggleAccordionByName(formatAccordionName);
SelectInstanceModal.checkOptionsWithCountersExistInAccordion(formatAccordionName);

cy.intercept('/search/instances?*').as('searchInstances0');
SelectInstanceModal.searchByName(instanceTitlePrefix);
cy.wait('@searchInstances0').its('response.statusCode').should('eq', 200);
instanceTitles.forEach((title) => {
InventorySearchAndFilter.verifySearchResult(title);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ describe('Inventory', () => {
cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => {
testData.user = userProperties;
});
cy.logout();
});
});

Expand All @@ -150,7 +149,8 @@ describe('Inventory', () => {
}, 20_000);

InventorySearchAndFilter.selectBrowseSubjects();
BrowseSubjects.waitForSubjectToAppear(testData.searchAuthorityQueries[0], true, true);
BrowseSubjects.waitForSubjectToAppear(testData.searchAuthorityQueries[0], true, true, 2);
cy.wait(10_000); // to make sure BOTH subjects are indexed as linked
InventorySearchAndFilter.browseSearch(testData.browseQueries[0]);
BrowseSubjects.checkAuthorityIconAndValueDisplayedForRow(
5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ const propertyName = 'authority';
const browseQuery = 'C409476';

const authorizedCorporate =
'C409476 Corporate name 110 Apple & Honey Productions subb subc subd subg subn subv subx suby subz';
'C409476 Corporate name 110 Apple & Honey Productions subb subc subd subg subn--subv--subx--suby--subz';
const referenceCorporate =
'C409476 Corporate name 410 Apple and Honey Productions subb subc subd subg subn subv subx suby subz';
'C409476 Corporate name 410 Apple and Honey Productions subb subc subd subg subn--subv--subx--suby--subz';
const authRefCorporate =
'C409476 Corporate name 510 Apple & Honey Film Corp. subb subc subd subg subn subv subx suby subz';
'C409476 Corporate name 510 Apple & Honey Film Corp. subb subc subd subg subn--subv--subx--suby--subz';
const authorizedConference =
'C409476 Conference Name 111 Western Region Agricultural Education Research Meeting subc subd subn subq subg subv subx suby subz';
'C409476 Conference Name 111 Western Region Agricultural Education Research Meeting subc subd subn subq subg--subv--subx--suby--subz';
const referenceConference =
'C409476 Conference Name 411 Western Regional Agricultural Education Research Meeting subc subd subn subq subg subv subx suby subz';
'C409476 Conference Name 411 Western Regional Agricultural Education Research Meeting subc subd subn subq subg--subv--subx--suby--subz';
const authRefConference =
'C409476 Conference Name 511 Western Region Agricultural Education Research Seminar (1983- ) subc subd subn subq subg subv subx suby subz';
'C409476 Conference Name 511 Western Region Agricultural Education Research Seminar (1983- ) subc subd subn subq subg--subv--subx--suby--subz';

const authorizedCorporateInvalid =
'C409476 Corporate name 110 Apple & Honey Productions subb subc subd subg subn subk subv subx suby subz';
'C409476 Corporate name 110 Apple & Honey Productions subb subc subd subg subn subk--subv--subx--suby--subz';
const referenceCorporateInvalid =
'C409476 Corporate name 410 Apple and Honey Productions subb subc subd subg subn subk subv subx suby subz';
'C409476 Corporate name 410 Apple and Honey Productions subb subc subd subg subn subk--subv--subx--suby--subz';
const authorizedConferenceInvalid =
'C409476 Conference Name 111 Western Region Agricultural Education Research Meeting subc subd subn subq subg subk subv subx suby subz';
'C409476 Conference Name 111 Western Region Agricultural Education Research Meeting subc subd subn subq subg subk--subv--subx--suby--subz';
const referenceConferenceInvalid =
'C409476 Conference Name 411 Western Regional Agricultural Education Research Meeting subc subd subn subq subg subk subv subx suby subz';
'C409476 Conference Name 411 Western Regional Agricultural Education Research Meeting subc subd subn subq subg subk--subv--subx--suby--subz';

const corporateOrConferenceTypes = ['Corporate Name', 'Conference Name'];
const permissions = [Permissions.uiMarcAuthoritiesAuthorityRecordView.gui];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { DEFAULT_JOB_PROFILE_NAMES, APPLICATION_NAMES } from '../../../support/constants';
import Permissions from '../../../support/dictionary/permissions';
import DataImport from '../../../support/fragments/data_import/dataImport';
import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles';
import Logs from '../../../support/fragments/data_import/logs/logs';
import MarcAuthorities from '../../../support/fragments/marcAuthority/marcAuthorities';
import MarcAuthority from '../../../support/fragments/marcAuthority/marcAuthority';
import QuickMarcEditor from '../../../support/fragments/quickMarcEditor';
Expand All @@ -16,9 +14,12 @@ describe('MARC', () => {
describe('MARC Authority', () => {
const testData = {
searchOption: 'Keyword',
marcValue: 'Cartoons & Comics',
valueForUpdate: '$a Cartoons & Animations',
valueAfterUpdate: 'Cartoons & Animations',
marcValueC358994: 'C358994 Cartoons & Comics',
valueForUpdateC358994: '$a C358994 Cartoons & Animations',
valueAfterUpdateC358994: 'C358994 Cartoons & Animations',
marcValueC358995: 'C358995 Cartoons & Books',
valueForUpdateC358995: '$a C358995 Cartoons & Journals',
valueAfterUpdateC358995: 'C358995 Cartoons & Journals',
calloutMessage:
'This record has successfully saved and is in process. Changes may not appear immediately.',
};
Expand All @@ -30,15 +31,24 @@ describe('MARC', () => {
marc: 'marcAuthFileForC358994.mrc',
fileName: `C358994testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY,
numOfRecords: 1,
propertyName: 'authority',
},
{
marc: 'marcAuthFileForC358995.mrc',
fileName: `C358995testMarcFile.${getRandomPostfix()}.mrc`,
jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY,
propertyName: 'authority',
},
];

const createdAuthorityIDs = [];

before('Creating user', () => {
cy.getAdminToken();
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(testData.marcValue);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(testData.marcValueC358994);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(testData.valueAfterUpdateC358994);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(testData.marcValueC358995);
MarcAuthorities.deleteMarcAuthorityByTitleViaAPI(testData.valueAfterUpdateC358995);

cy.createTempUser([
Permissions.moduleDataImportEnabled.gui,
Expand All @@ -49,25 +59,16 @@ describe('MARC', () => {
.then((createdUserProperties) => {
user.userAProperties = createdUserProperties;

cy.getToken(user.userAProperties.username, user.userAProperties.password);
marcFiles.forEach((marcFile) => {
cy.login(user.userAProperties.username, user.userAProperties.password, {
path: TopMenu.dataImportPath,
waiter: DataImport.waitLoading,
authRefresh: true,
}).then(() => {
DataImport.verifyUploadState();
DataImport.uploadFile(marcFile.marc, marcFile.fileName);
JobProfiles.waitLoadingList();
JobProfiles.search(marcFile.jobProfileToRun);
JobProfiles.runImportFile();
Logs.waitFileIsImported(marcFile.fileName);
Logs.checkStatusOfJobProfile('Completed');
Logs.openFileDetails(marcFile.fileName);
for (let i = 0; i < marcFile.numOfRecords; i++) {
Logs.getCreatedItemsID(i).then((link) => {
createdAuthorityIDs.push(link.split('/')[5]);
});
}
DataImport.uploadFileViaApi(
marcFile.marc,
marcFile.fileName,
marcFile.jobProfileToRun,
).then((response) => {
response.forEach((record) => {
createdAuthorityIDs.push(record[marcFile.propertyName].id);
});
});
});
})
Expand Down Expand Up @@ -99,7 +100,9 @@ describe('MARC', () => {
after('Deleting created user', () => {
cy.getAdminToken();
Users.deleteViaApi(user.userBProperties.userId);
MarcAuthority.deleteViaAPI(createdAuthorityIDs[0]);
createdAuthorityIDs.forEach((id) => {
MarcAuthority.deleteViaAPI(id, true);
});
});

it(
Expand All @@ -118,38 +121,36 @@ describe('MARC', () => {
`User ${user.userAProperties.username}, ${user.userCProperties.preferredFirstName} testMiddleName deleted successfully.`,
);
TopMenuNavigation.navigateToApp(APPLICATION_NAMES.MARC_AUTHORITY);
MarcAuthorities.searchBy(testData.searchOption, testData.marcValue);
MarcAuthorities.selectTitle(testData.marcValue);
MarcAuthorities.searchBy(testData.searchOption, testData.marcValueC358994);
MarcAuthorities.selectTitle(testData.marcValueC358994);
MarcAuthority.edit();
QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdate);
QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdateC358994);
QuickMarcEditor.pressSaveAndCloseButton();
QuickMarcEditor.checkCallout(testData.calloutMessage);
MarcAuthorities.checkDetailViewIncludesText(testData.valueAfterUpdate);
MarcAuthorities.checkDetailViewIncludesText(testData.valueAfterUpdateC358994);
},
);

it(
'C358995 Verify that user has access to "quickMARC" when user who edited MARC record has been deleted (spitfire)',
{ tags: ['criticalPath', 'spitfire', 'C358995'] },
() => {
cy.waitForAuthRefresh(() => {
cy.login(user.userCProperties.username, user.userCProperties.password, {
path: TopMenu.marcAuthorities,
waiter: MarcAuthorities.waitLoading,
});
cy.login(user.userCProperties.username, user.userCProperties.password, {
path: TopMenu.marcAuthorities,
waiter: MarcAuthorities.waitLoading,
authRefresh: true,
});
MarcAuthorities.searchBy(testData.searchOption, testData.valueAfterUpdate);
MarcAuthorities.selectTitle(testData.valueAfterUpdate);
MarcAuthorities.searchBy(testData.searchOption, testData.marcValueC358995);
MarcAuthorities.selectTitle(testData.marcValueC358995);
MarcAuthority.edit();
QuickMarcEditor.updateExistingFieldContent(7, `$a ${testData.marcValue}`);
QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdateC358995);
QuickMarcEditor.pressSaveAndCloseButton();
QuickMarcEditor.checkCallout(testData.calloutMessage);
MarcAuthorities.checkRecordDetailPageMarkedValue(testData.marcValue);
cy.waitForAuthRefresh(() => {
cy.login(user.userBProperties.username, user.userBProperties.password, {
path: TopMenu.usersPath,
waiter: UsersSearchPane.waitLoading,
});
MarcAuthorities.checkRecordDetailPageMarkedValue(testData.valueAfterUpdateC358995);
cy.login(user.userBProperties.username, user.userBProperties.password, {
path: TopMenu.usersPath,
waiter: UsersSearchPane.waitLoading,
authRefresh: true,
});
UsersSearchPane.searchByUsername(user.userCProperties.username);
UsersSearchPane.openUser(user.userCProperties.username);
Expand All @@ -159,13 +160,13 @@ describe('MARC', () => {
);

TopMenuNavigation.navigateToApp(APPLICATION_NAMES.MARC_AUTHORITY);
MarcAuthorities.searchBy(testData.searchOption, testData.marcValue);
MarcAuthorities.selectTitle(testData.marcValue);
MarcAuthorities.searchBy(testData.searchOption, testData.valueAfterUpdateC358995);
MarcAuthorities.selectTitle(testData.valueAfterUpdateC358995);
MarcAuthority.edit();
QuickMarcEditor.updateExistingFieldContent(7, testData.valueForUpdate);
QuickMarcEditor.updateExistingFieldContent(7, `$a ${testData.marcValueC358995}`);
QuickMarcEditor.pressSaveAndCloseButton();
QuickMarcEditor.checkCallout(testData.calloutMessage);
MarcAuthorities.checkDetailViewIncludesText(testData.valueAfterUpdate);
MarcAuthorities.checkDetailViewIncludesText(testData.marcValueC358995);
},
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe('MARC', () => {
query: `${query} and (authRefType=="Authorized")`,
}).then((records) => {
records.forEach((record) => {
MarcAuthority.deleteViaAPI(record.id);
MarcAuthority.deleteViaAPI(record.id, true);
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,19 @@ describe('MARC', () => {
});
});
});
cy.waitForAuthRefresh(() => {
cy.login(testData.userProperties.username, testData.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
cy.reload();
InventoryInstances.waitContentLoading();
}, 20_000);
cy.login(testData.userProperties.username, testData.userProperties.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
authRefresh: true,
});
});
});

after('Deleting created user and data', () => {
cy.getAdminToken();
Users.deleteViaApi(testData.userProperties.userId);
createdRecordIDs.forEach((id, index) => {
if (index) MarcAuthority.deleteViaAPI(id);
if (index) MarcAuthority.deleteViaAPI(id, true);
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ describe('MARC', () => {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
cy.reload();
InventoryInstances.waitContentLoading();
}, 20_000);
});
});
Expand All @@ -131,7 +129,7 @@ describe('MARC', () => {
cy.getAdminToken();
Users.deleteViaApi(testData.userProperties.userId);
createdRecordIDs.forEach((id, index) => {
if (index) MarcAuthority.deleteViaAPI(id);
if (index) MarcAuthority.deleteViaAPI(id, true);
else InventoryInstance.deleteInstanceViaApi(id);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ describe('MARC', () => {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
cy.reload();
InventoryInstances.waitContentLoading();
}, 20_000);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ describe('MARC', () => {
testData.forC359230.typeOfHeadingB,
testData.forC359230.typeOfHeadingC,
);
const title = interception.response.body.authorities[0].headingRef;
MarcAuthorities.selectTitle(title);
const heading = interception.response.body.authorities[0].headingRef;
MarcAuthorities.selectNthResultWithHeading(heading);
MarcAuthorities.verifyViewPaneContentExists();
MarcAuthorities.searchBy(testData.forC359230.searchOptionB, '*');
MarcAuthorities.checkSingleHeadingType(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ describe('eHoldings', () => {
cy.login(testData.user.username, testData.user.password, {
path: SettingsMenu.tenantPath,
waiter: TenantPane.waitLoading,
authRefresh: true,
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/fixtures/marcAuthFileForC358994.mrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
00531cz a2200205n 4500001000800000005001700008008004100025010001700066035002300083040002500106130002200131430003000153430002400183643002400207644001100231645001100242646001100253670005200264953000900316103569220081219072118.0831017n| acaabaaan |a ana  an 83700634  a(OCoLC)oca01040186 aDLCbengcDLCdOCoLC 0aCartoons & Comics 0aReihe "Cartoons & Comics" 0aCartoons und Comics aZürichbEdition C af5DLC at5DLC as5DLC aGrasso, M. Sati(e)risches, 1982:bp. 1 of cover aec29
00539cz a2200205n 4500001000800000005001700008008004100025010001700066035002300083040002500106130003000131430003000161430002400191643002400215644001100239645001100250646001100261670005200272953000900324103569220081219072118.0831017n| acaabaaan |a ana  an 83700634  a(OCoLC)oca01040186 aDLCbengcDLCdOCoLC 0aC358994 Cartoons & Comics 0aReihe "Cartoons & Comics" 0aCartoons und Comics aZürichbEdition C af5DLC at5DLC as5DLC aGrasso, M. Sati(e)risches, 1982:bp. 1 of cover aec29
1 change: 1 addition & 0 deletions cypress/fixtures/marcAuthFileForC358995.mrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
00462cz a2200181n 45000010009000000050017000090080041000260100018000670350023000850400025001081300029001336430024001626440011001866450011001976460011002086700052002199530009002711035692320081219072118.0831017n| acaabaaan |a ana  an 837006343  a(OCoLC)oca01040186 aDLCbengcDLCdOCoLC 0aC358995 Cartoons & Books aZürichbEdition C af5DLC at5DLC as5DLC aGrasso, M. Sati(e)risches, 1982:bp. 1 of cover aec29
Loading
Loading