From c8d503101eb80d115fbff0e3fc9acc668f58a2cf Mon Sep 17 00:00:00 2001 From: PavloPak Date: Fri, 23 Aug 2024 16:49:02 +0300 Subject: [PATCH 01/34] draft --- cypress.config.js | 4 ++-- .../assign-tags-preceding-succeeding-titles-present.cy.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index b8818f46f3..8472d68c6f 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -31,7 +31,7 @@ module.exports = defineConfig({ pageLoadTimeout: 60000, downloadsFolder: 'cypress/downloads', env: { - OKAPI_HOST: 'https://folio-testing-cypress-okapi.ci.folio.org', + OKAPI_HOST: 'https://folio-snapshot-2-okapi.dev.folio.org', EDGE_HOST: 'https://folio-testing-cypress-edge.ci.folio.org', EDGE_API_KEY: '', OKAPI_TENANT: 'diku', @@ -143,7 +143,7 @@ module.exports = defineConfig({ return result; }, - baseUrl: 'https://folio-testing-cypress-diku.ci.folio.org', + baseUrl: 'https://folio-snapshot-2.dev.folio.org', testIsolation: false, }, }); diff --git a/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js b/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js index f559adc0e1..10881c0af5 100644 --- a/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js +++ b/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js @@ -61,7 +61,7 @@ describe('Inventory', () => { }); it( - 'C358962 Assign tags to an Instance record when unlinked preceding/succeeding titles present 2: Source = FOLIO (volaris)', + 'C358144 Assign tags to an Instance record when unlinked preceding/succeeding titles present 1: Import (volaris)', { tags: ['extendedPath', 'volaris'] }, () => { cy.login(userData.username, userData.password, { From 97c81bb0cfa51e9d7008e0b9e3d5a6033293185f Mon Sep 17 00:00:00 2001 From: PavloPak Date: Fri, 23 Aug 2024 18:20:01 +0300 Subject: [PATCH 02/34] complete --- cypress.config.js | 4 ++-- ...-preceding-succeeding-titles-present.cy.js | 2 +- .../assing-tags-to-an-instance-record.cy.js | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 8472d68c6f..b8818f46f3 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -31,7 +31,7 @@ module.exports = defineConfig({ pageLoadTimeout: 60000, downloadsFolder: 'cypress/downloads', env: { - OKAPI_HOST: 'https://folio-snapshot-2-okapi.dev.folio.org', + OKAPI_HOST: 'https://folio-testing-cypress-okapi.ci.folio.org', EDGE_HOST: 'https://folio-testing-cypress-edge.ci.folio.org', EDGE_API_KEY: '', OKAPI_TENANT: 'diku', @@ -143,7 +143,7 @@ module.exports = defineConfig({ return result; }, - baseUrl: 'https://folio-snapshot-2.dev.folio.org', + baseUrl: 'https://folio-testing-cypress-diku.ci.folio.org', testIsolation: false, }, }); diff --git a/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js b/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js index 10881c0af5..f559adc0e1 100644 --- a/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js +++ b/cypress/e2e/inventory/tags/assign-tags-preceding-succeeding-titles-present.cy.js @@ -61,7 +61,7 @@ describe('Inventory', () => { }); it( - 'C358144 Assign tags to an Instance record when unlinked preceding/succeeding titles present 1: Import (volaris)', + 'C358962 Assign tags to an Instance record when unlinked preceding/succeeding titles present 2: Source = FOLIO (volaris)', { tags: ['extendedPath', 'volaris'] }, () => { cy.login(userData.username, userData.password, { diff --git a/cypress/e2e/inventory/tags/assing-tags-to-an-instance-record.cy.js b/cypress/e2e/inventory/tags/assing-tags-to-an-instance-record.cy.js index fc7868124d..7c5c361596 100644 --- a/cypress/e2e/inventory/tags/assing-tags-to-an-instance-record.cy.js +++ b/cypress/e2e/inventory/tags/assing-tags-to-an-instance-record.cy.js @@ -63,5 +63,25 @@ describe('Inventory', () => { InventoryInstance.deleteTag(tag.label); }, ); + + it( + 'C358144 Assign tags to an Instance record when unlinked preceding/succeeding titles present 1: Import (volaris)', + { tags: ['extendedPath', 'volaris'] }, + () => { + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + InventoryInstances.selectInstance(); + InventoryInstance.addTag(tag.label); + InventoryInstances.resetAllFilters(); + InventoryInstances.searchByTag(tag.label); + InventorySearchAndFilter.searchByParameter('Title (all)', instanceTitle); + InventoryInstance.checkAddedTag(tag.label, instanceTitle); + InventoryInstance.deleteTag(tag.label); + InventorySearchAndFilter.verifyTagCount(); + InventorySearchAndFilter.resetAllAndVerifyNoResultsAppear(); + cy.reload(); + InventorySearchAndFilter.verifyTagIsAbsent(tag.label); + }, + ); }); }); From 88e6705f5762a4b2aa75ad332b2e1d19db255b14 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:42:57 +0500 Subject: [PATCH 03/34] Fix the test cases in daily run (#4113) --- ...dit-in-app-instances-add-and-remove-mark-as-staff-only.cy.js | 2 +- .../bulk-edit-in-app-instances-change-note-type-within.cy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-add-and-remove-mark-as-staff-only.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-add-and-remove-mark-as-staff-only.cy.js index 550ef0c57b..e407d5f7e9 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-add-and-remove-mark-as-staff-only.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-add-and-remove-mark-as-staff-only.cy.js @@ -246,7 +246,7 @@ describe('bulk-edit', () => { BulkEditActions.verifySuccessBanner(1); BulkEditSearchPane.verifyChangedResults(folioItem.instanceId); BulkEditSearchPane.verifyReasonForError( - 'Instance is controlled by MARC record, these fields are blocked and can not be updated:', + 'Bulk edit of instance notes is not supported for MARC Instances.', ); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-change-note-type-within.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-change-note-type-within.cy.js index 0e3e4784aa..013ef6ce92 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-change-note-type-within.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-instances-change-note-type-within.cy.js @@ -144,7 +144,7 @@ describe('bulk-edit', () => { ]); BulkEditSearchPane.verifyExactChangesUnderColumns('Reproduction note', ''); BulkEditSearchPane.verifyInputLabel( - `${instanceUUIDsFileName}: 2 entries * 1 records changed * 2 errors`, + `${instanceUUIDsFileName}: 2 entries * 1 records changed * 1 errors`, ); BulkEditSearchPane.verifyReasonForError( 'Bulk edit of instance notes is not supported for MARC Instances', From e1fb2ad8a4aa32512fbb56d8bb1c7f55172bb521 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:52:33 +0500 Subject: [PATCH 04/34] Remove obsolete Data export permissions (#4114) --- ...ecord-from-central-updated-in-member.cy.js | 2 +- ...-fileds-of-shared-marcBib-in-central.cy.js | 6 ++-- ...d-fileds-of-shared-marcBib-in-member.cy.js | 6 ++-- ...stance-search-results-pane-on-member.cy.js | 1 - ...stance-search-results-pane-on-member.cy.js | 1 - ...stance-search-results-pane-on-member.cy.js | 1 - ...from-instance-details-pane-on-member.cy.js | 1 - .../data-export-failed-using-empty-file.cy.js | 17 +++++----- ...port-failed-using-non-existent-UUIDs.cy.js | 2 +- ...ort-instance-records-invalid-profile.cy.js | 3 +- .../export-instance-records.cy.js | 3 +- ...mport-with-matching-for-999-ff-field.cy.js | 1 - .../mrc-import-file-for-update-items.cy.js | 1 - .../e2e/mrc-import-with-matching-001.cy.js | 2 +- ...-linked-marc-auth-record-when-010=$0.cy.js | 2 +- ...-when-001=$0-by-value-without-prefix.cy.js | 2 +- ...atching-010-update-and-create-action.cy.js | 2 +- ...ue-which-controls-2-marc-bib-records.cy.js | 2 +- .../marc-authority-update.cy.js | 2 +- ...alue-of-linked-marc-authority-record.cy.js | 2 +- ...reated-from-ui-marc-authority-record.cy.js | 2 +- .../add-$9-to-linkable-fields.cy.js | 2 +- .../add-subfields-to-linked-fields.cy.js | 2 +- ...d-linked-fields-using-update-marcBib.cy.js | 2 +- ...-from-linked-not-repeatable-marc-bib.cy.js | 2 +- ...$9-from-not-linkable-marc-bib-fields.cy.js | 2 +- ...d-which-controlled-by-marc-authority.cy.js | 2 +- ...-linked-field-controlled-by-marcAuth.cy.js | 2 +- ...ontrolled-subfield-of-linked-marcBib.cy.js | 2 +- ...-fields-using-update-marcbib-profile.cy.js | 2 +- .../item-update-via-match-by-status.cy.js | 1 - .../marc-bib-import-delete-linked-field.cy.js | 2 +- ...tches-under-actions-in-a-job-profile.cy.js | 1 - ...update-$0-in-linked-repeatable-field.cy.js | 2 +- ...llable-and-not-controlable-subfields.cy.js | 2 +- ...-subfield-in-linked-repeatable-field.cy.js | 2 +- .../update-controllable-subfield0.cy.js | 2 +- ...trolled-and-not-controlled-subfields.cy.js | 2 +- ...ked-marc-bib-record-with-multiple-$0.cy.js | 2 +- ...everal-linked-controllable-subfield0.cy.js | 2 +- ...inked-marcBib-controlled-by-marcAuth.cy.js | 2 +- ...le-with-create-modify-update-actions.cy.js | 1 - ...ary-table-with-create-update-actions.cy.js | 1 - ...ctions-for-instance-holding-and-item.cy.js | 1 - ...t-summury-table-for-updating-actions.cy.js | 1 - ...s-and-items-with-instance-match-item.cy.js | 1 - ...nd-items-without-instance-match-item.cy.js | 1 - ...ct-all-option-for-instances-is-reset.cy.js | 19 +++++------ .../data-export/duplicate-job-profile.cy.js | 32 +++++++++---------- cypress/support/dictionary/permissions.js | 13 -------- 50 files changed, 69 insertions(+), 100 deletions(-) diff --git a/cypress/e2e/consortia/data-import/importing-marcAuthority-files/updated-imported-marcAuth-record-from-central-updated-in-member.cy.js b/cypress/e2e/consortia/data-import/importing-marcAuthority-files/updated-imported-marcAuth-record-from-central-updated-in-member.cy.js index e034374933..2a26da44a7 100644 --- a/cypress/e2e/consortia/data-import/importing-marcAuthority-files/updated-imported-marcAuth-record-from-central-updated-in-member.cy.js +++ b/cypress/e2e/consortia/data-import/importing-marcAuthority-files/updated-imported-marcAuth-record-from-central-updated-in-member.cy.js @@ -102,7 +102,7 @@ describe('Data Import', () => { cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { users.userAProperties = userProperties; diff --git a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js index 3d07862e95..066989bbbb 100644 --- a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js +++ b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-central.cy.js @@ -151,7 +151,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]) .then((userProperties) => { @@ -165,7 +165,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]); }) @@ -175,7 +175,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]); }) diff --git a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js index 80844af199..7c29eb62d5 100644 --- a/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js +++ b/cypress/e2e/consortia/data-import/importing-marcBib-files/update-$0-in-linked-fileds-of-shared-marcBib-in-member.cy.js @@ -151,7 +151,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]) .then((userProperties) => { @@ -165,7 +165,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]); }) @@ -175,7 +175,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.moduleDataImportEnabled.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]); }) diff --git a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-folio-source-instance-from-instance-search-results-pane-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-folio-source-instance-from-instance-search-results-pane-on-member.cy.js index 6eb0f5c7d2..ebcf77ebff 100644 --- a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-folio-source-instance-from-instance-search-results-pane-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-folio-source-instance-from-instance-search-results-pane-on-member.cy.js @@ -24,7 +24,6 @@ describe('Inventory', () => { cy.setTenant(Affiliations.College); cy.assignPermissionsToExistingUser(testData.user.userId, [ Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]); InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { diff --git a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-marc-source-instance-from-instance-search-results-pane-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-marc-source-instance-from-instance-search-results-pane-on-member.cy.js index 10c4b0a79c..928b630bc7 100644 --- a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-marc-source-instance-from-instance-search-results-pane-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-local-marc-source-instance-from-instance-search-results-pane-on-member.cy.js @@ -25,7 +25,6 @@ describe('Inventory', () => { cy.setTenant(Affiliations.College); cy.assignPermissionsToExistingUser(testData.user.userId, [ Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]); InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { diff --git a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-folio-source-instance-from-instance-search-results-pane-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-folio-source-instance-from-instance-search-results-pane-on-member.cy.js index c87ca4f7f9..b8f634f10d 100644 --- a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-folio-source-instance-from-instance-search-results-pane-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-folio-source-instance-from-instance-search-results-pane-on-member.cy.js @@ -29,7 +29,6 @@ describe('Inventory', () => { cy.setTenant(Affiliations.College); cy.assignPermissionsToExistingUser(testData.user.userId, [ Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]); diff --git a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-marc-source-instance-from-instance-details-pane-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-marc-source-instance-from-instance-details-pane-on-member.cy.js index 9bd1b7809b..5160a8d84e 100644 --- a/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-marc-source-instance-from-instance-details-pane-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/link-in-data-export-app-after-exporting-shared-marc-source-instance-from-instance-details-pane-on-member.cy.js @@ -40,7 +40,6 @@ describe('Inventory', () => { cy.setTenant(Affiliations.College); cy.assignPermissionsToExistingUser(testData.user.userId, [ Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]); diff --git a/cypress/e2e/data-export/auth-records-export/data-export-failed-using-empty-file.cy.js b/cypress/e2e/data-export/auth-records-export/data-export-failed-using-empty-file.cy.js index ae95a00190..8b8c2426fe 100644 --- a/cypress/e2e/data-export/auth-records-export/data-export-failed-using-empty-file.cy.js +++ b/cypress/e2e/data-export/auth-records-export/data-export-failed-using-empty-file.cy.js @@ -12,15 +12,14 @@ const emptyFile = `emptyFile${getRandomPostfix()}.csv`; describe('Data Export', () => { describe('Authority records export', () => { beforeEach('create test data', () => { - cy.createTempUser([ - permissions.dataExportAll.gui, - permissions.dataExportEnableModule.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password); - cy.visit(TopMenu.dataExportPath); - FileManager.createFile(`cypress/fixtures/${emptyFile}`); - }); + cy.createTempUser([permissions.dataExportUploadExportDownloadFileViewLogs.gui]).then( + (userProperties) => { + user = userProperties; + cy.login(user.username, user.password); + cy.visit(TopMenu.dataExportPath); + FileManager.createFile(`cypress/fixtures/${emptyFile}`); + }, + ); }); after('delete test data', () => { diff --git a/cypress/e2e/data-export/auth-records-export/export-failed-using-non-existent-UUIDs.cy.js b/cypress/e2e/data-export/auth-records-export/export-failed-using-non-existent-UUIDs.cy.js index e251ec3568..40136153af 100644 --- a/cypress/e2e/data-export/auth-records-export/export-failed-using-non-existent-UUIDs.cy.js +++ b/cypress/e2e/data-export/auth-records-export/export-failed-using-non-existent-UUIDs.cy.js @@ -28,7 +28,7 @@ describe('Data Export', () => { cy.createTempUser([ Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiMarcAuthoritiesAuthorityRecordDelete.gui, - Permissions.dataExportEnableModule.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((createdUserProperties) => { user.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js index cd2b39f574..143e70934a 100644 --- a/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js +++ b/cypress/e2e/data-export/export-instance-records-invalid-profile.cy.js @@ -23,8 +23,7 @@ describe('Data Export', () => { beforeEach('create test data', () => { cy.createTempUser([ permissions.inventoryAll.gui, - permissions.dataExportEnableSettings.gui, - permissions.dataExportEnableApp.gui, + permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { user = userProperties; const instanceID = InventoryInstances.createInstanceViaApi( diff --git a/cypress/e2e/data-export/export-to-marc/export-instance-records.cy.js b/cypress/e2e/data-export/export-to-marc/export-instance-records.cy.js index caf126414f..fa7c34b1e6 100644 --- a/cypress/e2e/data-export/export-to-marc/export-instance-records.cy.js +++ b/cypress/e2e/data-export/export-to-marc/export-instance-records.cy.js @@ -21,8 +21,7 @@ describe('Data Export', () => { beforeEach('create test data', () => { cy.createTempUser([ permissions.inventoryAll.gui, - permissions.dataExportAll.gui, - permissions.dataExportEnableModule.gui, + permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { user = userProperties; const instanceID = InventoryInstances.createInstanceViaApi( diff --git a/cypress/e2e/data-import/di-tft/marc-file-import-with-matching-for-999-ff-field.cy.js b/cypress/e2e/data-import/di-tft/marc-file-import-with-matching-for-999-ff-field.cy.js index d5f05ec693..74180ba74b 100644 --- a/cypress/e2e/data-import/di-tft/marc-file-import-with-matching-for-999-ff-field.cy.js +++ b/cypress/e2e/data-import/di-tft/marc-file-import-with-matching-for-999-ff-field.cy.js @@ -100,7 +100,6 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.dataExportEnableModule.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index 85eb636f74..a2d09c3ae5 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -271,7 +271,6 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { userId = userProperties.userId; diff --git a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js index 9baa243dd0..18c3434894 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-with-matching-001.cy.js @@ -74,7 +74,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.dataExportEnableModule.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/delete-010-field-of-linked-marc-auth-record-when-010=$0.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/delete-010-field-of-linked-marc-auth-record-when-010=$0.cy.js index b02f8b30ba..668b500561 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/delete-010-field-of-linked-marc-auth-record-when-010=$0.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/delete-010-field-of-linked-marc-auth-record-when-010=$0.cy.js @@ -169,7 +169,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/edit-010-a-with-valid-value-in-linked-marc-authority-record-when-001=$0-by-value-without-prefix.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/edit-010-a-with-valid-value-in-linked-marc-authority-record-when-001=$0-by-value-without-prefix.cy.js index 090fabafce..cb0f4ddbfd 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/edit-010-a-with-valid-value-in-linked-marc-authority-record-when-001=$0-by-value-without-prefix.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/edit-010-a-with-valid-value-in-linked-marc-authority-record-when-001=$0-by-value-without-prefix.cy.js @@ -166,7 +166,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/import-marcAuth-without-010-job-profile-matching-010-update-and-create-action.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/import-marcAuth-without-010-job-profile-matching-010-update-and-create-action.cy.js index a8db5e24ee..2efcf94258 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/import-marcAuth-without-010-job-profile-matching-010-update-and-create-action.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/import-marcAuth-without-010-job-profile-matching-010-update-and-create-action.cy.js @@ -100,7 +100,7 @@ describe('Data Import', () => { cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js index f4b852b7aa..23cb47ca6c 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update-1XX-tag-value-which-controls-2-marc-bib-records.cy.js @@ -199,7 +199,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update.cy.js index f0ca15a313..7f66eb329d 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/marc-authority-update.cy.js @@ -96,7 +96,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/update-4XX-field-value-of-linked-marc-authority-record.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/update-4XX-field-value-of-linked-marc-authority-record.cy.js index 32f3ef52ca..b665a61f08 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/update-4XX-field-value-of-linked-marc-authority-record.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/update-4XX-field-value-of-linked-marc-authority-record.cy.js @@ -186,7 +186,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-authority-files/update-created-from-ui-marc-authority-record.cy.js b/cypress/e2e/data-import/importing-marc-authority-files/update-created-from-ui-marc-authority-record.cy.js index 41d1f1e4f4..61e58a469f 100644 --- a/cypress/e2e/data-import/importing-marc-authority-files/update-created-from-ui-marc-authority-record.cy.js +++ b/cypress/e2e/data-import/importing-marc-authority-files/update-created-from-ui-marc-authority-record.cy.js @@ -146,7 +146,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiMarcAuthoritiesAuthorityRecordCreate.gui, Permissions.uiQuickMarcQuickMarcAuthorityCreate.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/add-$9-to-linkable-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/add-$9-to-linkable-fields.cy.js index 10cf1d5c12..7493ce8c57 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/add-$9-to-linkable-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/add-$9-to-linkable-fields.cy.js @@ -114,7 +114,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js index 06405504d9..7f06be0643 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/add-subfields-to-linked-fields.cy.js @@ -113,7 +113,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/can't-delete-protected-linked-fields-using-update-marcBib.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/can't-delete-protected-linked-fields-using-update-marcBib.cy.js index 3cf8cd1ea6..1b3b29df56 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/can't-delete-protected-linked-fields-using-update-marcBib.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/can't-delete-protected-linked-fields-using-update-marcBib.cy.js @@ -170,7 +170,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/delete-$0-subfield-from-linked-not-repeatable-marc-bib.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/delete-$0-subfield-from-linked-not-repeatable-marc-bib.cy.js index 5708dce822..ebb92493bc 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/delete-$0-subfield-from-linked-not-repeatable-marc-bib.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/delete-$0-subfield-from-linked-not-repeatable-marc-bib.cy.js @@ -149,7 +149,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/delete-$9-from-not-linkable-marc-bib-fields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/delete-$9-from-not-linkable-marc-bib-fields.cy.js index 1010821304..77d20221e2 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/delete-$9-from-not-linkable-marc-bib-fields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/delete-$9-from-not-linkable-marc-bib-fields.cy.js @@ -115,7 +115,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/delete-linked-field-which-controlled-by-marc-authority.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/delete-linked-field-which-controlled-by-marc-authority.cy.js index 82781a14d8..99c9056b1e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/delete-linked-field-which-controlled-by-marc-authority.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/delete-linked-field-which-controlled-by-marc-authority.cy.js @@ -137,7 +137,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/delete-repeatable-linked-field-controlled-by-marcAuth.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/delete-repeatable-linked-field-controlled-by-marcAuth.cy.js index 513f5252ad..fb7bad785b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/delete-repeatable-linked-field-controlled-by-marcAuth.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/delete-repeatable-linked-field-controlled-by-marcAuth.cy.js @@ -124,7 +124,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]) .then((createdUserProperties) => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/delete-uncontrolled-subfield-of-linked-marcBib.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/delete-uncontrolled-subfield-of-linked-marcBib.cy.js index 268876c8be..a8c8886ede 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/delete-uncontrolled-subfield-of-linked-marcBib.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/delete-uncontrolled-subfield-of-linked-marcBib.cy.js @@ -137,7 +137,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]) .then((createdUserProperties) => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js index 3688468082..67f48c03bb 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/edit-protected-and-linked-fields-using-update-marcbib-profile.cy.js @@ -133,7 +133,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js index 498950b0e9..3cc48ab1cb 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/item-update-via-match-by-status.cy.js @@ -141,7 +141,6 @@ describe('Data Import', () => { cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, - Permissions.dataExportEnableSettings.gui, Permissions.inventoryAll.gui, Permissions.uiInventoryMarcItemInProcess.gui, Permissions.uiInventoryMarcItemIntellectual.gui, diff --git a/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js index c2b9f7b013..39f0ff56d0 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/marc-bib-import-delete-linked-field.cy.js @@ -97,7 +97,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js index 39325379d9..5cfdbb5e8c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js @@ -172,7 +172,6 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.settingsDataImportEnabled.gui, Permissions.dataExportViewAddUpdateProfiles.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-$0-in-linked-repeatable-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-$0-in-linked-repeatable-field.cy.js index 101ba838da..37a23c1ba7 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-$0-in-linked-repeatable-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-$0-in-linked-repeatable-field.cy.js @@ -98,7 +98,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-and-not-controlable-subfields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-and-not-controlable-subfields.cy.js index d6103a95b3..b4973ea097 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-and-not-controlable-subfields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-and-not-controlable-subfields.cy.js @@ -87,7 +87,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-letter-subfield-in-linked-repeatable-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-letter-subfield-in-linked-repeatable-field.cy.js index 976fabfd85..10bbc171d7 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-letter-subfield-in-linked-repeatable-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-letter-subfield-in-linked-repeatable-field.cy.js @@ -153,7 +153,7 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { testData.user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js index d710ff8708..e1859429b4 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controllable-subfield0.cy.js @@ -125,7 +125,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js index 349283dbdf..53d54af366 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-controlled-and-not-controlled-subfields.cy.js @@ -100,7 +100,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js index 98a70afa46..b501e63941 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js @@ -152,7 +152,7 @@ describe('Data Import', () => { Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-several-linked-controllable-subfield0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-several-linked-controllable-subfield0.cy.js index 78fc7cd56e..ba423c9db8 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-several-linked-controllable-subfield0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-several-linked-controllable-subfield0.cy.js @@ -109,7 +109,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.inventoryAll.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-tag-value-of-linked-marcBib-controlled-by-marcAuth.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-tag-value-of-linked-marcBib-controlled-by-marcAuth.cy.js index 593a6cac4f..3c26715d4f 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-tag-value-of-linked-marcBib-controlled-by-marcAuth.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-tag-value-of-linked-marcBib-controlled-by-marcAuth.cy.js @@ -144,7 +144,7 @@ describe('Data Import', () => { Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.dataExportEnableApp.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-create-modify-update-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-create-modify-update-actions.cy.js index 541db5300a..143aef8cf7 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-create-modify-update-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-create-modify-update-actions.cy.js @@ -299,7 +299,6 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.uiInventoryViewCreateEditInstances.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js index eec0b5b4af..e344604421 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-create-update-actions.cy.js @@ -244,7 +244,6 @@ describe('Data Import', () => { Permissions.uiInventoryViewCreateEditInstances.gui, Permissions.dataExportViewAddUpdateProfiles.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, - Permissions.dataExportEnableSettings.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js index 55face8b3c..4e86c6206a 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js @@ -281,7 +281,6 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index 56c3624eaa..ce72702ad0 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -234,7 +234,6 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js index ce6a527445..cfdfc7dba1 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js @@ -194,7 +194,6 @@ describe('Data Import', () => { cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.dataExportEnableSettings.gui, Permissions.settingsDataImportEnabled.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js index b6f51a336e..d85412ded8 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js @@ -188,7 +188,6 @@ describe('Data Import', () => { Permissions.inventoryAll.gui, Permissions.settingsDataImportEnabled.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, - Permissions.dataExportEnableSettings.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/inventory/search-in-inventory/select-all-option-for-instances-is-reset.cy.js b/cypress/e2e/inventory/search-in-inventory/select-all-option-for-instances-is-reset.cy.js index 3f7b9fde0e..906117570c 100644 --- a/cypress/e2e/inventory/search-in-inventory/select-all-option-for-instances-is-reset.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/select-all-option-for-instances-is-reset.cy.js @@ -18,15 +18,16 @@ describe('Inventory', () => { InventoryInstances.createInstanceViaApi(testData.instanceTitle, testData.barcode); }); - cy.createTempUser([Permissions.inventoryAll.gui, Permissions.dataExportEnableApp.gui]).then( - (userProperties) => { - testData.user = userProperties; - cy.login(testData.user.username, testData.user.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }, - ); + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.dataExportUploadExportDownloadFileViewLogs.gui, + ]).then((userProperties) => { + testData.user = userProperties; + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); }); after('Delete test data', () => { diff --git a/cypress/e2e/settings/data-export/duplicate-job-profile.cy.js b/cypress/e2e/settings/data-export/duplicate-job-profile.cy.js index 07ebe65546..9b0f93dc35 100644 --- a/cypress/e2e/settings/data-export/duplicate-job-profile.cy.js +++ b/cypress/e2e/settings/data-export/duplicate-job-profile.cy.js @@ -20,23 +20,21 @@ const secondNewJobProfileCalloutMessage = `Job profile ${jobProfileNewName} has describe('Data Export', () => { describe('Job profile - setup', () => { before('create test data', () => { - cy.createTempUser([ - permissions.dataExportEnableSettings.gui, - permissions.dataExportEnableApp.gui, - permissions.inventoryAll.gui, - ]).then((userProperties) => { - user = userProperties; - ExportNewFieldMappingProfile.createNewFieldMappingProfileViaApi(mappingProfileName).then( - (response) => { - fieldMappingProfileId = response.body.id; - ExportNewJobProfile.createNewJobProfileViaApi(jobProfileName, response.body.id); - }, - ); - cy.login(user.username, user.password, { - path: TopMenu.settingsPath, - waiter: SettingsPane.waitLoading, - }); - }); + cy.createTempUser([permissions.dataExportViewAddUpdateProfiles.gui]).then( + (userProperties) => { + user = userProperties; + ExportNewFieldMappingProfile.createNewFieldMappingProfileViaApi(mappingProfileName).then( + (response) => { + fieldMappingProfileId = response.body.id; + ExportNewJobProfile.createNewJobProfileViaApi(jobProfileName, response.body.id); + }, + ); + cy.login(user.username, user.password, { + path: TopMenu.settingsPath, + waiter: SettingsPane.waitLoading, + }); + }, + ); }); after('delete test data', () => { diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index ce05270962..77426d6182 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -550,19 +550,6 @@ export default { gui: 'Settings (Calendar): Can edit and reassign existing calendars', }, // Data Export - dataExportAll: { internal: 'data-export.all', gui: 'Data Export - all permissions' }, - dataExportEnableModule: { - internal: 'module.data-export.enabled', - gui: 'Data export: all permissions', - }, - dataExportEnableSettings: { - internal: 'ui-data-export.settings.enabled', - gui: 'Settings (Data export): display list of settings pages', - }, - dataExportEnableApp: { - internal: 'ui-data-export.app.enabled', - gui: 'UI: Data export module is enabled', - }, dataExportViewAddUpdateProfiles: { internal: 'ui-data-export.settings.edit', gui: 'Settings (Data export): Can view, add, update profiles', From 25d34e2550045f08aba019a7a1e0f7759100b948 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Fri, 23 Aug 2024 21:40:08 +0500 Subject: [PATCH 05/34] FAT-15906 Update autotests regarding changes in Transformation form in Data export Settings (#4117) * Update the test cases C15819, C196758, C10983, C15821 --- ...ew-mapping-profile-holdings-instance.cy.js | 19 +++++- .../new-mapping-profile-holdings-items.cy.js | 29 +++++++- ...pping-profile-holdings-source-record.cy.js | 22 +++++- .../data-export/transformation-form.cy.js | 15 ++++- .../exportNewFieldMappingProfile.js | 67 ++++++++++++++++++- .../modalSelectTransformations.js | 25 ++++++- 6 files changed, 166 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-instance.cy.js b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-instance.cy.js index 53240e6eab..053fcd145c 100644 --- a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-instance.cy.js +++ b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-instance.cy.js @@ -51,15 +51,30 @@ describe('Data Export', () => { ModalSelectTransformations.uncheckItemRecordTypeChechbox(); ModalSelectTransformations.searchItemTransformationsByName('Instance - ID'); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', 'a'); ModalSelectTransformations.uncheckInstanceRecordTypeChechbox(); ModalSelectTransformations.checkHoldingsRecordTypeChechbox(); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', 'a'); ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Holdings - Instance - ID', + '245', + '3', + '4', + 'a', + ); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Instance - ID', + '123', + '1', + '2', + 'a', + 1, + ); ExportFieldMappingProfiles.saveMappingProfile(); InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); diff --git a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-items.cy.js b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-items.cy.js index 4a308f4645..f5e8c4d640 100644 --- a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-items.cy.js +++ b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-items.cy.js @@ -52,21 +52,44 @@ describe('Data Export', () => { ModalSelectTransformations.uncheckItemRecordTypeChechbox(); ModalSelectTransformations.searchItemTransformationsByName('Instance - ID'); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', 'a'); ModalSelectTransformations.uncheckInstanceRecordTypeChechbox(); ModalSelectTransformations.checkHoldingsRecordTypeChechbox(); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', 'a'); ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); ModalSelectTransformations.checkItemRecordTypeChechbox(); ModalSelectTransformations.searchItemTransformationsByName('Item - ID'); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('356', '5', '6', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('356', '5', '6', 'a'); ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Holdings - Instance - ID', + '245', + '3', + '4', + 'a', + ); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Instance - ID', + '123', + '1', + '2', + 'a', + 1, + ); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Item - ID', + '356', + '5', + '6', + 'a', + 2, + ); ExportFieldMappingProfiles.saveMappingProfile(); InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); diff --git a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js index 8914830ee2..ecbb69e782 100644 --- a/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js +++ b/cypress/e2e/settings/data-export/new-mapping-profile-holdings-source-record.cy.js @@ -51,18 +51,34 @@ describe('Data Export', () => { ModalSelectTransformations.verifyCheckboxDisabled('Instance'); ModalSelectTransformations.uncheckItemRecordTypeChechbox(); ModalSelectTransformations.searchItemTransformationsByName('Holdings - ID'); + ModalSelectTransformations.verifyValueInSearchField('Holdings - ID'); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', 'a'); ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); ModalSelectTransformations.checkItemRecordTypeChechbox(); ModalSelectTransformations.searchItemTransformationsByName('Item - ID'); + ModalSelectTransformations.verifyValueInSearchField('Item - ID'); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', '$a'); + ModalSelectTransformations.fillInTransformationsTextfields('245', '3', '4', 'a'); ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Holdings - ID', + '123', + '1', + '2', + 'a', + ); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Item - ID', + '245', + '3', + '4', + 'a', + 1, + ); InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); - ExportFieldMappingProfiles.saveMappingProfile(); InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); diff --git a/cypress/e2e/settings/data-export/transformation-form.cy.js b/cypress/e2e/settings/data-export/transformation-form.cy.js index 4f0e06f815..27267aef8e 100644 --- a/cypress/e2e/settings/data-export/transformation-form.cy.js +++ b/cypress/e2e/settings/data-export/transformation-form.cy.js @@ -77,9 +77,22 @@ describe('Data Export', () => { ModalSelectTransformations.verifySearchResultDoesNotInclude(['Holdings', 'Instance']); ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('456', '1', '2', '$a'); + ModalSelectTransformations.fillInTransformationsTextfieldsByFieldName( + 'Item - Barcode', + '456', + '1', + '', + 'a', + ); ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + 'Item - Barcode', + '456', + '1', + '\\', + 'a', + ); ExportFieldMappingProfiles.saveMappingProfile(); InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); diff --git a/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js b/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js index 08897907ce..447cc39987 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js @@ -5,6 +5,8 @@ import { Checkbox, Modal, Accordion, + MultiColumnList, + MultiColumnListCell, Option, TextArea, HTML, @@ -20,6 +22,7 @@ const outputFormatSelect = Select({ name: 'outputFormat' }); const newButton = Button('New'); const fieldsSuppressionTextArea = TextArea('Fields suppression'); const saveAndCloseButton = Button('Save & close'); +const transformationsAccordion = Accordion('Transformations'); export const CHECKBOX_NAMES = { SRS: 'Source record storage (entire record)', @@ -169,7 +172,7 @@ export default { Checkbox('Item').has({ checked: false }), TextArea('Description').exists(), Checkbox('Suppress 999 ff').has({ checked: false }), - Accordion('Transformations').find(Button('Add transformations')).has({ disabled: false }), + transformationsAccordion.find(Button('Add transformations')).has({ disabled: false }), HTML('No transformations found').exists(), ]); this.verifyFieldsSuppressionTextareaDisabled(true); @@ -220,4 +223,66 @@ export default { cy.get('[class^="folioRecordTypeContainer"]').find('[class^="error"]').should('not.exist'); } }, + + verifyAddedTransformationTable( + fieldNameValue, + fieldValue, + ind1Value, + ind2Value, + subfieldValue, + rowIndex = 0, + ) { + cy.expect([ + transformationsAccordion + .find(MultiColumnList()) + .find( + MultiColumnListCell({ + column: 'Field name', + content: fieldNameValue, + row: rowIndex, + }), + ) + .exists(), + transformationsAccordion + .find(MultiColumnList()) + .find( + MultiColumnListCell({ + column: 'Field', + content: fieldValue, + row: rowIndex, + }), + ) + .exists(), + transformationsAccordion + .find(MultiColumnList()) + .find( + MultiColumnListCell({ + column: 'In.1', + content: ind1Value, + row: rowIndex, + }), + ) + .exists(), + transformationsAccordion + .find(MultiColumnList()) + .find( + MultiColumnListCell({ + column: 'In.2', + content: ind2Value, + row: rowIndex, + }), + ) + .exists(), + transformationsAccordion + .find(MultiColumnList()) + .find( + MultiColumnListCell({ + column: 'Subfield', + content: subfieldValue, + row: rowIndex, + }), + ) + .exists(), + ]); + }, }; diff --git a/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js b/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js index e4275e3c6a..273b6d3fc9 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js @@ -26,6 +26,10 @@ export default { cy.get('div[class^=modal-] input[name=searchValue]').clear().type(`${name}{enter}`); }, + verifyValueInSearchField(searchValue) { + cy.expect(TextField({ name: 'searchValue' }).has({ value: searchValue })); + }, + selectTransformations: (marcField, subfield) => { cy.do([ Checkbox({ ariaLabel: 'Select field' }).click(), @@ -71,7 +75,10 @@ export default { cy.expect([ Checkbox({ id: 'select-all-checkbox', checked: false }).exists(), MultiColumnListHeader('Field name').exists(), - MultiColumnListHeader('Transformation').exists(), + MultiColumnListHeader('Field').exists(), + MultiColumnListHeader('In.1').exists(), + MultiColumnListHeader('In.2').exists(), + MultiColumnListHeader('Subfield').exists(), ]); }, verifySearchAndFilterPane() { @@ -150,6 +157,22 @@ export default { `//div[contains(@class, "mclRow--")][${rowIndex + 1}]//input[contains(@name, "subfield")]`, ).type(textfield4); }, + fillInTransformationsTextfieldsByFieldName(fieldName, marcField, ind1, ind2, subfield) { + cy.do([ + ModalTransformation.find(MultiColumnListRow({ innerHTML: including(fieldName) })) + .find(TextField({ name: including('marcField') })) + .fillIn(marcField), + ModalTransformation.find(MultiColumnListRow({ innerHTML: including(fieldName) })) + .find(TextField({ name: including('indicator1') })) + .fillIn(ind1), + ModalTransformation.find(MultiColumnListRow({ innerHTML: including(fieldName) })) + .find(TextField({ name: including('indicator2') })) + .fillIn(ind2), + ModalTransformation.find(MultiColumnListRow({ innerHTML: including(fieldName) })) + .find(TextField({ name: including('subfield') })) + .fillIn(subfield), + ]); + }, fillInTransformationsFirstRowMarcTextField(textfield1, rowIndex = 0) { cy.do( ModalTransformation.find( From a8dc99e2fc4bb927106cfd11a147b09d85063e22 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:57:43 +0500 Subject: [PATCH 06/34] implemented test C466162 (#4115) --- ...ing-classification-normalized-option.cy.js | 219 ++++++++++++++++++ cypress/fixtures/marcBibFileForC466162.mrc | 1 + 2 files changed, 220 insertions(+) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-each-instance-classification-type-using-classification-normalized-option.cy.js create mode 100644 cypress/fixtures/marcBibFileForC466162.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-each-instance-classification-type-using-classification-normalized-option.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-each-instance-classification-type-using-classification-normalized-option.cy.js new file mode 100644 index 0000000000..502d0c7924 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-each-instance-classification-type-using-classification-normalized-option.cy.js @@ -0,0 +1,219 @@ +import { Permissions } from '../../../support/dictionary'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import Users from '../../../support/fragments/users/users'; +import TopMenu from '../../../support/fragments/topMenu'; +import ClassificationIdentifierTypes from '../../../support/fragments/settings/inventory/instances/classificationIdentifierTypes'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import { + CLASSIFICATION_IDENTIFIER_TYPES, + DEFAULT_JOB_PROFILE_NAMES, +} from '../../../support/constants'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in "Select instance" plugin', () => { + const testData = { + folioInstances: [ + { + instanceTitle: 'C466162 Search by Classification Instance 1 - Additional Dewey', + classificationType: CLASSIFICATION_IDENTIFIER_TYPES.ADDITIONAL_DEWEY, + classificationValue: '598.099', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 2 - Canadian Classification', + classificationType: CLASSIFICATION_IDENTIFIER_TYPES.CANADIAN_CLASSIFICATION, + classificationValue: 'HT154', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 6 - LC (local)', + classificationType: CLASSIFICATION_IDENTIFIER_TYPES.DEWEY, + classificationValue: 'DD259.4 .B527 1973', + }, + { + instanceTitle: + 'C466162 Search by Classification Instance 7 - National Agricultural Library', + classificationType: CLASSIFICATION_IDENTIFIER_TYPES.GDC, + classificationValue: 'HD3492.H8', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 9 - SUDOC', + classificationType: CLASSIFICATION_IDENTIFIER_TYPES.LC, + classificationValue: 'L37.s:Oc1/2/991', + }, + ], + marcRecordsTitlesAndClassifications: [ + { + instanceTitle: 'C466162 Search by Classification Instance 3 - Dewey', + classificationValue: '598.0994', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 4 - GDC', + classificationValue: 'HEU/G74.3C49', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 5 - LC', + classificationValue: 'QS 11 .GA1 E53 2005', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 8 - NLM', + classificationValue: 'SB945.A5', + }, + { + instanceTitle: 'C466162 Search by Classification Instance 10 - UDC', + classificationValue: '631.321:631.411.3', + }, + ], + classificationOption: 'Classification, normalized', + localInstnaceClassificationValue: 'VP000321', + instanceTitleWithLocalClassification: 'C466162 Search by Classification Instance 11 - Local', + }; + const marcFile = { + marc: 'marcBibFileForC466162.mrc', + fileName: `testMarcFileC466162.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + const createdRecordIDs = []; + const localClassificationIdentifierType = { + name: `C466162 Classification identifier type ${getRandomPostfix()}`, + source: 'local', + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + let classificationIdentifierTypeId; + let user; + const search = (query, expectedResult) => { + SelectInstanceModal.chooseSearchOption(testData.classificationOption); + SelectInstanceModal.searchByName(query); + InventorySearchAndFilter.verifySearchResultIncludingValue(expectedResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }; + + before('Create user, test data', () => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + DataImport.uploadFileViaApi(marcFile.marc, marcFile.fileName, marcFile.jobProfileToRun).then( + (response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }, + ); + + ClassificationIdentifierTypes.createViaApi(localClassificationIdentifierType).then( + (response) => { + classificationIdentifierTypeId = response.body.id; + }, + ); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((createdUserProperties) => { + user = createdUserProperties; + + cy.getInstanceTypes({ limit: 1 }) + .then((instanceTypes) => { + testData.instanceTypeId = instanceTypes[0].id; + }) + .then(() => { + testData.folioInstances.forEach((folioInstance) => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: testData.instanceTypeId, + title: folioInstance.instanceTitle, + classifications: [ + { + classificationNumber: folioInstance.classificationValue, + classificationTypeId: folioInstance.classificationType, + }, + ], + }, + }).then((instance) => { + createdRecordIDs.push(instance.instanceId); + }); + }); + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: testData.instanceTypeId, + title: testData.instanceTitleWithLocalClassification, + classifications: [ + { + classificationNumber: testData.localInstnaceClassificationValue, + classificationTypeId: classificationIdentifierTypeId, + }, + ], + }, + }).then((instance) => { + createdRecordIDs.push(instance.instanceId); + }); + }); + + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after('Delete user, test data', () => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + ClassificationIdentifierTypes.deleteViaApi(classificationIdentifierTypeId); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(user.userId); + }); + + it( + 'C466162 Find Instance plugin | Search for each Instance classification type using "Classification, normalized" search option (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + testData.folioInstances.forEach((folioInstance) => { + search(folioInstance.classificationValue, folioInstance.instanceTitle); + }); + testData.marcRecordsTitlesAndClassifications.forEach((marcInstance) => { + search(marcInstance.classificationValue, marcInstance.instanceTitle); + }); + search( + testData.localInstnaceClassificationValue, + testData.instanceTitleWithLocalClassification, + ); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC466162.mrc b/cypress/fixtures/marcBibFileForC466162.mrc new file mode 100644 index 0000000000..ec94b1e38e --- /dev/null +++ b/cypress/fixtures/marcBibFileForC466162.mrc @@ -0,0 +1 @@ +01201cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808200130023324500560024626000470030226500380034930000150038731000220040232100250042436200230044957000290047265000330050165000450053465500420057970000450062185300180066686300230068490200160070790500210072394800370074495000340078136683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 a598.09940 aC466162 Search by Classification Instance 3 - Dewey aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01203cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808600170023324500540025026000470030426500380035130000150038931000220040432100250042636200230045157000290047465000330050365000450053665500420058170000450062385300180066886300230068690200160070990500210072594800370074695000340078336683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aHEU/G74.3C490 aC466162 Search by Classification Instance 4 - GDC aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01209cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021809000240023324500530025726000470031026500380035730000150039531000220041032100250043236200230045757000290048065000330050965000450054265500420058770000450062985300180067486300230069290200160071590500210073194800370075295000340078936683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aQS 11 .GA1 E53 20050 aC466162 Search by Classification Instance 5 - LC aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01199cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021806000130023324500540024626000470030026500380034730000150038531000220040032100250042236200230044757000290047065000330049965000450053265500420057770000450061985300180066486300230068290200160070590500210072194800370074295000340077936683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aSB945.A50 aC466162 Search by Classification Instance 8 - NLM aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01209cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808000220023324500550025526000470031026500380035730000150039531000220041032100250043236200230045757000290048065000330050965000450054265500420058770000450062985300180067486300230069290200160071590500210073194800370075295000340078936683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 a631.321:631.411.30 aC466162 Search by Classification Instance 10 - UDC aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N \ No newline at end of file From 8cc1d9b870e75f2d08899e559dbe6f2d97cfd785 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:02:03 +0500 Subject: [PATCH 07/34] FAT-15195/C466155 (#4111) * implemented test C466155 * implemented test C466162 * fix --- ...malized-option-using-advanced-search.cy.js | 164 ++++++++++++++++++ cypress/fixtures/marcBibFileForC466155.mrc | 1 + 2 files changed, 165 insertions(+) create mode 100644 cypress/e2e/inventory/advanced-search/search-by-classification-normalized-option-using-advanced-search.cy.js create mode 100644 cypress/fixtures/marcBibFileForC466155.mrc diff --git a/cypress/e2e/inventory/advanced-search/search-by-classification-normalized-option-using-advanced-search.cy.js b/cypress/e2e/inventory/advanced-search/search-by-classification-normalized-option-using-advanced-search.cy.js new file mode 100644 index 0000000000..4230eb1107 --- /dev/null +++ b/cypress/e2e/inventory/advanced-search/search-by-classification-normalized-option-using-advanced-search.cy.js @@ -0,0 +1,164 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Inventory', () => { + describe('Advanced search', () => { + const testData = { + classificationNormalized: 'Classification, normalized', + }; + + const marcFile = { + marc: 'marcBibFileForC466155.mrc', + fileName: `testMarcFileC466155.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const searchData = [ + { + row: 0, + query: 'WA 675 I61w 1967', + matchOption: 'Exact phrase', + }, + { + row: 0, + query: 'WA 675 I61w 1967', + matchOption: 'Contains all', + }, + { + row: 0, + query: 'WA 675', + matchOption: 'Starts with', + }, + { + row: 0, + query: '675 I61w', + matchOption: 'Contains any', + }, + ]; + + const searchDataWithOperator = [ + { + row: 1, + query: 'WA I61w 1967', + matchOption: 'Exact phrase', + }, + { + row: 2, + query: '675 I61w', + matchOption: 'Contains any', + operator: 'OR', + }, + { + row: 3, + query: 'wa', + matchOption: 'Starts with', + operator: 'AND', + }, + { + row: 4, + query: '1967-2024', + matchOption: 'Contains all', + operator: 'NOT', + }, + ]; + + const searchResults = [ + 'C466155 Search by Classification Instance (advanced search) - Instance 1 (Dewey)', + 'C466155 Search by Classification Instance (advanced search) - Instance 2 (GDC)', + 'C466155 Search by Classification Instance (advanced search) - Instance 3 (LC)', + 'C466155 Search by Classification Instance (advanced search) - Instance 4 (NLM)', + 'C466155 Search by Classification Instance (advanced search) - Instance 5 (UDC)', + ]; + + const search = (index) => { + InventoryInstances.clickAdvSearchButton(); + InventoryInstances.fillAdvSearchRow( + searchData[index].row, + searchData[index].query, + searchData[index].matchOption, + testData.classificationNormalized, + ); + InventoryInstances.clickSearchBtnInAdvSearchModal(); + }; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + cy.createTempUser([Permissions.uiInventoryViewInstances.gui]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after(() => { + cy.getAdminToken(); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C466155 Search for "Instance" by "Classification, normalized" option using "Advanced search" modal (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventorySearchAndFilter.instanceTabIsDefault(); + InventorySearchAndFilter.selectSearchOption(testData.classificationNormalized); + search(0); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[0]); + search(1); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[0]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[1]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[2]); + search(2); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[0]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[1]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[3]); + search(3); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[0]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[1]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[2]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[3]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[4]); + + InventoryInstances.clickAdvSearchButton(); + searchDataWithOperator.forEach((data) => { + InventoryInstances.fillAdvSearchRow( + data.row, + data.query, + data.matchOption, + testData.classificationNormalized, + data.operator, + ); + }); + InventoryInstances.clickSearchBtnInAdvSearchModal(); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[0]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[3]); + InventorySearchAndFilter.verifySearchResultIncludingValue(searchResults[4]); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC466155.mrc b/cypress/fixtures/marcBibFileForC466155.mrc new file mode 100644 index 0000000000..5882e4eed4 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC466155.mrc @@ -0,0 +1 @@ +01238cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808200210023324500850025426000470033926500380038630000150042431000220043932100250046136200230048657000290050965000330053865000450057165500420061670000450065885300180070386300230072190200160074490500210076094800370078195000340081836683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aWA 675 I61w 19670 aC466155 Search by Classification Instance (advanced search) - Instance 1 (Dewey) aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01241cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808600260023324500830025926000470034226500380038930000150042731000220044232100250046436200230048957000290051265000330054165000450057465500420061970000450066185300180070686300230072490200160074790500210076394800370078495000340082136683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aWA 675 I61w 1967-20240 aC466155 Search by Classification Instance (advanced search) - Instance 2 (GDC) aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01243cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021809000290023324500820026226000470034426500380039130000150042931000220044432100250046636200230049157000290051465000330054365000450057665500420062170000450066385300180070886300230072690200160074990500210076594800370078695000340082336683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aPA WA 675 I61w 1967-20240 aC466155 Search by Classification Instance (advanced search) - Instance 3 (LC) aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01231cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021806000160023324500830024926000470033226500380037930000150041731000220043232100250045436200230047957000290050265000330053165000450056465500420060970000450065185300180069686300230071490200160073790500210075394800370077495000340081136683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aWA 675 19670 aC466155 Search by Classification Instance (advanced search) - Instance 4 (NLM) aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N01232cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808000170023324500830025026000470033326500380038030000150041831000220043332100250045536200230048057000290050365000330053265000450056565500420061070000450065285300180069786300230071590200160073890500210075494800370077595000340081236683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 aWA I61w 19670 aC466155 Search by Classification Instance (advanced search) - Instance 5 (UDC) aLondon,bCambridge University Press [etc.] a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N \ No newline at end of file From bd6c38b4614d1ebb9199e53e347f8a7e68ff1f5b Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:10:49 +0500 Subject: [PATCH 08/34] FAT-15906 Update autotests regarding changes in Transformation form in Data export Settings (#4124) * Update the test case C345342 * Stabilize the test case C422220 * Add the tag 'shiftLeft' --- .../csv/bulk-edit-csv-users-ids-error.cy.js | 2 +- .../in-app/bulk-edit-in-app-elements.cy.js | 4 +- ...notes-in-different-columns-add-notes.cy.js | 8 +-- .../bulk-edit-user-permissions.cy.js | 2 +- ...edit-duplicate-field-mapping-profile.cy.js | 4 +- ...ransformations-placeholder-attribute.cy.js | 67 ++++++++++--------- .../new-field-mapping-profile.cy.js | 32 +++++---- .../exportFieldMappingProfiles.js | 2 +- .../exportNewFieldMappingProfile.js | 5 ++ .../modalSelectTransformations.js | 22 +++++- interactors/multi-column-list.js | 1 + 11 files changed, 91 insertions(+), 58 deletions(-) diff --git a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js index 57feabb412..13024725bf 100644 --- a/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js +++ b/cypress/e2e/bulk-edit/csv/bulk-edit-csv-users-ids-error.cy.js @@ -37,7 +37,7 @@ describe('bulk-edit', () => { it( 'C350928 Verify error accordion during matching (Local approach) (firebird)', - { tags: ['smoke', 'firebird'] }, + { tags: ['smoke', 'firebird', 'shiftLeft'] }, () => { BulkEditSearchPane.checkUsersRadio(); BulkEditSearchPane.selectRecordIdentifier('User UUIDs'); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js index 4761efdc69..a9719a1dde 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-elements.cy.js @@ -56,7 +56,7 @@ describe('bulk-edit', () => { it( 'C353232 Verify error accordion during matching (In app approach) (firebird)', - { tags: ['smoke', 'firebird'] }, + { tags: ['smoke', 'firebird', 'shiftLeft'] }, () => { BulkEditSearchPane.uploadFile(invalidItemBarcodesFileName); BulkEditSearchPane.waitFileUploading(); @@ -72,7 +72,7 @@ describe('bulk-edit', () => { it( 'C350941 Verify uploading file with identifiers -- In app approach (firebird)', - { tags: ['smoke', 'firebird'] }, + { tags: ['smoke', 'firebird', 'shiftLeft'] }, () => { BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Items', 'Item barcode'); BulkEditSearchPane.uploadFile(validItemBarcodeFileName); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js index 49b7e0d944..e00c6a7f2a 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js @@ -66,6 +66,10 @@ describe('bulk-edit', () => { before('create test data', () => { cy.clearLocalStorage(); + InventoryInstances.createHoldingsNoteTypeViaApi(newNoteType).then((noteId) => { + newNoteTypeId = noteId; + }); + cy.createTempUser([permissions.bulkEditEdit.gui, permissions.inventoryAll.gui]).then( (userProperties) => { user = userProperties; @@ -103,10 +107,6 @@ describe('bulk-edit', () => { }); }); - InventoryInstances.createHoldingsNoteTypeViaApi(newNoteType).then((noteId) => { - newNoteTypeId = noteId; - }); - cy.login(user.username, user.password, { path: TopMenu.bulkEditPath, waiter: BulkEditSearchPane.waitLoading, diff --git a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js index c0b24f1a5a..3871c50cde 100644 --- a/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js +++ b/cypress/e2e/bulk-edit/permissions/bulk-edit-user-permissions.cy.js @@ -33,7 +33,7 @@ describe('bulk-edit', () => { it( 'C350765 Verify BULK EDIT permissions list (firebird)', - { tags: ['smoke', 'firebird'] }, + { tags: ['smoke', 'firebird', 'shiftLeft'] }, () => { const permissionsToVerify = [ permissions.bulkEditCsvView.gui, diff --git a/cypress/e2e/settings/data-export/edit-duplicate-field-mapping-profile.cy.js b/cypress/e2e/settings/data-export/edit-duplicate-field-mapping-profile.cy.js index 8af433e7f9..e729eaacb4 100644 --- a/cypress/e2e/settings/data-export/edit-duplicate-field-mapping-profile.cy.js +++ b/cypress/e2e/settings/data-export/edit-duplicate-field-mapping-profile.cy.js @@ -62,7 +62,7 @@ describe('Data Export', () => { it( 'C15826 Editing the existing mapping profile (firebird)', - { tags: ['criticalPath', 'firebird'] }, + { tags: ['criticalPath', 'firebird', 'shiftLeft'] }, () => { SingleFieldMappingProfilePane.clickProfileNameFromTheList(profileNames[0]); SingleFieldMappingProfilePane.verifyActionOptions(); @@ -88,7 +88,7 @@ describe('Data Export', () => { it( 'C15827 Duplicate the existing mapping profile (firebird)', - { tags: ['criticalPath', 'firebird'] }, + { tags: ['criticalPath', 'firebird', 'shiftLeft'] }, () => { SingleFieldMappingProfilePane.clickProfileNameFromTheList(profileNames[1]); SingleFieldMappingProfilePane.verifyActionOptions(); diff --git a/cypress/e2e/settings/data-export/mapping-profiles-transformations-placeholder-attribute.cy.js b/cypress/e2e/settings/data-export/mapping-profiles-transformations-placeholder-attribute.cy.js index 3d1a607b8a..37f636fa8d 100644 --- a/cypress/e2e/settings/data-export/mapping-profiles-transformations-placeholder-attribute.cy.js +++ b/cypress/e2e/settings/data-export/mapping-profiles-transformations-placeholder-attribute.cy.js @@ -9,6 +9,9 @@ import InteractorsTools from '../../../support/utils/interactorsTools'; let user; const newTransformationCalloutMessage = '1 transformation has been successfully added'; +const fieldForTransformation = 'Holdings - Call number - Call number'; +const placeholderValues = ['900', '\\', '\\', 'a']; +const emptyPlaceholders = ['', '', '', '']; describe('Data Export', () => { describe('Mapping profile - setup', () => { @@ -38,55 +41,55 @@ describe('Data Export', () => { ExportNewFieldMappingProfile.createNewFieldMappingProfile('test.1', []); ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( - '900', - '0', - '0', - '$a', + ...placeholderValues, ); - ModalSelectTransformations.fillInTransformationsFirstRowMarcTextField('901'); + ModalSelectTransformations.typeInTransformationsMarcTextField('901'); ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( - '', - '', - '', - '', + ...emptyPlaceholders, ); - ModalSelectTransformations.fillInTransformationsFirstRowMarcTextField(''); + + ModalSelectTransformations.removeValueFromTransformationsMarcTextField(); ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( - '900', - '0', - '0', - '$a', + ...placeholderValues, ); - ModalSelectTransformations.fillInTransformationsFirstRowMarcTextField('123'); + + ModalSelectTransformations.typeInTransformationsMarcTextField(' '); ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( - '', - '', - '', - '', + ...emptyPlaceholders, ); - ModalSelectTransformations.fillInTransformationsFirstRowMarcTextField(''); + ModalSelectTransformations.clickTransformationsCancelButton(); + ModalSelectTransformations.verifyModalTransformationExists(false); + cy.wait(1000); ExportNewFieldMappingProfile.clickAddTransformationsButton(); ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( - '900', - '0', - '0', - '$a', + ...placeholderValues, ); + ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('902', '1', '2', '$b'); + ModalSelectTransformations.typeInTransformationsMarcTextField('001'); ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); - + ModalSelectTransformations.verifyModalTransformationExists(false); InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); + ExportNewFieldMappingProfile.verifyNewFieldMappingProfileFormIsOpened(); + ExportNewFieldMappingProfile.verifyAddedTransformationTable( + fieldForTransformation, + '001', + '', + '', + '', + ); + cy.wait(1000); + ExportNewFieldMappingProfile.clickAddTransformationsButton(); - ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsValues( - '902', - '1', - '2', - '$b', + ModalSelectTransformations.verifyFieldSelectedForTransformationByName( + fieldForTransformation, + ); + ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsValues('001', '', '', ''); + ModalSelectTransformations.verifyTransformationsFirstRowTextFieldsPlaceholders( + ...placeholderValues, ); - ModalSelectTransformations.clickTransformationsCancelButton(); }, ); }); diff --git a/cypress/e2e/settings/data-export/new-field-mapping-profile.cy.js b/cypress/e2e/settings/data-export/new-field-mapping-profile.cy.js index 3e8ec659fb..ed8f6fde2f 100644 --- a/cypress/e2e/settings/data-export/new-field-mapping-profile.cy.js +++ b/cypress/e2e/settings/data-export/new-field-mapping-profile.cy.js @@ -38,21 +38,27 @@ describe('Data Export', () => { Users.deleteViaApi(user.userId); }); - it('C10984 New mapping profile form (firebird)', { tags: ['criticalPath', 'firebird'] }, () => { - ExportFieldMappingProfiles.goToFieldMappingProfilesTab(); - ExportNewFieldMappingProfile.createNewFieldMappingProfile(fieldMappingProfileName, ['Item']); - ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); - ModalSelectTransformations.uncheckInstanceRecordTypeChechbox(); - ModalSelectTransformations.clickNthCheckbox(); - ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', 'a'); + it( + 'C10984 New mapping profile form (firebird)', + { tags: ['criticalPath', 'firebird', 'shiftLeft'] }, + () => { + ExportFieldMappingProfiles.goToFieldMappingProfilesTab(); + ExportNewFieldMappingProfile.createNewFieldMappingProfile(fieldMappingProfileName, [ + 'Item', + ]); + ModalSelectTransformations.uncheckHoldingsRecordTypeChechbox(); + ModalSelectTransformations.uncheckInstanceRecordTypeChechbox(); + ModalSelectTransformations.clickNthCheckbox(); + ModalSelectTransformations.fillInTransformationsTextfields('123', '1', '2', 'a'); - ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); - InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); + ModalSelectTransformations.clickTransformationsSaveAndCloseButton(); + InteractorsTools.checkCalloutMessage(newTransformationCalloutMessage); - ExportFieldMappingProfiles.saveMappingProfile(); - InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); + ExportFieldMappingProfiles.saveMappingProfile(); + InteractorsTools.checkCalloutMessage(newFieldMappingProfileCalloutMessage); - ExportFieldMappingProfiles.verifyProfileNameOnTheList(fieldMappingProfileName); - }); + ExportFieldMappingProfiles.verifyProfileNameOnTheList(fieldMappingProfileName); + }, + ); }); }); diff --git a/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js b/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js index 207645902a..8242039d2a 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/exportFieldMappingProfiles.js @@ -114,7 +114,7 @@ export default { searchButton.has({ disabled: true }), ]); cy.do(cy.get('[class^=mclEndOfListContainer--]').should('have.text', 'End of list')); - cy.wait(2000); + cy.wait(3000); this.verifyFieldMappingProfilesCount(); this.verifyColumnTitles(); }, diff --git a/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js b/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js index 447cc39987..a84552b7d0 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/exportNewFieldMappingProfile.js @@ -10,6 +10,7 @@ import { Option, TextArea, HTML, + Pane, } from '../../../../../interactors'; import modalSelectTransformations from './modalSelectTransformations'; import { EXPORT_TRANSFORMATION_NAMES } from '../../../constants'; @@ -285,4 +286,8 @@ export default { .exists(), ]); }, + + verifyNewFieldMappingProfileFormIsOpened() { + cy.expect(Pane('New field mapping profile').exists()); + }, }; diff --git a/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js b/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js index 273b6d3fc9..f560ff8fa0 100644 --- a/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js +++ b/cypress/support/fragments/data-export/exportMappingProfile/modalSelectTransformations.js @@ -173,11 +173,18 @@ export default { .fillIn(subfield), ]); }, - fillInTransformationsFirstRowMarcTextField(textfield1, rowIndex = 0) { + typeInTransformationsMarcTextField(textfield1, rowIndex = 0) { + cy.xpath( + `//div[contains(@class, "mclRow--")][${rowIndex + 1}]//input[contains(@name, "marcField")]`, + ).type(textfield1); + }, + removeValueFromTransformationsMarcTextField(rowIndex = 0) { cy.do( ModalTransformation.find( TextField({ name: `transformations[${rowIndex}].rawTransformation.marcField` }), - ).fillIn(textfield1), + ) + .find(Button({ ariaLabel: 'Clear this field' })) + .click(), ); }, clickTransformationsSaveAndCloseButton() { @@ -226,4 +233,15 @@ export default { ).has({ value: textfield4 }), ]); }, + verifyModalTransformationExists(isExist = true) { + if (isExist) cy.expect(ModalTransformation.exists()); + cy.expect(ModalTransformation.absent()); + }, + verifyFieldSelectedForTransformationByName(fieldName, rowIndex = 0) { + cy.expect( + ModalTransformation.find(MultiColumnListRow({ ariaLabel: fieldName })) + .find(Checkbox({ name: `transformations[${rowIndex}].isSelected` })) + .has({ checked: true }), + ); + }, }; diff --git a/interactors/multi-column-list.js b/interactors/multi-column-list.js index 8e4fa807ca..4916cfc8c9 100644 --- a/interactors/multi-column-list.js +++ b/interactors/multi-column-list.js @@ -24,6 +24,7 @@ export const MultiColumnListRow = HTML.extend('multi column list row') indexRow: (el) => el.parentElement.getAttribute('data-row-index'), ariaRowIndex: (el) => +el.getAttribute('aria-rowindex'), innerHTML: (el) => el.innerHTML, + ariaLabel: (el) => el.getAttribute('aria-label'), }); export const ListRow = HTML.extend('list row') From a4f2f16ff4f1385aa5df0f04f8636cba8d7a3ed1 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:49:13 +0500 Subject: [PATCH 09/34] implemented test C496185 (#4120) --- ...n-using-queries-with-different-order.cy.js | 169 ++++++++++++++++++ cypress/fixtures/marcBibFileForC496185.mrc | 1 + 2 files changed, 170 insertions(+) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-different-order.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496185.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-different-order.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-different-order.cy.js new file mode 100644 index 0000000000..953cc26f14 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-different-order.cy.js @@ -0,0 +1,169 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in "Select instance" plugin', () => { + const testData = { + searchItem: [ + { + searchOption: 'Place of publication', + searchValue: 'Burlington, Massachusetts', + }, + { + searchOption: 'Place of publication', + searchValue: 'Burlington', + }, + { + searchOption: 'Place of publication', + searchValue: 'Massachusetts', + }, + { + searchOption: 'Place of publication', + searchValue: 'Burlington Massachusetts', + }, + { + searchOption: 'Place of publication', + searchValue: 'Massachusetts, Burlington', + }, + { + searchOption: 'All', + searchValue: 'Burlington, Massachusetts', + }, + { + searchOption: 'All', + searchValue: 'Burlington', + }, + { + searchOption: 'All', + searchValue: 'Massachusetts', + }, + { + searchOption: 'All', + searchValue: 'Burlington Massachusetts', + }, + { + searchOption: 'All', + searchValue: 'Massachusetts, Burlington', + }, + { + searchOption: 'Query search', + searchValue: 'publication.place=Massachusetts, Burlington', + }, + { + searchOption: 'Query search', + searchValue: 'publication.place=Burlington', + }, + { + searchOption: 'Query search', + searchValue: 'publication.place=Massachusetts', + }, + { + searchOption: 'Query search', + searchValue: 'publication.place=Burlington Massachusetts', + }, + { + searchOption: 'Query search', + searchValue: 'publication.place=Massachusetts, Burlington', + }, + ], + searchResult: 'C496185 Tabletop game design for video game designers', + }; + + const marcFile = { + marc: 'marcBibFileForC496185.mrc', + fileName: `testMarcFileC496185.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C496185 Select Instance plugin | Search for Instance by "Place of publication" field using queries with different order of search terms (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + testData.searchItem.forEach((item) => { + SelectInstanceModal.chooseSearchOption(item.searchOption); + SelectInstanceModal.searchByName(item.searchValue); + InventorySearchAndFilter.verifySearchResultIncludingValue(testData.searchResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC496185.mrc b/cypress/fixtures/marcBibFileForC496185.mrc new file mode 100644 index 0000000000..bf3b2985c4 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496185.mrc @@ -0,0 +1 @@ +01283cam 2200337 i 4500001001000000003000600010005001700016008004100033010001500074019001400089020001800103020001500121035003900136040005200175042000800227049000900235050003000244082001900274100007500293245007200368264007700440300003000517336002200547337002600569338002400595500002000619504006700639650008600706650008300792650007000875893974423OCoLC20170209051107.0141023s2016 nyu b 001 0 eng  a2014040388 a923840368 a9780415627016 a041562701X a(OCoLC)893974423z(OCoLC)923840368 aDLCbengerdacDLCdBDXdOCLCFdCDNdYDXCPdCDX apcc aMTUM00aQA76.76.C672bH35155 201600a794.8/15262231 aHam, Ethan,0https://id.loc.gov/authorities/names/n2014066083eauthor.10aC496185 Tabletop game design for video game designers /cEthan Ham. 1aBurlington, Massachusetts :bFocal Press, Taylor & Francis Group,c2016. aviii, 313 pages ;c24 cm. atext2rdacontent. aunmediated2rdamedia. avolume2rdacarrier. aIncludes index. aIncludes bibliographical references (pages 297-307) and index. 0aComputer gamesxProgramming.0https://id.loc.gov/authorities/subjects/sh95003476. 0aComputer gamesxDesign.0https://id.loc.gov/authorities/subjects/sh2008101479. 0aStoryboards.0https://id.loc.gov/authorities/subjects/sh93006433. \ No newline at end of file From d8a9a77050840f939ec897340f1c3fbf3aaac8d2 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:57:16 +0500 Subject: [PATCH 10/34] FAT-15204/C496184 (#4129) * implemented test C496184 * linter fix --- ...ultiple-records-in-publication-field.cy.js | 118 ++++++++++++++++++ .../marc-holdings/holding-quickmark.cy.js | 2 +- cypress/fixtures/marcBibFileForC496184.mrc | 1 + 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496184.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js new file mode 100644 index 0000000000..5fb6e2b1f2 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js @@ -0,0 +1,118 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in Inventory', () => { + const testData = { + searchOption: ['Place of publication', 'All', 'Query search'], + searchValue: ['Petrozavodsk', 'Петрозаводск'], + searchResult: + 'C496184 "Kalevala" v kontekste regionalʹnoĭ i mirovoĭ kulʹtury : materialy Mezhdunarodnoĭ nauchnoĭ konferent͡sii, posvi͡ashchennoĭ 160-letii͡u polnogo izdanii͡a "Kalevaly" / redakt͡sionnai͡a kollegii͡a, I. I͡U. Vinokurova ... [and six others].', + }; + + const marcFile = { + marc: 'marcBibFileForC496184.mrc', + fileName: `testMarcFileC496184.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C496184 Select Instance plugin | Search for Instance which has multiple records in "Place of publication" field (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventorySearchAndFilter.instanceTabIsDefault(); + + testData.searchOption.forEach((option) => { + testData.searchValue.forEach((value) => { + SelectInstanceModal.chooseSearchOption(option); + if (option === 'Query search') { + SelectInstanceModal.searchByName(`publication.place=${value}`); + } else { + SelectInstanceModal.searchByName(value); + } + InventorySearchAndFilter.verifySearchResultIncludingValue(testData.searchResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/marc/marc-holdings/holding-quickmark.cy.js b/cypress/e2e/marc/marc-holdings/holding-quickmark.cy.js index 1bf8d74b25..32480bb7a9 100644 --- a/cypress/e2e/marc/marc-holdings/holding-quickmark.cy.js +++ b/cypress/e2e/marc/marc-holdings/holding-quickmark.cy.js @@ -141,7 +141,7 @@ describe('MARC', () => { 'Record cannot be saved. An 852 is required.', calloutTypes.error, ); - QuickMarcEditor.closeWithoutSavingAfterChange(); + QuickMarcEditor.pressCancel(); HoldingsRecordView.viewSource(); InventoryViewSource.contains(QuickMarcEditor.getSourceContent(initialTagContent)); }); diff --git a/cypress/fixtures/marcBibFileForC496184.mrc b/cypress/fixtures/marcBibFileForC496184.mrc new file mode 100644 index 0000000000..345a543da0 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496184.mrc @@ -0,0 +1 @@ +03192cam a2200493 i 4500001001000000003000400010005001700014008004100031020001800072020001500090035001200105035002100117040004100138041001800179042000800197049000900205050002100214066000700235111014300242245027800385260013000663300006000793336002100853337002500874338002300899546005400922504004100976630002601017650006101043650006601104650003301170630006101203650007301264650006801337650007801405655008601483655008301569700005401652710012201706880021401828880038802042880019402430880007402624in8438405ICU20120503130600.0110824s2010 ru a b 100 0 rus c a9785927404278 a5927404278 a8438405 a(OCoLC)748808445 aEVIEWbengerdacEVIEWdCGUdUtOrBLW0 arusaengafin apcc aCGUA 4aPH325b.M49 2010 c(N2 6880-01aMezhdunarodnai͡a konferent͡sii͡a "'Kalevala' v kontekste regionalʹnoĭ i mirovoĭ kulʹtury"d(2009 :cPetrozavodsk, Russia)106880-02aC496184 "Kalevala" v kontekste regionalʹnoĭ i mirovoĭ kulʹtury :bmaterialy Mezhdunarodnoĭ nauchnoĭ konferent͡sii, posvi͡ashchennoĭ 160-letii͡u polnogo izdanii͡a "Kalevaly" /credakt͡sionnai͡a kollegii͡a, I. I͡U. Vinokurova ... [and six others]. 6880-03aPetrozavodsk :bKarelʹskiĭ nauchnyĭ t͡sentr RAN :bInstitut i͡azyka, literatury i istorii KarNT͡S RAN,c2010. a551 pages, 3 unnumbered pages :billustrations ;c20 cm atext2rdacontent aunmediated2rdamedia avolume2rdacarrier aIn Russian, some articles in English and Finnish. aIncludes bibliographical references.00aKalevalavCongresses. 0aEpic poetry, FinnishxHistory and criticismvCongresses. 0aFolk literature, KarelianxHistory and criticismvCongresses. 0aFolk literaturevCongresses.07aKalevala.2fast0http://id.worldcat.org/fast/fst01358394 7aEpic poetry, Finnish.2fast0http://id.worldcat.org/fast/fst00913882 7aFolk literature.2fast0http://id.worldcat.org/fast/fst00928888 7aFolk literature, Karelian.2fast0http://id.worldcat.org/fast/fst00929109 7aConference papers and proceedings.2fast0http://id.worldcat.org/fast/fst01423772 7aCriticism, interpretation, etc.2fast0http://id.worldcat.org/fast/fst014116351 6880-04aVinokurova, I. I͡U.q(Irina I͡Urʹevna)2 6880-05aInstitut i͡azyka, literatury i istorii (Rossiĭskai͡a akademii͡a nauk. Karelʹskiĭ nauchnyĭ t͡sentr)2 6111-01/(NaМеждународная конференция "'Калевала' в контексте региональной и мировой культуры" (d(2009 :cПетрозаводск, Russia)106245-02/(Na"Калевала" в контексте региональной и мировой культуры :bматериалы Международной научной конференции, посвященной 160-летию полного издания "Калевалы" /cредакционная коллегия, И. Ю. Винокурова ... [and six others]. 6260-03/(NaПетрозаводск :bКарельский научный центр РАН :bИнститут языка, литературы и истории КарНЦ РАН,c2010.1 6700-04/(NaВинокурова, И. Ю.q(Ирина Юрьевна) \ No newline at end of file From cdccab9ef06da1f21c693a683838e7c8f2bab020 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:35:12 +0300 Subject: [PATCH 11/34] Fat 15877 (#4128) * fixed tests * deleted spase in test name * added waiter * fixed flaky test --- ...browse-same-call-number-shared-facet.cy.js | 2 +- ...source-with-instances-holdings-items.cy.js | 2 +- ...add-035-field-if-hrid-already-exists.cy.js | 212 ++++++++++++++++++ ...ld-add-035-field-if-hrid-not-exists.cy.js} | 200 +++-------------- ...eate_1.mrc => marcBibFileForC358998_1.mrc} | 0 ...date_1.mrc => marcBibFileForC358998_2.mrc} | 0 ...eate_2.mrc => marcBibFileForC543840_1.mrc} | 0 ...date_2.mrc => marcBibFileForC543840_2.mrc} | 0 .../fragments/inventory/instanceRecordView.js | 1 + 9 files changed, 252 insertions(+), 165 deletions(-) create mode 100644 cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-already-exists.cy.js rename cypress/e2e/data-import/importing-marc-bib-files/{updates-should-add-035-field.cy.js => updates-should-add-035-field-if-hrid-not-exists.cy.js} (52%) rename cypress/fixtures/{marcFileForC358998ForCreate_1.mrc => marcBibFileForC358998_1.mrc} (100%) rename cypress/fixtures/{marcFileForC358998ForUpdate_1.mrc => marcBibFileForC358998_2.mrc} (100%) rename cypress/fixtures/{marcFileForC358998ForCreate_2.mrc => marcBibFileForC543840_1.mrc} (100%) rename cypress/fixtures/{marcFileForC358998ForUpdate_2.mrc => marcBibFileForC543840_2.mrc} (100%) diff --git a/cypress/e2e/consortia/inventory/call-number-browse/browse-same-call-number-shared-facet.cy.js b/cypress/e2e/consortia/inventory/call-number-browse/browse-same-call-number-shared-facet.cy.js index 3e822c4988..6b743e7681 100644 --- a/cypress/e2e/consortia/inventory/call-number-browse/browse-same-call-number-shared-facet.cy.js +++ b/cypress/e2e/consortia/inventory/call-number-browse/browse-same-call-number-shared-facet.cy.js @@ -132,7 +132,7 @@ describe('Inventory', () => { JobProfiles.waitLoadingList(); JobProfiles.search(marcFiles[2].jobProfileToRun); JobProfiles.runImportFile(); - JobProfiles.waitFileIsImported(marcFiles[2].fileNameImported); + JobProfiles.waitFileIsImportedForConsortia(marcFiles[2].fileNameImported); Logs.checkStatusOfJobProfile(JOB_STATUS_NAMES.COMPLETED); Logs.openFileDetails(marcFiles[2].fileNameImported); for (let i = 0; i < marcFiles[2].numberOftitles; i++) { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js index 1cc5a070c6..028c8f9f4e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/import-to-create-open-orders-physical-resource-with-instances-holdings-items.cy.js @@ -100,7 +100,7 @@ describe('Data Import', () => { acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, }; - before('Login', () => { + before('Create user and login', () => { cy.createTempUser([ Permissions.settingsDataImportEnabled.gui, Permissions.moduleDataImportEnabled.gui, diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-already-exists.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-already-exists.cy.js new file mode 100644 index 0000000000..032c38cb2d --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-already-exists.cy.js @@ -0,0 +1,212 @@ +import { + ACCEPTED_DATA_TYPE_NAMES, + ACTION_NAMES_IN_ACTION_PROFILE, + DEFAULT_JOB_PROFILE_NAMES, + EXISTING_RECORD_NAMES, + FOLIO_RECORD_TYPE, + INSTANCE_STATUS_TERM_NAMES, + JOB_STATUS_NAMES, + RECORD_STATUSES, +} from '../../../support/constants'; +import { Permissions } from '../../../support/dictionary'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; +import Logs from '../../../support/fragments/data_import/logs/logs'; +import FieldMappingProfileView from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfileView'; +import FieldMappingProfiles from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles'; +import NewFieldMappingProfile from '../../../support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryViewSource from '../../../support/fragments/inventory/inventoryViewSource'; +import { + ActionProfiles as SettingsActionProfiles, + FieldMappingProfiles as SettingsFieldMappingProfiles, + JobProfiles as SettingsJobProfiles, + MatchProfiles as SettingsMatchProfiles, +} from '../../../support/fragments/settings/dataImport'; +import MatchProfiles from '../../../support/fragments/settings/dataImport/matchProfiles/matchProfiles'; +import NewMatchProfile from '../../../support/fragments/settings/dataImport/matchProfiles/newMatchProfile'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import FileManager from '../../../support/utils/fileManager'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Data Import', () => { + describe('Importing MARC Bib files', () => { + let user = null; + let instanceHrId; + const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS; + // unique file names + const marcFileNameForCreate = `C358998 createAutotestFile${getRandomPostfix()}.mrc`; + const marcFileNameForUpdate = `C358998 updateAutotestFile${getRandomPostfix()}.mrc`; + const fileNameAfterUpload = `C358998 fileNameAfterUpload${getRandomPostfix()}.mrc`; + + const mappingProfile = { + name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, + statisticalCode: 'ARL (Collection stats): books - Book, print (books)', + statisticalCodeUI: 'Book, print (books)', + }; + + const actionProfile = { + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + action: ACTION_NAMES_IN_ACTION_PROFILE.UPDATE, + }; + + const matchProfile = { + profileName: `C358998 Match 999$i to Instance UUID ${getRandomPostfix()}`, + incomingRecordFields: { + field: '999', + in1: 'f', + in2: 'f', + subfield: 'i', + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORD_NAMES.INSTANCE, + existingRecordOption: NewMatchProfile.optionsList.instanceUuid, + }; + + const jobProfile = { + profileName: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, + }; + + before('Create test user and login', () => { + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.settingsDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.uiInventoryViewCreateEditInstances.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, + Permissions.remoteStorageView.gui, + ]).then((userProperties) => { + user = userProperties; + + cy.login(user.username, user.password); + }); + }); + + after('Delete test data', () => { + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdate}`); + cy.getAdminToken().then(() => { + Users.deleteViaApi(user.userId); + SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); + SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); + SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); + SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrId}"` }).then( + (instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }, + ); + }); + }); + + it( + "C358998 Data Import Updates should add 035 field from 001/003, if it's HRID already exists", + { tags: ['criticalPath', 'folijet'] }, + () => { + cy.visit(TopMenu.dataImportPath); + DataImport.verifyUploadState(); + // upload the first .mrc file + DataImport.uploadFile('marcBibFileForC358998_1.mrc', marcFileNameForCreate); + JobProfiles.waitFileIsUploaded(); + JobProfiles.search(jobProfileToRun); + JobProfiles.runImportFile(); + Logs.waitFileIsImported(marcFileNameForCreate); + Logs.checkJobStatus(marcFileNameForCreate, JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); + [ + FileDetails.columnNameInResultList.srsMarc, + FileDetails.columnNameInResultList.instance, + ].forEach((columnName) => { + FileDetails.checkStatusInColumn(RECORD_STATUSES.CREATED, columnName); + }); + FileDetails.checkSrsRecordQuantityInSummaryTable('1'); + FileDetails.checkInstanceQuantityInSummaryTable('1'); + + FileDetails.openInstanceInInventory(RECORD_STATUSES.CREATED); + InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => { + instanceHrId = initialInstanceHrId; + + InstanceRecordView.viewSource(); + // changing the first file + InventoryViewSource.extructDataFrom999Field().then((uuid) => { + // change file using uuid for 999 field + DataImport.editMarcFile( + 'marcBibFileForC358998_2.mrc', + marcFileNameForUpdate, + ['instanceUuid', 'srsUuid', '303845'], + [uuid[0], uuid[1], instanceHrId], + ); + }); + // create mapping profile + cy.visit(SettingsMenu.mappingProfilePath); + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatusTerm); + NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); + NewFieldMappingProfile.save(); + FieldMappingProfileView.closeViewMode(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + // create action profile + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + // create match profile + cy.visit(SettingsMenu.matchProfilePath); + MatchProfiles.createMatchProfileWithExistingPart(matchProfile); + MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); + + // create job profile for update + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfileWithLinkingProfiles( + jobProfile, + actionProfile.name, + matchProfile.profileName, + ); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + // upload a marc file for updating already created first instance + cy.visit(TopMenu.dataImportPath); + DataImport.verifyUploadState(); + DataImport.uploadFile(marcFileNameForUpdate, fileNameAfterUpload); + JobProfiles.waitFileIsUploaded(); + JobProfiles.search(jobProfile.profileName); + JobProfiles.runImportFile(); + Logs.waitFileIsImported(fileNameAfterUpload); + Logs.checkJobStatus(fileNameAfterUpload, JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameAfterUpload); + FileDetails.checkStatusInColumn( + RECORD_STATUSES.UPDATED, + FileDetails.columnNameInResultList.srsMarc, + ); + FileDetails.checkStatusInColumn( + RECORD_STATUSES.UPDATED, + FileDetails.columnNameInResultList.instance, + ); + FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); + FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); + // open the first Instance in the Inventory and check 001, 003, 035 fields + FileDetails.openInstanceInInventory(RECORD_STATUSES.UPDATED); + InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); + InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); + InstanceRecordView.viewSource(); + InventoryViewSource.contains('001\t'); + InventoryViewSource.contains(instanceHrId); + InventoryViewSource.notContains('003\t'); + InventoryViewSource.contains('035\t'); + InventoryViewSource.contains('(LTSCA)303845'); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js similarity index 52% rename from cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js rename to cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js index 17929f31b8..45bc1fd33e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js @@ -39,12 +39,21 @@ describe('Data Import', () => { let user = null; const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS; // unique file names - const firstMarcFileNameForCreate = `C358998 firstCreateAutotestFile${getRandomPostfix()}.mrc`; - const firstMarcFileNameForUpdate = `C358998 firstUpdateAutotestFile${getRandomPostfix()}.mrc`; - const firstFileNameAfterUpload = `C358998 firstFileNameAfterUpload${getRandomPostfix()}.mrc`; - const secondMarcFileNameForCreate = `C358998 secondCreateAutotestFile${getRandomPostfix()}.mrc`; - const secondMarcFileNameForUpdate = `C358998 secondUpdateAutotestFile${getRandomPostfix()}.mrc`; - const secondFileNameAfterUpload = `C358998 secondFileNameAfterUpload${getRandomPostfix()}.mrc`; + const marcFileNameForCreate = `C358998 createAutotestFile${getRandomPostfix()}.mrc`; + const marcFileNameForUpdate = `C358998 updateAutotestFile${getRandomPostfix()}.mrc`; + const fileNameAfterUpload = `C358998 fileNameAfterUpload${getRandomPostfix()}.mrc`; + const itemQuantity = '8'; + const arrayOf999Fields = []; + const fieldsContent = [ + { rowNumber: 0, content: '(LTSCA)303845' }, + { rowNumber: 1, content: '(LTSCA)2300089' }, + { rowNumber: 2, content: '(NhCcYBP)yb1104243' }, + { rowNumber: 3, content: '289717' }, + { rowNumber: 4, content: '(OCoLC)1144093654' }, + { rowNumber: 5, content: '(OCoLC)1201684651' }, + { rowNumber: 6, content: '(OCoLC)1195818788' }, + { rowNumber: 7, content: '(OCoLC)991553174' }, + ]; const mappingProfile = { name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, @@ -88,161 +97,36 @@ describe('Data Import', () => { Permissions.remoteStorageView.gui, ]).then((userProperties) => { user = userProperties; - }); - }); - beforeEach('Login', () => { - cy.login(user.username, user.password); + cy.login(user.username, user.password); + }); }); after('Delete user', () => { + // delete created files in fixtures + FileManager.deleteFile(`cypress/fixtures/${marcFileNameForUpdate}`); cy.getAdminToken().then(() => { Users.deleteViaApi(user.userId); + SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); + SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); + SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); + SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); }); }); it( - 'C358998 Data Import Updates should add 035 field from 001/003, if HRID already exists (folijet)', - { tags: ['criticalPathFlaky', 'folijet'] }, - () => { - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - // upload the first .mrc file - DataImport.uploadFile('marcFileForC358998ForCreate_1.mrc', firstMarcFileNameForCreate); - JobProfiles.waitFileIsUploaded(); - JobProfiles.search(jobProfileToRun); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(firstMarcFileNameForCreate); - Logs.checkJobStatus(firstMarcFileNameForCreate, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(firstMarcFileNameForCreate); - [ - FileDetails.columnNameInResultList.srsMarc, - FileDetails.columnNameInResultList.instance, - ].forEach((columnName) => { - FileDetails.checkStatusInColumn(RECORD_STATUSES.CREATED, columnName); - }); - FileDetails.checkSrsRecordQuantityInSummaryTable('1'); - FileDetails.checkInstanceQuantityInSummaryTable('1'); - - FileDetails.openInstanceInInventory(RECORD_STATUSES.CREATED); - InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => { - const instanceHrId = initialInstanceHrId; - - InstanceRecordView.viewSource(); - // changing the first file - InventoryViewSource.extructDataFrom999Field().then((uuid) => { - // change file using uuid for 999 field - DataImport.editMarcFile( - 'marcFileForC358998ForUpdate_1.mrc', - firstMarcFileNameForUpdate, - ['instanceUuid', 'srsUuid', '303845'], - [uuid[0], uuid[1], instanceHrId], - ); - }); - // create mapping profile - cy.visit(SettingsMenu.mappingProfilePath); - FieldMappingProfiles.openNewMappingProfileForm(); - NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); - NewFieldMappingProfile.fillInstanceStatusTerm(mappingProfile.instanceStatusTerm); - NewFieldMappingProfile.addStatisticalCode(mappingProfile.statisticalCode, 8); - NewFieldMappingProfile.save(); - FieldMappingProfileView.closeViewMode(mappingProfile.name); - FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); - - // create action profile - cy.visit(SettingsMenu.actionProfilePath); - ActionProfiles.create(actionProfile, mappingProfile.name); - ActionProfiles.checkActionProfilePresented(actionProfile.name); - - // create match profile - cy.visit(SettingsMenu.matchProfilePath); - MatchProfiles.createMatchProfileWithExistingPart(matchProfile); - MatchProfiles.checkMatchProfilePresented(matchProfile.profileName); - - // create job profile for update - cy.visit(SettingsMenu.jobProfilePath); - JobProfiles.createJobProfileWithLinkingProfiles( - jobProfile, - actionProfile.name, - matchProfile.profileName, - ); - JobProfiles.checkJobProfilePresented(jobProfile.profileName); - - // upload a marc file for updating already created first instance - cy.visit(TopMenu.dataImportPath); - DataImport.verifyUploadState(); - DataImport.uploadFile(firstMarcFileNameForUpdate, firstFileNameAfterUpload); - JobProfiles.waitFileIsUploaded(); - JobProfiles.search(jobProfile.profileName); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(firstFileNameAfterUpload); - Logs.checkJobStatus(firstFileNameAfterUpload, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(firstFileNameAfterUpload); - FileDetails.checkStatusInColumn( - RECORD_STATUSES.UPDATED, - FileDetails.columnNameInResultList.srsMarc, - ); - FileDetails.checkStatusInColumn( - RECORD_STATUSES.UPDATED, - FileDetails.columnNameInResultList.instance, - ); - FileDetails.checkSrsRecordQuantityInSummaryTable('1', '1'); - FileDetails.checkInstanceQuantityInSummaryTable('1', '1'); - // open the first Instance in the Inventory and check 001, 003, 035 fields - FileDetails.openInstanceInInventory(RECORD_STATUSES.UPDATED); - InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); - InstanceRecordView.verifyStatisticalCode(mappingProfile.statisticalCodeUI); - InstanceRecordView.viewSource(); - InventoryViewSource.contains('001\t'); - InventoryViewSource.contains(instanceHrId); - InventoryViewSource.notContains('003\t'); - InventoryViewSource.contains('035\t'); - InventoryViewSource.contains('(LTSCA)303845'); - - cy.getAdminToken().then(() => { - SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); - SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); - SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); - SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrId}"` }).then( - (instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }, - ); - }); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${firstMarcFileNameForUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${secondMarcFileNameForUpdate}`); - }); - }, - ); - - it( - 'C358998 Data Import Updates should add 035 field from 001/003, if it is not HRID (folijet)', - { tags: ['criticalPathFlaky', 'folijet'] }, + "C543840 Data Import Updates should add 035 field from 001/003, if it's not HRID (folijet)", + { tags: ['criticalPath', 'folijet'] }, () => { - const itemQuantity = '8'; - const arrayOf999Fields = []; - const fieldsContent = [ - { rowNumber: 0, content: '(LTSCA)303845' }, - { rowNumber: 1, content: '(LTSCA)2300089' }, - { rowNumber: 2, content: '(NhCcYBP)yb1104243' }, - { rowNumber: 3, content: '289717' }, - { rowNumber: 4, content: '(OCoLC)1144093654' }, - { rowNumber: 5, content: '(OCoLC)1201684651' }, - { rowNumber: 6, content: '(OCoLC)1195818788' }, - { rowNumber: 7, content: '(OCoLC)991553174' }, - ]; - // upload .mrc file cy.visit(TopMenu.dataImportPath); - DataImport.uploadFile('marcFileForC358998ForCreate_2.mrc', secondMarcFileNameForCreate); + DataImport.uploadFile('marcBibFileForC543840_1.mrc', marcFileNameForCreate); JobProfiles.waitFileIsUploaded(); JobProfiles.search(jobProfileToRun); JobProfiles.runImportFile(); - Logs.waitFileIsImported(secondMarcFileNameForCreate); - Logs.checkJobStatus(secondMarcFileNameForCreate, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(secondMarcFileNameForCreate); + Logs.waitFileIsImported(marcFileNameForCreate); + Logs.checkJobStatus(marcFileNameForCreate, JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileNameForCreate); cy.wrap(fieldsContent).each((row) => { cy.wait(1000); FileDetails.checkStatusInColumn( @@ -264,7 +148,7 @@ describe('Data Import', () => { cy.wait(8000); cy.visit(TopMenu.dataImportPath); DataImport.waitLoading(); - Logs.openFileDetails(secondMarcFileNameForCreate); + Logs.openFileDetails(marcFileNameForCreate); FileDetails.openInstanceInInventory(RECORD_STATUSES.CREATED, row.rowNumber); cy.wait(8000); InventoryInstance.viewSource(); @@ -276,8 +160,8 @@ describe('Data Import', () => { .then(() => { // change file using uuid for 999 field DataImport.editMarcFile( - 'marcFileForC358998ForUpdate_2.mrc', - secondMarcFileNameForUpdate, + 'marcBibFileForC543840_2.mrc', + marcFileNameForUpdate, [ 'firstInstanceUuid', 'firstSrsUuid', @@ -332,13 +216,13 @@ describe('Data Import', () => { // upload a marc file for updating already created instances cy.visit(TopMenu.dataImportPath); DataImport.waitLoading(); - DataImport.uploadFile(secondMarcFileNameForUpdate, secondFileNameAfterUpload); + DataImport.uploadFile(marcFileNameForUpdate, fileNameAfterUpload); JobProfiles.waitFileIsUploaded(); JobProfiles.search(jobProfile.profileName); JobProfiles.runImportFile(); - Logs.waitFileIsImported(secondFileNameAfterUpload); - Logs.checkJobStatus(secondFileNameAfterUpload, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(secondFileNameAfterUpload); + Logs.waitFileIsImported(fileNameAfterUpload); + Logs.checkJobStatus(fileNameAfterUpload, JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(fileNameAfterUpload); cy.wrap(fieldsContent).each((row) => { cy.wait(1000); FileDetails.checkStatusInColumn( @@ -360,7 +244,7 @@ describe('Data Import', () => { // need to wait until page will be opened in loop cy.wait(8000); cy.visit(TopMenu.dataImportPath); - Logs.openFileDetails(secondFileNameAfterUpload); + Logs.openFileDetails(fileNameAfterUpload); FileDetails.openInstanceInInventory(RECORD_STATUSES.UPDATED, element.rowNumber); cy.wait(8000); InstanceRecordView.verifyInstanceStatusTerm(mappingProfile.instanceStatusTerm); @@ -376,16 +260,6 @@ describe('Data Import', () => { InventoryViewSource.contains(element.content); }); }); - - cy.getAdminToken().then(() => { - SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); - SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); - SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); - SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); - }); - // delete created files in fixtures - FileManager.deleteFile(`cypress/fixtures/${firstMarcFileNameForUpdate}`); - FileManager.deleteFile(`cypress/fixtures/${secondMarcFileNameForUpdate}`); }, ); }); diff --git a/cypress/fixtures/marcFileForC358998ForCreate_1.mrc b/cypress/fixtures/marcBibFileForC358998_1.mrc similarity index 100% rename from cypress/fixtures/marcFileForC358998ForCreate_1.mrc rename to cypress/fixtures/marcBibFileForC358998_1.mrc diff --git a/cypress/fixtures/marcFileForC358998ForUpdate_1.mrc b/cypress/fixtures/marcBibFileForC358998_2.mrc similarity index 100% rename from cypress/fixtures/marcFileForC358998ForUpdate_1.mrc rename to cypress/fixtures/marcBibFileForC358998_2.mrc diff --git a/cypress/fixtures/marcFileForC358998ForCreate_2.mrc b/cypress/fixtures/marcBibFileForC543840_1.mrc similarity index 100% rename from cypress/fixtures/marcFileForC358998ForCreate_2.mrc rename to cypress/fixtures/marcBibFileForC543840_1.mrc diff --git a/cypress/fixtures/marcFileForC358998ForUpdate_2.mrc b/cypress/fixtures/marcBibFileForC543840_2.mrc similarity index 100% rename from cypress/fixtures/marcFileForC358998ForUpdate_2.mrc rename to cypress/fixtures/marcBibFileForC543840_2.mrc diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 6c7b433441..50df609783 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -263,6 +263,7 @@ export default { verifyInstanceHridValue: (hrid) => cy.expect(instanceHridKeyValue.has({ value: hrid })), verifyPrecedingTitle: (title) => { + cy.wait(1500); cy.get('#precedingTitles [class*="mclCell-"]:nth-child(1)').eq(0).should('include.text', title); }, verifyPrecedingTitleSearchIcon: (title) => { From 6d0ec9b3fafa7016d3ccaac4b6609f0aef540811 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:30:02 +0500 Subject: [PATCH 12/34] Add the test case C430210 (#4130) --- ...-in-app-holding-notes-columns-titles.cy.js | 219 ++++++++++++++++++ .../fragments/inventory/holdingsRecordView.js | 5 + 2 files changed, 224 insertions(+) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-notes-columns-titles.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-notes-columns-titles.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-notes-columns-titles.cy.js new file mode 100644 index 0000000000..416fe86bf9 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-notes-columns-titles.cy.js @@ -0,0 +1,219 @@ +import permissions from '../../../support/dictionary/permissions'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import Users from '../../../support/fragments/users/users'; +import FileManager from '../../../support/utils/fileManager'; +import ExportFile from '../../../support/fragments/data-export/exportFile'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import { + APPLICATION_NAMES, + BULK_EDIT_TABLE_COLUMN_HEADERS, + HOLDING_NOTE_TYPES, +} from '../../../support/constants'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; + +let user; +const notes = { + administrative: 'C430210 Administrative\n note text', + electronicBookplate: 'C430210 Electronic bookplate note text', + provenance: 'C430210 Provenance note text', + reproduction: 'C430210 Reproduction note text', + binding: "C430210 test binding note:~,!,@,#,$,%,^,&,*,(,),~,', {.[,]<},>,ø, Æ, §,;", +}; +const instance = { + instanceName: `C430210 instance-${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const actionsToSelect = { + addNote: 'Add note', +}; +const administrativeNoteActionOptions = [ + 'Add note', + 'Change note type', + 'Find (full field search)', + 'Remove all', +]; +const nonAdministrativeNoteActionOptions = [ + 'Add note', + 'Change note type', + 'Find (full field search)', + 'Mark as staff only', + 'Remove all', + 'Remove mark as staff only', +]; +const initialValueSets = [ + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ADMINISTRATIVE_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ACTION_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.BINDING_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.COPY_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_BOOKPLATE_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.PROVENANCE_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.REPRODUCTION, ''], +]; +const notesToAdd = [ + [1, HOLDING_NOTE_TYPES.BINDING, notes.binding], + [2, HOLDING_NOTE_TYPES.ELECTRONIC_BOOKPLATE, notes.electronicBookplate], + [3, HOLDING_NOTE_TYPES.PROVENANCE, notes.provenance], + [4, HOLDING_NOTE_TYPES.REPRODUCTION, notes.reproduction], +]; +const editedValueSets = [ + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ADMINISTRATIVE_NOTE, notes.administrative], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ACTION_NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.BINDING_NOTE, notes.binding], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.COPY_NOTE, ''], + [ + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_BOOKPLATE_NOTE, + notes.electronicBookplate, + ], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.NOTE, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.PROVENANCE_NOTE, notes.provenance], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.REPRODUCTION, notes.reproduction], +]; +const holdingUUIDsFileName = `validHoldingUUIDs_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `*-Matched-Records-${holdingUUIDsFileName}`; +const changedRecordsFileName = `*-Changed-Records-${holdingUUIDsFileName}`; + +function addNoteInBulkEdit(rowNumber, holdingNoteType, noteText) { + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(rowNumber); + BulkEditActions.selectOption(holdingNoteType, rowNumber); + BulkEditActions.verifyTheActionOptions(nonAdministrativeNoteActionOptions, rowNumber); + BulkEditActions.selectSecondAction(actionsToSelect.addNote, rowNumber); + BulkEditActions.verifySecondActionSelected(actionsToSelect.addNote, rowNumber); + BulkEditActions.fillInSecondTextArea(noteText, rowNumber); + BulkEditActions.verifyValueInSecondTextArea(noteText, rowNumber); + BulkEditSearchPane.isConfirmButtonDisabled(false); +} + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.clearLocalStorage(); + + cy.createTempUser([ + permissions.bulkEditView.gui, + permissions.bulkEditEdit.gui, + permissions.inventoryAll.gui, + ]).then((userProperties) => { + user = userProperties; + + instance.instanceId = InventoryInstances.createInstanceViaApi( + instance.instanceName, + instance.itemBarcode, + ); + cy.getHoldings({ + limit: 1, + query: `"instanceId"="${instance.instanceId}"`, + }).then((holdings) => { + instance.holdingHRID = holdings[0].hrid; + instance.holdingsUUID = holdings[0].id; + + FileManager.createFile(`cypress/fixtures/${holdingUUIDsFileName}`, holdings[0].id); + }); + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading, + }); + }); + }); + + after('delete test data', () => { + cy.getAdminToken(); + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(instance.instanceId); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask(matchedRecordsFileName, changedRecordsFileName); + }); + + it( + 'C430210 Verify Bulk Edit actions for Holdings notes - columns titles (firebird)', + { tags: ['criticalPath', 'firebird'] }, + () => { + BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Holdings', 'Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyMatchedResults(instance.holdingHRID); + BulkEditActions.openActions(); + BulkEditSearchPane.searchColumnName('note'); + + initialValueSets.forEach((initialValueSet) => { + BulkEditSearchPane.changeShowColumnCheckbox(initialValueSet[0]); + }); + + initialValueSets.forEach((initialValueSet) => { + BulkEditSearchPane.verifyResultsUnderColumns(...initialValueSet); + }); + + BulkEditActions.openActions(); + BulkEditActions.downloadMatchedResults(); + ExportFile.verifyFileIncludes(matchedRecordsFileName, [instance.holdingsUUID]); + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditSearchPane.verifyBulkEditsAccordionExists(); + BulkEditActions.verifyOptionsDropdown(); + BulkEditActions.verifyRowIcons(); + BulkEditActions.verifyHoldingsOptions(); + BulkEditActions.selectOption(HOLDING_NOTE_TYPES.ADMINISTRATIVE_NOTE, 0); + BulkEditActions.verifyTheActionOptions(administrativeNoteActionOptions); + BulkEditActions.selectSecondAction(actionsToSelect.addNote); + BulkEditActions.verifySecondActionSelected(actionsToSelect.addNote); + BulkEditActions.fillInSecondTextArea(notes.administrative); + BulkEditActions.verifyValueInSecondTextArea(notes.administrative); + BulkEditSearchPane.isConfirmButtonDisabled(false); + + notesToAdd.forEach((noteToAdd) => { + addNoteInBulkEdit(...noteToAdd); + }); + + BulkEditActions.confirmChanges(); + BulkEditActions.verifyMessageBannerInAreYouSureForm(1); + BulkEditActions.verifyChangesInAreYouSureForm( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + [instance.holdingHRID], + ); + + editedValueSets.forEach((editedValueSet) => { + BulkEditActions.verifyChangesInAreYouSureForm(editedValueSet[0], [editedValueSet[1]]); + }); + + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.verifySuccessBanner(1); + BulkEditSearchPane.verifyExactChangesUnderColumns( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + instance.holdingHRID, + ); + + editedValueSets.forEach((editedValueSet) => { + BulkEditSearchPane.verifyExactChangesUnderColumns(...editedValueSet); + }); + + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + ExportFile.verifyFileIncludes(changedRecordsFileName, [instance.holdingsUUID]); + + editedValueSets.forEach((editedValueSet) => { + ExportFile.verifyFileIncludes(changedRecordsFileName, editedValueSet); + }); + + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchHoldingsByHRID(instance.holdingHRID); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.checkExactContentInAdministrativeNote(notes.administrative); + HoldingsRecordView.checkNotesByType(0, HOLDING_NOTE_TYPES.BINDING, notes.binding); + HoldingsRecordView.checkNotesByType( + 1, + HOLDING_NOTE_TYPES.ELECTRONIC_BOOKPLATE, + notes.electronicBookplate, + ); + HoldingsRecordView.checkNotesByType(2, HOLDING_NOTE_TYPES.PROVENANCE, notes.provenance); + HoldingsRecordView.checkNotesByType(3, HOLDING_NOTE_TYPES.REPRODUCTION, notes.reproduction); + }, + ); + }); +}); diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index dc5629e9b7..01c73d29a5 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -153,6 +153,11 @@ export default { .find(HTML(including(note))) .exists(), ), + checkExactContentInAdministrativeNote: (note) => cy.expect( + MultiColumnList({ id: 'administrative-note-list' }) + .find(MultiColumnListCell({ content: note })) + .exists(), + ), checkHoldingsStatement: (statement) => cy.expect( MultiColumnList({ id: 'list-holdingsStatement' }) .find(HTML(including(statement))) From 3bd4ee4c0b27a44b9c924a20516e80d05727c9fe Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Wed, 28 Aug 2024 16:01:12 +0300 Subject: [PATCH 13/34] fixes for vega tests (#4125) --- .../lost-item-processing-fee-on-actual-lost-items.cy.js | 2 +- cypress/support/fragments/loans/renewals.js | 2 +- .../fragments/settings/circulation/titleLevelRequests.js | 2 ++ cypress/support/fragments/settings/users/limits.js | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/users/feeFines/lost-item-processing-fee-on-actual-lost-items.cy.js b/cypress/e2e/users/feeFines/lost-item-processing-fee-on-actual-lost-items.cy.js index 842b2e84d8..397b30dbc7 100644 --- a/cypress/e2e/users/feeFines/lost-item-processing-fee-on-actual-lost-items.cy.js +++ b/cypress/e2e/users/feeFines/lost-item-processing-fee-on-actual-lost-items.cy.js @@ -188,7 +188,7 @@ describe('ui-users-loans: Loans', () => { }); it( - 'C365133 Verify ACTUAL COST lost items are being billed the "Lost item processing fee" when declared lost', + 'C365133 Verify ACTUAL COST lost items are being billed the "Lost item processing fee" when declared lost (vega)', { tags: ['extendedPath', 'vega'] }, () => { UsersSearchPane.searchByKeywords(testData.userId); diff --git a/cypress/support/fragments/loans/renewals.js b/cypress/support/fragments/loans/renewals.js index afbb759a86..b2bf4035f3 100644 --- a/cypress/support/fragments/loans/renewals.js +++ b/cypress/support/fragments/loans/renewals.js @@ -199,7 +199,7 @@ export default { }, renewAllLoans() { - cy.get('#clickable-list-column- input[type=checkbox]').click(); + cy.get('input[name=check-all]').click(); cy.do(Button(buttonLabels.renew).click()); }, confirmRenewalsSuccess() { diff --git a/cypress/support/fragments/settings/circulation/titleLevelRequests.js b/cypress/support/fragments/settings/circulation/titleLevelRequests.js index 6728978317..dfbe91ccd5 100644 --- a/cypress/support/fragments/settings/circulation/titleLevelRequests.js +++ b/cypress/support/fragments/settings/circulation/titleLevelRequests.js @@ -95,10 +95,12 @@ export default { enableTLRViaApi() { this.updateTLRSettingViaApi({ titleLevelRequestsFeatureEnabled: true }); + cy.wait(3000); }, disableTLRViaApi() { this.updateTLRSettingViaApi({ titleLevelRequestsFeatureEnabled: false }); + cy.wait(3000); }, updateTLRSettingViaApi(newSettings) { diff --git a/cypress/support/fragments/settings/users/limits.js b/cypress/support/fragments/settings/users/limits.js index 8a3327036c..efbbfd43fb 100644 --- a/cypress/support/fragments/settings/users/limits.js +++ b/cypress/support/fragments/settings/users/limits.js @@ -52,6 +52,7 @@ export default { this.getLimitIdViaApi(limitName).then((limitId) => { cy.do([TextField({ name: limitId }).fillIn(number), saveButton.click()]); }); + cy.wait(2000); }, verifySuccessfullyUpdated(groupName) { From d75a4bc8b220f25be82d3dac6a82f559ce722ed1 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:18:31 +0300 Subject: [PATCH 14/34] added test (#4134) Co-authored-by: Ostap Voitsekhovskyi --- .../inventory/marc-marc-search-query.cy.js | 50 +++++++++++++++++++ cypress/fixtures/marcBibFileForC514901.mrc | 1 + .../fragments/inventory/inventoryInstances.js | 29 +++++++++++ 3 files changed, 80 insertions(+) create mode 100644 cypress/e2e/inventory/marc-marc-search-query.cy.js create mode 100644 cypress/fixtures/marcBibFileForC514901.mrc diff --git a/cypress/e2e/inventory/marc-marc-search-query.cy.js b/cypress/e2e/inventory/marc-marc-search-query.cy.js new file mode 100644 index 0000000000..3cd13dd665 --- /dev/null +++ b/cypress/e2e/inventory/marc-marc-search-query.cy.js @@ -0,0 +1,50 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; +import { Permissions } from '../../support/dictionary'; +import DataImport from '../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import TopMenu from '../../support/fragments/topMenu'; +import Users from '../../support/fragments/users/users'; +import getRandomPostfix from '../../support/utils/stringTools'; + +describe('Inventory', () => { + const testData = { + filePath: 'marcBibFileForC514901.mrc', + marcFileName: `C514901 createAutotestFile${getRandomPostfix()}.mrc`, + }; + + before('Create test data and login', () => { + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.filePath, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ).then((response) => { + testData.instanceId = response[0].instance.id; + }); + + cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => { + testData.user = userProperties; + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken().then(() => { + InventoryInstance.deleteInstanceViaApi(testData.instanceId); + Users.deleteViaApi(testData.user.userId); + }); + }); + + it( + 'C514901 Check MARC-MARC search query (folijet)', + { tags: ['criticalPath', 'folijet'] }, + () => { + InventoryInstances.verifyRecordsMatchingViaApi(); + }, + ); +}); diff --git a/cypress/fixtures/marcBibFileForC514901.mrc b/cypress/fixtures/marcBibFileForC514901.mrc new file mode 100644 index 0000000000..b8e8b600cc --- /dev/null +++ b/cypress/fixtures/marcBibFileForC514901.mrc @@ -0,0 +1 @@ +01090cam a2200277 a 4500001000700000003000600007008004100013005001700054010001700071020001800088020001500106035002400121035009600145040003900241049000900280082001700289096001500306100002000321245007800341246007800419260007400497300002500571504005300596590013100649650003200780303845LTSCA090725s2023 wlk b 000 0 eng d20220713063434.0 a 2009936271 a9781845903221 a1845909321 a(OCoLC)ocm000064758 a(OCoLC)ocm000064758 z (OCoLC)0000976939443 z (OCoLC)ocn00001001261435 z (OCoLC)120194933 aBTCTAcBTCTAdI4FdTI2dYDXCPdMWU aUATA04a615.8512222 aIn Process1 aEwin, Dabney M.10a101 things I wish I'd known when I started using hypnosis /cDabney Ewin.3 aOne hundred and one things I wish I'd known when I started using hypnosis aCarmarthen, Wales ;aBethel, Conn. :bCrown House Publishing,cc2009. avi, 128 p. ;c23 cm. aIncludes bibliographical references (p. 127-128) aPresented to the University of Manitoba Neil John Maclean Health Sciences Library by the Manitoba Society for Medical Hypnosis 0aHypnotismxTherapeutic use. \ No newline at end of file diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index 01447d3323..2d0e5ea1f2 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -1490,4 +1490,33 @@ export default { isDefaultSearchParamsRequired: false, }); }, + + verifyRecordsMatchingViaApi() { + cy.okapiRequest({ + method: 'POST', + path: 'source-storage/records/matching', + body: { + logicalOperator: 'AND', + filters: [ + { + values: ['64758', '(OCoLC)64758'], + field: '035', + indicator1: '', + indicator2: '', + subfield: 'a', + matchType: 'EXACTLY_MATCHES', + qualifier: 'ENDS_WITH', + qualifierValue: '758', + }, + ], + recordType: 'MARC_BIB', + limit: 1000, + offset: 0, + returnTotalRecordsCount: true, + }, + isDefaultSearchParamsRequired: false, + }) + .its('status') + .should('equal', 200); + }, }; From c0ac2aa43f69de2a02735611eee4356919466356 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Wed, 28 Aug 2024 20:55:10 +0500 Subject: [PATCH 15/34] FAT-15996 / Updated tests affected by UIQM-685 and UIQM-631 (#4138) * Fixed tests affected by UIQM-685 and UIQM-631 * linter fix --- .../marc-authority.cy.js | 2 +- .../marc-authority-edit.cy.js | 19 ++++++-- ...validation-when-creating-new-marcBib.cy.js | 10 +--- .../ldr-length-in-derive-window.cy.js | 6 +-- ...ing-marc-bib-record-with-invalid-ldr.cy.js | 15 ++++-- .../marc-bibliographic-edit.cy.js | 48 +++++++++++++++---- cypress/fixtures/marcBibFileForC353526.mrc | 1 + 7 files changed, 71 insertions(+), 30 deletions(-) create mode 100644 cypress/fixtures/marcBibFileForC353526.mrc diff --git a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js index 25e821bfd7..69bb17e01d 100644 --- a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js +++ b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js @@ -205,7 +205,7 @@ describe('MARC', () => { MarcAuthority.checkRemovedTag(9); cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(9, 'Record cannot be saved. A MARC tag must contain three characters.'); + QuickMarcEditor.checkErrorMessage(9, 'Tag must contain three characters and can only accept numbers 0-9.'); }, ); diff --git a/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js b/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js index 67539a2ef8..1d6871aca5 100644 --- a/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js @@ -28,7 +28,7 @@ describe('MARC', () => { tag: '100', rowIndex: 14, }, - errorMultiple1XX: 'Record cannot be saved. Cannot have multiple 1XXs', + errorMultiple1XX: 'Field 1XX is non-repeatable and required.', }; const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY; const propertyName = 'authority'; @@ -91,7 +91,7 @@ describe('MARC', () => { QuickMarcEditor.pressSaveAndClose(); cy.wait(1500); MarcAuthority.clicksaveAndCloseButton(); - MarcAuthority.checkRemoved1XXTag(); + QuickMarcEditor.checkCallout('Field 1XX is non-repeatable and required.'); QuickMarcEditor.undoDelete(); MarcAuthority.changeTag(testData.authority.rowIndex, testData.authority.tag); QuickMarcEditor.checkContentByTag( @@ -105,7 +105,7 @@ describe('MARC', () => { ); QuickMarcEditor.checkErrorMessage(14, testData.errorMultiple1XX); QuickMarcEditor.checkErrorMessage(15, testData.errorMultiple1XX); - QuickMarcEditor.closeWithoutSavingAfterChange(); + QuickMarcEditor.pressCancel(); MarcAuthorities.selectTitle(testData.authority.title); MarcAuthority.contains(testData.authority.title); }, @@ -1036,6 +1036,8 @@ describe('MARC', () => { tag: '100', rowIndex: 14, }, + errorMultiple1XX: 'Field 1XX is non-repeatable and required.', + errorFieldNonRepitable: 'Field is non-repeatable.', }; const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY; const propertyName = 'authority'; @@ -1103,10 +1105,17 @@ describe('MARC', () => { QuickMarcEditor.pressSaveAndClose(); cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - MarcAuthority.changeTag(6, '040'); + QuickMarcEditor.checkErrorMessage(6, testData.errorMultiple1XX); + QuickMarcEditor.checkErrorMessage(14, testData.errorMultiple1XX); + // QuickMarcEditor.checkErrorMessage(14, testData.errorFieldNonRepitable); + MarcAuthority.changeTag(6, '025'); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.verifyConfirmModal(); + QuickMarcEditor.checkDeleteModal(1); QuickMarcEditor.clickRestoreDeletedField(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent('$a Q215410 $2 wikidata $1 http://www.wikidata.org/entity/Q215410', 5); QuickMarcEditor.checkButtonsEnabled(); }, ); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js index 2c7532fa8f..a8e831ca7c 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js @@ -30,10 +30,7 @@ describe('MARC', () => { tagLDRElvlBoxEmpty: '', }, errors: { - ldrCharacterLength: - 'Record cannot be saved. The Leader must contain 24 characters, including null spaces.', - tagCharacterLength: 'Record cannot be saved. A MARC tag must contain three characters.', - invalidTag: 'Invalid MARC tag. Please try again.', + tagCharacterLength: 'Tag must contain three characters and can only accept numbers 0-9.', }, }; @@ -91,9 +88,6 @@ describe('MARC', () => { `$a ${testData.fieldContents.tag245}`, ); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(0, testData.errors.ldrCharacterLength); - QuickMarcEditor.fillInElvlBoxInLDRField(testData.fieldContents.tagLDRElvlBox); QuickMarcEditor.verifyValueInElvlBoxInLDRField(testData.fieldContents.tagLDRElvlBox); @@ -116,7 +110,7 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagValue(5, testData.tags.tagABC); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(5, testData.errors.invalidTag); + QuickMarcEditor.checkErrorMessage(5, testData.errors.tagCharacterLength); QuickMarcEditor.updateExistingTagValue(5, testData.tags.tag100); QuickMarcEditor.pressSaveAndClose(); diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/ldr-length-in-derive-window.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/ldr-length-in-derive-window.cy.js index e574c4fff5..bd975bb5a1 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/ldr-length-in-derive-window.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/ldr-length-in-derive-window.cy.js @@ -14,8 +14,6 @@ describe('MARC', () => { let userId; let instanceID; const elvlBoxNewValue = ''; - const ldrCharacterLength = - 'Record cannot be saved. The Leader must contain 24 characters, including null spaces.'; const marcFile = { marc: 'marcBibFileForC353612.mrc', fileName: `testMarcFileC353612${getRandomPostfix()}.mrc`, @@ -70,7 +68,9 @@ describe('MARC', () => { QuickMarcEditor.pressSaveAndClose(); cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(0, ldrCharacterLength); + QuickMarcEditor.verifyAfterDerivedMarcBibSave(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyLDRPositionsDefaultValues('records[0].content.ELvl', 'u', false); }, ); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notification-confirmation-modal-when-saving-marc-bib-record-with-invalid-ldr.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notification-confirmation-modal-when-saving-marc-bib-record-with-invalid-ldr.cy.js index fd4ec96759..459fd5d834 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notification-confirmation-modal-when-saving-marc-bib-record-with-invalid-ldr.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notification-confirmation-modal-when-saving-marc-bib-record-with-invalid-ldr.cy.js @@ -69,12 +69,17 @@ describe('MARC', () => { InventoryInstance.editMarcBibliographicRecord(); QuickMarcEditor.fillInElvlBoxInLDRField(''); QuickMarcEditor.deleteFieldByTagAndCheck('222'); - QuickMarcEditor.clickSaveAndKeepEditingButton(); - QuickMarcEditor.checkErrorMessage(0, testData.error); - QuickMarcEditor.fillInElvlBoxInLDRField('\\'); - QuickMarcEditor.clickSaveAndCloseThenCheck(1); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkDeleteModal(1); QuickMarcEditor.clickRestoreDeletedField(); - QuickMarcEditor.checkButtonsDisabled(); + QuickMarcEditor.checkDeleteModalClosed(); + QuickMarcEditor.checkContent('$a The Journal of ecclesiastical history', 13); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); }, ); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic-edit.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic-edit.cy.js index d58c0614ce..92342ae1f6 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic-edit.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic-edit.cy.js @@ -11,6 +11,7 @@ import SettingsMenu from '../../../../support/fragments/settingsMenu'; import TopMenu from '../../../../support/fragments/topMenu'; import Users from '../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../support/utils/stringTools'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; describe('MARC', () => { describe('MARC Bibliographic', () => { @@ -92,6 +93,31 @@ describe('MARC', () => { }, ]; + const marcFiles = [ + { + marc: 'marcBibFileForC353526.mrc', + fileName: `testMarcFileC353526.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }, + ]; + let instanceIds; + + before('Create test data', () => { + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + instanceIds = record[marcFile.propertyName].id; + }); + }); + }); + }); + beforeEach(() => { fileName = `testMarcFile.${getRandomPostfix()}.mrc`; cy.createTempUser([ @@ -126,10 +152,15 @@ describe('MARC', () => { cy.getAdminToken(); if (createdInstanceID) InventoryInstance.deleteInstanceViaApi(createdInstanceID); Users.deleteViaApi(testData.userProperties.userId); - MarcFieldProtection.getListViaApi({ - query: `"field"=="${protectedFields.protectedField}"`, - }).then((list) => { - list.forEach(({ id }) => MarcFieldProtection.deleteViaApi(id)); + }); + + after('Delete test data', () => { + cy.getAdminToken(); + InventoryInstance.deleteInstanceViaApi(instanceIds); + cy.visit(SettingsMenu.marcFieldProtectionPath); + protectedFields.forEach((field) => { + MarcFieldProtection.delete(field.protectedField); + MarcFieldProtection.confirmDelete(); }); }); @@ -160,14 +191,15 @@ describe('MARC', () => { 'C353526 Protection of specified fields when editing "MARC Bibliographic" record (spitfire) (TaaS)', { tags: ['criticalPath', 'spitfire'] }, () => { + InventoryInstances.searchByTitle(instanceIds); InventoryInstance.editMarcBibliographicRecord(); MarcAuthority.checkInfoButton('999'); MarcAuthority.addNewField(5, testData.tags.tag260, '$a London', '1', '1'); MarcAuthority.addNewField(6, testData.tags.tag520, '$a Added row'); - MarcAuthority.addNewField(7, testData.tags.tag655, '$b Added row', '1', '/'); - MarcAuthority.addNewField(8, testData.tags.tag655, '$b Different row', '1', '/'); - MarcAuthority.addNewField(9, testData.tags.tag655, '$b Row without indicator', '1', '/'); - MarcAuthority.addNewField(10, testData.tags.tag755, '$b Different row', '1', '/'); + MarcAuthority.addNewField(7, testData.tags.tag655, '$b Added row', '1', '#'); + MarcAuthority.addNewField(8, testData.tags.tag655, '$b Different row', '1', '#'); + MarcAuthority.addNewField(9, testData.tags.tag655, '$b Row without indicator', '1', '#'); + MarcAuthority.addNewField(10, testData.tags.tag755, '$b Different row', '1', '#'); cy.wait(2000); QuickMarcEditor.pressSaveAndClose(); cy.wait(1500); diff --git a/cypress/fixtures/marcBibFileForC353526.mrc b/cypress/fixtures/marcBibFileForC353526.mrc new file mode 100644 index 0000000000..70a84e36d3 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC353526.mrc @@ -0,0 +1 @@ +01181cas a2200385 450000100070000000500170000700800410002401000170006502200140008203500260009603500220012203500110014403500190015504000440017405000150021808200110023322200420024424500430028626500380032930000150036731000220038232100250040436200230042957000290045265000330048165000450051465500420055970000450060185300180064686300230066490200160068790500210070394800370072495000340076136683220141106221425.0750907c19509999enkqr p 0 a0eng d a 58020553  a0022-0469 a(CStRLIN)NYCX1604275S a(NIC)notisABP6388 a366832 a(OCoLC)1604275 dCtYdMBTIdCtYdMBTIdNICdCStRLINdNIC0 aBR140b.J6 a270.0504aThe Journal of ecclesiastical history04aThe Journal of ecclesiastical history. a32 East 57th St., New York, 10022 av.b25 cm. aQuarterly,b1970- aSemiannual,b1950-690 av. 1- Apr. 1950- aEditor: C. W. Dugmore. 0aChurch historyxPeriodicals. 7aChurch history2fast0(OCoLC)fst00860740 7aPeriodicals2fast0(OCoLC)fst014116411 aDugmore, C. W.q(Clifford William),eed.0381av.i(year)4081a1-49i1950-1998 apfndbLintz a19890510120000.02 a20141106bmdbatcheltsxaddfast lOLINaBR140b.J86h01/01/01 N \ No newline at end of file From 03c52963af01a8ad75920e1310a65e8438af5b1d Mon Sep 17 00:00:00 2001 From: Dmytro-Melnyshyn <77053927+Dmytro-Melnyshyn@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:12:31 +0300 Subject: [PATCH 16/34] FAT-16052: Hide call number type options for Local, Other scheme, and SuDoc. (#4139) --- CHANGELOG.md | 1 + .../browse-call-number-resetAll-button.cy.js | 4 +- ...owse-call-numbers-only-correct-types.cy.js | 36 ++++++++--------- .../browse-call-numbers-sorting.cy.js | 2 +- ...owse-call-numbers-type-holdings-item.cy.js | 40 +++++++++---------- ...at-with-sudoc-can-be-found-in-browse.cy.js | 38 +++++++++--------- cypress/support/constants.js | 6 +-- 7 files changed, 64 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d0475cca4..85f5dc2bb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Updated Call Number search option labels. Refs FAT-13489. - Update `` interactor. Refs STCOM-1304. +- Hide call number type options for Local, Other scheme, and SuDoc. Refs FAT-16052. ## [4.7.0](https://github.com/folio-org/stripes-testing/tree/v4.7.0) (2024-03-12) diff --git a/cypress/e2e/inventory/call-number-browse/browse-call-number-resetAll-button.cy.js b/cypress/e2e/inventory/call-number-browse/browse-call-number-resetAll-button.cy.js index 78844eb5fb..7baba1a1c0 100644 --- a/cypress/e2e/inventory/call-number-browse/browse-call-number-resetAll-button.cy.js +++ b/cypress/e2e/inventory/call-number-browse/browse-call-number-resetAll-button.cy.js @@ -1,4 +1,4 @@ -import { CALL_NUMBER_TYPE_NAMES } from '../../../support/constants'; +import { BROWSE_CALL_NUMBER_OPTIONS } from '../../../support/constants'; import { Permissions } from '../../../support/dictionary'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; @@ -53,7 +53,7 @@ describe('Inventory', () => { InventorySearchAndFilter.checkEffectiveLocationAccordionInputInFocus(); resetAllAndCheckBrowseSearchInputFieldInFocus(); - Object.values(CALL_NUMBER_TYPE_NAMES).forEach((type) => { + Object.values(BROWSE_CALL_NUMBER_OPTIONS).forEach((type) => { InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup(type); InventorySearchAndFilter.checkBrowseOptionSelected(type); searchBrowseRecordAndCheckBrowseInventoryResultPaneInFocus(); diff --git a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-only-correct-types.cy.js b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-only-correct-types.cy.js index 055a390054..819ba88e83 100644 --- a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-only-correct-types.cy.js +++ b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-only-correct-types.cy.js @@ -269,26 +269,26 @@ describe('Inventory', () => { BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[6].lc); BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('lc', 6)); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.LOCAL, - ); - InventorySearchAndFilter.browseSearch(callNumbers[6].local); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[6].local); - BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('local', 6)); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.LOCAL, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[6].local); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[6].local); + // BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('local', 6)); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.LIBRARY_OF_MEDICINE, - ); - InventorySearchAndFilter.browseSearch(callNumbers[2].nlm); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[2].nlm); - BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('nlm', 2)); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.LIBRARY_OF_MEDICINE, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[2].nlm); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[2].nlm); + // BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('nlm', 2)); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, - ); - InventorySearchAndFilter.browseSearch(callNumbers[4].sudoc); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[4].sudoc); - BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('sudoc', 4)); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[4].sudoc); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[4].sudoc); + // BrowseCallNumber.verifyCallNumbersNotFound(filterCNsExcluding('sudoc', 4)); }, ); }); diff --git a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-sorting.cy.js b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-sorting.cy.js index d868eba921..0a1f2e05ab 100644 --- a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-sorting.cy.js +++ b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-sorting.cy.js @@ -53,7 +53,7 @@ describe('Inventory', () => { InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(testData.instanceId); }); - it( + it.skip( 'C388549 Browse call numbers - Correct sorting for Other scheme type call numbers (spitfire) (TaaS)', { tags: ['criticalPath', 'spitfire'] }, () => { diff --git a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-type-holdings-item.cy.js b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-type-holdings-item.cy.js index 6989c1bea0..d874f916d4 100644 --- a/cypress/e2e/inventory/call-number-browse/browse-call-numbers-type-holdings-item.cy.js +++ b/cypress/e2e/inventory/call-number-browse/browse-call-numbers-type-holdings-item.cy.js @@ -181,11 +181,11 @@ describe('Inventory', () => { InventorySearchAndFilter.browseSearch(callNumbers[0].value); BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[0].value); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, - ); - InventorySearchAndFilter.browseSearch(callNumbers[1].value); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[1].value); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[1].value); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[1].value); InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( BROWSE_CALL_NUMBER_OPTIONS.LIBRARY_OF_MEDICINE, @@ -199,17 +199,17 @@ describe('Inventory', () => { InventorySearchAndFilter.browseSearch(callNumbers[3].value); BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[3].value); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.LOCAL, - ); - InventorySearchAndFilter.browseSearch(callNumbers[5].value); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[5].value); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.LOCAL, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[5].value); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[5].value); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.OTHER_SCHEME, - ); - InventorySearchAndFilter.browseSearch(callNumbers[4].value); - BrowseCallNumber.checkNonExactSearchResult(callNumbers[4].value); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.OTHER_SCHEME, + // ); + // InventorySearchAndFilter.browseSearch(callNumbers[4].value); + // BrowseCallNumber.checkNonExactSearchResult(callNumbers[4].value); InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( BROWSE_CALL_NUMBER_OPTIONS.CALL_NUMBERS_ALL, @@ -226,11 +226,11 @@ describe('Inventory', () => { InventorySearchAndFilter.browseSearch(callNumbers[3].value); BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[3].value); - InventorySearchAndFilter.browseSearch(callNumbers[5].value); - BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[5].value); - - InventorySearchAndFilter.browseSearch(callNumbers[4].value); - BrowseCallNumber.checkNonExactSearchResult(callNumbers[4].value); + // InventorySearchAndFilter.browseSearch(callNumbers[5].value); + // BrowseCallNumber.valueInResultTableIsHighlighted(callNumbers[5].value); + // + // InventorySearchAndFilter.browseSearch(callNumbers[4].value); + // BrowseCallNumber.checkNonExactSearchResult(callNumbers[4].value); }, ); }); diff --git a/cypress/e2e/inventory/call-number-browse/call-number-not-valid-format-with-sudoc-can-be-found-in-browse.cy.js b/cypress/e2e/inventory/call-number-browse/call-number-not-valid-format-with-sudoc-can-be-found-in-browse.cy.js index 46400882b9..e32668e48b 100644 --- a/cypress/e2e/inventory/call-number-browse/call-number-not-valid-format-with-sudoc-can-be-found-in-browse.cy.js +++ b/cypress/e2e/inventory/call-number-browse/call-number-not-valid-format-with-sudoc-can-be-found-in-browse.cy.js @@ -6,7 +6,7 @@ import Location from '../../../support/fragments/settings/tenant/locations/newLo import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; import { getTestEntityValue, randomFourDigitNumber } from '../../../support/utils/stringTools'; -import { BROWSE_CALL_NUMBER_OPTIONS, ITEM_STATUS_NAMES } from '../../../support/constants'; +import { ITEM_STATUS_NAMES } from '../../../support/constants'; describe('Inventory', () => { describe('Call Number Browse', () => { @@ -136,25 +136,25 @@ describe('Inventory', () => { InventorySearchAndFilter.verifyKeywordsAsDefault(); InventorySearchAndFilter.checkBrowseSearchInputFieldContent(''); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, - ); - InventorySearchAndFilter.browseSearch(testData.firstCallNumber); - InventorySearchAndFilter.verifyBrowseInventorySearchResults({ - records: [{ callNumber: testData.firstCallNumber }], - }); - InventorySearchAndFilter.clickResetAllButton(); - InventorySearchAndFilter.checkBrowseResultListCallNumbersExists(false); - InventorySearchAndFilter.verifyKeywordsAsDefault(); - InventorySearchAndFilter.checkBrowseSearchInputFieldContent(''); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, + // ); + // InventorySearchAndFilter.browseSearch(testData.firstCallNumber); + // InventorySearchAndFilter.verifyBrowseInventorySearchResults({ + // records: [{ callNumber: testData.firstCallNumber }], + // }); + // InventorySearchAndFilter.clickResetAllButton(); + // InventorySearchAndFilter.checkBrowseResultListCallNumbersExists(false); + // InventorySearchAndFilter.verifyKeywordsAsDefault(); + // InventorySearchAndFilter.checkBrowseSearchInputFieldContent(''); - InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( - BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, - ); - InventorySearchAndFilter.browseSearch(testData.secondCallNumber); - InventorySearchAndFilter.verifyBrowseInventorySearchResults({ - records: [{ callNumber: testData.secondCallNumber }], - }); + // InventorySearchAndFilter.selectBrowseOptionFromCallNumbersGroup( + // BROWSE_CALL_NUMBER_OPTIONS.SUPERINTENDENT_OF_DOCUMENTS, + // ); + // InventorySearchAndFilter.browseSearch(testData.secondCallNumber); + // InventorySearchAndFilter.verifyBrowseInventorySearchResults({ + // records: [{ callNumber: testData.secondCallNumber }], + // }); }, ); }); diff --git a/cypress/support/constants.js b/cypress/support/constants.js index c892a35873..b4c0a801f7 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -370,10 +370,10 @@ export const BROWSE_CALL_NUMBER_OPTIONS = { CALL_NUMBERS_ALL: 'Call numbers (all)', DEWEY_DECIMAL: 'Dewey Decimal classification', LIBRARY_OF_CONGRESS: 'Library of Congress classification', - LOCAL: 'Local', + // LOCAL: 'Local', LIBRARY_OF_MEDICINE: 'National Library of Medicine classification', - OTHER_SCHEME: 'Other scheme', - SUPERINTENDENT_OF_DOCUMENTS: 'Superintendent of Documents classification', + // OTHER_SCHEME: 'Other scheme', + // SUPERINTENDENT_OF_DOCUMENTS: 'Superintendent of Documents classification', }; export const BROWSE_CLASSIFICATION_OPTIONS = { From bd4ea44252f7440ac9592a767d15a7f505125b81 Mon Sep 17 00:00:00 2001 From: Dmytro-Melnyshyn <77053927+Dmytro-Melnyshyn@users.noreply.github.com> Date: Thu, 29 Aug 2024 14:18:33 +0300 Subject: [PATCH 17/34] FAT-16040: Change the labels of the Classification and Call number sections in Inventory browse options. (#4135) --- CHANGELOG.md | 1 + cypress/support/fragments/inventory/instanceRecordEdit.js | 2 +- .../support/fragments/inventory/inventorySearchAndFilter.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85f5dc2bb1..ccb446767f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Updated Call Number search option labels. Refs FAT-13489. - Update `` interactor. Refs STCOM-1304. - Hide call number type options for Local, Other scheme, and SuDoc. Refs FAT-16052. +- Change the labels of the Classification and Call number sections in Inventory browse options. Refs FAT-16040. ## [4.7.0](https://github.com/folio-org/stripes-testing/tree/v4.7.0) (2024-03-12) diff --git a/cypress/support/fragments/inventory/instanceRecordEdit.js b/cypress/support/fragments/inventory/instanceRecordEdit.js index f52b12ce97..ba1811c69f 100644 --- a/cypress/support/fragments/inventory/instanceRecordEdit.js +++ b/cypress/support/fragments/inventory/instanceRecordEdit.js @@ -22,7 +22,7 @@ import InstanceStates from './instanceStates'; const closeButton = Button({ icon: 'times' }); const saveAndCloseButton = Button('Save & close'); const rootSection = Section({ id: 'instance-form' }); -const classificationSection = Section({ label: 'Classification' }); +const classificationSection = Section({ label: 'Classification (instance)' }); const addClassificationButton = classificationSection.find(Button('Add classification')); const actionsButton = Button('Actions'); const identifierAccordion = Accordion('Identifier'); diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 91d6aae50b..5ab1fc896b 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -355,14 +355,14 @@ export default { Object.values(BROWSE_CALL_NUMBER_OPTIONS).forEach((value) => { cy.expect( browseSearchAndFilterInput - .find(OptionGroup('Call numbers')) + .find(OptionGroup('Call numbers (item)')) .has({ text: including(value) }), ); }); Object.values(BROWSE_CLASSIFICATION_OPTIONS).forEach((value) => { cy.expect( browseSearchAndFilterInput - .find(OptionGroup('Classification')) + .find(OptionGroup('Classification (instance)')) .has({ text: including(value) }), ); }); @@ -879,7 +879,7 @@ export default { }, selectBrowseOptionFromCallNumbersGroup(option) { - cy.get('optgroup[label="Call numbers"]') + cy.get('optgroup[label="Call numbers (item)"]') .contains('option', option) .then((optionToSelect) => { cy.get('select').select(optionToSelect.val()); From edb45c489773e343646e0edb592d696b337f5303 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Thu, 29 Aug 2024 15:23:43 +0300 Subject: [PATCH 18/34] Fat 15865 (#4143) * fixes for Lists record types --- .../e2e/lists/Export-list/export-list.cy.js | 12 +++--- cypress/e2e/lists/filter-lists.cy.js | 42 +++---------------- ...ickup-hold-shelf-expiration-triggers.cy.js | 10 ++--- cypress/support/fragments/lists/lists.js | 16 +++---- 4 files changed, 26 insertions(+), 54 deletions(-) diff --git a/cypress/e2e/lists/Export-list/export-list.cy.js b/cypress/e2e/lists/Export-list/export-list.cy.js index 6f961befa7..b731d81648 100644 --- a/cypress/e2e/lists/Export-list/export-list.cy.js +++ b/cypress/e2e/lists/Export-list/export-list.cy.js @@ -74,7 +74,7 @@ describe('lists', () => { Lists.buildQuery(); Lists.queryBuilderActions(); Lists.actionButton(); - cy.contains('Export list (CSV)').should('be.disabled'); + cy.contains('Export all columns (CSV)').should('be.disabled'); }); it('C411812 Export list: Refresh is in progress', { tags: ['smoke', 'corsair'] }, () => { @@ -90,7 +90,7 @@ describe('lists', () => { Lists.queryBuilderActions(); cy.wait(1000); Lists.actionButton(); - cy.contains('Export list (CSV)').should('be.disabled'); + cy.contains('Export all columns (CSV)').should('be.disabled'); cy.wait(3000); cy.contains('View updated list').click(); }); @@ -134,7 +134,7 @@ describe('lists', () => { Lists.actionButton(); cy.contains('Edit list').click(); Lists.actionButton(); - cy.contains('Export list (CSV)').should('be.disabled'); + cy.contains('Export all columns (CSV)').should('be.disabled'); }, ); @@ -152,7 +152,7 @@ describe('lists', () => { Lists.selectVisibility(listData.visibility); Lists.saveList(); Lists.actionButton(); - cy.contains('Export list (CSV)').should('be.disabled'); + cy.contains('Export all columns (CSV)').should('be.disabled'); cy.wait(3000); }, ); @@ -171,7 +171,7 @@ describe('lists', () => { Lists.selectVisibility(listData.visibility); Lists.buildQuery(); cy.get('#field-option-0').click(); - cy.contains('User - First name').click(); + cy.contains('User — Last name, first name').click(); cy.get('[data-testid="operator-option-0"]').select('=='); cy.get('[data-testid="input-value-0"]').type('ABCD'); cy.get('button:contains("Test query")').click(); @@ -182,7 +182,7 @@ describe('lists', () => { Lists.actionButton(); cy.contains('Edit list').click(); Lists.actionButton(); - cy.contains('Export list (CSV)').should('be.visible'); + cy.contains('Export all columns (CSV)').should('be.visible'); cy.wait(3000); }, ); diff --git a/cypress/e2e/lists/filter-lists.cy.js b/cypress/e2e/lists/filter-lists.cy.js index 5a46ca88c9..302a79d19d 100644 --- a/cypress/e2e/lists/filter-lists.cy.js +++ b/cypress/e2e/lists/filter-lists.cy.js @@ -197,48 +197,18 @@ describe('lists', () => { 'C411806 Filter section: Record types (corsair) (TaaS)', { tags: ['criticalPath', 'corsair'] }, () => { - // #2 Click on "Record types" accordion on the 'Filter' pane Lists.clickOnAccordionInFilter(recordTypesFilters.accordionName); Lists.verifyAccordionCollapsedInFilter(recordTypesFilters.accordionName); - // #3 Click on "Record types" accordion again Lists.clickOnAccordionInFilter(recordTypesFilters.accordionName); Lists.verifyAccordionCollapsedInFilter(recordTypesFilters.accordionName); - // #4 Check the list of record types - Lists.verifyRecordTypesAccordionDefaultContent(); - // #5 Select all record types by marking the checkboxes as active recordTypesFilters.filters.forEach((filter) => { - Lists.clickOnCheckbox(filter); + Lists.selectRecordTypeFilter(filter); + Lists.verifyClearFilterButton(recordTypesFilters.accordionName); + Lists.verifyResetAllButtonEnabled(); + Lists.verifyListsFilteredByRecordType(filter); + Lists.resetAllFilters(); + Lists.verifyClearFilterButtonAbsent(recordTypesFilters.accordionName); }); - Lists.verifyClearFilterButton(recordTypesFilters.accordionName); - Lists.verifyResetAllButtonEnabled(); - Lists.verifyListsFilteredByRecordType(recordTypesFilters.filters); - // #6 Click on "x" - Lists.clickOnClearFilterButton(recordTypesFilters.accordionName); - Lists.verifyRecordTypesAccordionDefaultContent(); - Lists.verifyListsFilteredByRecordType(recordTypesFilters.filters); - // #7 Click on "Loans" checkbox - Lists.clickOnCheckbox('Loans'); - Lists.verifyClearFilterButton(recordTypesFilters.accordionName); - Lists.verifyResetAllButtonEnabled(); - Lists.verifyListsFilteredByRecordType(['Loans']); - // #8 Click on "Items" checkbox - Lists.clickOnCheckbox('Loans'); - Lists.verifyCheckboxUnchecked('Loans'); - Lists.clickOnCheckbox('Items'); - Lists.verifyClearFilterButton(recordTypesFilters.accordionName); - Lists.verifyResetAllButtonEnabled(); - Lists.verifyListsFilteredByRecordType(['Items']); - // #9 Click on "Users" checkbox - Lists.clickOnCheckbox('Items'); - Lists.verifyCheckboxUnchecked('Items'); - Lists.clickOnCheckbox('Users'); - Lists.verifyClearFilterButton(recordTypesFilters.accordionName); - Lists.verifyResetAllButtonEnabled(); - Lists.verifyListsFilteredByRecordType(['Users']); - // #10 Click on "Reset all" - Lists.resetAllFilters(); - Lists.verifyRecordTypesAccordionDefaultContent(); - Lists.verifyClearFilterButtonAbsent(recordTypesFilters.accordionName); }, ); }); diff --git a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js index f15e59746b..ce0df92bb8 100644 --- a/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js +++ b/cypress/e2e/recieve-notice/item-recalled-recall-request-awaiting-pickup-hold-shelf-expiration-triggers.cy.js @@ -328,24 +328,24 @@ describe('Request notice triggers', () => { NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.itemRecaled); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.itemRecaled); - const dublicate = true; + const duplicate = true; NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.recallRequest); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.recallRequest); - NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.awaitingPickUp, dublicate); + NewNoticePolicyTemplate.createPatronNoticeTemplate(noticeTemplates.awaitingPickUp, duplicate); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.awaitingPickUp); NewNoticePolicyTemplate.createPatronNoticeTemplate( noticeTemplates.holdShelfBeforeOnce, - dublicate, + duplicate, ); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeOnce); NewNoticePolicyTemplate.createPatronNoticeTemplate( noticeTemplates.holdShelfBeforeRecurring, - dublicate, + duplicate, ); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfBeforeRecurring); NewNoticePolicyTemplate.createPatronNoticeTemplate( noticeTemplates.holdShelfUponAt, - dublicate, + duplicate, ); NewNoticePolicyTemplate.checkAfterSaving(noticeTemplates.holdShelfUponAt); diff --git a/cypress/support/fragments/lists/lists.js b/cypress/support/fragments/lists/lists.js index 528c907e7d..144d986000 100644 --- a/cypress/support/fragments/lists/lists.js +++ b/cypress/support/fragments/lists/lists.js @@ -8,6 +8,7 @@ import { Modal, MultiColumnListCell, MultiColumnListRow, + MultiSelect, Pane, RadioButton, TextArea, @@ -29,7 +30,7 @@ const keepEditingButton = closeModal.find(Button('Keep editing')); const actions = Button('Actions'); const refreshList = Button('Refresh list'); const editList = Button('Edit list'); -const exportList = Button('Export list (CSV)'); +const exportList = Button('Export all columns (CSV)'); const testQuery = Button('Test query'); const runQuery = Button('Run query & save'); const filterPane = Pane('Filter'); @@ -318,6 +319,11 @@ export default { cy.do(filterPane.find(Checkbox(name)).click()); }, + selectRecordTypeFilter(type) { + cy.do(MultiSelect().choose(type)); + cy.wait(1000); + }, + verifyCheckboxChecked(name) { cy.expect(filterPane.find(Checkbox(name)).has({ checked: true })); }, @@ -410,20 +416,16 @@ export default { }); }, - verifyListsFilteredByRecordType: (filters) => { + verifyListsFilteredByRecordType: (filter) => { cy.wait(500); - const cells = []; cy.get('div[class^="mclRowContainer--"]') .find('[data-row-index]') .each(($row) => { cy.get('[class*="mclCell-"]:nth-child(2)', { withinSubject: $row }) .invoke('text') .then((cellValue) => { - cells.push(cellValue); + cy.expect(cellValue).to.equal(filter); }); - }) - .then(() => { - cy.expect(ArrayUtils.compareArrays(cells, filters)).to.equal(true); }); }, From 059c513f88283995a41c0cdbfb216f6b3370acbd Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:14:26 +0300 Subject: [PATCH 19/34] Fat 15547 c496130 (#4131) * added test * fixed test --------- Co-authored-by: Ostap Voitsekhovskyi --- ...-icon-for-succeeding-title-with-issn.cy.js | 67 +++++++++++++++++++ cypress/fixtures/marcBibFileForC496130.mrc | 1 + 2 files changed, 68 insertions(+) create mode 100644 cypress/e2e/inventory/instance/new-search-icon-for-succeeding-title-with-issn.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496130.mrc diff --git a/cypress/e2e/inventory/instance/new-search-icon-for-succeeding-title-with-issn.cy.js b/cypress/e2e/inventory/instance/new-search-icon-for-succeeding-title-with-issn.cy.js new file mode 100644 index 0000000000..d6e99c4bed --- /dev/null +++ b/cypress/e2e/inventory/instance/new-search-icon-for-succeeding-title-with-issn.cy.js @@ -0,0 +1,67 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import { Permissions } from '../../../support/dictionary'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Inventory', () => { + describe('Instance', () => { + const testData = { + filePath: 'marcBibFileForC496130.mrc', + marcFileName: `C496130 createAutotestFile${getRandomPostfix()}.mrc`, + instanceTitle: 'C496130 Liebigs Annalen der Chemie', + succeedingTitle: 'C496130 Liebigs Annalen der Chemie', + }; + + before('Create test data and login', () => { + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.filePath, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ).then((response) => { + testData.instanceId = response[0].instance.id; + }); + + cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => { + testData.user = userProperties; + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken().then(() => { + InventoryInstance.deleteInstanceViaApi(testData.instanceId); + Users.deleteViaApi(testData.user.userId); + }); + }); + + it( + 'C496130 Check new search icon for Succeeding title with ISSN (folijet)', + { tags: ['extendedPath', 'folijet'] }, + () => { + InventoryInstances.searchByTitle(testData.instanceId); + InventoryInstances.selectInstance(); + InstanceRecordView.waitLoading(); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InstanceRecordView.verifySucceedingTitle(testData.succeedingTitle); + InstanceRecordView.verifySucceedingTitleSearchIcon(testData.succeedingTitle); + InstanceRecordView.succeedingTitlesIconClick(); + InventorySearchAndFilter.waitLoading(); + InventorySearchAndFilter.checkSearchQueryText( + `title exactPhrase ${testData.succeedingTitle} and issn containsAll testISSN`, + ); + InventoryInstances.verifySearchResultIncludingValue(testData.succeedingTitle); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC496130.mrc b/cypress/fixtures/marcBibFileForC496130.mrc new file mode 100644 index 0000000000..e870290e07 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496130.mrc @@ -0,0 +1 @@ +02514cas a2200541Ka 45000010008000000030005000080050017000130060019000300070015000490070015000640080041000790220013001200290022001330400062001550420008002170490009002250500024002340600014002580600016002720820016002882450039003042460023003432640037003663100012004033360026004153370026004413380036004673620094005035000020005975060054006175150056006715150038007275330084007655380036008495550417008855830085013025880126013875880111015135000025016246500028016496500027016776500028017046500027017326500030017596500017017897760099018067850067019054337982amdb20151204113848.0m o d cr bn||||||abpcr bn||||||ada100318d18741978gw mr poo 0 a0ger d atestISSN1 aAU@b000045724637 aOCLCEbengcOCLCEdOCLCOdOCLCQdFQMdOCLCOdTXAdUtOrBLW adlr aTXAM 4aQD1b.L7 Electronic 4aW1bJU772 4aFilm S0128304a540.5bA61200aC496130 Liebigs Annalen der Chemie1 aAnnalen der Chemie 1aBerlin :bVerlag Chemie,c-1978. aMonthly atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 aBegan with: Bd. 173, published in 1874; ceased with: [Vol.]1978, Heft 12, published 1978. aImprint varies. 3Use copyfRestrictions unspecified2star5MiAaHDL aIndividual volume numbering discontinued with 1973. aSome no. issued in combined form. aElectronic reproduction.b[S.l.] :cHathiTrust Digital Library,d2010.5MiAaHDL aMode of access: World Wide Web. aBd. 165 (1873)-220 (1883) (Includes index to an earlier title). 1 v.; Bd. 221 (1884)-276 (1893). 1 v.; Bd. 277 (1893)-328 (1903). 1 v.; Bd. 329 (1903)-380 (1911). 1 v.; Bd. 381 (1912)-430 (1923). 1 v.; Bd. 431 (1923)-500 (1932), with index for Bd. 381-430; Bd. 501 (1933)-550 (1942). l v.; Bd. 551 (1942)-600 (1956). l v. Bds. 1-460 have also indexes in every fourth volume. Bd. 468-<540> in every eighth volume.1 adigitizedc2010hHathiTrust Digital Librarylcommitted to preserve2pda5MiAaHDL aDescription based on: Bd. 173, published in 1874; title from PFD title page (Wiley online library, viewed Apr. 10, 2013). aLatest issue consulted: [Vol.]1978, Heft 12, published 1978 (Wiley online library, viewed Apr. 10, 2013). aElectronic resource. 0aChemistryvPeriodicals. 0aPharmacyvPeriodicals. 2aChemistryvPeriodicals. 6aChimievPériodiques. 6aPharmacievPériodiques.17aChemie.2gtt08iPrint version:tJustus Liebigs Annalen der Chemiex0075-4617w(DLC) 08036877w(OCoLC)175492700tC496130 Liebigs Annalen der Chemiew(OCoLC)663881438xtestISSN \ No newline at end of file From 264daf76c747472846a661069484a393b8b88959 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:38:27 +0300 Subject: [PATCH 20/34] added test (#4132) --- ...h-icon-for-preceding-title-with-issn.cy.js | 67 +++++++++++++++++++ cypress/fixtures/marcBibFileForC496129.mrc | 1 + 2 files changed, 68 insertions(+) create mode 100644 cypress/e2e/inventory/instance/new-search-icon-for-preceding-title-with-issn.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496129.mrc diff --git a/cypress/e2e/inventory/instance/new-search-icon-for-preceding-title-with-issn.cy.js b/cypress/e2e/inventory/instance/new-search-icon-for-preceding-title-with-issn.cy.js new file mode 100644 index 0000000000..b728510bb3 --- /dev/null +++ b/cypress/e2e/inventory/instance/new-search-icon-for-preceding-title-with-issn.cy.js @@ -0,0 +1,67 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import { Permissions } from '../../../support/dictionary'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Inventory', () => { + describe('Instance', () => { + const testData = { + filePath: 'marcBibFileForC496129.mrc', + marcFileName: `C496129 createAutotestFile${getRandomPostfix()}.mrc`, + instanceTitle: 'C496129 Justus Liebigs Annalen der Chemie.', + precedingTitle: 'C496129 Justus Liebigs Annalen der Chemie.', + }; + + before('Create test data and login', () => { + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.filePath, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ).then((response) => { + testData.instanceId = response[0].instance.id; + }); + + cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => { + testData.user = userProperties; + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken().then(() => { + InventoryInstance.deleteInstanceViaApi(testData.instanceId); + Users.deleteViaApi(testData.user.userId); + }); + }); + + it( + 'C496129 Check new search icon for Preceding title with ISSN (folijet)', + { tags: ['extendedPath', 'folijet'] }, + () => { + InventoryInstances.searchByTitle(testData.instanceId); + InventoryInstances.selectInstance(); + InstanceRecordView.waitLoading(); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InstanceRecordView.verifyPrecedingTitle(testData.precedingTitle); + InstanceRecordView.verifyPrecedingTitleSearchIcon(testData.precedingTitle); + InstanceRecordView.precedingTitlesIconClick(); + InventorySearchAndFilter.waitLoading(); + InventorySearchAndFilter.checkSearchQueryText( + `title exactPhrase ${testData.precedingTitle} and issn containsAll precedingTitle`, + ); + InventoryInstances.verifySearchResultIncludingValue(testData.precedingTitle); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC496129.mrc b/cypress/fixtures/marcBibFileForC496129.mrc new file mode 100644 index 0000000000..6bb0f6310a --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496129.mrc @@ -0,0 +1 @@ +02639cas a2200565Ka 45000010008000000030005000080050017000130060019000300070015000490070015000640080041000790220019001200290022001390350024001610400062001850420008002470490009002550500024002640600014002880600016003020820016003182450047003342460023003812640037004043100012004413360026004533370026004793380036005053620094005415000020006355060054006555150056007095150038007655330084008035380036008875550417009235830085013405880126014255880111015515000025016626500028016876500027017156500028017426500027017706500030017976500017018277760099018447800081019437850049020244337982amdb20151204113848.0m o d cr bn||||||abpcr bn||||||ada100318d18741978gw mr poo 0 a0ger d aprecedingTitle1 aAU@b000045724637 a(OCoLC)ocn559383346 aOCLCEbengcOCLCEdOCLCOdOCLCQdFQMdOCLCOdTXAdUtOrBLW adlr aTXAM 4aQD1b.L7 Electronic 4aW1bJU772 4aFilm S0128304a540.5bA61200aC496129 Justus Liebigs Annalen der Chemie.1 aAnnalen der Chemie 1aBerlin :bVerlag Chemie,c-1978. aMonthly atextbtxt2rdacontent acomputerbc2rdamedia aonline resourcebcr2rdacarrier1 aBegan with: Bd. 173, published in 1874; ceased with: [Vol.]1978, Heft 12, published 1978. aImprint varies. 3Use copyfRestrictions unspecified2star5MiAaHDL aIndividual volume numbering discontinued with 1973. aSome no. issued in combined form. aElectronic reproduction.b[S.l.] :cHathiTrust Digital Library,d2010.5MiAaHDL aMode of access: World Wide Web. aBd. 165 (1873)-220 (1883) (Includes index to an earlier title). 1 v.; Bd. 221 (1884)-276 (1893). 1 v.; Bd. 277 (1893)-328 (1903). 1 v.; Bd. 329 (1903)-380 (1911). 1 v.; Bd. 381 (1912)-430 (1923). 1 v.; Bd. 431 (1923)-500 (1932), with index for Bd. 381-430; Bd. 501 (1933)-550 (1942). l v.; Bd. 551 (1942)-600 (1956). l v. Bds. 1-460 have also indexes in every fourth volume. Bd. 468-<540> in every eighth volume.1 adigitizedc2010hHathiTrust Digital Librarylcommitted to preserve2pda5MiAaHDL aDescription based on: Bd. 173, published in 1874; title from PFD title page (Wiley online library, viewed Apr. 10, 2013). aLatest issue consulted: [Vol.]1978, Heft 12, published 1978 (Wiley online library, viewed Apr. 10, 2013). aElectronic resource. 0aChemistryvPeriodicals. 0aPharmacyvPeriodicals. 2aChemistryvPeriodicals. 6aChimievPériodiques. 6aPharmacievPériodiques.17aChemie.2gtt08iPrint version:tJustus Liebigs Annalen der Chemiex0075-4617w(DLC) 08036877w(OCoLC)175492700tC496129 Justus Liebigs Annalen der Chemie.w(OCoLC)613892321xprecedingTitle00tLiebigs Annalen der Chemiew(OCoLC)663881438 \ No newline at end of file From 8eacaf7c7f46407963f40c53027da33268330a8a Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:48:12 +0300 Subject: [PATCH 21/34] added test (#4133) --- ...displayed-for-empty-succeeding-title.cy.js | 59 +++++++++++++++++++ .../fragments/inventory/instanceRecordView.js | 6 ++ 2 files changed, 65 insertions(+) create mode 100644 cypress/e2e/inventory/instance/new-search-icon-is-not-displayed-for-empty-succeeding-title.cy.js diff --git a/cypress/e2e/inventory/instance/new-search-icon-is-not-displayed-for-empty-succeeding-title.cy.js b/cypress/e2e/inventory/instance/new-search-icon-is-not-displayed-for-empty-succeeding-title.cy.js new file mode 100644 index 0000000000..bcf8a928d1 --- /dev/null +++ b/cypress/e2e/inventory/instance/new-search-icon-is-not-displayed-for-empty-succeeding-title.cy.js @@ -0,0 +1,59 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import { Permissions } from '../../../support/dictionary'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Inventory', () => { + describe('Instance', () => { + const testData = { + filePath: 'oneMarcBib.mrc', + marcFileName: `C496132 createAutotestFile${getRandomPostfix()}.mrc`, + succeedingTitle: 'No value set-', + }; + + before('Create test data and login', () => { + cy.getAdminToken(); + DataImport.uploadFileViaApi( + testData.filePath, + testData.marcFileName, + DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + ).then((response) => { + testData.instanceId = response[0].instance.id; + }); + + cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => { + testData.user = userProperties; + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken().then(() => { + InventoryInstance.deleteInstanceViaApi(testData.instanceId); + Users.deleteViaApi(testData.user.userId); + }); + }); + + it( + 'C496132 Check that new search icon is not displayed for empty Succeeding title (folijet)', + { tags: ['extendedPath', 'folijet'] }, + () => { + InventoryInstances.searchByTitle(testData.instanceId); + InventoryInstances.selectInstance(); + InstanceRecordView.waitLoading(); + InstanceRecordView.verifyInstanceRecordViewOpened(); + InstanceRecordView.verifySucceedingTitle(testData.succeedingTitle); + InstanceRecordView.verifySucceedingTitleSearchIconAbsent(testData.succeedingTitle); + }, + ); + }); +}); diff --git a/cypress/support/fragments/inventory/instanceRecordView.js b/cypress/support/fragments/inventory/instanceRecordView.js index 50df609783..578bd88d19 100644 --- a/cypress/support/fragments/inventory/instanceRecordView.js +++ b/cypress/support/fragments/inventory/instanceRecordView.js @@ -287,6 +287,12 @@ export default { .find('button[ariaLabel="search"]') .should('not.exist'); }, + verifySucceedingTitleSearchIconAbsent() { + cy.get('#succeedingTitles [class*="mclCell-"]:nth-child(1)') + .eq(0) + .find('button[ariaLabel="search"]') + .should('not.exist'); + }, verifySucceedingTitleSearchIcon: (title) => { cy.expect( succeedingTitles From 4e9cb43e5285333e41240287f7b49bd07c340030 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:53:04 +0300 Subject: [PATCH 22/34] Fat 15877 (#4144) * fixed tests * deleted spase in test name * added waiter * fixed flaky test * fixed tests --------- Co-authored-by: Ostap Voitsekhovskyi --- .../data-import/e2e/match-on-holdings-856-u.cy.js | 2 -- .../e2e/mrc-import-file-for-update-items.cy.js | 3 --- ...st-matches-under-actions-in-a-job-profile.cy.js | 1 + ...s-should-add-035-field-if-hrid-not-exists.cy.js | 14 +++++++------- ...ted-actions-for-instance-holding-and-item.cy.js | 2 -- ...import-summury-table-for-updating-actions.cy.js | 2 -- ...ldings-and-items-with-instance-match-item.cy.js | 1 + ...ngs-and-items-without-instance-match-item.cy.js | 1 + .../browse-authority-records/marc-authority.cy.js | 5 ++++- .../marc-authority-edit.cy.js | 5 ++++- .../inventory/inventorySearchAndFilter.js | 4 ++-- .../fieldMappingProfile/newFieldMappingProfile.js | 1 + 12 files changed, 21 insertions(+), 20 deletions(-) diff --git a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js index 088f5de742..aece695a58 100644 --- a/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js +++ b/cypress/e2e/data-import/e2e/match-on-holdings-856-u.cy.js @@ -104,7 +104,6 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.enableStaffSuppressFacet.gui, ]).then((userProperties) => { userId = userProperties.userId; @@ -231,7 +230,6 @@ describe('Data Import', () => { Logs.checkJobStatus(nameForUpdateCreateMarcFile, JOB_STATUS_NAMES.COMPLETED); cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.selectYesfilterStaffSuppress(); InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); InstanceRecordView.verifyInstancePaneExists(); InstanceRecordView.openHoldingView(); diff --git a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js index a2d09c3ae5..57063dd531 100644 --- a/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js +++ b/cypress/e2e/data-import/e2e/mrc-import-file-for-update-items.cy.js @@ -269,7 +269,6 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { @@ -384,8 +383,6 @@ describe('Data Import', () => { // download .csv file cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.selectYesfilterStaffSuppress(); - cy.wait(1500); InventorySearchAndFilter.searchInstanceByHRID(instanceHRID); InventorySearchAndFilter.saveUUIDs(); // need to create a new file with instance UUID because tests are runing in multiple threads diff --git a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js index 5cfdbb5e8c..9f731b787a 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/nest-matches-under-actions-in-a-job-profile.cy.js @@ -221,6 +221,7 @@ describe('Data Import', () => { InventorySearchAndFilter.filterHoldingsByPermanentLocation(holdingsPermanentLocation); InventorySearchAndFilter.searchHoldingsByHRID(holdingsHrId); InventorySearchAndFilter.selectResultCheckboxes(1); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); InventorySearchAndFilter.exportInstanceAsMarc(); cy.intercept('/data-export/quick-export').as('getHrid'); cy.wait('@getHrid', getLongDelay()).then((req) => { diff --git a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js index 45bc1fd33e..cd48dadb6e 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/updates-should-add-035-field-if-hrid-not-exists.cy.js @@ -39,9 +39,9 @@ describe('Data Import', () => { let user = null; const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS; // unique file names - const marcFileNameForCreate = `C358998 createAutotestFile${getRandomPostfix()}.mrc`; - const marcFileNameForUpdate = `C358998 updateAutotestFile${getRandomPostfix()}.mrc`; - const fileNameAfterUpload = `C358998 fileNameAfterUpload${getRandomPostfix()}.mrc`; + const marcFileNameForCreate = `C543840 createAutotestFile${getRandomPostfix()}.mrc`; + const marcFileNameForUpdate = `C543840 updateAutotestFile${getRandomPostfix()}.mrc`; + const fileNameAfterUpload = `C543840 fileNameAfterUpload${getRandomPostfix()}.mrc`; const itemQuantity = '8'; const arrayOf999Fields = []; const fieldsContent = [ @@ -56,7 +56,7 @@ describe('Data Import', () => { ]; const mappingProfile = { - name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + name: `C543840 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE, instanceStatusTerm: INSTANCE_STATUS_TERM_NAMES.BATCH_LOADED, statisticalCode: 'ARL (Collection stats): books - Book, print (books)', @@ -65,12 +65,12 @@ describe('Data Import', () => { const actionProfile = { typeValue: FOLIO_RECORD_TYPE.INSTANCE, - name: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + name: `C543840 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, action: ACTION_NAMES_IN_ACTION_PROFILE.UPDATE, }; const matchProfile = { - profileName: `C358998 Match 999$i to Instance UUID ${getRandomPostfix()}`, + profileName: `C543840 Match 999$i to Instance UUID ${getRandomPostfix()}`, incomingRecordFields: { field: '999', in1: 'f', @@ -83,7 +83,7 @@ describe('Data Import', () => { }; const jobProfile = { - profileName: `C358998 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, + profileName: `C543840 Update instance via 999$i match and check 001, 003, 035 ${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, }; diff --git a/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js b/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js index 4e86c6206a..3ab1df1161 100644 --- a/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js +++ b/cypress/e2e/data-import/log-details/import-summary-table-with-updated-actions-for-instance-holding-and-item.cy.js @@ -282,7 +282,6 @@ describe('Data Import', () => { Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, - Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((userProperties) => { user = userProperties; @@ -372,7 +371,6 @@ describe('Data Import', () => { // download .csv file cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.selectYesfilterStaffSuppress(); InventorySearchAndFilter.searchByParameter('Subject', subject); InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); diff --git a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js index ce72702ad0..7479a4ea6e 100644 --- a/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js +++ b/cypress/e2e/data-import/log-details/import-summury-table-for-updating-actions.cy.js @@ -232,7 +232,6 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.enableStaffSuppressFacet.gui, Permissions.dataExportViewAddUpdateProfiles.gui, Permissions.dataExportUploadExportDownloadFileViewLogs.gui, ]).then((userProperties) => { @@ -369,7 +368,6 @@ describe('Data Import', () => { // download .csv file cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.selectYesfilterStaffSuppress(); InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.saveUUIDs(); diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js index cfdfc7dba1..12f985a1dc 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-with-instance-match-item.cy.js @@ -310,6 +310,7 @@ describe('Data Import', () => { InventorySearchAndFilter.searchInstanceByHRID(testData.instanceHrid); InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.selectResultCheckboxes(1); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); InventorySearchAndFilter.saveUUIDs(); // need to create a new file with instance UUID because tests are runing in multiple threads cy.intercept('/search/instances/ids**').as('getIds'); diff --git a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js index d85412ded8..8fa5679897 100644 --- a/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js +++ b/cypress/e2e/data-import/log-details/record-title-is-present-in-log-details-when-job-profile-only-involves-holdings-and-items-without-instance-match-item.cy.js @@ -301,6 +301,7 @@ describe('Data Import', () => { InventorySearchAndFilter.searchInstanceByHRID(testData.secondHrid); InstanceRecordView.verifyInstancePaneExists(); InventorySearchAndFilter.selectResultCheckboxes(1); + FileManager.deleteFolder(Cypress.config('downloadsFolder')); InventorySearchAndFilter.saveUUIDs(); // need to create a new file with instance UUID because tests are runing in multiple threads cy.intercept('/search/instances/ids**').as('getIds'); diff --git a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js index 69bb17e01d..97f8911ef1 100644 --- a/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js +++ b/cypress/e2e/marc/marc-authority/browse-authority-records/marc-authority.cy.js @@ -205,7 +205,10 @@ describe('MARC', () => { MarcAuthority.checkRemovedTag(9); cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(9, 'Tag must contain three characters and can only accept numbers 0-9.'); + QuickMarcEditor.checkErrorMessage( + 9, + 'Tag must contain three characters and can only accept numbers 0-9.', + ); }, ); diff --git a/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js b/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js index 1d6871aca5..381cecd8f6 100644 --- a/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-authority-record/marc-authority-edit.cy.js @@ -1115,7 +1115,10 @@ describe('MARC', () => { QuickMarcEditor.checkDeleteModal(1); QuickMarcEditor.clickRestoreDeletedField(); QuickMarcEditor.checkDeleteModalClosed(); - QuickMarcEditor.checkContent('$a Q215410 $2 wikidata $1 http://www.wikidata.org/entity/Q215410', 5); + QuickMarcEditor.checkContent( + '$a Q215410 $2 wikidata $1 http://www.wikidata.org/entity/Q215410', + 5, + ); QuickMarcEditor.checkButtonsEnabled(); }, ); diff --git a/cypress/support/fragments/inventory/inventorySearchAndFilter.js b/cypress/support/fragments/inventory/inventorySearchAndFilter.js index 5ab1fc896b..d1b559f8f8 100644 --- a/cypress/support/fragments/inventory/inventorySearchAndFilter.js +++ b/cypress/support/fragments/inventory/inventorySearchAndFilter.js @@ -521,9 +521,9 @@ export default { else cy.expect(MultiColumnListCell({ content: cellContent }).absent()); }, - verifySearchResultIncludingValue: ((value) => { + verifySearchResultIncludingValue: (value) => { cy.expect(MultiColumnListCell({ content: including(value) }).exists()); - }), + }, verifyContentNotExistInSearchResult: (cellContent) => cy.expect(MultiColumnListCell({ content: cellContent }).absent()), diff --git a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile.js b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile.js index 8da77ffb48..463ca719f0 100644 --- a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile.js +++ b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile.js @@ -136,6 +136,7 @@ const save = () => { // TODO need to wait until profile to be filled cy.wait(3000); cy.do(saveButton.click()); + cy.wait(1500); }; const selectOrganizationByName = (organizationName) => { cy.do(organizationLookUpButton.click()); From fb88bde2bf6c6476406b418104ee0e91cf65eeb6 Mon Sep 17 00:00:00 2001 From: Tetiana Paranich <89065577+TetianaParanich@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:20:04 +0300 Subject: [PATCH 23/34] FAT-15809-C451451 (#4137) * added test * changed test's ID --- ...endor-as-specified-vendor-currencies.cy.js | 71 +++++++++++++++++++ .../fragments/invoices/invoiceEditForm.js | 3 + .../support/fragments/invoices/invoiceView.js | 30 ++++---- 3 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 cypress/e2e/invoices/non-default-currency-is-transfered-to-invoice-when-organization-vendor-as-specified-vendor-currencies.cy.js diff --git a/cypress/e2e/invoices/non-default-currency-is-transfered-to-invoice-when-organization-vendor-as-specified-vendor-currencies.cy.js b/cypress/e2e/invoices/non-default-currency-is-transfered-to-invoice-when-organization-vendor-as-specified-vendor-currencies.cy.js new file mode 100644 index 0000000000..f6f4faf680 --- /dev/null +++ b/cypress/e2e/invoices/non-default-currency-is-transfered-to-invoice-when-organization-vendor-as-specified-vendor-currencies.cy.js @@ -0,0 +1,71 @@ +import Permissions from '../../support/dictionary/permissions'; +import { Invoices, InvoiceView } from '../../support/fragments/invoices'; +import { NewOrganization, Organizations } from '../../support/fragments/organizations'; +import TopMenu from '../../support/fragments/topMenu'; +import Users from '../../support/fragments/users/users'; +import DateTools from '../../support/utils/dateTools'; +import getRandomPostfix from '../../support/utils/stringTools'; + +describe('Invoices', () => { + const organization = { + ...NewOrganization.getDefaultOrganization(), + isVendor: true, + vendorCurrencies: ['DZD'], + }; + const testData = { + user: {}, + invoice: { + invoiceDate: DateTools.getFormattedDate({ date: new Date() }), + batchGroupName: 'FOLIO', + vendorInvoiceNo: getRandomPostfix(), + paymentMethod: 'Cash', + exchangeRate: '1', + }, + vendorCurrencieUI: 'Algerian Dinar', + }; + + before('Create test data and login', () => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((organizationResp) => { + organization.id = organizationResp; + }); + + cy.createTempUser([Permissions.viewEditCreateInvoiceInvoiceLine.gui]).then((userProperties) => { + testData.user = userProperties; + + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.invoicesPath, + waiter: Invoices.waitLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.user.userId); + cy.getInvoiceIdApi({ + query: `vendorInvoiceNo="${testData.invoice.vendorInvoiceNo}"`, + }).then((id) => cy.deleteInvoiceFromStorageViaApi(id)); + Organizations.deleteOrganizationViaApi(organization.id); + }); + + it( + 'C451451 Non-default currency is transferred to Invoice when Organization-vendor has specified "Vendor currencies" (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + const InvoiceEditForm = Invoices.openInvoiceEditForm({ createNew: true }); + InvoiceEditForm.fillInvoiceFields({ + invoiceDate: testData.invoice.invoiceDate, + batchGroupName: testData.invoice.batchGroupName, + vendorInvoiceNo: testData.invoice.vendorInvoiceNo, + vendorName: organization.name, + paymentMethod: testData.invoice.paymentMethod, + exchangeRate: testData.invoice.exchangeRate, + }); + InvoiceEditForm.checkCurrency('Algerian Dinar (DZD)'); + cy.wait(1000); + InvoiceEditForm.clickSaveButton({ invoiceCreated: true, invoiceLineCreated: false }); + InvoiceView.verifyCurrency(testData.vendorCurrencieUI); + }, + ); +}); diff --git a/cypress/support/fragments/invoices/invoiceEditForm.js b/cypress/support/fragments/invoices/invoiceEditForm.js index 4ff234288d..057efe932d 100644 --- a/cypress/support/fragments/invoices/invoiceEditForm.js +++ b/cypress/support/fragments/invoices/invoiceEditForm.js @@ -68,6 +68,9 @@ export default { checkFiscalYearIsAbsent() { cy.do(infoFields.fiscalYear.absent()); }, + checkCurrency(currency) { + cy.expect(Button({ id: 'currency' }).has({ singleValue: currency })); + }, selectVendorOnUi(vendorName) { cy.do([ Button('Organization look-up').click(), diff --git a/cypress/support/fragments/invoices/invoiceView.js b/cypress/support/fragments/invoices/invoiceView.js index d3badbd8ec..12048a6171 100644 --- a/cypress/support/fragments/invoices/invoiceView.js +++ b/cypress/support/fragments/invoices/invoiceView.js @@ -1,25 +1,26 @@ import { - MultiColumnListCell, - MultiColumnListRow, - Section, + Accordion, + Button, + HTML, including, KeyValue, - PaneHeader, - Pane, - HTML, - MultiColumnList, Link, - Button, + MultiColumnList, + MultiColumnListCell, + MultiColumnListRow, + Pane, + PaneHeader, + Section, } from '../../../../interactors'; +import interactorsTools from '../../utils/interactorsTools'; import InvoiceEditForm from './invoiceEditForm'; -import InvoiceLineEditForm from './invoiceLineEditForm'; import InvoiceLineDetails from './invoiceLineDetails'; +import InvoiceLineEditForm from './invoiceLineEditForm'; +import InvoiceStates from './invoiceStates'; import ApproveInvoiceModal from './modal/approveInvoiceModal'; -import PayInvoiceModal from './modal/payInvoiceModal'; import CancelInvoiceModal from './modal/cancelInvoiceModal'; +import PayInvoiceModal from './modal/payInvoiceModal'; import SelectOrderLinesModal from './modal/selectOrderLinesModal'; -import InvoiceStates from './invoiceStates'; -import interactorsTools from '../../utils/interactorsTools'; const invoiceDetailsPane = Pane({ id: 'pane-invoiceDetails' }); @@ -335,4 +336,9 @@ export default { verifyWarningMessage(message) { cy.expect(HTML(including(message)).exists()); }, + + verifyCurrency(currency) { + cy.do(Accordion({ id: 'extendedInformation' }).clickHeader()); + cy.expect(KeyValue('Currency').has({ value: currency })); + }, }; From 76920a088574f45e01817ae46dce1531a475ade3 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:50:06 +0500 Subject: [PATCH 24/34] Fix the tests in daily run (#4141) --- ...-app-holdings-notes-in-different-columns-add-notes.cy.js | 1 + .../query/bulk-edit-query-items-edit-render-preview.cy.js | 4 +++- cypress/support/utils/dateTools.js | 6 ++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js index e00c6a7f2a..6e2a301753 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holdings-notes-in-different-columns-add-notes.cy.js @@ -66,6 +66,7 @@ describe('bulk-edit', () => { before('create test data', () => { cy.clearLocalStorage(); + cy.getAdminToken(); InventoryInstances.createHoldingsNoteTypeViaApi(newNoteType).then((noteId) => { newNoteTypeId = noteId; }); diff --git a/cypress/e2e/bulk-edit/query/bulk-edit-query-items-edit-render-preview.cy.js b/cypress/e2e/bulk-edit/query/bulk-edit-query-items-edit-render-preview.cy.js index d37705e4f5..e18cd00da0 100644 --- a/cypress/e2e/bulk-edit/query/bulk-edit-query-items-edit-render-preview.cy.js +++ b/cypress/e2e/bulk-edit/query/bulk-edit-query-items-edit-render-preview.cy.js @@ -64,7 +64,9 @@ describe('bulk-edit', () => { QueryModal.verifyQueryAreaContent('(temporary_location.name == )'); QueryModal.verifyValueColumn(); QueryModal.chooseValueSelect(LOCATION_NAMES.ONLINE_UI); - QueryModal.verifyQueryAreaContent(`(temporary_location.name == "${LOCATION_IDS.ONLINE}")`); + QueryModal.verifyQueryAreaContent( + `(temporary_location.name == "${LOCATION_NAMES.ONLINE_UI}")`, + ); QueryModal.testQueryDisabled(false); QueryModal.runQueryDisabled(); QueryModal.clickTestQuery(); diff --git a/cypress/support/utils/dateTools.js b/cypress/support/utils/dateTools.js index 59870e25ee..966fed98a4 100644 --- a/cypress/support/utils/dateTools.js +++ b/cypress/support/utils/dateTools.js @@ -112,15 +112,17 @@ export default { get2DaysAfterTomorrowDateForFiscalYearOnUIEdit: () => { const currentDate = new Date(); + currentDate.setDate(currentDate.getDate() + 3); return `${padWithZero(currentDate.getMonth() + 1)}/${padWithZero( - currentDate.getDate() + 3, + currentDate.getDate(), )}/${currentDate.getFullYear()}`; }, getSomeDaysAfterTomorrowDateForFiscalYear: (days) => { const currentDate = new Date(); + currentDate.setDate(currentDate.getDate() + days); return `${currentDate.getFullYear()}-${padWithZero(currentDate.getMonth() + 1)}-${padWithZero( - currentDate.getDate() + days, + currentDate.getDate(), )}`; }, From 7d7e8fd528b171bab0634a6282a167977a537787 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Fri, 30 Aug 2024 01:59:49 +0500 Subject: [PATCH 25/34] implemented test C496187 (#4142) --- ...tion-which-has-value-with-diacritics.cy.js | 118 ++++++++++++++++++ ...se-url-before-linking-while-creating.cy.js | 2 - .../create-new-marc-bib-invalid-values.cy.js | 7 +- ...d-field-with-base-url-before-linking.cy.js | 2 + .../derive-marc-bib/derive-fields-crud.cy.js | 2 + cypress/fixtures/marcBibFileForC496187.mrc | 1 + 6 files changed, 126 insertions(+), 6 deletions(-) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-which-has-value-with-diacritics.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496187.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-which-has-value-with-diacritics.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-which-has-value-with-diacritics.cy.js new file mode 100644 index 0000000000..f2165595c6 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-which-has-value-with-diacritics.cy.js @@ -0,0 +1,118 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in "Select instance" plugin', () => { + const testData = { + searchOption: ['Place of publication', 'All', 'Query search'], + searchValue: ['Hünfelden', 'Hunfelden'], + searchResult: + 'C496187 Aller Wort verschwiegenes Rot : Albrecht Goes zu Ehren / mit Beiträgen von Wolfram Aichele ... [et al.] ; herausgegen von Oliver Kohler.', + }; + + const marcFile = { + marc: 'marcBibFileForC496187.mrc', + fileName: `testMarcFileC496187.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C496187 Select Instance plugin | Search for Instance by "Place of publication" field which has value with diacritics (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventorySearchAndFilter.instanceTabIsDefault(); + + testData.searchOption.forEach((option) => { + testData.searchValue.forEach((value) => { + SelectInstanceModal.chooseSearchOption(option); + if (option === 'Query search') { + SelectInstanceModal.searchByName(`publication.place=${value}`); + } else { + SelectInstanceModal.searchByName(value); + } + InventorySearchAndFilter.verifySearchResultIncludingValue(testData.searchResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking-while-creating.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking-while-creating.cy.js index c5f5bb0a51..a022ce9c26 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking-while-creating.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking-while-creating.cy.js @@ -238,8 +238,6 @@ describe('MARC', () => { QuickMarcEditor.verifyTagFieldAfterLinking(...field); }); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { createdRecordIDs.push(id); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-invalid-values.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-invalid-values.cy.js index b82d328940..9f67a1f3fd 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-invalid-values.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-invalid-values.cy.js @@ -27,7 +27,7 @@ describe('MARC', () => { }, error06and07Filed: 'Record cannot be saved. Please enter a valid Leader 06 and Leader 07. Valid values are listed at https://loc.gov/marc/bibliographic/bdleader.html', error07Filed: 'Record cannot be saved. Please enter a valid Leader 07. Valid values are listed at https://loc.gov/marc/bibliographic/bdleader.html', - errorMultiple245MarcTags: 'Record cannot be saved with more than one field 245.', + errorMultipleTags: 'Field is non-repeatable.', }; const field008DropdownsOptionsSets = [ { name: INVENTORY_008_FIELD_DROPDOWNS_BOXES_NAMES.DTST, option: 'm - Multiple dates' }, @@ -101,7 +101,7 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagName(testData.tags.tag245, testData.tags.tag246); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.verifyNo245TagCallout(); + QuickMarcEditor.checkCallout('Field 245 is required.'); QuickMarcEditor.updateExistingTagName(testData.tags.tag246, testData.tags.tag245); QuickMarcEditor.updateExistingField( @@ -116,8 +116,7 @@ describe('MARC', () => { ); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(4, testData.errorMultiple245MarcTags); - QuickMarcEditor.checkErrorMessage(5, testData.errorMultiple245MarcTags); + QuickMarcEditor.checkErrorMessage(5, testData.errorMultipleTags); InventoryInstance.verifyNewQuickMarcEditorPaneExists(); }, ); diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking.cy.js index a1cc79f712..38a997f1c3 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/automated-linking/protocol-displayed-in-$0-of-auto-linked-field-with-base-url-before-linking.cy.js @@ -213,6 +213,8 @@ describe('MARC', () => { QuickMarcEditor.verifyTagFieldAfterLinking(...field); }); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAfterDerivedMarcBibSave(); InventoryInstance.viewSource(); diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/derive-fields-crud.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/derive-fields-crud.cy.js index fda96c14b8..e55289f61a 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/derive-fields-crud.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/derive-fields-crud.cy.js @@ -108,6 +108,8 @@ describe('MARC', () => { QuickMarcEditor.verifyTagValue(13, tags.tag100); QuickMarcEditor.verifyTagValue(14, tags.tag245); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.continueWithSaveAndCheckNewInstanceCreated(); InventoryInstance.viewSource(); // Verify The "245" MARC field is displayed above the "100 field. diff --git a/cypress/fixtures/marcBibFileForC496187.mrc b/cypress/fixtures/marcBibFileForC496187.mrc new file mode 100644 index 0000000000..f2dc1afee0 --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496187.mrc @@ -0,0 +1 @@ +01081nam a2200301 a 4500001001000000003000400010005001700014008004100031010001600072020001500088035002100103035002000124040001100144041000800155042001100163050002500174245015300199260003700352300004100389504004100430600004600471600007800517650006900595700003100664700002900695700002700724740002800751in1468864ICU19930917000000.0930525s1993 gw a b 010 0 ger c a 93145865 a3876304687 a(ICU)BID17150200 a(OCoLC)28112866 aCUcCU0 ager alcnccp14aPT2613.O36bZ55 199300aC496187 Aller Wort verschwiegenes Rot :bAlbrecht Goes zu Ehren /cmit Beiträgen von Wolfram Aichele ... [et al.] ; herausgegen von Oliver Kohler. aHünfelden :bPräsenz,c1993. a269 p. :bill. (some col.) ;c22 cm. aIncludes bibliographical references.10aGoes, Albrecht,d1908-2000xAppreciation.17aGoes, Albrecht,d1908-20002fast0http://id.worldcat.org/fast/fst01434369 7aArt appreciation.2fast0http://id.worldcat.org/fast/fst0081544710aGoes, Albrecht,d1908-200010aAichele, Wolfram,d1924-10aKohler, Oliver,d1958-01aAlbrecht Goes zu ehren. \ No newline at end of file From b6faa5dec402bcb6fcafabd52c854d76a05b90b1 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Fri, 30 Aug 2024 12:46:32 +0300 Subject: [PATCH 26/34] FAT-16060-FAT-16061 (#4145) * updateHoldingRecord method updated * FAT-16060: test added * FAT-16061: test added --- .../view-authority-files-central-member.cy.js | 122 ++++++++++++++++++ cypress/support/dictionary/permissions.js | 4 + .../marc-authority/manageAuthorityFiles.js | 19 +++ 3 files changed, 145 insertions(+) create mode 100644 cypress/e2e/consortia/settings/marc-authority/view-authority-files-central-member.cy.js diff --git a/cypress/e2e/consortia/settings/marc-authority/view-authority-files-central-member.cy.js b/cypress/e2e/consortia/settings/marc-authority/view-authority-files-central-member.cy.js new file mode 100644 index 0000000000..d6576f49bf --- /dev/null +++ b/cypress/e2e/consortia/settings/marc-authority/view-authority-files-central-member.cy.js @@ -0,0 +1,122 @@ +import Permissions from '../../../../support/dictionary/permissions'; +import ManageAuthorityFiles from '../../../../support/fragments/settings/marc-authority/manageAuthorityFiles'; +import TopMenu from '../../../../support/fragments/topMenu'; +import Users from '../../../../support/fragments/users/users'; +import getRandomPostfix, { + randomFourDigitNumber, + getRandomLetters, +} from '../../../../support/utils/stringTools'; +import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; +import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; +import ConsortiumManagerApp from '../../../../support/fragments/consortium-manager/consortiumManagerApp'; + +describe('MARC', () => { + describe('MARC Authority', () => { + describe('Settings', () => { + describe('Consortia', () => { + const testData = { + name: `Local source C430207 ${getRandomPostfix()}`, + prefix: getRandomLetters(7), + startsWith: `1${randomFourDigitNumber()}`, + isActive: true, + baseURL: '', + }; + + before('Create users, login', () => { + cy.resetTenant(); + cy.getAdminToken(); + + cy.createAuthoritySourceFileUsingAPI( + testData.prefix, + testData.startsWith, + testData.name, + testData.isActive, + ).then((sourceId) => { + testData.sourceFileId = sourceId; + }); + + cy.createTempUser([Permissions.uiSettingsViewAuthorityFiles.gui]).then( + (userPropertiesA) => { + testData.userA = userPropertiesA; + cy.createTempUser([Permissions.uiMarcAuthoritiesAuthorityRecordCreate.gui]).then( + (userPropertiesB) => { + testData.userB = userPropertiesB; + cy.assignAffiliationToUser(Affiliations.College, testData.userA.userId); + cy.assignAffiliationToUser(Affiliations.College, testData.userB.userId); + cy.setTenant(Affiliations.College); + cy.assignPermissionsToExistingUser(testData.userA.userId, [ + Permissions.uiSettingsViewAuthorityFiles.gui, + ]); + cy.assignPermissionsToExistingUser(testData.userB.userId, [ + Permissions.uiSettingsViewAuthorityFiles.gui, + Permissions.uiSettingsManageAuthorityFiles.gui, + ]); + }, + ); + }, + ); + }); + + after('Delete data, users', () => { + cy.resetTenant(); + cy.getAdminToken(); + Users.deleteViaApi(testData.userA.userId); + Users.deleteViaApi(testData.userB.userId); + cy.deleteAuthoritySourceFileViaAPI(testData.sourceFileId); + }); + + it( + 'C430207 View "Manage authority files" pane in "Settings >> MARC authority" with view permissions in Central and Member tenants (spitfire)', + { tags: ['criticalPathECS', 'spitfire'] }, + () => { + cy.login(testData.userA.username, testData.userA.password, { + path: TopMenu.settingsAuthorityFilesPath, + waiter: ManageAuthorityFiles.waitContentLoading, + }).then(() => { + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + ManageAuthorityFiles.checkAuthorityFilesTableExists(); + ManageAuthorityFiles.verifyTableHeaders(); + ManageAuthorityFiles.checkActiveTooltipButtonShown(); + ManageAuthorityFiles.checkNewButtonEnabled(false); + ManageAuthorityFiles.checkManageAuthorityFilesPaneExists(); + ManageAuthorityFiles.checkAuthorityFilesTableNotEditable(); + + ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); + cy.visit(TopMenu.settingsAuthorityFilesPath); + ManageAuthorityFiles.waitContentLoading(); + ManageAuthorityFiles.checkAuthorityFilesTableExists(); + ManageAuthorityFiles.verifyTableHeaders(); + ManageAuthorityFiles.checkActiveTooltipButtonShown(); + ManageAuthorityFiles.checkNewButtonEnabled(false); + ManageAuthorityFiles.checkManageAuthorityFilesPaneExists(); + ManageAuthorityFiles.checkAuthorityFilesTableNotEditable(); + }); + }, + ); + + it( + 'C430209 View "Manage authority files" pane in "Settings >> MARC authority" with CRUD permissions in Member tenant and no permissions in Central tenant (spitfire)', + { tags: ['criticalPathECS', 'spitfire'] }, + () => { + cy.login(testData.userB.username, testData.userB.password).then(() => { + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + + ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); + cy.visit(TopMenu.settingsAuthorityFilesPath); + ManageAuthorityFiles.waitContentLoading(); + ManageAuthorityFiles.checkAuthorityFilesTableExists(); + ManageAuthorityFiles.verifyTableHeaders(); + ManageAuthorityFiles.checkActiveTooltipButtonShown(); + ManageAuthorityFiles.checkNewButtonEnabled(false); + ManageAuthorityFiles.checkManageAuthorityFilesPaneExists(); + ManageAuthorityFiles.checkAuthorityFilesTableNotEditable(); + + ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.central); + ConsortiumManagerApp.verifyChooseSettingsIsDisplayed(); + }); + }, + ); + }); + }); + }); +}); diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 77426d6182..8c0883e75e 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -999,6 +999,10 @@ export default { internal: 'ui-inventory.settings.modes-of-issuance', gui: 'Settings (Inventory): Create, edit, delete locally defined modes of issuance', }, + uiSettingsViewAuthorityFiles: { + internal: 'ui-marc-authorities.settings.authority-files.view', + gui: 'Settings (MARC authority): View authority files', + }, // Added the below permissions for custom label creation uiSettingsEHoldingsViewAccessStatusTypes: { diff --git a/cypress/support/fragments/settings/marc-authority/manageAuthorityFiles.js b/cypress/support/fragments/settings/marc-authority/manageAuthorityFiles.js index e99346f276..4add7ce712 100644 --- a/cypress/support/fragments/settings/marc-authority/manageAuthorityFiles.js +++ b/cypress/support/fragments/settings/marc-authority/manageAuthorityFiles.js @@ -11,6 +11,7 @@ import { TextField, including, matching, + or, } from '../../../../../interactors'; import { DEFAULT_FOLIO_AUTHORITY_FILES, AUTHORITY_FILE_TEXT_FIELD_NAMES } from '../../../constants'; @@ -39,6 +40,7 @@ const tableHeaderTexts = [ ]; const editButton = Button({ icon: 'edit' }); const deleteButton = Button({ icon: 'trash' }); +const tooltipButton = Button({ icon: 'info' }); const successSaveCalloutText = (authorityFileName) => { return `The authority file ${authorityFileName} has been successfully created.`; }; @@ -513,4 +515,21 @@ export default { } }); }, + + checkAuthorityFilesTableNotEditable() { + cy.wait(2000); + cy.expect([ + Form(including('Authority files')).find(editButton).absent(), + Form(including('Authority files')).find(deleteButton).absent(), + ]); + }, + + waitContentLoading() { + cy.expect([firstRow.exists(), newButton.has({ disabled: or(true, false) })]); + cy.wait(3000); + }, + + checkActiveTooltipButtonShown() { + cy.expect(MultiColumnListHeader(tableHeaderTexts[4]).find(tooltipButton).exists()); + }, }; From 72b7f24a331ff170c3e6f0d3e4e48411d076294e Mon Sep 17 00:00:00 2001 From: Kyrylo Brener Date: Fri, 30 Aug 2024 13:24:18 +0300 Subject: [PATCH 27/34] fse erm tags updated --- cypress/e2e/fse/api/edge-api.cy.js | 12 ++++++------ cypress/e2e/fse/ui/erm-comparison-ui.cy.js | 2 +- cypress/e2e/fse/ui/erm-usage-ui.cy.js | 2 +- cypress/e2e/fse/ui/local-kb-admin-ui.cy.js | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/fse/api/edge-api.cy.js b/cypress/e2e/fse/api/edge-api.cy.js index 9344fb4f26..206c2439b4 100644 --- a/cypress/e2e/fse/api/edge-api.cy.js +++ b/cypress/e2e/fse/api/edge-api.cy.js @@ -1,14 +1,14 @@ describe('fse-edge', () => { // all test steps are hidden from report in order to hide sensitive edge related data (api key). TODO: update to hide only api key - it('TC195410 - edge-erm verification', { tags: ['fse', 'api', 'edge'] }, () => { + it('TC195410 - edge-erm verification', { tags: ['fse', 'api', 'edge-erm'] }, () => { cy.allure().logCommandSteps(false); cy.postEdgeErm().then((response) => { cy.expect(response.status).to.eq(200); }); }); - it('TC195411 - edge-ncip verification', { tags: ['fse', 'api', 'edge'] }, () => { + it('TC195411 - edge-ncip verification', { tags: ['fse', 'api', 'edge-ncip'] }, () => { // Request body taken from https://github.com/folio-org/mod-ncip/tree/master/docs/sampleNcipMessages // UserIdentifierValue is specified as 'EBSCOSupport' in the requestBody @@ -40,21 +40,21 @@ describe('fse-edge', () => { }); }); - it('TC195412 - edge-oai-pmh verification', { tags: ['fse', 'api', 'edge'] }, () => { + it('TC195412 - edge-oai-pmh verification', { tags: ['fse', 'api', 'edge-oai'] }, () => { cy.allure().logCommandSteps(false); cy.getEdgeOai().then((response) => { cy.expect(response.status).to.eq(200); }); }); - it('TC195413 - edge-patron verification', { tags: ['fse', 'api', 'edge'] }, () => { + it('TC195413 - edge-patron verification', { tags: ['fse', 'api', 'edge-patron'] }, () => { cy.allure().logCommandSteps(false); cy.getEdgePatron().then((response) => { cy.expect(response.status).to.eq(200); }); }); - it('TC195414 - edge-orders verification', { tags: ['fse', 'api', 'edge'] }, () => { + it('TC195414 - edge-orders verification', { tags: ['fse', 'api', 'edge-orders'] }, () => { cy.allure().logCommandSteps(false); cy.postEdgeOrders().then((response) => { cy.expect(response.status).to.eq(200); @@ -63,7 +63,7 @@ describe('fse-edge', () => { it( `TC195415 - edge-rtac verification for ${Cypress.env('EDGE_HOST')}`, - { tags: ['fse', 'api', 'edge'] }, + { tags: ['fse', 'api', 'edge-rtac'] }, () => { cy.allure().logCommandSteps(false); cy.getUserToken(Cypress.env('diku_login'), Cypress.env('diku_password')); diff --git a/cypress/e2e/fse/ui/erm-comparison-ui.cy.js b/cypress/e2e/fse/ui/erm-comparison-ui.cy.js index 61289cbc28..86bb16fa43 100644 --- a/cypress/e2e/fse/ui/erm-comparison-ui.cy.js +++ b/cypress/e2e/fse/ui/erm-comparison-ui.cy.js @@ -11,7 +11,7 @@ describe('fse-erm-comparison - UI', () => { it( `TC195305 - verify that erm-comparison module is displayed for ${Cypress.env('OKAPI_HOST')}`, - { tags: ['fse', 'ui', 'erm-comparison'] }, + { tags: ['fse', 'ui', 'erm'] }, () => { cy.visit(TopMenu.ermComparisonPath); ErmComparison.waitLoading(); diff --git a/cypress/e2e/fse/ui/erm-usage-ui.cy.js b/cypress/e2e/fse/ui/erm-usage-ui.cy.js index 81fadb00ca..ea80215ae5 100644 --- a/cypress/e2e/fse/ui/erm-usage-ui.cy.js +++ b/cypress/e2e/fse/ui/erm-usage-ui.cy.js @@ -11,7 +11,7 @@ describe('fse-erm-usage - UI', () => { it( `TC195310 - verify that erm-usage module is displayed for ${Cypress.env('OKAPI_HOST')}`, - { tags: ['fse', 'ui', 'erm-usage'] }, + { tags: ['fse', 'ui', 'erm'] }, () => { cy.visit(TopMenu.ermUsagePath); ErmUsage.waitLoading(); diff --git a/cypress/e2e/fse/ui/local-kb-admin-ui.cy.js b/cypress/e2e/fse/ui/local-kb-admin-ui.cy.js index 2d5a067b7e..95f55fbbbf 100644 --- a/cypress/e2e/fse/ui/local-kb-admin-ui.cy.js +++ b/cypress/e2e/fse/ui/local-kb-admin-ui.cy.js @@ -11,7 +11,7 @@ describe('fse-local-kbAdmin - UI', () => { it( `TC195333 - verify that marc local KB admin page is displayed for ${Cypress.env('OKAPI_HOST')}`, - { tags: ['fse', 'ui', 'local-kbAdmin'] }, + { tags: ['fse', 'ui', 'local-kbAdmin', 'erm'] }, () => { cy.visit(TopMenu.localKbAdmin); LocalKbAdmin.waitLoading(); From 8d685ba29cd9eac8e8643cb9ca2841c2522da864 Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Fri, 30 Aug 2024 19:23:02 +0500 Subject: [PATCH 28/34] implemented test C496186 (#4140) --- ...lication-using-queries-with-asteriks.cy.js | 118 ++++++++++++++++++ ...ultiple-records-in-publication-field.cy.js | 2 +- cypress/fixtures/marcBibFileForC496186.mrc | 1 + 3 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-asteriks.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496186.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-asteriks.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-asteriks.cy.js new file mode 100644 index 0000000000..1619136bb9 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-using-queries-with-asteriks.cy.js @@ -0,0 +1,118 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in "Select instance" plugin', () => { + const testData = { + searchOption: ['Place of publication', 'All', 'Query search'], + searchValue: ['*WA.', 'Seattle*', '*ttle, W*'], + searchResult: + 'C496186 The Rock cycle [videorecording] : understanding the processes and products of an ever-changing earth / Terra Productions : producer, Blair Robbins ; scientific advisor, Robert L. Burk.', + }; + + const marcFile = { + marc: 'marcBibFileForC496186.mrc', + fileName: `testMarcFileC496186.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C496186 Select Instance plugin | Search for Instance by "Place of publication" field using queries with asterisk (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventorySearchAndFilter.instanceTabIsDefault(); + + testData.searchOption.forEach((option) => { + testData.searchValue.forEach((value) => { + SelectInstanceModal.chooseSearchOption(option); + if (option === 'Query search') { + SelectInstanceModal.searchByName(`publication.place=${value}`); + } else { + SelectInstanceModal.searchByName(value); + } + InventorySearchAndFilter.verifySearchResultIncludingValue(testData.searchResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js index 5fb6e2b1f2..c1152371bf 100644 --- a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-instance-which-has-multiple-records-in-publication-field.cy.js @@ -14,7 +14,7 @@ import Organizations from '../../../support/fragments/organizations/organization import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; describe('Inventory', () => { - describe('Search in Inventory', () => { + describe('Search in "Select instance" plugin', () => { const testData = { searchOption: ['Place of publication', 'All', 'Query search'], searchValue: ['Petrozavodsk', 'Петрозаводск'], diff --git a/cypress/fixtures/marcBibFileForC496186.mrc b/cypress/fixtures/marcBibFileForC496186.mrc new file mode 100644 index 0000000000..921cdad12d --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496186.mrc @@ -0,0 +1 @@ +01145cgm 2200289Ia 450000100070000000500170000700700110002400800410003503500230007603500200009904000130011904900090013205000230014108200120016424501990017626000460037530000560042152002280047753800090070565000130071465000110072765000340073865500200077270000200079270000200081271000230083243991620040913145058.0vf cnaho- 910521s1990 wau--- e vleng d a(OCoLC)ocm23814994 a(OCoLC)23814994 aHCKcHCK aJW2A 4aQE431.2b.R63 1982 4a549.11404aC496186 The Rock cycleh[videorecording] : understanding the processes and products of an ever-changing earth /cTerra Productions : producer, Blair Robbins ; scientific advisor, Robert L. Burk. aSeattle, WA. :bTerra Productions,c1990. a1 videocassette (30 min.) :bsd., col. +e1 guide. aExamines the rock cycle as a fundamental geologic process by which earth materials are formed and altered. Identifies the major types of rocks, and describes how they are affected by erosion, weathering, heat, and pressure. aVHS. 0aGeology. 0aRocks. 0aSedimentation and deposition. 0aVideocassettes.1 aBurk, Robert L.1 aRobbins, Blair.2 aTerra Productions. \ No newline at end of file From e1028b91bc81cc50e8f5ae1d6f5dc19e708542ba Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Fri, 30 Aug 2024 22:45:54 +0500 Subject: [PATCH 29/34] FAT-16119/ Updated and fixed tests in sprint run (#4149) * updated and fixed tests in sprint run * linter fic --- .../search-in-inventory-linked-authID.cy.js | 4 ++++ .../field-008-existence-validation.cy.js | 2 +- ...n-the-marc-authority-record-controls-marc-bib.cy.js | 4 ++-- ...-edit-110-field-value-which-controls-marc-bib.cy.js | 3 +-- ...dit-110-t-field-value-which-controls-marc-bib.cy.js | 3 +-- ...-edit-111-field-value-which-controls-marc-bib.cy.js | 3 +-- ...dit-111-with-t-which-controls-marc-bib-record.cy.js | 3 +-- ...-edit-130-field-value-which-controls-marc-bib.cy.js | 3 +-- ...thority-edit-150-field-that-controls-marc-bib.cy.js | 3 +-- .../auto-linking-fields-with-$9.cy.js | 2 -- .../auto-linking-fields-with-0-subfield.cy.js | 2 -- .../create-new-marc-bib-008-field-validation.cy.js | 4 +--- .../create-new-marc-bib-add-multiple-999.cy.js | 2 -- .../create-new-marc-bib-with-multiple-001-fields.cy.js | 2 -- ...tifications-shown-before-modals-when-deriving.cy.js | 10 +++++----- .../derive-marc-bib/marc-bib-derive.cy.js | 2 ++ ...stence-validation-when-edit-imported-marc-bib.cy.js | 4 +++- ...-headings-enabled-disabled-in-linked-marc-bib.cy.js | 2 -- .../edit-marc-bib-add-multiple-001s.cy.js | 3 ++- ...fore-confirmation-modals-when-saving-marc-bib.cy.js | 7 +++---- ...n-saving-marcHold-record-while-editing-record.cy.js | 2 +- 21 files changed, 30 insertions(+), 40 deletions(-) diff --git a/cypress/e2e/inventory/search-in-inventory/search-in-inventory-linked-authID.cy.js b/cypress/e2e/inventory/search-in-inventory/search-in-inventory-linked-authID.cy.js index a84a9dba5e..e05f0908e4 100644 --- a/cypress/e2e/inventory/search-in-inventory/search-in-inventory-linked-authID.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/search-in-inventory-linked-authID.cy.js @@ -82,6 +82,8 @@ describe('Inventory', () => { InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(22, testData.tag700); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstances.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); @@ -98,6 +100,8 @@ describe('Inventory', () => { InventoryInstance.clickLinkButton(); QuickMarcEditor.verifyAfterLinkingAuthorityByIndex(65, testData.tag700); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); cy.login(testData.userProperties.username, testData.userProperties.password, { diff --git a/cypress/e2e/marc/marc-authority/edit-authority-record/field-008-existence-validation.cy.js b/cypress/e2e/marc/marc-authority/edit-authority-record/field-008-existence-validation.cy.js index 9092c54aba..a6757ae93f 100644 --- a/cypress/e2e/marc/marc-authority/edit-authority-record/field-008-existence-validation.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-authority-record/field-008-existence-validation.cy.js @@ -66,7 +66,7 @@ describe('MARC', () => { tag110Value: '$a DC Talk (Musical group).$t Jesus freaks.$l Afrikaans test', calloutMessage: 'This record has successfully saved and is in process. Changes may not appear immediately.', - errorCalloutMessage: 'Record cannot be saved without 008 field', + errorCalloutMessage: 'Field 008 is required.', initial008EnteredValue: DateTools.getCurrentDateYYMMDD(), }; const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY; diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/edit-tag-value-100-which-has-$t-in-the-marc-authority-record-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/edit-tag-value-100-which-has-$t-in-the-marc-authority-record-controls-marc-bib.cy.js index 687aca5d5b..7dc6d01fc3 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/edit-tag-value-100-which-has-$t-in-the-marc-authority-record-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/edit-tag-value-100-which-has-$t-in-the-marc-authority-record-controls-marc-bib.cy.js @@ -152,8 +152,8 @@ describe('MARC', () => { QuickMarcEditor.clickSaveAndKeepEditingButton(); QuickMarcEditor.checkErrorMessage(7, testData.calloutMessage); QuickMarcEditor.updateExistingTagName(testData.tag155, testData.tag119); - QuickMarcEditor.pressSaveAndKeepEditing(testData.calloutMessageAfterDeleting1XXField); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + QuickMarcEditor.checkErrorMessage(7, testData.calloutMessage); QuickMarcEditor.updateExistingTagName(testData.tag119, testData.tag100); QuickMarcEditor.checkButtonsDisabled(); QuickMarcEditor.updateExistingField(testData.tag100, testData.tag100content); diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-field-value-which-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-field-value-which-controls-marc-bib.cy.js index 6a59e84322..6132e4db5f 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-field-value-which-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-field-value-which-controls-marc-bib.cy.js @@ -164,8 +164,7 @@ describe('MARC', () => { testData.tagsForChanging[1], ); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkCallout(testData.errorMessageAfterSaving); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(20, testData.errorMessageAfterChangingTag); QuickMarcEditor.updateExistingTagName( testData.tagsForChanging[1], diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-t-field-value-which-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-t-field-value-which-controls-marc-bib.cy.js index 36e45b7f3f..cf1fdf4d2b 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-t-field-value-which-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-110-t-field-value-which-controls-marc-bib.cy.js @@ -175,8 +175,7 @@ describe('MARC', () => { testData.tagsForChanging[3], ); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkCallout(testData.errorMessageAfterSaving); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(8, testData.errorMessageAfterChangingTag); QuickMarcEditor.updateExistingTagName( testData.tagsForChanging[3], diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-field-value-which-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-field-value-which-controls-marc-bib.cy.js index 5f3c7ee459..15b0ee7fc1 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-field-value-which-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-field-value-which-controls-marc-bib.cy.js @@ -162,8 +162,7 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagName(testData.tag155, testData.tag109); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkCallout(testData.errorMessageAfterSaving); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(8, testData.errorMessageAfterChangingTag); QuickMarcEditor.updateExistingTagName(testData.tag109, testData.tag111); QuickMarcEditor.checkButtonsDisabled(); diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-with-t-which-controls-marc-bib-record.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-with-t-which-controls-marc-bib-record.cy.js index f474a5ad3f..2d794d0dbb 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-with-t-which-controls-marc-bib-record.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-111-with-t-which-controls-marc-bib-record.cy.js @@ -143,8 +143,7 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagName(previousTagValue, testData.tag129); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkCallout(testData.cannotSaveCalloutMessage); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(10, testData.cannotChangeCalloutMessage); QuickMarcEditor.updateExistingTagName(testData.tag129, testData.tag111); QuickMarcEditor.checkButtonsDisabled(); diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-130-field-value-which-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-130-field-value-which-controls-marc-bib.cy.js index e5703412c1..5d74001bea 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-130-field-value-which-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-130-field-value-which-controls-marc-bib.cy.js @@ -163,8 +163,7 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagName(testData.tag155, testData.tag121); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkCallout(testData.errorMessageAfterSaving); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(7, testData.errorMessageAfterChangingTag); QuickMarcEditor.updateExistingTagName(testData.tag121, testData.tag130); QuickMarcEditor.checkButtonsDisabled(); diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-150-field-that-controls-marc-bib.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-150-field-that-controls-marc-bib.cy.js index 0cbc6377e4..b1ade0c70c 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-150-field-that-controls-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-150-field-that-controls-marc-bib.cy.js @@ -151,8 +151,7 @@ describe('MARC', () => { QuickMarcEditor.checkErrorMessage(9, testData.cannotChangeCalloutMessage); QuickMarcEditor.updateExistingTagName(testData.tag155, testData.tag149); - QuickMarcEditor.pressSaveAndKeepEditing(testData.cannotSaveCalloutMessage); - QuickMarcEditor.closeCallout(); + QuickMarcEditor.checkErrorMessage(9, testData.cannotChangeCalloutMessage); QuickMarcEditor.updateExistingTagName(testData.tag149, testData.tag150); QuickMarcEditor.checkButtonsDisabled(); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js index c1f560d33e..6499fbdb04 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js @@ -174,8 +174,6 @@ describe('MARC', () => { QuickMarcEditor.checkContent(newFields[3].contentWithout$9, 8); QuickMarcEditor.checkContent(testData.fieldContents.tag245Content, 4); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { testData.createdInstanceID = id; diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-0-subfield.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-0-subfield.cy.js index 44be4397b0..7f0fbe1a87 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-0-subfield.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-0-subfield.cy.js @@ -202,8 +202,6 @@ describe('MARC', () => { QuickMarcEditor.updateExistingField('610', '$0 n93094742'); cy.wait(500); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-008-field-validation.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-008-field-validation.cy.js index ea300bc7f1..fe1339acaf 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-008-field-validation.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-008-field-validation.cy.js @@ -51,14 +51,12 @@ describe('MARC', () => { QuickMarcEditor.pressSaveAndClose(); cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkDelete008Callout(); + QuickMarcEditor.checkCallout('Field 008 is required.'); QuickMarcEditor.undoDelete(); QuickMarcEditor.updateExistingTagName('00', '008'); QuickMarcEditor.check008FieldContent(); cy.intercept('records-editor/records').as('saveMarc'); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); cy.wait('@saveMarc').then((res) => { expect(res.request.body.fields[0].content).not.to.have.property('Entered'); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-add-multiple-999.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-add-multiple-999.cy.js index f8e24c223d..5bc82a766f 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-add-multiple-999.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-add-multiple-999.cy.js @@ -55,8 +55,6 @@ describe('MARC', () => { // Click "Save & close" button QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { instanceId = id; diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-with-multiple-001-fields.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-with-multiple-001-fields.cy.js index 122574e8f1..a3d91524cf 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-with-multiple-001-fields.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/create-new-marc-bib-with-multiple-001-fields.cy.js @@ -64,8 +64,6 @@ describe('MARC', () => { QuickMarcEditor.updateTagNameToLockedTag(5, testData.tags.tag001); QuickMarcEditor.checkFourthBoxEditable(5, false); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { instanceId = id; diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/error-notifications-shown-before-modals-when-deriving.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/error-notifications-shown-before-modals-when-deriving.cy.js index 6420a9e6ba..47f1a97bde 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/error-notifications-shown-before-modals-when-deriving.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/error-notifications-shown-before-modals-when-deriving.cy.js @@ -18,9 +18,7 @@ describe('MARC', () => { tag300Value: '$av.$b25 cm.', }; - const calloutLDRMessage = - 'Record cannot be saved. The Leader must contain 24 characters, including null spaces.'; - const calloutTagMessage = 'Record cannot be saved. A MARC tag must contain three characters.'; + const calloutTagMessage = 'Tag must contain three characters and can only accept numbers 0-9.'; const marcFile = { marc: 'marcBibForC375177.mrc', @@ -97,7 +95,7 @@ describe('MARC', () => { // #8 Click "Save & close" button. QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(0, calloutLDRMessage); + QuickMarcEditor.checkErrorMessage(5, calloutTagMessage); // #9 Input deleted value in "LDR" field. QuickMarcEditor.fillEmptyTextFieldOfField( @@ -108,13 +106,15 @@ describe('MARC', () => { // #10 Click "Save & close" button. QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(6, calloutTagMessage); + QuickMarcEditor.checkErrorMessage(5, calloutTagMessage); // #11 Input original tag value for field updated in Step 5. QuickMarcEditor.updateExistingTagName('0', testData.tag022); // #12 Click "Save & close" button. QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkDeleteModal(1); // #13 Click "Restore deleted field(s)" button in modal. diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/marc-bib-derive.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/marc-bib-derive.cy.js index 5d13f8d376..213b62196e 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/marc-bib-derive.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/marc-bib-derive.cy.js @@ -67,6 +67,8 @@ describe('MARC', () => { QuickMarcEditor.checkSubfieldsPresenceInTag008(); QuickMarcEditor.updateExistingField(testData.tag245, testData.newTitle); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndCloseDerive(); InventoryInstance.checkInstanceTitle(testData.newTitle); InventoryInstance.editMarcBibliographicRecord(); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js index fc55456192..fb8076c2bf 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/008-field-existence-validation-when-edit-imported-marc-bib.cy.js @@ -51,7 +51,7 @@ describe('MARC', () => { ], calloutMessage: 'This record has successfully saved and is in process. Changes may not appear immediately.', - errorCalloutMessage: 'Record cannot be saved without 008 field', + errorCalloutMessage: 'Field 008 is required.', initial008EnteredValue: DateTools.getCurrentDateYYMMDD(), }; const field008DropdownValues = [ @@ -152,6 +152,8 @@ describe('MARC', () => { ); cy.wait(500); }); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + cy.wait(1500); QuickMarcEditor.pressSaveAndKeepEditing(testData.calloutMessage); QuickMarcEditor.checkEditableQuickMarcFormIsOpened(); QuickMarcEditor.check008FieldContent(); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/automated-linking/link-headings-enabled-disabled-in-linked-marc-bib.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/automated-linking/link-headings-enabled-disabled-in-linked-marc-bib.cy.js index a79b304064..e9f4b226d7 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/automated-linking/link-headings-enabled-disabled-in-linked-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/automated-linking/link-headings-enabled-disabled-in-linked-marc-bib.cy.js @@ -213,8 +213,6 @@ describe('MARC', () => { ); QuickMarcEditor.verifyDisabledLinkHeadingsButton(); QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.viewSource(); InventoryViewSource.contains( diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/edit-marc-bib-add-multiple-001s.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/edit-marc-bib-add-multiple-001s.cy.js index dd67e182ec..70de4e5de8 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/edit-marc-bib-add-multiple-001s.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/edit-marc-bib-add-multiple-001s.cy.js @@ -79,7 +79,8 @@ describe('MARC', () => { QuickMarcEditor.updateExistingField('', testData.tag001Content); QuickMarcEditor.updateTagNameToLockedTag(5, testData.tag001); QuickMarcEditor.checkFourthBoxEditable(5, false); - + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.waitLoading(); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notifications-shown-before-confirmation-modals-when-saving-marc-bib.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notifications-shown-before-confirmation-modals-when-saving-marc-bib.cy.js index cd1c383270..190ce2d8f3 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notifications-shown-before-confirmation-modals-when-saving-marc-bib.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/error-notifications-shown-before-confirmation-modals-when-saving-marc-bib.cy.js @@ -18,8 +18,7 @@ describe('MARC', () => { tag300: '300', tag300content: 'TEST', tagLDR: 'LDR', - errorMessage: - 'Record cannot be saved. The Leader must contain 24 characters, including null spaces.', + errorMessage: 'Tag must contain three characters and can only accept numbers 0-9.', errorMarcTagWrongLength: 'Record cannot be saved. A MARC tag must contain three characters.', }; const marcFile = { @@ -79,14 +78,14 @@ describe('MARC', () => { QuickMarcEditor.deleteTag(13); QuickMarcEditor.updateExistingField(testData.tag300, testData.tag300content); QuickMarcEditor.clickSaveAndKeepEditingButton(); - QuickMarcEditor.checkErrorMessage(0, testData.errorMessage); + QuickMarcEditor.checkErrorMessage(10, testData.errorMessage); QuickMarcEditor.fillEmptyTextFieldOfField( 0, 'records[0].content.ELvl', '\\', ); QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkErrorMessage(10, testData.errorMarcTagWrongLength); + QuickMarcEditor.checkErrorMessage(10, testData.errorMessage); QuickMarcEditor.updateExistingTagName(testData.tag0, testData.tag040); QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyConfirmModal(); diff --git a/cypress/e2e/marc/marc-holdings/error-notif-shown-before-modals-when-saving-marcHold-record-while-editing-record.cy.js b/cypress/e2e/marc/marc-holdings/error-notif-shown-before-modals-when-saving-marcHold-record-while-editing-record.cy.js index a13e3f42a0..4ed074df9f 100644 --- a/cypress/e2e/marc/marc-holdings/error-notif-shown-before-modals-when-saving-marcHold-record-while-editing-record.cy.js +++ b/cypress/e2e/marc/marc-holdings/error-notif-shown-before-modals-when-saving-marcHold-record-while-editing-record.cy.js @@ -40,7 +40,7 @@ describe('MARC', () => { rowIndex: 9, }, errors: { - tagCharacterLength: 'Record cannot be saved. A MARC tag must contain three characters.', + tagCharacterLength: 'Tag must contain three characters and can only accept numbers 0-9.', }, }; const marcFile = { From 18dc8f54955b47054cadf1801e6a94b7a47377b3 Mon Sep 17 00:00:00 2001 From: Sviatlana Stsiapanava <152482600+sviatlana-stsiapanava@users.noreply.github.com> Date: Fri, 30 Aug 2024 23:26:58 +0500 Subject: [PATCH 30/34] Add the test case C432296 (#4147) --- ...perties-columns-in-are-you-sure-form.cy.js | 273 ++++++++++++++++++ cypress/support/constants.js | 26 ++ .../fragments/bulk-edit/bulk-edit-actions.js | 18 ++ .../bulk-edit/bulk-edit-search-pane.js | 4 + 4 files changed, 321 insertions(+) create mode 100644 cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-properties-columns-in-are-you-sure-form.cy.js diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-properties-columns-in-are-you-sure-form.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-properties-columns-in-are-you-sure-form.cy.js new file mode 100644 index 0000000000..b346cf65f0 --- /dev/null +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-holding-properties-columns-in-are-you-sure-form.cy.js @@ -0,0 +1,273 @@ +import getRandomPostfix from '../../../support/utils/stringTools'; +import permissions from '../../../support/dictionary/permissions'; +import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import Users from '../../../support/fragments/users/users'; +import FileManager from '../../../support/utils/fileManager'; +import HoldingsRecordView from '../../../support/fragments/inventory/holdingsRecordView'; +import ExportFile from '../../../support/fragments/data-export/exportFile'; +import { + APPLICATION_NAMES, + BULK_EDIT_TABLE_COLUMN_HEADERS, + HOLDING_NOTE_TYPES, + LOCATION_NAMES, +} from '../../../support/constants'; + +let user; +let locationId; +const administrativeNoteText = 'C432296 Administrative note'; +const electronicBookplateNoteText = 'C432296 Electronic bookplate note'; +const newURI = 'https://test.com/study'; +const electronicAccessValue = + 'URL relationship;URI;Link text;Materials specified;URL public note\n;https://test.com/study;;;'; +const electronicAccessURI = 'https://www.emeraldinsight.com/journal/jepp'; +const instance = { + instanceName: `C432296 instance-${getRandomPostfix()}`, + itemBarcode: getRandomPostfix(), +}; +const actionsToSelect = { + addNote: 'Add note', + changeNoteType: 'Change note type', + replaceWith: 'Replace with', + clearField: 'Clear field', + setTrue: 'Set true', +}; +const columnNamesSet = [ + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ADMINISTRATIVE_NOTE, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_ACCESS, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_PERMANENT_LOCATION, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_TEMPORARY_LOCATION, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ACTION_NOTE, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_BOOKPLATE_NOTE, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.SUPPRESS_FROM_DISCOVERY, +]; +const editedValueSets = [ + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ADMINISTRATIVE_NOTE, ''], + [ + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_PERMANENT_LOCATION, + LOCATION_NAMES.ONLINE_UI, + ], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_TEMPORARY_LOCATION, ''], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ACTION_NOTE, administrativeNoteText], + [ + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_BOOKPLATE_NOTE, + electronicBookplateNoteText, + ], + [BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.SUPPRESS_FROM_DISCOVERY, 'true'], +]; +const holdingUUIDsFileName = `validHoldingUUIDs_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `*-Matched-Records-${holdingUUIDsFileName}`; +const previewFileName = `*-Updates-Preview-${holdingUUIDsFileName}`; +const changedRecordsFileName = `*-Changed-Records-${holdingUUIDsFileName}`; + +describe('bulk-edit', () => { + describe('in-app approach', () => { + before('create test data', () => { + cy.clearLocalStorage(); + + cy.createTempUser([permissions.bulkEditEdit.gui, permissions.inventoryAll.gui]).then( + (userProperties) => { + user = userProperties; + + instance.instanceId = InventoryInstances.createInstanceViaApi( + instance.instanceName, + instance.itemBarcode, + ); + cy.getHoldings({ + limit: 1, + query: `"instanceId"="${instance.instanceId}"`, + }).then((holdings) => { + instance.holdingHRID = holdings[0].hrid; + instance.holdingsUUID = holdings[0].id; + + cy.getInstance({ + limit: 1, + expandAll: true, + query: `"id"=="${instance.instanceId}"`, + }).then((instanceData) => { + instance.instanceHRID = instanceData.hrid; + + FileManager.createFile( + `cypress/fixtures/${holdingUUIDsFileName}`, + `${instance.holdingsUUID}`, + ); + }); + + cy.getLocations({ query: 'name="Main Library"' }) + .then((res) => { + locationId = res.id; + }) + .then(() => { + cy.updateHoldingRecord(holdings[0].id, { + ...holdings[0], + administrativeNotes: [administrativeNoteText], + electronicAccess: [ + { + uri: electronicAccessURI, + }, + ], + temporaryLocationId: locationId, + permanentLocationId: locationId, + }); + }); + + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading, + }); + }); + }, + ); + }); + + after('delete test data', () => { + cy.getAdminToken(); + InventoryInstances.deleteInstanceAndItsHoldingsAndItemsViaApi(instance.instanceId); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask( + matchedRecordsFileName, + previewFileName, + changedRecordsFileName, + ); + }); + + it( + 'C432296 Verify updated properties columns appear on "Are you sure?" form and on Confirmation screen - holdings (firebird)', + { tags: ['criticalPath', 'firebird'] }, + () => { + BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Holdings', 'Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.waitFileUploading(); + BulkEditSearchPane.verifyResultsUnderColumns( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + instance.holdingHRID, + ); + BulkEditActions.openActions(); + BulkEditSearchPane.uncheckShowColumnCheckbox(...columnNamesSet); + + columnNamesSet.forEach((columnName) => { + BulkEditSearchPane.verifyCheckboxInActionsDropdownMenuChecked(columnName, false); + }); + + BulkEditActions.openActions(); + BulkEditActions.downloadMatchedResults(); + ExportFile.verifyFileIncludes(matchedRecordsFileName, [columnNamesSet]); + + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditSearchPane.verifyBulkEditsAccordionExists(); + BulkEditActions.verifyOptionsDropdown(); + BulkEditActions.verifyRowIcons(); + BulkEditActions.verifyActionsColumnIsNotPopulated(); + BulkEditActions.selectOption(HOLDING_NOTE_TYPES.ADMINISTRATIVE_NOTE, 0); + BulkEditActions.selectSecondAction(actionsToSelect.changeNoteType); + BulkEditActions.selectNoteTypeWhenChangingIt(HOLDING_NOTE_TYPES.ACTION_NOTE, 0); + BulkEditActions.verifySecondActionSelected(actionsToSelect.changeNoteType); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(1); + BulkEditActions.selectOption('URI', 1); + BulkEditActions.selectSecondAction(actionsToSelect.replaceWith, 1); + BulkEditActions.fillInSecondTextArea(newURI, 1); + BulkEditActions.verifySecondActionSelected(actionsToSelect.replaceWith, 1); + BulkEditActions.verifyValueInSecondTextArea(newURI, 1); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(2); + BulkEditActions.replacePermanentLocation(LOCATION_NAMES.ONLINE_UI, 'holdings', 2); + BulkEditActions.verifyActionsSelectDropdownDisabled(2); + BulkEditActions.verifySecondActionSelected(actionsToSelect.replaceWith, 2); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(3); + BulkEditActions.selectOption('Temporary holdings location', 3); + BulkEditActions.selectSecondAction(actionsToSelect.clearField, 3); + BulkEditActions.verifySecondActionSelected(actionsToSelect.clearField, 3); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(4); + BulkEditActions.selectOption(HOLDING_NOTE_TYPES.ELECTRONIC_BOOKPLATE, 4); + BulkEditActions.selectSecondAction(actionsToSelect.addNote, 4); + BulkEditActions.fillInSecondTextArea(electronicBookplateNoteText, 4); + BulkEditActions.verifySecondActionSelected(actionsToSelect.addNote, 4); + BulkEditActions.verifyValueInSecondTextArea(electronicBookplateNoteText, 4); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(5); + BulkEditActions.selectOption('Suppress from discovery', 5); + BulkEditActions.selectSecondAction(actionsToSelect.setTrue, 5); + BulkEditActions.verifySecondActionSelected(actionsToSelect.setTrue, 5); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.confirmChanges(); + BulkEditActions.verifyMessageBannerInAreYouSureForm(1); + BulkEditActions.verifyChangesInAreYouSureForm( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + [instance.holdingHRID], + ); + + editedValueSets.forEach((editedValueSet) => { + BulkEditActions.verifyChangesInAreYouSureForm(editedValueSet[0], [editedValueSet[1]]); + }); + + BulkEditActions.verifyChangesInAreYouSureForm( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_ACCESS, + [newURI], + ); + BulkEditActions.downloadPreview(); + ExportFile.verifyFileIncludes(previewFileName, [ + Object.values(BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS), + electronicAccessValue, + ...editedValueSets, + ]); + BulkEditActions.commitChanges(); + BulkEditSearchPane.waitFileUploading(); + BulkEditActions.verifySuccessBanner(1); + BulkEditSearchPane.verifyExactChangesUnderColumns( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + instance.holdingHRID, + ); + + editedValueSets.forEach((editedValueSet) => { + BulkEditSearchPane.verifyExactChangesUnderColumns(...editedValueSet); + }); + + BulkEditSearchPane.verifyChangesUnderColumns( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ELECTRONIC_ACCESS, + newURI, + ); + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + ExportFile.verifyFileIncludes(changedRecordsFileName, [ + Object.values(BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS), + electronicAccessValue, + ...editedValueSets, + ]); + + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchHoldingsByHRID(instance.holdingHRID); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.checkAdministrativeNote('-'); + HoldingsRecordView.checkNotesByType( + 0, + HOLDING_NOTE_TYPES.ACTION_NOTE, + administrativeNoteText, + ); + HoldingsRecordView.checkNotesByType( + 1, + HOLDING_NOTE_TYPES.ELECTRONIC_BOOKPLATE, + electronicBookplateNoteText, + ); + HoldingsRecordView.checkMarkAsSuppressedFromDiscovery(); + HoldingsRecordView.checkElectronicAccess('-', newURI); + HoldingsRecordView.checkPermanentLocation(LOCATION_NAMES.ONLINE_UI); + HoldingsRecordView.checkTemporaryLocation('-'); + }, + ); + }); +}); diff --git a/cypress/support/constants.js b/cypress/support/constants.js index b4c0a801f7..d2a9183da7 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -840,16 +840,42 @@ export const DEFAULT_LOCALE_STRING = '{"locale":"en-US","timezone":"UTC","curren export const BULK_EDIT_TABLE_COLUMN_HEADERS = { INVENTORY_HOLDINGS: { + ACQUISITION_METHOD: 'Acquisition method', HOLDINGS_UUID: 'Holdings UUID', + INSTANCE: 'Instance (Title, Publisher, Publication date)', HOLDINGS_HRID: 'Holdings HRID', + HOLDINGS_TYPE: 'Holdings type', ADMINISTRATIVE_NOTE: 'Administrative note', ELECTRONIC_BOOKPLATE_NOTE: 'Electronic bookplate note', + ELECTRONIC_ACCESS: 'Electronic access', NOTE: 'Note', BINDING_NOTE: 'Binding note', ACTION_NOTE: 'Action note', COPY_NOTE: 'Copy note', REPRODUCTION: 'Reproduction note', + HOLDINGS_PERMANENT_LOCATION: 'Holdings permanent location', PROVENANCE_NOTE: 'Provenance note', + HOLDINGS_TEMPORARY_LOCATION: 'Holdings temporary location', + SUPPRESS_FROM_DISCOVERY: 'Suppress from discovery', + SOURCE: 'Source', + STATISTICAL_CODES: 'Statistical codes', + SHELVING_TITLE: 'Shelving title', + FORMER_HOLDINGS_ID: 'Former holdings Id', + HOLDINGS_COPY_NUMBER: 'Holdings copy number', + HOLDINGS_LEVEL_CALL_NUMBER_TYPE: 'Holdings level call number type', + HOLDINGS_LEVEL_CALL_NUMBER_PREFIX: 'Holdings level call number prefix', + HOLDINGS_LEVEL_CALL_NUMBER_SUFFIX: 'Holdings level call number suffix', + HOLDINGS_LEVEL_CALL_NUMBER: 'Holdings level call number', + NUMBER_OF_ITEMS: 'Number of items', + HOLDINGS_STATEMENT: 'Holdings statement', + HOLDINGS_STATEMENT_FOR_SUPPLEMENTS: 'Holdings statement for supplements', + HOLDINGS_STATEMENT_FOR_INDEXES: 'Holdings statement for indexes', + ILL_POLICY: 'ILL policy', + DIGITIZATION_POLICY: 'Digitization policy', + RETENTION_POLICY: 'Retention policy', + ORDER_FORMAT: 'Order format', + RECEIPT_STATUS: 'Receipt status', + TAGS: 'Tags', }, }; diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index 9a27d074db..c8915c692c 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -2,6 +2,7 @@ import { HTML, including } from '@interactors/html'; import { not } from 'bigtest'; import FileManager from '../../utils/fileManager'; import { + Accordion, Modal, SelectionOption, Button, @@ -22,6 +23,7 @@ import DateTools from '../../utils/dateTools'; import BulkEditSearchPane from './bulk-edit-search-pane'; const actionsBtn = Button('Actions'); +const bulkEditsAccordion = Accordion('Bulk edits'); const dropdownMenu = DropdownMenu(); const cancelBtn = Button({ id: 'clickable-cancel' }); const cancelButton = Button('Cancel'); @@ -120,12 +122,14 @@ export default { isSelectActionAbsent(rowIndex = 0) { cy.expect(RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.action).absent()); }, + verifyBulkEditForm(rowIndex = 0) { cy.do( RepeatableFieldItem({ index: rowIndex }).find(bulkPageSelections.valueType).choose('Email'), ); this.verifyRowIcons(); }, + verifyRowIcons() { cy.expect([plusBtn.exists(), Button({ icon: 'trash', disabled: true }).exists()]); }, @@ -150,9 +154,11 @@ export default { cy.expect([plusBtn.exists(), Button({ icon: 'trash', disabled: isDisabled }).exists()]); BulkEditSearchPane.isConfirmButtonDisabled(true); }, + deleteRow(rowIndex = 0) { cy.do(RepeatableFieldItem({ index: rowIndex }).find(deleteBtn).click()); }, + verifyAreYouSureForm(count, cellContent) { cy.expect([ areYouSureForm.find(HTML(including(`${count} records will be changed`))).exists(), @@ -1231,4 +1237,16 @@ export default { }), ); }, + + verifyActionsColumnIsNotPopulated() { + cy.expect(bulkEditsAccordion.find(Select({ dataTestID: 'select-actions-1' })).absent()); + }, + + verifyActionsSelectDropdownDisabled(rowIndex = 0, isDisabled = true) { + cy.expect( + RepeatableFieldItem({ index: rowIndex }) + .find(Select('Actions select')) + .has({ disabled: isDisabled }), + ); + }, }; diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js index a5888031e6..bb34818b85 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -681,6 +681,10 @@ export default { }); }, + verifyCheckboxInActionsDropdownMenuChecked(name, isChecked = true) { + cy.expect(DropdownMenu().find(Checkbox(name)).has({ checked: isChecked })); + }, + uncheckShowColumnCheckbox(...names) { names.forEach((name) => { cy.get(`[name='${name}']`).then((element) => { From d1ea1edbc91f7fb30f1d26329fd1c72d204dbc8f Mon Sep 17 00:00:00 2001 From: Sherzod-Kenjaev <114989418+Sherzod-Kenjaev@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:02:31 +0500 Subject: [PATCH 31/34] implemented test C496188 (#4150) --- ...e-of-publication-is-case-insensitive.cy.js | 121 ++++++++++++++++++ cypress/fixtures/marcBibFileForC496188.mrc | 1 + 2 files changed, 122 insertions(+) create mode 100644 cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-is-case-insensitive.cy.js create mode 100644 cypress/fixtures/marcBibFileForC496188.mrc diff --git a/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-is-case-insensitive.cy.js b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-is-case-insensitive.cy.js new file mode 100644 index 0000000000..c6a3e93079 --- /dev/null +++ b/cypress/e2e/inventory/search-in-select-instance-plugin/plug-in-search-by-place-of-publication-is-case-insensitive.cy.js @@ -0,0 +1,121 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import NewOrder from '../../../support/fragments/orders/newOrder'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import SelectInstanceModal from '../../../support/fragments/orders/modals/selectInstanceModal'; + +describe('Inventory', () => { + describe('Search in "Select instance" plugin', () => { + const testData = { + searchOption: ['Place of publication', 'All', 'Query search'], + searchValue: ['Milwaukee', 'milwaukee', 'MILWAUKEE'], + searchResults: [ + 'C496188 (lower case)Whales / Diane Swanson.', + 'C496188 (Regular case)Whales / Diane Swanson.', + 'C496188 (UPPER case)Whales / Diane Swanson.', + ], + }; + + const marcFile = { + marc: 'marcBibFileForC496188.mrc', + fileName: `testMarcFileC496188.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; + + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + manualPo: false, + }; + let orderNumber; + let orderID; + + const createdRecordIDs = []; + + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + + cy.createTempUser([ + Permissions.uiInventoryViewInstances.gui, + Permissions.uiOrdersCreate.gui, + ]).then((userProperties) => { + testData.user = userProperties; + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + + cy.login(testData.user.username, testData.user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.clickTitleLookUp(); + InventorySearchAndFilter.instanceTabIsDefault(); + }); + }); + + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + createdRecordIDs.forEach((id) => { + InventoryInstance.deleteInstanceViaApi(id); + }); + Users.deleteViaApi(testData.user.userId); + }); + + it( + 'C496188 Select Instance plugin | Search for Instance by "Place of publication" field is case insensitive (spitfire)', + { tags: ['criticalPath', 'spitfire'] }, + () => { + InventorySearchAndFilter.instanceTabIsDefault(); + + testData.searchOption.forEach((option) => { + testData.searchValue.forEach((value) => { + SelectInstanceModal.chooseSearchOption(option); + if (option === 'Query search') { + SelectInstanceModal.searchByName(`publication.place=${value}`); + } else { + SelectInstanceModal.searchByName(value); + } + InventorySearchAndFilter.verifySearchResultIncludingValue(testData.searchResult); + SelectInstanceModal.clickResetAllButton(); + SelectInstanceModal.checkDefaultSearchOptionSelected(); + SelectInstanceModal.checkTableContent(); + }); + }); + }, + ); + }); +}); diff --git a/cypress/fixtures/marcBibFileForC496188.mrc b/cypress/fixtures/marcBibFileForC496188.mrc new file mode 100644 index 0000000000..e19d857fcd --- /dev/null +++ b/cypress/fixtures/marcBibFileForC496188.mrc @@ -0,0 +1 @@ +01823cam 2200433 i 450000100090000000300060000900500170001501000130003201900140004502000150005902000180007403500380009204001130013004200090024304900090025205000240026108200140028509200200029910000760031924000840039524500510047925000180053026400460054826400100059430000510060433600270065533700290068233800280071138500260073949000370076550001320080250000200093452001010095450400590105565000880111465000120120265500650121480001100127938890744OCoLC20160926072514.0 a98006598 a731465887 a0836822161 a9780836822168 a(OCoLC)38890744z(OCoLC)731465887 aDLCbengerdacDLCdOCLdBAKERdBTCTAdKRVdOCLCQdYDXCPdOCLCOdOCLCFdP4IdOCLCOdOCLCAdOCLCQdOCLCOdMTU alcac aMTUM00aQL737.C4bS785 199800a599.5221 aJb599.5, S972w1 aSwanson, Diane,d1944-0https://id.loc.gov/authorities/names/n89623125.10aWelcome to the world of whales0https://id.loc.gov/authorities/names/n98024925.10aC496188 (Regular case)Whales /cDiane Swanson. aU.S. edition. 1aMilwaukee :bGareth Stevens Pub.,c[1998] 4c1998. a32 pages :bcolor illustrations ;c21 x 22 cm. atextbtxt2rdacontent. aunmediatedbn2rdamedia. avolumebnc2rdacarrier. nageaChildren2lcdgt.1 aWelcome to the world of animals. aOriginally published: Welcome to the world of whales. North Vancouver, B.C. : Whitecap Books, 1996. With additional end matter. aIncludes index. aDescribes the physical characteristics and behaviors of these large mammals which live in water. aIncludes bibliographical references page () and index. 0aWhalesvJuvenile literature.0https://id.loc.gov/authorities/subjects/sh2008113466. 1aWhales. 7aJuvenile works.2fast0https://id.worldcat.org/fast/1411637.1 aSwanson, Diane,d1944-tWelcome to the world of animals.0https://id.loc.gov/authorities/names/n98024588.01821cam 2200433 i 450000100090000000300060000900500170001501000130003201900140004502000150005902000180007403500380009204001130013004200090024304900090025205000240026108200140028509200200029910000760031924000840039524500490047925000180052826400460054626400100059230000510060233600270065333700290068033800280070938500260073749000370076350001320080050000200093252001010095250400590105365000880111265000120120065500650121280001100127738890744OCoLC20160926072514.0 a98006598 a731465887 a0836822161 a9780836822168 a(OCoLC)38890744z(OCoLC)731465887 aDLCbengerdacDLCdOCLdBAKERdBTCTAdKRVdOCLCQdYDXCPdOCLCOdOCLCFdP4IdOCLCOdOCLCAdOCLCQdOCLCOdMTU alcac aMTUM00aQL737.C4bS785 199800a599.5221 aJb599.5, S972w1 aSwanson, Diane,d1944-0https://id.loc.gov/authorities/names/n89623125.10aWelcome to the world of whales0https://id.loc.gov/authorities/names/n98024925.10aC496188 (lower case)Whales /cDiane Swanson. aU.S. edition. 1amilwaukee :bGareth Stevens Pub.,c[1998] 4c1998. a32 pages :bcolor illustrations ;c21 x 22 cm. atextbtxt2rdacontent. aunmediatedbn2rdamedia. avolumebnc2rdacarrier. nageaChildren2lcdgt.1 aWelcome to the world of animals. aOriginally published: Welcome to the world of whales. North Vancouver, B.C. : Whitecap Books, 1996. With additional end matter. aIncludes index. aDescribes the physical characteristics and behaviors of these large mammals which live in water. aIncludes bibliographical references page () and index. 0aWhalesvJuvenile literature.0https://id.loc.gov/authorities/subjects/sh2008113466. 1aWhales. 7aJuvenile works.2fast0https://id.worldcat.org/fast/1411637.1 aSwanson, Diane,d1944-tWelcome to the world of animals.0https://id.loc.gov/authorities/names/n98024588.01821cam 2200433 i 450000100090000000300060000900500170001501000130003201900140004502000150005902000180007403500380009204001130013004200090024304900090025205000240026108200140028509200200029910000760031924000840039524500490047925000180052826400460054626400100059230000510060233600270065333700290068033800280070938500260073749000370076350001320080050000200093252001010095250400590105365000880111265000120120065500650121280001100127738890744OCoLC20160926072514.0 a98006598 a731465887 a0836822161 a9780836822168 a(OCoLC)38890744z(OCoLC)731465887 aDLCbengerdacDLCdOCLdBAKERdBTCTAdKRVdOCLCQdYDXCPdOCLCOdOCLCFdP4IdOCLCOdOCLCAdOCLCQdOCLCOdMTU alcac aMTUM00aQL737.C4bS785 199800a599.5221 aJb599.5, S972w1 aSwanson, Diane,d1944-0https://id.loc.gov/authorities/names/n89623125.10aWelcome to the world of whales0https://id.loc.gov/authorities/names/n98024925.10aC496188 (UPPER case)Whales /cDiane Swanson. aU.S. edition. 1aMILWAUKEE :bGareth Stevens Pub.,c[1998] 4c1998. a32 pages :bcolor illustrations ;c21 x 22 cm. atextbtxt2rdacontent. aunmediatedbn2rdamedia. avolumebnc2rdacarrier. nageaChildren2lcdgt.1 aWelcome to the world of animals. aOriginally published: Welcome to the world of whales. North Vancouver, B.C. : Whitecap Books, 1996. With additional end matter. aIncludes index. aDescribes the physical characteristics and behaviors of these large mammals which live in water. aIncludes bibliographical references page () and index. 0aWhalesvJuvenile literature.0https://id.loc.gov/authorities/subjects/sh2008113466. 1aWhales. 7aJuvenile works.2fast0https://id.worldcat.org/fast/1411637.1 aSwanson, Diane,d1944-tWelcome to the world of animals.0https://id.loc.gov/authorities/names/n98024588. \ No newline at end of file From ae5b30159154ac27f2afb8d7c8e5a7a774eba76f Mon Sep 17 00:00:00 2001 From: IhorBohdan <99126301+IhorBohdan@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:46:32 +0300 Subject: [PATCH 32/34] Update tests after UIF-540 (#4112) * Fix extended tests Thunderjet * Rewrite big UI methods into one API * Update tests after UIF-540 * Fix Tests --------- Co-authored-by: bohdanihor --- .../e2e/finance/check-available-balance.cy.js | 6 +++--- ...ered-amount-exceeds-available-amount.cy.js | 4 ++-- ...allocation-result-in-negative-amount.cy.js | 12 ++++++++---- .../transfer-allocation-between-funds.cy.js | 16 ++++++++-------- .../groups/add-multiple-funds-to-group.cy.js | 3 ++- ...-when-approved-credit-invoice-exists.cy.js | 4 ++-- ...ctly-when-paid-credit-invoice-exists.cy.js | 2 +- ...ctly-then-paid-credit-invoice-exists.cy.js | 2 +- ...-when-approved-credit-invoice-exists.cy.js | 10 +++++++++- .../invoices-create-credit-invoice.cy.js | 7 ++++--- .../support/fragments/finance/funds/funds.js | 1 + .../fragments/finance/groups/groups.js | 1 + .../support/fragments/invoices/invoices.js | 19 +++++++++++-------- 13 files changed, 53 insertions(+), 34 deletions(-) diff --git a/cypress/e2e/finance/check-available-balance.cy.js b/cypress/e2e/finance/check-available-balance.cy.js index c3fbef3da4..7ae49eab1b 100644 --- a/cypress/e2e/finance/check-available-balance.cy.js +++ b/cypress/e2e/finance/check-available-balance.cy.js @@ -111,16 +111,16 @@ describe('Finance', () => { () => { FinanceHelp.searchByName(defaultFiscalYear.name); FiscalYears.selectFisacalYear(defaultFiscalYear.name); - FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + FiscalYears.checkAvailableBalance('$1,000.00', '($100.00)'); FiscalYears.clickOnLedgerTab(); FinanceHelp.searchByName(defaultLedger.name); Ledgers.selectLedger(defaultLedger.name); - FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + FiscalYears.checkAvailableBalance('$1,000.00', '($100.00)'); Ledgers.clickOnFundTab(); FinanceHelp.searchByName(defaultFund.name); Funds.selectFund(defaultFund.name); Funds.selectBudgetDetails(); - FiscalYears.checkAvailableBalance('$1,000.00', '-$100.00'); + FiscalYears.checkAvailableBalance('$1,000.00', '($100.00)'); }, ); }); diff --git a/cypress/e2e/finance/funds/correct-financial-summary-values-when-encumbered-amount-exceeds-available-amount.cy.js b/cypress/e2e/finance/funds/correct-financial-summary-values-when-encumbered-amount-exceeds-available-amount.cy.js index f03fefa18d..11c9723663 100644 --- a/cypress/e2e/finance/funds/correct-financial-summary-values-when-encumbered-amount-exceeds-available-amount.cy.js +++ b/cypress/e2e/finance/funds/correct-financial-summary-values-when-encumbered-amount-exceeds-available-amount.cy.js @@ -180,14 +180,14 @@ describe('Finance: Funds', () => { { key: 'Net transfers', value: '$0.00' }, { key: 'Total funding', value: '$500.00' }, { key: 'Encumbered', value: '$1,000.00' }, - { key: 'Awaiting payment', value: '-$100.00' }, + { key: 'Awaiting payment', value: '($100.00)' }, { key: 'Expended', value: '$0.00' }, { key: 'Credited', value: '$0.00' }, { key: 'Unavailable', value: '$900.00' }, { key: 'Over encumbrance', value: '$400.00' }, { key: 'Over expended', value: '$0.00' }, ], - balance: { cash: '$500.00', available: '-$400.00' }, + balance: { cash: '$500.00', available: '($400.00)' }, }); }, ); diff --git a/cypress/e2e/finance/funds/decrease-allocation-result-in-negative-amount.cy.js b/cypress/e2e/finance/funds/decrease-allocation-result-in-negative-amount.cy.js index 1d11ad724e..ca5c2467a4 100644 --- a/cypress/e2e/finance/funds/decrease-allocation-result-in-negative-amount.cy.js +++ b/cypress/e2e/finance/funds/decrease-allocation-result-in-negative-amount.cy.js @@ -74,16 +74,20 @@ describe('Finance', () => { BudgetDetails.checkBudgetDetails({ summary: [ { key: 'Decrease in allocation', value: '$10.00' }, - { key: 'Total allocated', value: '-$10.00' }, - { key: 'Total funding', value: '-$10.00' }, + { key: 'Total allocated', value: '($10.00)' }, + { key: 'Total funding', value: '($10.00)' }, ], - balance: { cash: '-$10.00', available: '-$10.00' }, + balance: { cash: '($10.00)', available: '($10.00)' }, }); // Close "Budget details" page by clicking "X" button BudgetDetails.closeBudgetDetails(); FundDetails.checkFundDetails({ - currentBudget: { name: testData.budget.name, allocated: '-$10.00', available: '-$10.00' }, + currentBudget: { + name: testData.budget.name, + allocated: '($10.00)', + available: '($10.00)', + }, }); }, ); diff --git a/cypress/e2e/finance/funds/transfer-allocation-between-funds.cy.js b/cypress/e2e/finance/funds/transfer-allocation-between-funds.cy.js index 9a5b0377e7..3d9073fdef 100644 --- a/cypress/e2e/finance/funds/transfer-allocation-between-funds.cy.js +++ b/cypress/e2e/finance/funds/transfer-allocation-between-funds.cy.js @@ -126,13 +126,13 @@ describe('Finance', () => { transferCreated: true, }); BudgetDetails.checkBudgetDetails({ - balance: { available: '-$40.00' }, + balance: { available: '($40.00)' }, }); // Close Budget details by clicking "X" button BudgetDetails.closeBudgetDetails(); FundDetails.checkFundDetails({ - currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '-$40.00' }, + currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '($40.00)' }, }); }, ); @@ -163,13 +163,13 @@ describe('Finance', () => { FinanceHelper.searchByName(funds.second.name); Funds.selectFund(funds.second.name); FundDetails.checkFundDetails({ - currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '-$10.00' }, + currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '($10.00)' }, }); // Click on the record in "Current budget" accordion const BudgetDetails = FundDetails.openCurrentBudgetDetails(); BudgetDetails.checkBudgetDetails({ - balance: { available: '-$10.00' }, + balance: { available: '($10.00)' }, }); // Click "Actions" button, Select "Transfer" option @@ -185,13 +185,13 @@ describe('Finance', () => { // Click "Confirm" button AddTransferModal.clickConfirmButton({ confirmNegative: { confirm: true } }); BudgetDetails.checkBudgetDetails({ - balance: { available: '-$30.00' }, + balance: { available: '($30.00)' }, }); // Close Budget details by clicking "X" button BudgetDetails.closeBudgetDetails(); FundDetails.checkFundDetails({ - currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '-$30.00' }, + currentBudget: { name: budgets.second.name, allocated: '$100.00', available: '($30.00)' }, }); }, ); @@ -303,13 +303,13 @@ describe('Finance', () => { // Click "Confirm" button AddTransferModal.clickConfirmButton({ confirmNegative: { confirm: true } }); BudgetDetails.checkBudgetDetails({ - balance: { available: '-$40.00' }, + balance: { available: '($40.00)' }, }); // Close Budget details by clicking "X" button BudgetDetails.closeBudgetDetails(); FundDetails.checkFundDetails({ - currentBudget: { name: budgets.second.name, allocated: '$0.00', available: '-$40.00' }, + currentBudget: { name: budgets.second.name, allocated: '$0.00', available: '($40.00)' }, }); }, ); diff --git a/cypress/e2e/finance/groups/add-multiple-funds-to-group.cy.js b/cypress/e2e/finance/groups/add-multiple-funds-to-group.cy.js index b2a5a3ce2f..dd13772cfb 100644 --- a/cypress/e2e/finance/groups/add-multiple-funds-to-group.cy.js +++ b/cypress/e2e/finance/groups/add-multiple-funds-to-group.cy.js @@ -75,12 +75,13 @@ describe('ui-finance: Groups', () => { }); after(() => { + cy.logout(); cy.loginAsAdmin({ path: TopMenu.fundPath, waiter: Funds.waitLoading }); FinanceHelp.searchByName(firstFund.name); Funds.selectFund(firstFund.name); Funds.selectBudgetDetails(); Funds.deleteBudgetViaActions(); - cy.visit(TopMenu.fundPath); + Funds.closeFundDetails(); FinanceHelp.searchByName(secondFund.name); Funds.selectFund(secondFund.name); Funds.selectBudgetDetails(); diff --git a/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js b/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js index 4a25e09b76..ec50c4e95c 100644 --- a/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js +++ b/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js @@ -277,14 +277,14 @@ describe('Finance: Transactions', () => { { key: 'Net transfers', value: '$10.00' }, { key: 'Total funding', value: '$110.00' }, { key: 'Encumbered', value: '$115.00' }, - { key: 'Awaiting payment', value: '-$15.00' }, + { key: 'Awaiting payment', value: '($15.00)' }, { key: 'Expended', value: '$20.00' }, { key: 'Credited', value: '$0.00' }, { key: 'Unavailable', value: '$120.00' }, { key: 'Over encumbrance', value: '$10.00' }, { key: 'Over expended', value: '$0.00' }, ], - balance: { cash: '$90.00', available: '-$10.00' }, + balance: { cash: '$90.00', available: '($10.00)' }, }); }, ); diff --git a/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-paid-credit-invoice-exists.cy.js b/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-paid-credit-invoice-exists.cy.js index 806de241ca..8070488ef2 100644 --- a/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-paid-credit-invoice-exists.cy.js +++ b/cypress/e2e/finance/transactions/restricted-encumbrances-are-calculated-correctly-when-paid-credit-invoice-exists.cy.js @@ -288,7 +288,7 @@ describe('Finance: Transactions', () => { { key: 'Over encumbrance', value: '$11.00' }, { key: 'Over expended', value: '$0.00' }, ], - balance: { cash: '$130.00', available: '-$11.00' }, + balance: { cash: '$130.00', available: '($11.00)' }, }); Funds.closeBudgetDetails(); FinanceHelp.clickFiscalYearButton(); diff --git a/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-then-paid-credit-invoice-exists.cy.js b/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-then-paid-credit-invoice-exists.cy.js index 155b52eec7..6860267f02 100644 --- a/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-then-paid-credit-invoice-exists.cy.js +++ b/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-then-paid-credit-invoice-exists.cy.js @@ -261,7 +261,7 @@ describe('Finance: Transactions', () => { { key: 'Over encumbrance', value: '$10.00' }, { key: 'Over expended', value: '$11.00' }, ], - balance: { cash: '$130.00', available: '-$21.00' }, + balance: { cash: '$130.00', available: '($21.00)' }, }); }, ); diff --git a/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js b/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js index aca5a1852f..3def925d92 100644 --- a/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js +++ b/cypress/e2e/finance/transactions/restricted-expenditures-are-calculated-correctly-when-approved-credit-invoice-exists.cy.js @@ -25,6 +25,7 @@ import FinanceHelp from '../../../support/fragments/finance/financeHelper'; import BudgetDetails from '../../../support/fragments/finance/budgets/budgetDetails'; import InvoiceLineDetails from '../../../support/fragments/invoices/invoiceLineDetails'; import InteractorsTools from '../../../support/utils/interactorsTools'; +import Approvals from '../../../support/fragments/settings/invoices/approvals'; describe('Finance: Transactions', () => { const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; @@ -76,12 +77,18 @@ describe('Finance: Transactions', () => { allowableExpenditure: 100, }; const organization = { ...NewOrganization.defaultUiOrganizations }; + const isApprovePayEnabled = false; let firstInvoice; let secondInvoice; let thirdInvoice; let user; let servicePointId; let location; + const setApprovePayValue = (isEnabled = false) => { + cy.getAdminToken().then(() => { + Approvals.setApprovePayValue(isEnabled); + }); + }; before(() => { cy.getAdminToken(); @@ -236,6 +243,7 @@ describe('Finance: Transactions', () => { path: TopMenu.invoicesPath, waiter: Invoices.waitLoading, }); + setApprovePayValue(isApprovePayEnabled); }); }); @@ -273,7 +281,7 @@ describe('Finance: Transactions', () => { { key: 'Over encumbrance', value: '$10.00' }, { key: 'Over expended', value: '$10.00' }, ], - balance: { cash: '$90.00', available: '-$20.00' }, + balance: { cash: '$90.00', available: '($20.00)' }, }); }, ); diff --git a/cypress/e2e/invoices/invoices-create-credit-invoice.cy.js b/cypress/e2e/invoices/invoices-create-credit-invoice.cy.js index b5a8ed50c9..0f894f4c03 100644 --- a/cypress/e2e/invoices/invoices-create-credit-invoice.cy.js +++ b/cypress/e2e/invoices/invoices-create-credit-invoice.cy.js @@ -10,6 +10,7 @@ import Organizations from '../../support/fragments/organizations/organizations'; import TopMenu from '../../support/fragments/topMenu'; import DateTools from '../../support/utils/dateTools'; import { Approvals } from '../../support/fragments/settings/invoices'; +import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; describe('Invoices', () => { const invoice = { ...NewInvoice.defaultUiInvoice }; @@ -51,7 +52,7 @@ describe('Invoices', () => { Approvals.setApprovePayValue(false); Invoices.approveInvoice(); // check transactions after approve - cy.visit(TopMenu.fundPath); + TopMenuNavigation.openAppFromDropdown('Finance'); Helper.searchByName(fund.name); Funds.selectFund(fund.name); Funds.openBudgetDetails(fund.code, DateTools.getCurrentFiscalYearCode()); @@ -62,13 +63,13 @@ describe('Invoices', () => { transactionFactory.create('pending', valueInTransactionTable, fund.code, '', 'Invoice', ''), ); // pay invoice - cy.visit(TopMenu.invoicesPath); + TopMenuNavigation.openAppFromDropdown('Invoices'); Invoices.searchByNumber(invoice.invoiceNumber); Invoices.selectInvoice(invoice.invoiceNumber); Approvals.setApprovePayValue(false); Invoices.payInvoice(); // check transactions after payment - cy.visit(TopMenu.fundPath); + TopMenuNavigation.openAppFromDropdown('Finance'); Helper.searchByName(fund.name); Funds.selectFund(fund.name); Funds.openBudgetDetails(fund.code, DateTools.getCurrentFiscalYearCode()); diff --git a/cypress/support/fragments/finance/funds/funds.js b/cypress/support/fragments/finance/funds/funds.js index 764e18e457..93c0b892ba 100644 --- a/cypress/support/fragments/finance/funds/funds.js +++ b/cypress/support/fragments/finance/funds/funds.js @@ -879,6 +879,7 @@ export default { }, selectBudgetDetails(rowNumber = 0) { + cy.wait(4000); cy.do(currentBudgetSection.find(MultiColumnListRow({ index: rowNumber })).click()); cy.expect(budgetPane.exists()); }, diff --git a/cypress/support/fragments/finance/groups/groups.js b/cypress/support/fragments/finance/groups/groups.js index 91b15ce4e3..2238fd4a0a 100644 --- a/cypress/support/fragments/finance/groups/groups.js +++ b/cypress/support/fragments/finance/groups/groups.js @@ -187,6 +187,7 @@ export default { }), selectGroup: (GroupName) => { + cy.wait(4000); cy.do(Section({ id: 'group-results-pane' }).find(Link(GroupName)).click()); }, diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index 3005293c02..787c4b876a 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -653,11 +653,15 @@ export default { Button('Add line from POL').click(), ]); cy.expect(Modal('Select order lines').exists()); + cy.wait(4000); cy.do([ Modal('Select order lines') .find(SearchField({ id: searchInputId })) .fillIn(orderNumber), Modal('Select order lines').find(searchButton).click(), + ]); + cy.wait(4000); + cy.do([ Checkbox({ ariaLabel: `record ${rowNumber} checkbox` }).clickInput(), Button('Save').click(), ]); @@ -974,14 +978,9 @@ export default { this.searchByNumber(invoiceNumber); this.selectInvoice(invoiceNumber); }, - selectInvoice: (invoiceNumber, rowIndex = 0) => { + selectInvoice: (invoiceNumber) => { cy.wait(4000); - cy.do( - invoiceResultsPane - .find(MultiColumnListRow({ index: rowIndex })) - .find(Link(invoiceNumber)) - .click(), - ); + cy.do(invoiceResultsPane.find(Link(invoiceNumber)).click()); }, checkVendorCodeInInvoicePane: (vendorCode) => { @@ -1112,7 +1111,11 @@ export default { .fillIn(organization.name), searchButton.click(), ]); - FinanceHelper.selectFromResultsList(); + cy.do( + Modal('Select Organization') + .find(MultiColumnListRow({ index: 0 })) + .click(), + ); }, selectApprovalDateFilter: (dateFrom, dateTo) => { From fbdd1668acbbf82b2f36981508ca1b00b3b822eb Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Mon, 2 Sep 2024 19:53:27 +0300 Subject: [PATCH 33/34] added a new test on title level request (FAT-15867) (#4154) --- ...uests-app-use-shared-facet-in-member.cy.js | 1 - .../requests/cancel-item-level-request.cy.js | 2 +- .../create-recall-item-level-request.cy.js | 2 +- .../requests/edit-item-level-request.cy.js | 2 +- .../requests/edit-title-level-request.cy.js | 2 +- .../find-requester-via-user-barcode.cy.js | 2 +- .../new-request-user-without-barcode.cy.js | 9 +- ...cannot-duplicate-cancellation-reason.cy.js | 9 +- ...tle-level-request-from-title-look-up.cy.js | 163 ++++++++++++++++++ ...uest-for-item-with-status-in-process.cy.js | 1 - .../search-requests-by-instance-ISBN.cy.js | 10 +- .../tlr-Item-renewable.cy.js | 1 - ...tem-level-request-from-instance-page.cy.js | 1 - ...te-title-level-request-from-user-app.cy.js | 1 - ...ail-for-title-request-hold-or-recall.cy.js | 1 - cypress/support/api/users.js | 7 +- .../support/fragments/requests/newRequest.js | 1 + .../fragments/requests/selectInstanceModal.js | 4 + 18 files changed, 183 insertions(+), 36 deletions(-) create mode 100644 cypress/e2e/title-level-request/place-title-level-request-from-title-look-up.cy.js diff --git a/cypress/e2e/consortia/inventory/search-in-inventory/title-look-up-plugin-in-requests-app-use-shared-facet-in-member.cy.js b/cypress/e2e/consortia/inventory/search-in-inventory/title-look-up-plugin-in-requests-app-use-shared-facet-in-member.cy.js index ca53955b3e..af7bb28221 100644 --- a/cypress/e2e/consortia/inventory/search-in-inventory/title-look-up-plugin-in-requests-app-use-shared-facet-in-member.cy.js +++ b/cypress/e2e/consortia/inventory/search-in-inventory/title-look-up-plugin-in-requests-app-use-shared-facet-in-member.cy.js @@ -161,7 +161,6 @@ describe('Inventory', () => { }); cy.setTenant(Affiliations.University); - TitleLevelRequests.disableTLRViaApi(); createdRecordsFromUniversity.forEach((instanceId) => { InventoryInstance.deleteInstanceViaApi(instanceId); }); diff --git a/cypress/e2e/requests/cancel-item-level-request.cy.js b/cypress/e2e/requests/cancel-item-level-request.cy.js index 53229dc612..94c7da8de0 100644 --- a/cypress/e2e/requests/cancel-item-level-request.cy.js +++ b/cypress/e2e/requests/cancel-item-level-request.cy.js @@ -100,7 +100,7 @@ describe('Cancel item level request', () => { userData.userId = userProperties.userId; userData.barcode = userProperties.barcode; userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData.patronGroup = userProperties.userGroup.group; userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; }) .then(() => { diff --git a/cypress/e2e/requests/create-recall-item-level-request.cy.js b/cypress/e2e/requests/create-recall-item-level-request.cy.js index d06ffbc408..ca547fba5b 100644 --- a/cypress/e2e/requests/create-recall-item-level-request.cy.js +++ b/cypress/e2e/requests/create-recall-item-level-request.cy.js @@ -81,7 +81,7 @@ describe('Create Recall Item level request', () => { userData.userId = userProperties.userId; userData.barcode = userProperties.barcode; userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData.patronGroup = userProperties.userGroup.group; userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; }) .then(() => { diff --git a/cypress/e2e/requests/edit-item-level-request.cy.js b/cypress/e2e/requests/edit-item-level-request.cy.js index 9d6e7b2620..783523ee5a 100644 --- a/cypress/e2e/requests/edit-item-level-request.cy.js +++ b/cypress/e2e/requests/edit-item-level-request.cy.js @@ -99,7 +99,7 @@ describe('Edit item level request', () => { userData.userId = userProperties.userId; userData.barcode = userProperties.barcode; userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData.patronGroup = userProperties.userGroup.group; userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; }) .then(() => { diff --git a/cypress/e2e/requests/edit-title-level-request.cy.js b/cypress/e2e/requests/edit-title-level-request.cy.js index 11891f2aec..59d00a9b03 100644 --- a/cypress/e2e/requests/edit-title-level-request.cy.js +++ b/cypress/e2e/requests/edit-title-level-request.cy.js @@ -95,7 +95,7 @@ describe('Title Level Request', () => { userData.userId = userProperties.userId; userData.barcode = userProperties.barcode; userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData.patronGroup = userProperties.userGroup.group; userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; }) .then(() => { diff --git a/cypress/e2e/requests/find-requester-via-user-barcode.cy.js b/cypress/e2e/requests/find-requester-via-user-barcode.cy.js index d5a499afa5..43b7e91d7f 100644 --- a/cypress/e2e/requests/find-requester-via-user-barcode.cy.js +++ b/cypress/e2e/requests/find-requester-via-user-barcode.cy.js @@ -81,7 +81,7 @@ describe('Find requester via user barcode', () => { userData.userId = userProperties.userId; userData.barcode = userProperties.barcode; userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData.patronGroup = userProperties.userGroup.group; userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; }) .then(() => { diff --git a/cypress/e2e/requests/new-request-user-without-barcode.cy.js b/cypress/e2e/requests/new-request-user-without-barcode.cy.js index c059a088c7..6efd138d40 100644 --- a/cypress/e2e/requests/new-request-user-without-barcode.cy.js +++ b/cypress/e2e/requests/new-request-user-without-barcode.cy.js @@ -14,7 +14,7 @@ import generateItemBarcode from '../../support/utils/generateItemBarcode'; import getRandomPostfix from '../../support/utils/stringTools'; describe('Choose requester without a barcode', () => { - const userData = {}; + let userData = {}; const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(); const itemData = { barcode: generateItemBarcode(), @@ -68,12 +68,7 @@ describe('Choose requester without a barcode', () => { .then(() => { cy.createTempUser([Permissions.uiRequestsAll.gui], null, 'staff', false) .then((userProperties) => { - userData.username = userProperties.username; - userData.password = userProperties.password; - userData.userId = userProperties.userId; - userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; - userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; + userData = userProperties; }) .then(() => { UserEdit.addServicePointsViaApi([servicePoint.id], userData.userId, servicePoint.id); diff --git a/cypress/e2e/settings/circulation/cannot-duplicate-cancellation-reason.cy.js b/cypress/e2e/settings/circulation/cannot-duplicate-cancellation-reason.cy.js index 257622ca32..75684306a0 100644 --- a/cypress/e2e/settings/circulation/cannot-duplicate-cancellation-reason.cy.js +++ b/cypress/e2e/settings/circulation/cannot-duplicate-cancellation-reason.cy.js @@ -5,7 +5,7 @@ import SettingsMenu from '../../../support/fragments/settingsMenu'; import Users from '../../../support/fragments/users/users'; describe('Cancel item level request', () => { - const userData = {}; + let userData = {}; const cancellationReason = { id: uuid(), name: uuid(), @@ -21,12 +21,7 @@ describe('Cancel item level request', () => { .then(() => { cy.createTempUser([Permissions.settingsCircView.gui]) .then((userProperties) => { - userData.username = userProperties.username; - userData.password = userProperties.password; - userData.userId = userProperties.userId; - userData.barcode = userProperties.barcode; - userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; + userData = userProperties; }) .then(() => { cy.login(userData.username, userData.password, { diff --git a/cypress/e2e/title-level-request/place-title-level-request-from-title-look-up.cy.js b/cypress/e2e/title-level-request/place-title-level-request-from-title-look-up.cy.js new file mode 100644 index 0000000000..d0fb9e089e --- /dev/null +++ b/cypress/e2e/title-level-request/place-title-level-request-from-title-look-up.cy.js @@ -0,0 +1,163 @@ +import { + FULFILMENT_PREFERENCES, + ITEM_STATUS_NAMES, + REQUEST_LEVELS, + REQUEST_TYPES, +} from '../../support/constants'; +import permissions from '../../support/dictionary/permissions'; +import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; +import EditRequest from '../../support/fragments/requests/edit-request'; +import NewRequest from '../../support/fragments/requests/newRequest'; +import RequestDetail from '../../support/fragments/requests/requestDetail'; +import Requests from '../../support/fragments/requests/requests'; +import SelectInstanceModal from '../../support/fragments/requests/selectInstanceModal'; +import TitleLevelRequests from '../../support/fragments/settings/circulation/titleLevelRequests'; +import Location from '../../support/fragments/settings/tenant/locations/newLocation'; +import ServicePoints from '../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import TopMenu from '../../support/fragments/topMenu'; +import UserEdit from '../../support/fragments/users/userEdit'; +import Users from '../../support/fragments/users/users'; +import generateItemBarcode from '../../support/utils/generateItemBarcode'; +import { getTestEntityValue } from '../../support/utils/stringTools'; + +describe('Title Level Request', () => { + let userData = {}; + const instanceData = { + title: getTestEntityValue('Instance'), + itemBarcode: generateItemBarcode(), + }; + const testData = { + userServicePoint: ServicePoints.getDefaultServicePointWithPickUpLocation(), + }; + before('Preconditions', () => { + cy.getAdminToken() + .then(() => { + ServicePoints.createViaApi(testData.userServicePoint); + testData.defaultLocation = Location.getDefaultLocation(testData.userServicePoint.id); + Location.createViaApi(testData.defaultLocation); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypes) => { + instanceData.instanceTypeId = instanceTypes[0].id; + }); + cy.getHoldingTypes({ limit: 1 }).then((holdingTypes) => { + instanceData.holdingTypeId = holdingTypes[0].id; + }); + cy.getLoanTypes({ limit: 1 }).then((res) => { + instanceData.loanTypeId = res[0].id; + }); + cy.getMaterialTypes({ limit: 1 }).then((materialTypes) => { + instanceData.materialTypeId = materialTypes.id; + }); + }) + .then(() => { + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId: instanceData.instanceTypeId, + title: instanceData.title, + }, + holdings: [ + { + holdingsTypeId: instanceData.holdingTypeId, + permanentLocationId: testData.defaultLocation.id, + }, + ], + items: [ + { + barcode: instanceData.itemBarcode, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + permanentLoanType: { id: instanceData.loanTypeId }, + materialType: { id: instanceData.materialTypeId }, + }, + ], + }).then((specialInstanceIds) => { + instanceData.instanceId = specialInstanceIds.instanceId; + }); + }); + + cy.createTempUser([ + permissions.uiRequestsView.gui, + permissions.uiRequestsCreate.gui, + permissions.uiRequestsAll.gui, + permissions.uiRequestsEdit.gui, + permissions.uiUsersView.gui, + permissions.inventoryAll.gui, + ]).then((userProperties) => { + userData = userProperties; + userData.patronGroup = userProperties.userGroup.group; + userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; + UserEdit.addServicePointViaApi( + testData.userServicePoint.id, + userData.userId, + testData.userServicePoint.id, + ); + cy.wait(3000); + cy.getInstance({ + limit: 1, + expandAll: true, + query: `"id"=="${instanceData.instanceId}"`, + }).then((instance) => { + instanceData.instanceHRID = instance.hrid; + }); + TitleLevelRequests.enableTLRViaApi(); + cy.login(userData.username, userData.password, { + path: TopMenu.requestsPath, + waiter: Requests.waitLoading, + }); + }); + }); + + after('Deleting created entities', () => { + cy.getAdminToken(); + Requests.getRequestApi({ query: `(instance.title=="${instanceData.title}")` }).then( + (requestResponse) => { + cy.wrap(requestResponse).each((request) => { + Requests.deleteRequestViaApi(request.id); + }); + }, + ); + InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(instanceData.itemBarcode); + UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.userServicePoint.id]); + ServicePoints.deleteViaApi(testData.userServicePoint.id); + Users.deleteViaApi(userData.userId); + Location.deleteInstitutionCampusLibraryLocationViaApi( + testData.defaultLocation.institutionId, + testData.defaultLocation.campusId, + testData.defaultLocation.libraryId, + testData.defaultLocation.id, + ); + }); + it( + 'C353599 C353600 Place title level request from title look-up (vega)', + { tags: ['extendedPath', 'vega'] }, + () => { + NewRequest.openNewRequestPane(); + NewRequest.waitLoadingNewRequestPage(); + NewRequest.enableTitleLevelRequest(); + NewRequest.openTitleLookUp(); + SelectInstanceModal.waitLoading(); + SelectInstanceModal.searchByTitle(instanceData.title); + SelectInstanceModal.selectTheFirstInstance(); + NewRequest.enterRequesterBarcode(userData.barcode); + NewRequest.verifyRequesterInformation(userData.username, userData.barcode); + NewRequest.chooseRequestType(REQUEST_TYPES.PAGE); + NewRequest.choosePickupServicePoint(testData.userServicePoint.name); + NewRequest.saveRequestAndClose(); + NewRequest.verifyRequestSuccessfullyCreated(userData.username); + RequestDetail.checkTitleInformation({ + TLRs: '1', + title: instanceData.title, + }); + RequestDetail.checkRequestInformation({ + type: REQUEST_TYPES.PAGE, + status: EditRequest.requestStatuses.NOT_YET_FILLED, + level: REQUEST_LEVELS.TITLE, + }); + RequestDetail.checkRequesterInformation({ + lastName: userData.fullName, + barcode: userData.barcode, + group: userData.patronGroup, + preference: FULFILMENT_PREFERENCES.HOLD_SHELF, + pickupSP: testData.userServicePoint.name, + }); + }, + ); +}); diff --git a/cypress/e2e/title-level-request/recall-request-for-item-with-status-in-process.cy.js b/cypress/e2e/title-level-request/recall-request-for-item-with-status-in-process.cy.js index c109d20de3..ec8554d00f 100644 --- a/cypress/e2e/title-level-request/recall-request-for-item-with-status-in-process.cy.js +++ b/cypress/e2e/title-level-request/recall-request-for-item-with-status-in-process.cy.js @@ -75,7 +75,6 @@ describe('Title level request', () => { UserEdit.changeServicePointPreferenceViaApi(userData.userId, [testData.servicePoint.id]); ServicePoints.deleteViaApi(testData.servicePoint.id); Users.deleteViaApi(userData.userId); - TitleLevelRequests.disableTLRViaApi(); }); it( diff --git a/cypress/e2e/title-level-request/search-requests-by-instance-ISBN.cy.js b/cypress/e2e/title-level-request/search-requests-by-instance-ISBN.cy.js index 6fd9b5fb87..8c08920f5a 100644 --- a/cypress/e2e/title-level-request/search-requests-by-instance-ISBN.cy.js +++ b/cypress/e2e/title-level-request/search-requests-by-instance-ISBN.cy.js @@ -18,7 +18,7 @@ import generateItemBarcode from '../../support/utils/generateItemBarcode'; import getRandomPostfix, { randomFourDigitNumber } from '../../support/utils/stringTools'; describe('Requests', () => { - const userData = {}; + let userData = {}; const servicePoint = ServicePoints.getDefaultServicePointWithPickUpLocation(); const itemData = { barcode: generateItemBarcode(), @@ -97,13 +97,7 @@ describe('Requests', () => { .then(() => { cy.createTempUser([Permissions.uiRequestsAll.gui]) .then((userProperties) => { - userData.username = userProperties.username; - userData.password = userProperties.password; - userData.userId = userProperties.userId; - userData.barcode = userProperties.barcode; - userData.firstName = userProperties.firstName; - userData.patronGroup = userProperties.patronGroup; - userData.fullName = `${userData.username}, ${Users.defaultUser.personal.firstName} ${Users.defaultUser.personal.middleName}`; + userData = userProperties; }) .then(() => { cy.wrap(true) diff --git a/cypress/e2e/title-level-request/tlr-Item-renewable.cy.js b/cypress/e2e/title-level-request/tlr-Item-renewable.cy.js index b5b2c0a918..2923c3c64d 100644 --- a/cypress/e2e/title-level-request/tlr-Item-renewable.cy.js +++ b/cypress/e2e/title-level-request/tlr-Item-renewable.cy.js @@ -246,7 +246,6 @@ describe('TLR: Item renew', () => { testData.defaultLocation.libraryId, testData.defaultLocation.id, ); - TitleLevelRequests.disableTLRViaApi(); }); afterEach('Deleting created entities', () => { diff --git a/cypress/e2e/title-level-request/user-can-create-item-level-request-from-instance-page.cy.js b/cypress/e2e/title-level-request/user-can-create-item-level-request-from-instance-page.cy.js index f21dff53b1..f1a0a6c88c 100644 --- a/cypress/e2e/title-level-request/user-can-create-item-level-request-from-instance-page.cy.js +++ b/cypress/e2e/title-level-request/user-can-create-item-level-request-from-instance-page.cy.js @@ -114,7 +114,6 @@ describe('Title Level Request. Create Item or Title level request', () => { testData.defaultLocation.libraryId, testData.defaultLocation.id, ); - TitleLevelRequests.disableTLRViaApi(); }); it( 'C347890 Check that user can create Item level request from instance page (vega) (TaaS)', diff --git a/cypress/e2e/title-level-request/user-can-create-title-level-request-from-user-app.cy.js b/cypress/e2e/title-level-request/user-can-create-title-level-request-from-user-app.cy.js index 56fc9cf684..954d8fac36 100644 --- a/cypress/e2e/title-level-request/user-can-create-title-level-request-from-user-app.cy.js +++ b/cypress/e2e/title-level-request/user-can-create-title-level-request-from-user-app.cy.js @@ -115,7 +115,6 @@ describe('Create Item or Title level request', () => { testData.defaultLocation.libraryId, testData.defaultLocation.id, ); - TitleLevelRequests.disableTLRViaApi(); }); it( 'C347888 Check that user can create Title level request from User app (use Actions) (vega) (Taas)', diff --git a/cypress/e2e/title-level-request/user-can-see-request-detail-for-title-request-hold-or-recall.cy.js b/cypress/e2e/title-level-request/user-can-see-request-detail-for-title-request-hold-or-recall.cy.js index f89598a7ab..96c036d276 100644 --- a/cypress/e2e/title-level-request/user-can-see-request-detail-for-title-request-hold-or-recall.cy.js +++ b/cypress/e2e/title-level-request/user-can-see-request-detail-for-title-request-hold-or-recall.cy.js @@ -216,7 +216,6 @@ describe('Request Detail. TLR', () => { testData.defaultLocation.libraryId, testData.defaultLocation.id, ); - TitleLevelRequests.disableTLRViaApi(); }); it( diff --git a/cypress/support/api/users.js b/cypress/support/api/users.js index 59cb55580d..ba39fb5fb0 100644 --- a/cypress/support/api/users.js +++ b/cypress/support/api/users.js @@ -46,7 +46,7 @@ Cypress.Commands.add('getFirstUserGroupId', (searchParams, patronGroupName) => { userGroupIdx = response.body.usergroups.findIndex(({ group }) => group === patronGroupName) || 0; } - return response.body.usergroups[userGroupIdx].id; + return response.body.usergroups[userGroupIdx]; }); }); @@ -86,7 +86,7 @@ Cypress.Commands.add( } cy.getFirstUserGroupId({ limit: patronGroupName ? 100 : 1 }, patronGroupName).then( - (userGroupdId) => { + (userGroup) => { const queryField = 'displayName'; cy.getPermissionsApi({ query: `(${queryField}=="${permissions.join(`")or(${queryField}=="`)}"))"`, @@ -96,7 +96,7 @@ Cypress.Commands.add( // cy.log('internalPermissions=' + [...permissionsResponse.body.permissions.map(permission => permission.permissionName)]); const userBody = { ...Users.defaultUser, - patronGroup: userGroupdId, + patronGroup: userGroup.id, type: userType, username: userProperties.username, personal: { ...Users.defaultUser.personal, lastName: userProperties.username }, @@ -129,6 +129,7 @@ Cypress.Commands.add( ), ], }); + userProperties.userGroup = userGroup; cy.overrideLocalSettings(userProperties.userId); cy.wrap(userProperties).as('userProperties'); }); diff --git a/cypress/support/fragments/requests/newRequest.js b/cypress/support/fragments/requests/newRequest.js index fdb0b4bc3e..5e43af7cbd 100644 --- a/cypress/support/fragments/requests/newRequest.js +++ b/cypress/support/fragments/requests/newRequest.js @@ -142,6 +142,7 @@ export default { // need to synchronize actions before click cy.wait(3000); cy.do(titleLevelRequest.click()); + cy.wait(2000); }, waitLoadingNewRequestPage(TLR = false) { diff --git a/cypress/support/fragments/requests/selectInstanceModal.js b/cypress/support/fragments/requests/selectInstanceModal.js index 8457f0a5a1..61113d5c35 100644 --- a/cypress/support/fragments/requests/selectInstanceModal.js +++ b/cypress/support/fragments/requests/selectInstanceModal.js @@ -47,6 +47,10 @@ export default { cy.expect(selectInstanceModal.find(MultiColumnList()).has({ rowCount: 1 })); }, + selectTheFirstInstance() { + cy.do(selectInstanceModal.find(MultiColumnListRow({ index: 0 })).click()); + }, + fillInSearchField(title) { cy.do([selectInstanceModal.find(searchField).fillIn(title)]); }, From 175b9ec60fd31fe20b793e01503ed6ca81bffc88 Mon Sep 17 00:00:00 2001 From: Ostap Voitsekhovskyi Date: Tue, 3 Sep 2024 07:27:05 +0300 Subject: [PATCH 34/34] new logic for collecting failed tests from TestRail (#4151) * new logic for collecting failed tests from TestRail * old version of glob --- collect-failed-tests.js | 122 ++++++++++++++++++++++++++++++++++++++++ package.json | 3 + 2 files changed, 125 insertions(+) create mode 100644 collect-failed-tests.js diff --git a/collect-failed-tests.js b/collect-failed-tests.js new file mode 100644 index 0000000000..afceff5ff2 --- /dev/null +++ b/collect-failed-tests.js @@ -0,0 +1,122 @@ +/* eslint-disable no-console */ +const { glob } = require('glob'); +const fs = require('fs'); +const { getTestNames } = require('find-test-names'); +const axios = require('axios'); + +const status = { + Passed: 1, + Blocked: 2, + Untested: 3, + Retest: 4, + Failed: 5, +}; + +const team = { + Firebird: 3, + Folijet: 4, + Spitfire: 6, + Thunderjet: 8, + Vega: 9, + Volaris: 13, + Corsair: 19, +}; + +const selectedStatus = [status.Failed]; +const selectedTeams = [team.Thunderjet, team.Folijet]; + +const testUsername = ''; +const testPassword = ''; +const runId = 2581; + +const ids = []; +const arrayOfFiles = []; +const filteredFiles = []; + +function getTest(offsetToPass) { + return axios({ + method: 'get', + url: `https://foliotest.testrail.io/index.php?/api/v2/get_tests/${runId}`, + headers: { 'Content-Type': 'application/json' }, + params: { offset: offsetToPass }, + auth: { + username: testUsername, + password: testPassword, + }, + }).then((response) => { + console.log(`GET /tests (offset: ${offsetToPass}, length: ${response.data.tests.length})`); + return response.data.tests; + }); +} + +async function getTests() { + const tests = []; + let offset = 0; + let testsFromResponse = 0; + do { + testsFromResponse = await getTest(offset); + tests.push(...testsFromResponse); + offset += 250; + } while (testsFromResponse.length === 250); + return tests; +} + +function removeRootPath(path) { + return path.substring(path.indexOf('cypress\\e2e\\')); +} + +function titleContainsId(title, testCaseIds) { + if (title === undefined) { + return false; + } + for (let i = 0; i < testCaseIds.length; i++) { + if (title.includes(testCaseIds[i])) { + return true; + } + } + return false; +} + +function parseCommand() { + getTests() + .then((tests) => { + console.log(`Number of all tests in the #${runId} run: ${tests.length}\n`); + tests.forEach((test) => { + if ( + selectedStatus.includes(test.status_id) && + selectedTeams.includes(test.custom_dev_team) + ) { + ids.push('C' + test.case_id); + } + }); + }) + .then(() => { + glob('cypress/e2e/**/*') + .then((res) => { + res.forEach((file) => { + if (file.includes('.cy.js')) { + arrayOfFiles.push(removeRootPath(file).replace(/\\/g, '/')); + } + }); + }) + .then(() => { + arrayOfFiles.forEach((file) => { + const text = fs.readFileSync(file, { encoding: 'utf8' }); + const names = getTestNames(text); + names.tests.forEach((test) => { + if (test.type === 'test' && titleContainsId(test.name, ids)) { + filteredFiles.push(file); + } + }); + }); + filteredFiles.sort(); + }) + .then(() => { + console.log(`Number of filtered tests: ${filteredFiles.length}\n`); + const parsedCommand = `--spec "${filteredFiles.join(',')}"`; + console.log(parsedCommand); + }); + }); +} + +parseCommand(); diff --git a/package.json b/package.json index 2eaf2b91a5..a987a16926 100644 --- a/package.json +++ b/package.json @@ -36,12 +36,15 @@ "@interactors/html": "^1.0.0-rc1.4", "@interactors/keyboard": "^1.0.0-rc1.5", "axe-core": "4.3.3", + "axios": "^1.7.7", "cypress": "12.0.0", "cypress-cloud": "^1.9.6", "cypress-testrail-simple": "^3.1.0", "date-fns": "^2.16.1", "debug": "^4.0.1", "element-is-visible": "^1.0.0", + "find-test-names": "^1.28.28", + "glob": "^10.4.5", "moment": "^2.29.3" }, "devDependencies": {