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
Showing
2 changed files
with
90 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import permissions from '../../../support/dictionary/permissions'; | ||
import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import QueryModal, { | ||
itemFieldValues, | ||
enumOperators, | ||
} from '../../../support/fragments/bulk-edit/query-modal'; | ||
import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; | ||
import { ITEM_STATUS_NAMES } from '../../../support/constants'; | ||
import getRandomPostfix from '../../../support/utils/stringTools'; | ||
|
||
let user; | ||
const item = { | ||
instanceName: `testBulkEdit_${getRandomPostfix()}`, | ||
itemBarcode: getRandomPostfix(), | ||
}; | ||
|
||
describe('Bulk Edit - Query', () => { | ||
before('create test data', () => { | ||
cy.getAdminToken(); | ||
cy.createTempUser([ | ||
permissions.bulkEditEdit.gui, | ||
permissions.uiInventoryViewCreateEditItems.gui, | ||
permissions.bulkEditQueryView.gui, | ||
]).then((userProperties) => { | ||
user = userProperties; | ||
|
||
item.instanceId = InventoryInstances.createInstanceViaApi( | ||
item.instanceName, | ||
item.itemBarcode, | ||
); | ||
cy.login(user.username, user.password, { | ||
path: TopMenu.bulkEditPath, | ||
waiter: BulkEditSearchPane.waitLoading, | ||
}); | ||
}); | ||
}); | ||
|
||
after('delete test data', () => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
InventoryInstances.deleteInstanceAndHoldingRecordAndAllItemsViaApi(item.itemBarcode); | ||
}); | ||
|
||
it( | ||
'C436765 Query builder - Search items with a given status ("Enum" property type) (firebird)', | ||
{ tags: ['smoke', 'firebird'] }, | ||
() => { | ||
BulkEditSearchPane.openQuerySearch(); | ||
BulkEditSearchPane.checkItemsRadio(); | ||
BulkEditSearchPane.clickBuildQueryButton(); | ||
QueryModal.verify(); | ||
QueryModal.verifyFieldsSortedAlphabetically(); | ||
QueryModal.selectField(itemFieldValues.itemStatus); | ||
QueryModal.verifySelectedField(itemFieldValues.itemStatus); | ||
QueryModal.verifyQueryAreaContent('(item_status )'); | ||
QueryModal.verifyOperatorColumn(); | ||
QueryModal.verifyOperatorsList(enumOperators); | ||
QueryModal.selectOperator('not in'); | ||
QueryModal.verifyQueryAreaContent('(item_status not in )'); | ||
QueryModal.verifyValueColumn(); | ||
QueryModal.fillInValueMultiselect(ITEM_STATUS_NAMES.ON_ORDER); | ||
QueryModal.fillInValueMultiselect(ITEM_STATUS_NAMES.AGED_TO_LOST); | ||
QueryModal.verifyQueryAreaContent( | ||
`(item_status not in "${ITEM_STATUS_NAMES.ON_ORDER}","${ITEM_STATUS_NAMES.AGED_TO_LOST}")`, | ||
); | ||
QueryModal.testQueryDisabled(false); | ||
QueryModal.runQueryDisabled(); | ||
QueryModal.removeValueFromMultiselect(ITEM_STATUS_NAMES.ON_ORDER); | ||
QueryModal.removeValueFromMultiselect(ITEM_STATUS_NAMES.AGED_TO_LOST); | ||
QueryModal.testQueryDisabled(); | ||
QueryModal.runQueryDisabled(); | ||
QueryModal.chooseFromValueMultiselect(ITEM_STATUS_NAMES.AVAILABLE); | ||
QueryModal.chooseFromValueMultiselect(ITEM_STATUS_NAMES.MISSING); | ||
QueryModal.verifyQueryAreaContent( | ||
`(item_status not in "${ITEM_STATUS_NAMES.AVAILABLE}","${ITEM_STATUS_NAMES.MISSING}")`, | ||
); | ||
QueryModal.testQueryDisabled(false); | ||
QueryModal.runQueryDisabled(); | ||
QueryModal.clickTestQuery(); | ||
QueryModal.verifyPreviewOfRecordsMatched(); | ||
QueryModal.clickRunQuery(); | ||
QueryModal.verifyClosed(); | ||
BulkEditSearchPane.verifySpecificTabHighlighted('Query'); | ||
}, | ||
); | ||
}); |
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