-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb64b1d
commit c8ba8b2
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...-exporting-shared-folio-source-instance-from-instance-search-results-pane-on-member.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import Permissions from '../../../../support/dictionary/permissions'; | ||
import Users from '../../../../support/fragments/users/users'; | ||
import TopMenu from '../../../../support/fragments/topMenu'; | ||
import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; | ||
import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; | ||
import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; | ||
import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; | ||
import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; | ||
import ExportFile from '../../../../support/fragments/data-export/exportFile'; | ||
import FileManager from '../../../../support/utils/fileManager'; | ||
|
||
describe('Inventory', () => { | ||
describe('Instance', () => { | ||
const testData = {}; | ||
|
||
before('Create test data', () => { | ||
cy.getAdminToken(); | ||
InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { | ||
testData.instance = instanceData; | ||
}); | ||
|
||
cy.createTempUser([Permissions.uiInventoryViewInstances.gui]) | ||
.then((userProperties) => { | ||
testData.user = userProperties; | ||
}) | ||
.then(() => { | ||
cy.wait(3000); | ||
cy.assignAffiliationToUser(Affiliations.College, testData.user.userId); | ||
cy.setTenant(Affiliations.College); | ||
cy.assignPermissionsToExistingUser(testData.user.userId, [ | ||
Permissions.inventoryAll.gui, | ||
Permissions.dataExportEnableSettings.gui, | ||
Permissions.dataExportEnableApp.gui, | ||
]); | ||
|
||
cy.login(testData.user.username, testData.user.password, { | ||
path: TopMenu.inventoryPath, | ||
waiter: InventoryInstances.waitContentLoading, | ||
}); | ||
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); | ||
ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.college); | ||
}); | ||
}); | ||
|
||
after('Delete test data', () => { | ||
cy.resetTenant(); | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(testData.user.userId); | ||
InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId); | ||
FileManager.deleteFileFromDownloadsByMask(testData.fileName); | ||
FileManager.deleteFile(`cypress/fixtures/${testData.fileName}`); | ||
}); | ||
|
||
it( | ||
'C422077 (CONSORTIA) Verify the link in Data export app after exporting shared FOLIO Source Instance from Instance search results pane on Member tenant (consortia) (folijet)', | ||
{ tags: ['criticalPathECS', 'folijet'] }, | ||
() => { | ||
InventoryInstances.searchByTitle(testData.instance.instanceTitle); | ||
InventorySearchAndFilter.closeInstanceDetailPane(); | ||
InventorySearchAndFilter.selectResultCheckboxes(1); | ||
InventorySearchAndFilter.verifySelectedRecords(1); | ||
InventorySearchAndFilter.exportInstanceAsMarc(); | ||
// download exported marc file | ||
cy.visit(TopMenu.dataExportPath); | ||
cy.wait(1000); | ||
ExportFile.getExportedFileNameViaApi().then((name) => { | ||
testData.fileName = name; | ||
ExportFile.downloadExportedMarcFile(name); | ||
// Need to wait,while file to be downloaded | ||
cy.wait(2000); | ||
FileManager.findDownloadedFilesByMask(`*${name}`).then((files) => expect(files.length).eq(1)); | ||
}); | ||
}, | ||
); | ||
}); | ||
}); |