Skip to content

Commit 6bfcdc8

Browse files
authored
FAT-27419-pt1: tests added (#7462)
* FAT-27419-pt1: tests added * Promin minor updates
1 parent 7eb3dc2 commit 6bfcdc8

13 files changed

Lines changed: 963 additions & 7 deletions

cypress/e2e/data-export/auth-records-export/export-authority-records-additional-types-of-headings.cy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ describe('Data Export', () => {
9393
});
9494
})
9595
.then(() => {
96+
// reset to default (if more records than slice size, they will be split in several files)
97+
cy.configureDataExportFileLimit('slice_size', 10_000);
98+
9699
cy.login(user.username, user.password, {
97100
path: TopMenu.marcAuthorities,
98101
waiter: MarcAuthorities.waitLoading,

cypress/e2e/data-import/importing-marc-bib-files/mrc-import-with-999-field-and-without.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('Data Import', () => {
2020
const jobProfileToRun = DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS;
2121
const instanceTitle = 'Mistapim in Cambodia [microform]. Photos. by the author.';
2222
const error =
23-
'org.folio.processing.exceptions.EventProcessingException: A new Instance was not created because the incoming record already contains a 999ff$s or 999ff$i field';
23+
'A new Instance was not created because the incoming record already contained a 999ff$s or 999ff$i field';
2424
const nameMarcFileForCreate = `C359012 autotestFile${getRandomPostfix()}.mrc`;
2525

2626
before('Create test user and login', () => {
@@ -75,7 +75,7 @@ describe('Data Import', () => {
7575
RECORD_STATUSES.ERROR,
7676
FileDetails.columnNameInResultList.error,
7777
);
78-
FileDetails.openJsonScreen('The Journal of ecclesiastical history.');
78+
FileDetails.openJsonScreen('No content');
7979
JsonScreenView.verifyJsonScreenIsOpened();
8080
JsonScreenView.verifyContentInTab(error);
8181
},
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
import { Permissions } from '../../../support/dictionary';
2+
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
3+
import InventoryInstances, {
4+
searchInstancesOptions,
5+
} from '../../../support/fragments/inventory/inventoryInstances';
6+
import BrowseSubjects from '../../../support/fragments/inventory/search/browseSubjects';
7+
import QuickMarcEditor from '../../../support/fragments/quickMarcEditor';
8+
import TopMenu from '../../../support/fragments/topMenu';
9+
import Users from '../../../support/fragments/users/users';
10+
import getRandomPostfix from '../../../support/utils/stringTools';
11+
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
12+
13+
describe('Inventory', () => {
14+
describe('Subject Browse', () => {
15+
const randomPostfix = getRandomPostfix();
16+
const subjectValue = `AT_C584543_TopicalTerm_${randomPostfix}`;
17+
const lcshSource = 'Library of Congress Subject Headings';
18+
const meshSource = 'Medical Subject Headings';
19+
const topicalTermType = 'Topical term';
20+
const keywordSearchOption = searchInstancesOptions[0]; // Keyword
21+
const precedingSubjectPrefix = 'AT_C584543_PrecedingSubject_';
22+
23+
const testData = {
24+
user: {},
25+
instanceId1: null,
26+
instanceId2: null,
27+
};
28+
29+
const marcBibFields1 = [
30+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
31+
{
32+
tag: '245',
33+
content: `$a AT_C584543_MarcBibInstance_1_${randomPostfix}`,
34+
indicators: ['1', '1'],
35+
},
36+
// 2nd indicator 0 = Library of Congress Subject Headings; tag 650 = Topical term
37+
{ tag: '650', content: `$a ${subjectValue}`, indicators: ['\\', '0'] },
38+
// preceding subjects to make sure target subject is on line 6
39+
{ tag: '600', content: `$a ${precedingSubjectPrefix}1`, indicators: ['\\', '0'] },
40+
{ tag: '600', content: `$a ${precedingSubjectPrefix}2`, indicators: ['\\', '0'] },
41+
{ tag: '600', content: `$a ${precedingSubjectPrefix}3`, indicators: ['\\', '0'] },
42+
{ tag: '600', content: `$a ${precedingSubjectPrefix}4`, indicators: ['\\', '0'] },
43+
{ tag: '600', content: `$a ${precedingSubjectPrefix}5`, indicators: ['\\', '0'] },
44+
];
45+
46+
const marcBibFields2 = [
47+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
48+
{
49+
tag: '245',
50+
content: `$a AT_C584543_MarcBibInstance_2_${randomPostfix}`,
51+
indicators: ['1', '1'],
52+
},
53+
// 2nd indicator 2 = Medical Subject Headings; tag 650 = Topical term
54+
{ tag: '650', content: `$a ${subjectValue}`, indicators: ['\\', '2'] },
55+
];
56+
57+
before('Create test data and login', () => {
58+
cy.getAdminToken();
59+
InventoryInstances.deleteInstanceByTitleViaApi('C584543_');
60+
cy.then(() => {
61+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields1).then(
62+
(instanceId) => {
63+
testData.instanceId1 = instanceId;
64+
},
65+
);
66+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields2).then(
67+
(instanceId) => {
68+
testData.instanceId2 = instanceId;
69+
},
70+
);
71+
}).then(() => {
72+
cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => {
73+
testData.user = userProperties;
74+
cy.login(testData.user.username, testData.user.password, {
75+
path: TopMenu.inventoryPath,
76+
waiter: InventoryInstances.waitContentLoading,
77+
});
78+
});
79+
});
80+
});
81+
82+
after('Delete test data', () => {
83+
cy.getAdminToken();
84+
Users.deleteViaApi(testData.user.userId);
85+
InventoryInstance.deleteInstanceViaApi(testData.instanceId1);
86+
InventoryInstance.deleteInstanceViaApi(testData.instanceId2);
87+
});
88+
89+
it(
90+
'C584543 Browsing the instance with different subject sources (folijet)',
91+
{ tags: ['extendedPath', 'folijet', 'C584543'] },
92+
() => {
93+
// Step 1-3: Navigate to Inventory, switch to Browse, select Subject option
94+
InventorySearchAndFilter.validateSearchTabIsDefault();
95+
InventorySearchAndFilter.instanceTabIsDefault();
96+
InventorySearchAndFilter.verifyDefaultSearchOptionSelected(keywordSearchOption);
97+
BrowseSubjects.waitForSubjectToAppear(subjectValue, { quantity: 2 });
98+
for (let i = 1; i <= 5; i++) {
99+
BrowseSubjects.waitForSubjectToAppear(`${precedingSubjectPrefix}${i}`);
100+
}
101+
102+
// Step 4: Search by subject value; verify 2 rows with same Subject/type but different sources
103+
InventorySearchAndFilter.switchToBrowseTab();
104+
InventorySearchAndFilter.validateBrowseToggleIsSelected();
105+
InventorySearchAndFilter.verifyKeywordsAsDefault();
106+
BrowseSubjects.select();
107+
BrowseSubjects.browse(subjectValue);
108+
BrowseSubjects.checkValueIsBold(subjectValue);
109+
BrowseSubjects.verifyDuplicateSubjectsWithDifferentSources({
110+
name: subjectValue,
111+
source: lcshSource,
112+
type: topicalTermType,
113+
});
114+
BrowseSubjects.verifyDuplicateSubjectsWithDifferentSources({
115+
name: subjectValue,
116+
source: meshSource,
117+
type: topicalTermType,
118+
});
119+
},
120+
);
121+
});
122+
});
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import { Permissions } from '../../../support/dictionary';
2+
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
3+
import InventoryInstances, {
4+
searchInstancesOptions,
5+
} from '../../../support/fragments/inventory/inventoryInstances';
6+
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
7+
import BrowseSubjects from '../../../support/fragments/inventory/search/browseSubjects';
8+
import QuickMarcEditor from '../../../support/fragments/quickMarcEditor';
9+
import TopMenu from '../../../support/fragments/topMenu';
10+
import Users from '../../../support/fragments/users/users';
11+
import getRandomPostfix from '../../../support/utils/stringTools';
12+
import { FOLIO_SUBJECT_TYPES } from '../../../support/fragments/settings/inventory/instances/subjectTypes';
13+
import { FOLIO_SUBJECT_SOURCES } from '../../../support/fragments/settings/inventory/instances/subjectSources';
14+
15+
describe('Inventory', () => {
16+
describe('Subject Browse', () => {
17+
const randomPostfix = getRandomPostfix();
18+
const subjectValue = `AT_C584544_Subject_${randomPostfix}`;
19+
const lcshSource = FOLIO_SUBJECT_SOURCES[0];
20+
const topicalTermType = FOLIO_SUBJECT_TYPES[6]; // Topical term
21+
const geographicNameType = FOLIO_SUBJECT_TYPES[7]; // Geographic name
22+
const keywordSearchOption = searchInstancesOptions[0];
23+
24+
const testData = {
25+
user: {},
26+
instanceId1: null,
27+
instanceId2: null,
28+
};
29+
30+
const marcBibFields1 = [
31+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
32+
{
33+
tag: '245',
34+
content: `$a AT_C584544_MarcBibInstance_1_${randomPostfix}`,
35+
indicators: ['1', '1'],
36+
},
37+
// 2nd indicator 0 = Library of Congress Subject Headings; tag 650 = Topical term
38+
{ tag: '650', content: `$a ${subjectValue}`, indicators: ['\\', '0'] },
39+
];
40+
41+
const marcBibFields2 = [
42+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
43+
{
44+
tag: '245',
45+
content: `$a AT_C584544_MarcBibInstance_2_${randomPostfix}`,
46+
indicators: ['1', '1'],
47+
},
48+
// 2nd indicator 0 = Library of Congress Subject Headings; tag 651 = Geographic name
49+
{ tag: '651', content: `$a ${subjectValue}`, indicators: ['\\', '0'] },
50+
];
51+
52+
before('Create test data and login', () => {
53+
cy.getAdminToken();
54+
InventoryInstances.deleteInstanceByTitleViaApi('C584544_');
55+
cy.then(() => {
56+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields1).then(
57+
(instanceId) => {
58+
testData.instanceId1 = instanceId;
59+
},
60+
);
61+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields2).then(
62+
(instanceId) => {
63+
testData.instanceId2 = instanceId;
64+
},
65+
);
66+
}).then(() => {
67+
cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => {
68+
testData.user = userProperties;
69+
cy.login(testData.user.username, testData.user.password, {
70+
path: TopMenu.inventoryPath,
71+
waiter: InventoryInstances.waitContentLoading,
72+
});
73+
});
74+
});
75+
});
76+
77+
after('Delete test data', () => {
78+
cy.getAdminToken();
79+
Users.deleteViaApi(testData.user.userId);
80+
InventoryInstance.deleteInstanceViaApi(testData.instanceId1);
81+
InventoryInstance.deleteInstanceViaApi(testData.instanceId2);
82+
});
83+
84+
it(
85+
'C584544 Browsing the instance with different subject types (folijet)',
86+
{ tags: ['extendedPath', 'folijet', 'C584544'] },
87+
() => {
88+
// Step 1: Navigate to Inventory; verify Search tab, Instance tab, and Keyword option are defaults
89+
InventorySearchAndFilter.validateSearchTabIsDefault();
90+
InventorySearchAndFilter.instanceTabIsDefault();
91+
InventorySearchAndFilter.verifyDefaultSearchOptionSelected(keywordSearchOption);
92+
BrowseSubjects.waitForSubjectToAppear(subjectValue, { quantity: 2 });
93+
94+
// Step 2: Select Browse toggle; verify browse landing page and disabled buttons
95+
InventorySearchAndFilter.switchToBrowseTab();
96+
InventorySearchAndFilter.validateBrowseToggleIsSelected();
97+
InventorySearchAndFilter.verifyKeywordsAsDefault();
98+
99+
// Step 3: Select Subject in browse option
100+
BrowseSubjects.select();
101+
102+
// Step 4: Browse by subject value; verify 2 rows with same Subject/source but different types
103+
BrowseSubjects.browse(subjectValue);
104+
BrowseSubjects.checkValueIsBold(subjectValue);
105+
BrowseSubjects.checkResultsWithSameSubject(subjectValue, 2, {
106+
subjectSourceValues: [lcshSource, lcshSource],
107+
subjectTypeValues: [geographicNameType, topicalTermType],
108+
numberOfTitlesValues: [1, 1],
109+
});
110+
},
111+
);
112+
});
113+
});
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import { Permissions } from '../../../support/dictionary';
2+
import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance';
3+
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances';
4+
import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter';
5+
import BrowseSubjects from '../../../support/fragments/inventory/search/browseSubjects';
6+
import QuickMarcEditor from '../../../support/fragments/quickMarcEditor';
7+
import { FOLIO_SUBJECT_SOURCES } from '../../../support/fragments/settings/inventory/instances/subjectSources';
8+
import { FOLIO_SUBJECT_TYPES } from '../../../support/fragments/settings/inventory/instances/subjectTypes';
9+
import TopMenu from '../../../support/fragments/topMenu';
10+
import Users from '../../../support/fragments/users/users';
11+
import getRandomPostfix from '../../../support/utils/stringTools';
12+
import { or } from '../../../../interactors';
13+
14+
describe('Inventory', () => {
15+
describe('Subject Browse', () => {
16+
const randomPostfix = getRandomPostfix();
17+
const subjectValue = `AT_C584545_Subject_${randomPostfix}`;
18+
const lcshSource = FOLIO_SUBJECT_SOURCES[0];
19+
const topicalTermType = FOLIO_SUBJECT_TYPES[6];
20+
const geographicNameType = FOLIO_SUBJECT_TYPES[7];
21+
22+
const testData = {
23+
user: {},
24+
instanceId1: null,
25+
instanceId2: null,
26+
};
27+
28+
const marcBibFields1 = [
29+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
30+
{
31+
tag: '245',
32+
content: `$a AT_C584545_MarcBibInstance_1_${randomPostfix}`,
33+
indicators: ['1', '1'],
34+
},
35+
// 2nd indicator 0 = Library of Congress Subject Headings; tag 650 = Topical term
36+
{ tag: '650', content: `$a ${subjectValue}`, indicators: ['\\', '0'] },
37+
];
38+
39+
const marcBibFields2 = [
40+
{ tag: '008', content: QuickMarcEditor.defaultValid008Values },
41+
{
42+
tag: '245',
43+
content: `$a AT_C584545_MarcBibInstance_2_${randomPostfix}`,
44+
indicators: ['1', '1'],
45+
},
46+
// 2nd indicator 0 = Library of Congress Subject Headings; tag 651 = Geographic name
47+
{ tag: '651', content: `$a ${subjectValue}`, indicators: ['\\', '0'] },
48+
];
49+
50+
before('Create test data and login', () => {
51+
cy.getAdminToken();
52+
InventoryInstances.deleteInstanceByTitleViaApi('C584545_');
53+
cy.then(() => {
54+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields1).then(
55+
(instanceId) => {
56+
testData.instanceId1 = instanceId;
57+
},
58+
);
59+
cy.createMarcBibliographicViaAPI(QuickMarcEditor.defaultValidLdr, marcBibFields2).then(
60+
(instanceId) => {
61+
testData.instanceId2 = instanceId;
62+
},
63+
);
64+
}).then(() => {
65+
cy.createTempUser([Permissions.inventoryAll.gui]).then((userProperties) => {
66+
testData.user = userProperties;
67+
cy.login(testData.user.username, testData.user.password, {
68+
path: TopMenu.inventoryPath,
69+
waiter: InventoryInstances.waitContentLoading,
70+
});
71+
});
72+
});
73+
});
74+
75+
after('Delete test data', () => {
76+
cy.getAdminToken();
77+
Users.deleteViaApi(testData.user.userId);
78+
InventoryInstance.deleteInstanceViaApi(testData.instanceId1);
79+
InventoryInstance.deleteInstanceViaApi(testData.instanceId2);
80+
});
81+
82+
it(
83+
'C584545 Browsing the multiple instances with different subject types (folijet)',
84+
{ tags: ['extendedPath', 'folijet', 'C584545'] },
85+
() => {
86+
BrowseSubjects.waitForSubjectToAppear(subjectValue, { quantity: 2 });
87+
88+
// Step 1: Browse by subject value; verify 2 rows with same Subject/source but different types
89+
BrowseSubjects.searchBrowseSubjects(subjectValue);
90+
BrowseSubjects.checkValueIsBold(subjectValue);
91+
BrowseSubjects.checkResultsWithSameSubject(subjectValue, 2, {
92+
subjectSourceValues: [lcshSource, lcshSource],
93+
subjectTypeValues: [geographicNameType, topicalTermType],
94+
numberOfTitlesValues: [1, 1],
95+
});
96+
97+
// Step 2: Click hyperlink on any subject row; verify instances list shown
98+
BrowseSubjects.openInstance({ name: subjectValue });
99+
InventorySearchAndFilter.waitLoading();
100+
InventoryInstances.waitLoading();
101+
102+
// Step 3: Select first instance; verify Subject accordion shows correct subject data
103+
InventoryInstances.selectInstance(0);
104+
InventoryInstance.waitLoading();
105+
InventoryInstance.waitInstanceRecordViewOpened();
106+
InventoryInstance.openSubjectAccordion();
107+
InventoryInstance.verifyInstanceSubject(0, 0, subjectValue);
108+
InventoryInstance.verifyInstanceSubject(0, 1, lcshSource);
109+
InventoryInstance.verifyInstanceSubject(0, 2, or(geographicNameType, topicalTermType));
110+
},
111+
);
112+
});
113+
});

0 commit comments

Comments
 (0)