Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAT-12781-C451572 #3520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions cypress.config.js
Expand Up @@ -22,16 +22,16 @@ module.exports = defineConfig({
pageLoadTimeout: 60000,
downloadsFolder: 'cypress/downloads',
env: {
OKAPI_HOST: 'https://folio-testing-cypress-okapi.ci.folio.org',
OKAPI_TENANT: 'diku',
diku_login: 'diku_admin',
diku_password: 'admin',
OKAPI_HOST: 'https://okapi-missinglinks.int.aws.folio.org',
OKAPI_TENANT: 'fs09000000',
diku_login: 'admin',
diku_password: 'bugfest09',
is_kiwi_release: false,
downloadTimeout: 2000,
allure: 'true',
grepFilterSpecs: true,
grepOmitFiltered: true,
rtrAuth: true,
rtrAuth: false,
ecsEnabled: false,
},
e2e: {
Expand Down Expand Up @@ -117,7 +117,7 @@ module.exports = defineConfig({

return result;
},
baseUrl: 'https://folio-testing-cypress-diku.ci.folio.org',
baseUrl: 'https://missinglinks.int.aws.folio.org',
testIsolation: false,
},
});
@@ -0,0 +1,70 @@
import { DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants';
import DataImport from '../../support/fragments/data_import/dataImport';
import InventoryInstance from '../../support/fragments/inventory/inventoryInstance';
import InventoryInstances from '../../support/fragments/inventory/inventoryInstances';
import SearchAndFilter from '../../support/fragments/marvaEditor/searchAndFilter';
import TopMenu from '../../support/fragments/topMenu';
import FileManager from '../../support/utils/fileManager';
import getRandomPostfix from '../../support/utils/stringTools';

describe('Citation', () => {
describe('Marva Search', () => {
const testData = {
marcFilePath: 'marcBibFileForC451572.mrc',
modifiedMarcFile: `C451572 editedMarcFile${getRandomPostfix()}.mrc`,
marcFileName: `C451572 marcFile${getRandomPostfix()}.mrc`,
uniqueTitle: `!A Alice's Adventures in Wonderland${getRandomPostfix()}`,
};
const resourceData = {
creator: 'Neale-Silva, Eduardo',
language: 'spa',
classificationNumber: '468.2/421 class_number',
title: `${testData.uniqueTitle} tt 9 TT test35 cultural approach to intermediate Spanish tk1 /`,
isbnIdentifier: '123456789123456',
lccnIdentifier: '80021016',
publisher: 'Publisher Name',
publicationDate: '2024',
};

before('Create test data', () => {
// need to change title to unique for searching
DataImport.editMarcFile(
testData.marcFilePath,
testData.modifiedMarcFile,
["!A Alice's Adventures in Wonderland"],
[testData.uniqueTitle],
);
cy.getAdminToken();
DataImport.uploadFileViaApi(
testData.modifiedMarcFile,
testData.marcFileName,
DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS,
);

cy.loginAsAdmin();
});

after('Delete test data', () => {
FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`);
cy.getAdminToken();
InventoryInstances.getInstancesViaApi({
limit: 100,
// query: `title="!A Alice's Adventures in Wonderland783.6502416094969857 TT test35 cultural approach to intermediate Spanish tk1 / Eduardo Neale-Silva and Robert L. Nicholas SOR"`
// ${testData.uniqueTitle} TT test35 cultural approach to intermediate Spanish tk1 / Eduardo Neale-Silva and Robert L. Nicholas SOR"`
}).then((instance) => {
InventoryInstance.deleteInstanceViaApi(instance.id);
});
});

it(
'C451572 Marva Search: Basic search and search results (citation)',
{ tags: ['draft', 'citation'] },
() => {
cy.visit(TopMenu.marvaEditorPath);
SearchAndFilter.waitLoading();
SearchAndFilter.searchResourceByTitle(testData.uniqueTitle);
SearchAndFilter.verifySearchResult(resourceData);
},
);
});
});
1 change: 1 addition & 0 deletions cypress/fixtures/marcBibFileForC451572.mrc
@@ -0,0 +1 @@
04659nam a2200841 i 4500001001500000008004100015005001700056010001700073020002600090024001900116040001800135041001300153046002100166050002200187082003100209100003800240110003800278110003600316111005100352245014700403250001100550260005200561261000900613263000900622264002400631300006600655310005100721334002400772336001900796337002900815338002600844362003800870500002900908500002200937501002000959504002300979505002201002506012201024508002301146511002101169513003901190515002401229516002301253520001701276524002701293530003401320532002801354533010801382534008401490535006901574536011801643538005501761542009201816544010301908546001802011547002202029550001702051552024102068555008202309556004102391581004602432585002102478588002802499600030502527650023802832651022303070655029503293700005703588710003603645711005903681753004703740856003003787oin00010313530830111s1981 ic af f 001 0 u20240319080937.9 a 80021016  a123456789123456qISBN13aEANdEAN test2 aDLCcDLCdICU0 aengaspa k12/09/1990l20560 aPC4112b.N38 19810 a468.2/421 class_number2193 aNeale-Silva, Eduardo0Family type aname test0number testelyricist. aname test0number testeeditor. ameeting name test0meeting number testjauthor10a!A Alice's Adventures in WonderlandbTT test35 cultural approach to intermediate Spanish tk1 /cEduardo Neale-Silva and Robert L. Nicholas SOR a2d ed.0 aGlenview, Ill. :bScott, Foresman, testcc1981. d2023 a202320aAlaskabname $ 2023 a467 p., [8] leaves of plates : abill., some col. ; bc25 cm. apublication frequencybpublication frequency_b amultipart monograph atextbtxt2336 aprojectedbg2337 source acardbno2338 source1 adates of publication notezdopn_z aEnglish or Spanish note. aIncludes indexes. awith Note field abibliographybnote atable of contents aaccess notebaccess note_bcaccess note_cdaccess note_deaccess note_efaccess note_fgaccess note_ gqaccess note_q acredits Note field aparticipant Note atype of report_abtype of report_b aissuance Note field acomputer Data Note asummary test acitation Coverage test aadditional Physical Form test aaccessibility Note test areproduction note_abrepro note_bcrepro note_cdrepro note_derepro note_efrepro note_fnrepro note_n aoriginal Version Note_abovn_bcovn_ceovn_efovn_fkovn_kmovn_mnovn_ntovn_t alocation of originals duplicatesblofd_bclofd_cdlofd_dglofd_g afunding informationbfunding info_bcfund info_cdfund info_defund info_effund info_fgfund info_ghfund info_h asystem detailsisystem details_iusystem details_u ainfo relating to copyright statusbbccddeeffgghhiijjkkllmmnnooppqqrrss arelated partsbrelated parts_bcrelated parts_cdrelated parts_derelated parts_enrelated parts_n aLanguage note aformer Title Note aissuing Body aentity and attribute informationbe&a info_bce&a info_cde&a info_dee&a info_efe&a info_fge&a info_ghe&a info_hie&a info_ije&a info_jke&a info_kle&a info_lme&a info_mne&a info_noe&a info_ope&a info_pue&a info_uze&a info_z alocation of other archival materialblocofother_bclocofother_cdlocofother_d ainformation About Documentation test aadditional physical formzadd phys form_z aexhibitions Note adescription Source Note3 aname test tt familybnumerationctitlesddate 2024jattributionqAlternative name ttuaffiliationvformSubdivisionxgeneralSubdivisionychronologicalSubdivisionzgeographicSubdivision2source3materialsSpecifiederelator_term4relator_code0authorityLink1equivalent6linkage7controlField8fieldLink aSpanish language.bgeog covercEvent locationd2024gmisc info2source0http://id.worldcat.org/fast/fst01128292xGeneral subdychron subd3Specified materialeRelator term4Relator code1Equivalent6Linkage7Control field8Field link aname ttgMiscvForm subdivisionxGeneral subdivisionychronologicalSubdivisionzgeographicSubdivision2source3materialsSpecifiederelator_term4relator_code0authorityLink1equivalent6linkage7controlField8fieldLink 7aTextbooks namebgeographicCoveragevfor English speakers. formSubdivisionxgeneralSubdivisionychronologicalSubdivisionzgeographicSubdivision2fast source3materialsSpecifiederelator_term4relator_code0http://id.worldcat.org/fast/fst014238651equivalent6linkage7controlField8fieldLink3 aNicholas, Robert L. testeeditor090contr numberart aorg contr0org contr nmbr4anl1 acntr meeting name0cntr meeting numberjphotographer., asystem details access notebsdan_bcsdan_c utest@tt.comznote test tt
33 changes: 0 additions & 33 deletions cypress/support/fragments/data_import/dataImport.js
Expand Up @@ -225,14 +225,6 @@ function processFileWithSplitFiles(
});
}

function getCreatedRecordInfo(jobExecutionId) {
return cy.okapiRequest({
path: `metadata-provider/jobLogEntries/${jobExecutionId}`,
searchParams: { limit: 100 },
isDefaultSearchParamsRequired: false,
});
}

function getCreatedRecordInfoWithSplitFiles(jobExecutionId, recordId) {
return cy.okapiRequest({
path: `metadata-provider/jobLogEntries/${jobExecutionId}/records/${recordId}`,
Expand Down Expand Up @@ -360,31 +352,6 @@ function uploadFileWithoutSplitFilesViaApi(filePathName, fileName, profileName)
delay: 5000,
},
);

getCreatedRecordInfo(jobExecutionId).then((recordResponse) => {
// we can get relatedInstanceInfo and in it get idList or hridList
const recordInfo = recordResponse.body.entries.map((entry) => ({
instance: {
id: entry.relatedInstanceInfo.length === 0 ? '' : entry.relatedInstanceInfo.idList[0],
hrid:
entry.relatedInstanceInfo.length === 0 ? '' : entry.relatedInstanceInfo.hridList[0],
},
holding: {
id: entry.relatedHoldingsInfo.length === 0 ? '' : entry.relatedHoldingsInfo[0].id,
hrid: entry.relatedHoldingsInfo.length === 0 ? '' : entry.relatedHoldingsInfo[0].hrid,
},
item: {
id: entry.relatedItemInfo.length === 0 ? '' : entry.relatedItemInfo[0].id,
hrid: entry.relatedItemInfo.length === 0 ? '' : entry.relatedItemInfo[0].hrid,
},
authority: {
id: entry.relatedAuthorityInfo.length === 0 ? '' : entry.relatedAuthorityInfo.idList[0],
hrid:
entry.relatedAuthorityInfo.length === 0 ? '' : entry.relatedAuthorityInfo.hridList[0],
},
}));
return recordInfo;
});
});
});
}
Expand Down
45 changes: 45 additions & 0 deletions cypress/support/fragments/marvaEditor/searchAndFilter.js
@@ -0,0 +1,45 @@
export default {
waitLoading: () => {
cy.get('[class*="search-pane"]').should('exist');
cy.get('[class*="item-search-content"]')
.contains('Enter search criteria to start search')
.should('exist');
},

searchResourceByTitle: (title) => {
cy.get('#id-search-select').select('Title');
cy.get('#id-search-input').type(title);
cy.get('[data-testid="id-search-button"]').click();
},

verifySearchResult(data) {
cy.get('[class*="search-result-entry-container"]')
.first()
.find('[class*="work-details-card"]')
.find('[class*="details"]')
.contains(data.creator)
.should('exist');
cy.get('[class*="search-result-entry-container"]')
.first()
.find('[class*="work-details-card"]')
.find('[class*="details"]')
.contains(data.language)
.should('exist');
cy.get('[class*="search-result-entry-container"]')
.first()
.find('[class*="work-details-card"]')
.find('[class*="details"]')
.contains(data.classificationNumber)
.should('exist');
cy.get('[class*="table instance-list"]')
.find('tr[data-testid="table-row"]')
.first()
.within(() => {
cy.get('td').eq(1).should('contain', data.title);
cy.get('td').eq(2).should('contain', data.isbnIdentifier);
cy.get('td').eq(3).should('contain', data.lccnIdentifier);
cy.get('td').eq(4).should('contain', data.publisher);
cy.get('td').eq(5).should('contain', data.publicationDate);
});
},
};
2 changes: 2 additions & 0 deletions cypress/support/fragments/topMenu.js
Expand Up @@ -37,6 +37,7 @@ const listsPath = '/lists';
const coursesPath = '/cr/courses';
const consortiumManagerPath = '/consortia-settings';
const settingsAuthorityFilesPath = '/settings/marc-authorities/manage-authority-files';
const marvaEditorPath = '/marva/search';

export default {
// direct paths to folio apps to use in cy.visit() into initial steps of our scenarios
Expand Down Expand Up @@ -78,6 +79,7 @@ export default {
consortiumManagerPath,
coursesPath,
settingsAuthorityFilesPath,
marvaEditorPath,

openCheckInApp: () => {
cy.do(Link({ href: including('/checkin') }).click());
Expand Down