-
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
42b1d7c
commit d562ba8
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...nventory/instance/inventory-enable-staff-suppress-facet-permission-in-inventory-app.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,52 @@ | ||
import { Permissions } from '../../../support/dictionary'; | ||
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 InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; | ||
|
||
describe('Inventory', () => { | ||
describe('Instance', () => { | ||
const testData = { | ||
accordion: 'Suppress from discovery', | ||
}; | ||
|
||
before('Create test data and login', () => { | ||
cy.getAdminToken(); | ||
InventoryInstance.createInstanceViaApi().then(({ instanceData }) => { | ||
testData.instance = instanceData; | ||
|
||
cy.getInstanceById(testData.instance.instanceId).then((body) => { | ||
body.discoverySuppress = true; | ||
cy.updateInstance(body); | ||
}); | ||
}); | ||
|
||
cy.createTempUser([Permissions.enableStaffSuppressFacet.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(() => { | ||
Users.deleteViaApi(testData.user.userId); | ||
InventoryInstance.deleteInstanceViaApi(testData.instance.instanceId); | ||
}); | ||
}); | ||
|
||
it( | ||
'C432313 Check "Inventory: Enable staff suppress facet" permission in Inventory app (folijet)', | ||
{ tags: ['extendedPath', 'folijet'] }, | ||
() => { | ||
InventorySearchAndFilter.expandAccordion(testData.accordion); | ||
InventorySearchAndFilter.verifyCheckboxInAccordion(testData.accordion, 'No', false); | ||
InventorySearchAndFilter.verifyCheckboxInAccordion(testData.accordion, 'Yes', false); | ||
}, | ||
); | ||
}); | ||
}); |