Skip to content

Commit

Permalink
added waiter (#3600)
Browse files Browse the repository at this point in the history
* added waiter

* fixed ECS tests

* fixed tests
  • Loading branch information
TetianaParanich committed May 9, 2024
1 parent c0e0bd1 commit 35a1b4c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 20 deletions.
Expand Up @@ -39,7 +39,7 @@ describe('Inventory', () => {
testData.instanceId = response[0].instance.id;

InventoryInstance.shareInstanceViaApi(
testData.response[0].instance.id,
testData.instanceId,
testData.consortiaId,
Affiliations.College,
Affiliations.Consortia,
Expand All @@ -51,7 +51,7 @@ describe('Inventory', () => {
Locations.createViaApi(collegeLocationData).then((location) => {
testData.collegeLocation = location;
InventoryHoldings.createHoldingRecordViaApi({
instanceId: testData.instanceIds[0],
instanceId: testData.instanceId,
permanentLocationId: testData.collegeLocation.id,
}).then((holding) => {
testData.holding = holding;
Expand Down Expand Up @@ -90,7 +90,6 @@ describe('Inventory', () => {
InventoryHoldings.deleteHoldingRecordViaApi(testData.holding.id);
Locations.deleteViaApi(testData.collegeLocation);
InventoryInstance.deleteInstanceViaApi(testData.instanceId);
InventoryInstance.deleteInstanceViaApi(testData.instanceId);
});

it(
Expand Down
Expand Up @@ -31,6 +31,11 @@ describe('Inventory', () => {
cy.createTempUser([Permissions.uiInventoryViewCreateEditInstances.gui]).then(
(userProperties) => {
testData.user = userProperties;

cy.login(testData.user.username, testData.user.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});
},
);
});
Expand All @@ -48,19 +53,17 @@ describe('Inventory', () => {
'C404355 (CONSORTIA) Verify the header of a shared Instance on edit page for the Central tenant (consortia) (folijet)',
{ tags: ['extendedPathECS', 'folijet'] },
() => {
cy.login(testData.user.username, testData.user.password, {
path: TopMenu.inventoryPath,
waiter: InventoryInstances.waitContentLoading,
});

cy.wait(5000);
InventoryInstances.searchByTitle(testData.instance.instanceTitle);
InventoryInstances.selectInstance();
InventoryInstance.waitLoading();

InstanceRecordView.edit();
InstanceRecordEdit.waitLoading();

InstanceRecordEdit.checkInstanceHeader(` Edit shared instance • ${testData.instance.instanceTitle}`);
InstanceRecordEdit.checkInstanceHeader(
` Edit shared instance • ${testData.instance.instanceTitle}`,
);
},
);
});
Expand Down
Expand Up @@ -109,6 +109,7 @@ describe('Inventory', () => {
'C423392 (CONSORTIA) User can see the the name of locations from Member tenant when he is on the second Member tenant (consortia) (folijet)',
{ tags: ['criticalPathECS', 'folijet'] },
() => {
cy.wait(5000);
InventoryInstances.searchByTitle(testData.instanceTitle);
InventoryInstances.selectInstance();
InventoryInstance.verifyConsortiaHoldingsAccordion();
Expand Down
Expand Up @@ -61,6 +61,7 @@ describe('Data Import', () => {
physicalUnitPrice: '"20"',
quantityPhysical: '"1"',
currency: 'USD',
materialType: MATERIAL_TYPE_NAMES.BOOK,
locationName: `"${LOCATION_NAMES.ANNEX}"`,
locationQuantityPhysical: '"1"',
},
Expand All @@ -84,7 +85,7 @@ describe('Data Import', () => {
mappingProfile: {
typeValue: FOLIO_RECORD_TYPE.ITEM,
name: `C380474 Create simple item for open order ${getRandomPostfix()}`,
materialType: `"${MATERIAL_TYPE_NAMES.ELECTRONIC_RESOURCE}"`,
materialType: `"${MATERIAL_TYPE_NAMES.BOOK}"`,
permanentLoanType: LOAN_TYPE_NAMES.CAN_CIRCULATE,
status: ITEM_STATUS_NAMES.AVAILABLE,
},
Expand Down
Expand Up @@ -36,7 +36,7 @@ import TopMenu from '../../../support/fragments/topMenu';
import Users from '../../../support/fragments/users/users';
import getRandomPostfix from '../../../support/utils/stringTools';

describe.skip('Data Import', () => {
describe('Data Import', () => {
describe('Importing MARC Bib files', () => {
let user;
let instanceHrid;
Expand All @@ -59,7 +59,7 @@ describe.skip('Data Import', () => {
physicalUnitPrice: '"20"',
quantityPhysical: '"1"',
currency: 'USD',
electronicUnitPrice: '25',
electronicUnitPrice: '"25"',
quantityElectronic: '"1"',
locationName: `"${LOCATION_NAMES.ANNEX}"`,
locationQuantityPhysical: '"1"',
Expand Down Expand Up @@ -137,7 +137,6 @@ describe.skip('Data Import', () => {
});
});

// test is skiped because of https://issues.folio.org/browse/MODORDERS-884
it(
'C380446 Import to create open orders: P/E mix with Instances, Holdings, Items (folijet)',
{ tags: ['smoke', 'folijet'] },
Expand Down
2 changes: 1 addition & 1 deletion cypress/support/constants.js
Expand Up @@ -221,7 +221,7 @@ export const RECEIVING_WORKFLOW_NAMES = {
};

export const ACQUISITION_METHOD_NAMES = {
APPROVAL_PLAN: 'Approval plan',
APPROVAL_PLAN: 'Approval Plan',
DDA: 'Demand driven acquisitions (DDA)',
DEPOSITORY: 'Depository',
EBA: 'Evidence based acquisitions (EBA)',
Expand Down
Expand Up @@ -95,6 +95,7 @@ const searchInstanceByHRID = (id) => {
TextArea({ id: 'input-inventory-search' }).fillIn(id),
searchButton.click(),
]);
cy.wait(1500);
};

const searchHoldingsByHRID = (hrid) => {
Expand Down Expand Up @@ -1049,6 +1050,7 @@ export default {
stuffSupressAccordion.clickHeader(),
stuffSupressAccordion.find(Checkbox({ id: 'clickable-filter-staffSuppress-true' })).click(),
]);
cy.wait(1500);
},

clearSharedFilter() {
Expand Down
15 changes: 9 additions & 6 deletions cypress/support/fragments/inventory/search/browseContributors.js
Expand Up @@ -67,7 +67,14 @@ const nameTypeClear = typeSelect.find(Button({ icon: 'times-circle-solid' }));
const actionsButton = Button('Actions');
const rowContributorName = (ContributorName, contributorNameType) => MultiColumnListRow(`${ContributorName}${contributorNameType}1`);

const searchRecordByName = (recordName) => {
cy.do(recordSearch.fillIn(recordName));
cy.expect(recordSearch.has({ value: recordName }));
cy.do(searchButton.click());
};

export default {
searchRecordByName,
defaultInstanceAWithContributor,
defaultInstanceZWithContributor,
getInstancesWithContributor(titles = ['_a_', '_z_']) {
Expand Down Expand Up @@ -191,12 +198,8 @@ export default {
},

browse(contributorName) {
this.searchRecordByName(contributorName);
},
searchRecordByName(recordName) {
cy.do(recordSearch.fillIn(recordName));
cy.expect(recordSearch.has({ value: recordName }));
cy.do(searchButton.click());
cy.wait(1500);
searchRecordByName(contributorName);
},

verifySearchTerm(contributorName) {
Expand Down

0 comments on commit 35a1b4c

Please sign in to comment.