diff --git a/cypress/e2e/linked-data/check-view-and-search.cy.js b/cypress/e2e/linked-data/check-view-and-search.cy.js index d6cfb75a7d..cfcc4935b1 100644 --- a/cypress/e2e/linked-data/check-view-and-search.cy.js +++ b/cypress/e2e/linked-data/check-view-and-search.cy.js @@ -2,13 +2,79 @@ import TopMenu from '../../support/fragments/topMenu'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; import SearchAndFilter from '../../support/fragments/linked-data/searchAndFilter'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import Work from '../../support/fragments/linked-data/work'; +import FileManager from '../../support/utils/fileManager'; +import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import { DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; describe('Citation: check navigation', () => { - beforeEach(() => { + const testData = { + marcFilePath: 'marcBibFileForC451572.mrc', + modifiedMarcFile: `C451572 editedMarcFile${getRandomPostfix()}.mrc`, + marcFileName: `C451572 marcFile${getRandomPostfix()}.mrc`, + uniqueTitle: `Cypress test ${getRandomPostfix()}`, + uniqueIsbn: `ISBN${getRandomLetters(8)}`, + uniqueCreator: `Creator-${getRandomLetters(10)}`, + }; + + const resourceData = { + creator: testData.uniqueCreator, + language: 'spa', + classificationNumber: 'PC4112', + title: `${testData.uniqueTitle} TT test35 cultural approach to intermediate Spanish tk1 /`, + isbnIdentifier: testData.uniqueIsbn, + lccnIdentifier: 'aa1994901234', + publisher: 'Scott, Foresman, test', + publicationDate: '2024', + edition: '3rd ed. test', + }; + + before('Create test data via API', () => { + // Set unique title, ISBN and Creator for searching + DataImport.editMarcFile( + testData.marcFilePath, + testData.modifiedMarcFile, + ["!A Alice's Adventures in Wonderland", '123456789123456', 'Neale-Silva, Eduardo'], + [testData.uniqueTitle, testData.uniqueIsbn, testData.uniqueCreator], + ); + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.modifiedMarcFile, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ); + }); + + after('Delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); + cy.getAdminToken(); + // delete inventory instance both from inventory and LDE modules + // this might change later once corresponding instance will automatically get deleted in linked-data + InventoryInstances.getInstanceIdApi({ + limit: 1, + query: `title="${resourceData.title}"`, + }).then((id) => { + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); + }); + Work.getInstancesByTitle(testData.uniqueTitle).then((instances) => { + const filteredInstances = instances.filter( + (element) => element.titles[0].value === testData.uniqueTitle, + ); + Work.deleteById(filteredInstances[0].id); + }); + Work.getIdByTitle(testData.uniqueTitle).then((id) => Work.deleteById(id)); + }); + + beforeEach('Apply test data manually', () => { cy.loginAsAdmin({ - path: TopMenu.linkedDataEditor, - waiter: LinkedDataEditor.waitLoading, + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading, }); + // create test data based on uploaded marc file + LinkedDataEditor.createTestWorkDataManuallyBasedOnMarcUpload(resourceData.title); }); it( diff --git a/cypress/e2e/linked-data/duplicate-instance.cy.js b/cypress/e2e/linked-data/duplicate-instance.cy.js index 31dc1c8d7d..808e72cba0 100644 --- a/cypress/e2e/linked-data/duplicate-instance.cy.js +++ b/cypress/e2e/linked-data/duplicate-instance.cy.js @@ -1,44 +1,92 @@ import Work from '../../support/fragments/linked-data/work'; import TopMenu from '../../support/fragments/topMenu'; -import getRandomPostfix from '../../support/utils/stringTools'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; import EditResource from '../../support/fragments/linked-data/editResource'; import SearchAndFilter from '../../support/fragments/linked-data/searchAndFilter'; -import { APPLICATION_NAMES, LOCATION_NAMES } from '../../support/constants'; +import { APPLICATION_NAMES, LOCATION_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import FileManager from '../../support/utils/fileManager'; +import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; +import DataImport from '../../support/fragments/data_import/dataImport'; describe('Citation: duplicate instance', () => { const testData = { + marcFilePath: 'marcBibFileForC451572.mrc', + modifiedMarcFile: `C451572 editedMarcFile${getRandomPostfix()}.mrc`, + marcFileName: `C451572 marcFile${getRandomPostfix()}.mrc`, uniqueTitle: `Cypress test ${getRandomPostfix()}`, + uniqueIsbn: `ISBN${getRandomLetters(8)}`, + uniqueCreator: `Creator-${getRandomLetters(10)}`, uniqueInstanceTitle: `Instance AQA title ${getRandomPostfix()}`, callNumber: '331.2', }; + const resourceData = { + creator: testData.uniqueCreator, + language: 'spa', + classificationNumber: 'PC4112', + title: `${testData.uniqueTitle} TT test35 cultural approach to intermediate Spanish tk1 /`, + isbnIdentifier: testData.uniqueIsbn, + lccnIdentifier: 'aa1994901234', + publisher: 'Scott, Foresman, test', + publicationDate: '2024', + edition: '3rd ed. test', + }; + + before('Create test data via API', () => { + // Set unique title, ISBN and Creator for searching + DataImport.editMarcFile( + testData.marcFilePath, + testData.modifiedMarcFile, + ["!A Alice's Adventures in Wonderland", '123456789123456', 'Neale-Silva, Eduardo'], + [testData.uniqueTitle, testData.uniqueIsbn, testData.uniqueCreator], + ); + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.modifiedMarcFile, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ); + }); + after('Delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); cy.getAdminToken(); // delete inventory instance both from inventory and LDE modules // this might change later once corresponding instance will automatically get deleted in linked-data InventoryInstances.getInstanceIdApi({ limit: 1, - query: `title="${testData.uniqueInstanceTitle}"`, + query: `title="${resourceData.title}"`, }).then((id) => { InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); }); - Work.getInstancesByTitle(testData.uniqueInstanceTitle).then((instances) => { + Work.getInstancesByTitle(testData.uniqueTitle).then((instances) => { const filteredInstances = instances.filter( - (element) => element.titles[0].value === testData.uniqueInstanceTitle, + (element) => element.titles[0].value === testData.uniqueTitle, ); Work.deleteById(filteredInstances[0].id); }); + // delete work created in pre-condition + Work.getIdByTitle(testData.uniqueTitle).then((id) => Work.deleteById(id)); + // delete duplicate instance data + InventoryInstances.getInstanceIdApi({ + limit: 1, + query: `title="${testData.uniqueInstanceTitle}"`, + }).then((id) => { + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); + }); }); - beforeEach(() => { + beforeEach('Apply test data manually', () => { cy.loginAsAdmin({ - path: TopMenu.linkedDataEditor, - waiter: SearchAndFilter.waitLoading, + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading, }); + // create test data based on uploaded marc file + LinkedDataEditor.createTestWorkDataManuallyBasedOnMarcUpload(resourceData.title); }); it( @@ -63,6 +111,7 @@ describe('Citation: duplicate instance', () => { // navigate to the inventory module TopMenuNavigation.openAppFromDropdown(APPLICATION_NAMES.INVENTORY); InventoryInstances.searchByTitle(testData.uniqueInstanceTitle); + InventoryInstance.verifySourceInAdministrativeData('LINKED_DATA'); // Add holdings const HoldingsRecordEdit = InventoryInstance.pressAddHoldingsButton(); HoldingsRecordEdit.fillHoldingFields({ diff --git a/cypress/e2e/linked-data/duplicate-work.cy.js b/cypress/e2e/linked-data/duplicate-work.cy.js index 524211b73f..7b30d7be99 100644 --- a/cypress/e2e/linked-data/duplicate-work.cy.js +++ b/cypress/e2e/linked-data/duplicate-work.cy.js @@ -1,19 +1,27 @@ import Work from '../../support/fragments/linked-data/work'; import TopMenu from '../../support/fragments/topMenu'; -import getRandomPostfix from '../../support/utils/stringTools'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; import EditResource from '../../support/fragments/linked-data/editResource'; import SearchAndFilter from '../../support/fragments/linked-data/searchAndFilter'; import NewInstance from '../../support/fragments/linked-data/newInstance'; -import { APPLICATION_NAMES } from '../../support/constants'; +import { APPLICATION_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import FileManager from '../../support/utils/fileManager'; +import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; +import DataImport from '../../support/fragments/data_import/dataImport'; describe('Citation: duplicate existing work', () => { const testData = { + marcFilePath: 'marcBibFileForC451572.mrc', + modifiedMarcFile: `C451572 editedMarcFile${getRandomPostfix()}.mrc`, + marcFileName: `C451572 marcFile${getRandomPostfix()}.mrc`, uniqueTitle: `Cypress test ${getRandomPostfix()}`, + uniqueIsbn: `ISBN${getRandomLetters(8)}`, + uniqueCreator: `Creator-${getRandomLetters(10)}`, + uniqueDuplicateTitle: `Cypress test duplicate ${getRandomPostfix()}`, uniqueInstanceTitle: `Instance AQA title ${getRandomPostfix()}`, resourceIdentifiers: [ { type: 'ISBN', value: '1587657090' }, @@ -21,17 +29,70 @@ describe('Citation: duplicate existing work', () => { ], }; + const resourceData = { + creator: testData.uniqueCreator, + language: 'spa', + classificationNumber: 'PC4112', + title: `${testData.uniqueTitle} TT test35 cultural approach to intermediate Spanish tk1 /`, + isbnIdentifier: testData.uniqueIsbn, + lccnIdentifier: 'aa1994901234', + publisher: 'Scott, Foresman, test', + publicationDate: '2024', + edition: '3rd ed. test', + }; + + before('Create test data via API', () => { + // Set unique title, ISBN and Creator for searching + DataImport.editMarcFile( + testData.marcFilePath, + testData.modifiedMarcFile, + ["!A Alice's Adventures in Wonderland", '123456789123456', 'Neale-Silva, Eduardo'], + [testData.uniqueTitle, testData.uniqueIsbn, testData.uniqueCreator], + ); + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.modifiedMarcFile, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ); + }); + after('Delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); cy.getAdminToken(); + // delete inventory instance both from inventory and LDE modules + // this might change later once corresponding instance will automatically get deleted in linked-data + InventoryInstances.getInstanceIdApi({ + limit: 1, + query: `title="${resourceData.title}"`, + }).then((id) => { + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); + }); + Work.getInstancesByTitle(testData.uniqueTitle).then((instances) => { + const filteredInstances = instances.filter( + (element) => element.titles[0].value === testData.uniqueTitle, + ); + Work.deleteById(filteredInstances[0].id); + }); Work.getIdByTitle(testData.uniqueTitle).then((id) => Work.deleteById(id)); + // delete duplicate work data + Work.getInstancesByTitle(testData.uniqueInstanceTitle).then((instances) => { + const filteredInstances = instances.filter( + (element) => element.titles[0].value === testData.uniqueInstanceTitle, + ); + Work.deleteById(filteredInstances[0].id); + }); + Work.getIdByTitle(testData.uniqueDuplicateTitle).then((id) => Work.deleteById(id)); InventoryInstances.deleteInstanceByTitleViaApi(testData.uniqueInstanceTitle); }); - beforeEach(() => { + beforeEach('Apply test data manually', () => { cy.loginAsAdmin({ - path: TopMenu.linkedDataEditor, - waiter: SearchAndFilter.waitLoading, + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading, }); + // create test data based on uploaded marc file + LinkedDataEditor.createTestWorkDataManuallyBasedOnMarcUpload(resourceData.title); }); it( @@ -45,7 +106,7 @@ describe('Citation: duplicate existing work', () => { LinkedDataEditor.editWork(); // duplicate work EditResource.duplicateResource(); - EditResource.setValueForTheField(testData.uniqueTitle, 'Preferred Title for Work'); + EditResource.setValueForTheField(testData.uniqueDuplicateTitle, 'Preferred Title for Work'); EditResource.saveAndKeepEditing(); // add instance EditResource.openNewInstanceForm(); @@ -55,8 +116,8 @@ describe('Citation: duplicate existing work', () => { // wait for LDE page to be displayed LinkedDataEditor.waitLoading(); // search created work by title - SearchAndFilter.searchResourceByTitle(testData.uniqueTitle); - SearchAndFilter.checkSearchResultsByTitle(testData.uniqueTitle); + SearchAndFilter.searchResourceByTitle(testData.uniqueDuplicateTitle); + SearchAndFilter.checkSearchResultsByTitle(testData.uniqueDuplicateTitle); // check that newly created instance is displayed in the inventory TopMenuNavigation.openAppFromDropdown(APPLICATION_NAMES.INVENTORY); InventoryInstances.searchByTitle(testData.uniqueInstanceTitle); diff --git a/cypress/e2e/linked-data/edit-resource-marc-record.cy.js b/cypress/e2e/linked-data/edit-resource-marc-record.cy.js index c693bfbfe2..ce3d656e0f 100644 --- a/cypress/e2e/linked-data/edit-resource-marc-record.cy.js +++ b/cypress/e2e/linked-data/edit-resource-marc-record.cy.js @@ -1,46 +1,96 @@ import TopMenu from '../../support/fragments/topMenu'; -import getRandomPostfix from '../../support/utils/stringTools'; +import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; -import { INSTANCE_SOURCE_NAMES, APPLICATION_NAMES } from '../../support/constants'; +import { INSTANCE_SOURCE_NAMES, APPLICATION_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; import EditResource from '../../support/fragments/linked-data/editResource'; import ViewMarc from '../../support/fragments/linked-data/viewMarc'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; import SearchAndFilter from '../../support/fragments/linked-data/searchAndFilter'; import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; import Work from '../../support/fragments/linked-data/work'; +import FileManager from '../../support/utils/fileManager'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import DataImport from '../../support/fragments/data_import/dataImport'; describe('Citation: edit existing instance', () => { const source = INSTANCE_SOURCE_NAMES.LDE; const testData = { + marcFilePath: 'marcBibFileForC451572.mrc', + modifiedMarcFile: `C451572 editedMarcFile${getRandomPostfix()}.mrc`, + marcFileName: `C451572 marcFile${getRandomPostfix()}.mrc`, + uniqueTitle: `Cypress test ${getRandomPostfix()}`, + uniqueIsbn: `ISBN${getRandomLetters(8)}`, + uniqueCreator: `Creator-${getRandomLetters(10)}`, uniqueInstanceTitle: `Instance AQA title ${getRandomPostfix()}`, + callNumber: '331.2', edition: 'test edition', }; - beforeEach(() => { - cy.loginAsAdmin({ - path: TopMenu.linkedDataEditor, - waiter: SearchAndFilter.waitLoading, - }); + const resourceData = { + creator: testData.uniqueCreator, + language: 'spa', + classificationNumber: 'PC4112', + title: `${testData.uniqueTitle} TT test35 cultural approach to intermediate Spanish tk1 /`, + isbnIdentifier: testData.uniqueIsbn, + lccnIdentifier: 'aa1994901234', + publisher: 'Scott, Foresman, test', + publicationDate: '2024', + edition: '3rd ed. test', + }; + + before('Create test data via API', () => { + // Set unique title, ISBN and Creator for searching + DataImport.editMarcFile( + testData.marcFilePath, + testData.modifiedMarcFile, + ["!A Alice's Adventures in Wonderland", '123456789123456', 'Neale-Silva, Eduardo'], + [testData.uniqueTitle, testData.uniqueIsbn, testData.uniqueCreator], + ); + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.modifiedMarcFile, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ); }); after('Delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); cy.getAdminToken(); // delete inventory instance both from inventory and LDE modules // this might change later once corresponding instance will automatically get deleted in linked-data InventoryInstances.getInstanceIdApi({ limit: 1, - query: `title="${testData.uniqueInstanceTitle}"`, + query: `title="${resourceData.title}"`, }).then((id) => { InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); }); - Work.getInstancesByTitle(testData.uniqueInstanceTitle).then((instances) => { + Work.getInstancesByTitle(testData.uniqueTitle).then((instances) => { const filteredInstances = instances.filter( - (element) => element.titles[0].value === testData.uniqueInstanceTitle, + (element) => element.titles[0].value === testData.uniqueTitle, ); Work.deleteById(filteredInstances[0].id); }); + // delete work created in pre-condition + Work.getIdByTitle(testData.uniqueTitle).then((id) => Work.deleteById(id)); + // delete duplicate instance data + InventoryInstances.getInstanceIdApi({ + limit: 1, + query: `title="${testData.uniqueInstanceTitle}"`, + }).then((id) => { + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); + }); + }); + + beforeEach('Apply test data manually', () => { + cy.loginAsAdmin({ + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading, + }); + // create test data based on uploaded marc file + LinkedDataEditor.createTestWorkDataManuallyBasedOnMarcUpload(resourceData.title); }); it( @@ -65,6 +115,7 @@ describe('Citation: edit existing instance', () => { InventoryInstance.editInstanceInLde(); // edit edition EditResource.waitLoading(); + cy.wait(5000); EditResource.setEdition(testData.edition); EditResource.saveAndKeepEditing(); EditResource.viewMarc(); diff --git a/cypress/e2e/linked-data/search.cy.js b/cypress/e2e/linked-data/search.cy.js index d3961e66fb..45273c8720 100644 --- a/cypress/e2e/linked-data/search.cy.js +++ b/cypress/e2e/linked-data/search.cy.js @@ -6,6 +6,8 @@ import TopMenu from '../../support/fragments/topMenu'; import FileManager from '../../support/utils/fileManager'; import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; +import InventorySearchAndFilter from '../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; describe('Citation: Search Linked data resources', () => { const testData = { @@ -26,6 +28,7 @@ describe('Citation: Search Linked data resources', () => { lccnIdentifier: 'aa1994901234', publisher: 'Scott, Foresman, test', publicationDate: '2024', + edition: '3rd ed. test', }; before('Create test data', () => { @@ -47,14 +50,30 @@ describe('Citation: Search Linked data resources', () => { after('Delete test data', () => { FileManager.deleteFile(`cypress/fixtures/${testData.modifiedMarcFile}`); cy.getAdminToken(); + // delete inventory instance both from inventory and LDE modules + // this might change later once corresponding instance will automatically get deleted in linked-data + InventoryInstances.getInstanceIdApi({ + limit: 1, + query: `title="${resourceData.title}"`, + }).then((id) => { + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(id); + }); + Work.getInstancesByTitle(testData.uniqueTitle).then((instances) => { + const filteredInstances = instances.filter( + (element) => element.titles[0].value === testData.uniqueTitle, + ); + Work.deleteById(filteredInstances[0].id); + }); Work.getIdByTitle(testData.uniqueTitle).then((id) => Work.deleteById(id)); }); beforeEach(() => { cy.loginAsAdmin({ - path: TopMenu.linkedDataEditor, - waiter: LinkedDataEditor.waitLoading, + path: TopMenu.inventoryPath, + waiter: InventorySearchAndFilter.waitLoading, }); + // create test data based on uploaded marc file + LinkedDataEditor.createTestWorkDataManuallyBasedOnMarcUpload(resourceData.title); }); describe('Linked-data Search', () => { diff --git a/cypress/support/fragments/linked-data/linkedDataEditor.js b/cypress/support/fragments/linked-data/linkedDataEditor.js index 5e86a59a12..47ba899feb 100644 --- a/cypress/support/fragments/linked-data/linkedDataEditor.js +++ b/cypress/support/fragments/linked-data/linkedDataEditor.js @@ -1,5 +1,9 @@ import { Option } from '../../../../interactors'; -import editResource from './editResource'; +import EditResource from './editResource'; +import InventoryInstances from '../inventory/inventoryInstances'; +import InventoryInstance from '../inventory/inventoryInstance'; +import PreviewResource from './previewResource'; +import SearchAndFilter from './searchAndFilter'; const searchSection = "//div[@class='item-search-content']"; const actionsButton = "//button[@data-testid='search-view-actions-dropdown']"; @@ -37,18 +41,18 @@ export default { cy.xpath( `(//div[@class='search-result-entry-container'][${rowNumber}]//table[contains(@class, 'table instance-list')]//button[contains(text(), 'Edit')])[${instanceNumber}]`, ).click(); - editResource.waitLoading(); + EditResource.waitLoading(); }, openNewResourceForm: () => { cy.xpath(actionsButton).click(); cy.xpath(newResourceButton).click(); - editResource.waitLoading(); + EditResource.waitLoading(); }, editWork: () => { cy.xpath("//div[@class='full-display-container']//button[text()='Edit work']").click(); - editResource.waitLoading(); + EditResource.waitLoading(); }, generateValidLccn: () => { @@ -65,4 +69,18 @@ export default { const patternString = randomFirstChar + randomSecondChar + randomDigits; return patternString; }, + + createTestWorkDataManuallyBasedOnMarcUpload(title) { + // create work based on uploaded marc file + InventoryInstances.searchByTitle(title); + InventoryInstance.editInstanceInLde(); + PreviewResource.waitLoading(); + PreviewResource.clickContinue(); + // edit edition + EditResource.waitLoading(); + EditResource.setEdition(title); + EditResource.saveAndClose(); + // search for LDE is displayed + SearchAndFilter.waitLoading(); + }, };