-
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.
* C343345 added * updated per comments * settings path updated
- Loading branch information
1 parent
4dda26d
commit 311183d
Showing
9 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
cypress/integration/invoices/settings/invoices.settings.createBatchGroup.spec.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,23 @@ | ||
import TopMenu from '../../../support/fragments/topMenu'; | ||
import NewBatchGroup from '../../../support/fragments/invoices/newBatchGroup'; | ||
import SettingsInvoices from '../../../support/fragments/invoices/settingsInvoices'; | ||
import TestType from '../../../support/dictionary/testTypes'; | ||
|
||
describe('ui-invoices-settings: Batch Group creation', () => { | ||
const batchGroup = { ...NewBatchGroup.defaultUiBatchGroup }; | ||
before(() => { | ||
cy.login(Cypress.env('diku_login'), Cypress.env('diku_password')); | ||
cy.visit(`${TopMenu.settingsInvoice}${SettingsInvoices.settingsInvoicePath.batchGroups}`); | ||
}); | ||
|
||
it('C343345 Create and edit Batch groups', { tags: [TestType.smoke] }, () => { | ||
SettingsInvoices.waitBatchGroupsLoading(); | ||
SettingsInvoices.createNewBatchGroup(batchGroup); | ||
SettingsInvoices.checkBatchGroup(batchGroup); | ||
batchGroup.name += 'updated'; | ||
batchGroup.description += 'updated'; | ||
SettingsInvoices.editBatchGroup(batchGroup); | ||
SettingsInvoices.checkBatchGroup(batchGroup); | ||
SettingsInvoices.deleteBatchGroup(batchGroup); | ||
}); | ||
}); |
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,8 @@ | ||
import getRandomPostfix from '../../utils/stringTools'; | ||
|
||
export default { | ||
defaultUiBatchGroup : { | ||
name: `000autotest_group_${getRandomPostfix()}`, | ||
description: 'Created by autotest', | ||
} | ||
}; |
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,65 @@ | ||
import { Button, TextField, NavListItem, MultiColumnListHeader, EditableListRow, MultiColumnListCell } from '../../../../interactors'; | ||
import InteractorsTools from '../../utils/interactorsTools'; | ||
import DateTools from '../../utils/dateTools'; | ||
|
||
const saveButton = Button('Save'); | ||
const deleteButton = Button('Delete'); | ||
const trashIconButton = Button({ icon: 'trash' }); | ||
const editIconButton = Button({ icon: 'edit' }); | ||
|
||
export default { | ||
settingsInvoicePath: { | ||
approvals: '/approvals', | ||
adjustments: '/adjustments', | ||
batchGroups: '/batch-groups', | ||
batchGroupConfiguration: '/batch-group-configuration', | ||
voucherNumber: '/invoice/voucher-number' | ||
}, | ||
|
||
waitBatchGroupsLoading: () => { | ||
cy.expect(MultiColumnListHeader({ id: 'list-column-name' }).exists()); | ||
}, | ||
|
||
fillRequiredFields: (batchGroup) => { | ||
cy.do([ | ||
TextField({ placeholder: 'name' }).fillIn(batchGroup.name), | ||
TextField({ placeholder: 'description' }).fillIn(batchGroup.description), | ||
saveButton.click() | ||
]); | ||
}, | ||
|
||
createNewBatchGroup(batchGroup) { | ||
cy.do(Button({ id: 'clickable-add-batch-groups' }).click()); | ||
this.fillRequiredFields(batchGroup); | ||
}, | ||
|
||
editBatchGroup(batchGroup, rowNumber = 0) { | ||
cy.do(EditableListRow({ index: rowNumber }).find(editIconButton).click()); | ||
this.fillRequiredFields(batchGroup); | ||
}, | ||
|
||
checkBatchGroup: (batchGroup, rowNumber = 0) => { | ||
const createdByAdmin = `${DateTools.getFormattedDateWithSlashes({ date: new Date() })} by ADMINISTRATOR, DIKU`; | ||
|
||
cy.expect(EditableListRow({ index: rowNumber }) | ||
.find(MultiColumnListCell({ columnIndex: 0 })) | ||
.has({ content: batchGroup.name })); | ||
|
||
cy.expect(EditableListRow({ index: rowNumber }) | ||
.find(MultiColumnListCell({ columnIndex: 1 })) | ||
.has({ content: batchGroup.description })); | ||
|
||
cy.expect(EditableListRow({ index: rowNumber }) | ||
.find(MultiColumnListCell({ columnIndex: 2 })) | ||
.has({ content: createdByAdmin })); | ||
}, | ||
|
||
deleteBatchGroup: (batchGroup, rowNumber = 0) => { | ||
cy.do([ | ||
EditableListRow({ index: rowNumber }) | ||
.find(trashIconButton).click(), | ||
deleteButton.click() | ||
]); | ||
InteractorsTools.checkCalloutMessage(`The Batch group ${batchGroup.name} was successfully deleted`); | ||
} | ||
}; |
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
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
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
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
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
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