-
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
ac039e3
commit 8a0c8e0
Showing
5 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
cypress/e2e/settings/orders/routing-address-option-is-displayed-in-orders-settings.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/permissions'; | ||
import ListConfiguration from '../../../support/fragments/settings/orders/listConfiguration'; | ||
import SettingsMenu from '../../../support/fragments/settingsMenu'; | ||
import Users from '../../../support/fragments/users/users'; | ||
import RoutingAddress from '../../../support/fragments/settings/orders/routingAddress'; | ||
import SettingOrdersNavigationMenu from '../../../support/fragments/settings/orders/settingOrdersNavigationMenu'; | ||
|
||
Cypress.on('uncaught:exception', () => false); | ||
|
||
describe('orders: Settings', () => { | ||
let user; | ||
|
||
before(() => { | ||
cy.getAdminToken(); | ||
|
||
cy.createTempUser([permissions.uiSettingsOrdersCanViewAndEditAllSettings.gui]).then( | ||
(userProperties) => { | ||
user = userProperties; | ||
cy.login(user.username, user.password, { | ||
path: SettingsMenu.ordersRoutingAddressPath, | ||
waiter: RoutingAddress.waitLoading, | ||
}); | ||
}, | ||
); | ||
}); | ||
|
||
after(() => { | ||
cy.getAdminToken(); | ||
Users.deleteViaApi(user.userId); | ||
}); | ||
|
||
it( | ||
'C466206 "Routing address" option is displayed in "Orders" settings (thunderjet)', | ||
{ tags: ['criticalPath', 'thunderjet'] }, | ||
() => { | ||
RoutingAddress.selectAddressType('Home'); | ||
RoutingAddress.save(); | ||
RoutingAddress.checkAddressTypeOption('Home'); | ||
RoutingAddress.selectAddressType('Order'); | ||
SettingOrdersNavigationMenu.selectListConfiguration(); | ||
RoutingAddress.closeWhitoutSaving(); | ||
ListConfiguration.waitLoading(); | ||
SettingOrdersNavigationMenu.selectRoutingAddress(); | ||
RoutingAddress.waitLoading(); | ||
RoutingAddress.selectAddressType('Order'); | ||
SettingOrdersNavigationMenu.selectListConfiguration(); | ||
RoutingAddress.keepEditing(); | ||
RoutingAddress.save(); | ||
RoutingAddress.checkAddressTypeOption('Order'); | ||
}, | ||
); | ||
}); |
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
30 changes: 29 additions & 1 deletion
30
cypress/support/fragments/settings/orders/routingAddress.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 |
---|---|---|
@@ -1,7 +1,35 @@ | ||
import { Section } from '../../../../../interactors'; | ||
import { Button, Modal, Section, Select } from '../../../../../interactors'; | ||
import InteractorsTools from '../../../utils/interactorsTools'; | ||
|
||
const cancelEditingConfirmationModal = Modal({ id: 'cancel-editing-confirmation' }); | ||
|
||
export default { | ||
waitLoading() { | ||
cy.expect(Section({ id: 'central-ordering' }).exists()); | ||
}, | ||
|
||
selectAddressType(addressType) { | ||
cy.wait(4000); | ||
cy.do(Select({ name: 'ROUTING_USER_ADDRESS_TYPE_ID' }).choose(addressType)); | ||
}, | ||
|
||
checkAddressTypeOption(addressType) { | ||
cy.wait(4000); | ||
cy.expect(Select({ name: 'ROUTING_USER_ADDRESS_TYPE_ID' }).hasValue(addressType)); | ||
}, | ||
|
||
save() { | ||
cy.do(Button({ id: 'clickable-save-routing-address-footer' }).click()); | ||
InteractorsTools.checkCalloutMessage('Routing address setting was successfully updated'); | ||
}, | ||
|
||
closeWhitoutSaving() { | ||
cy.expect(cancelEditingConfirmationModal.exists()); | ||
cy.do(Button({ id: 'clickable-cancel-editing-confirmation-cancel' }).click()); | ||
}, | ||
|
||
keepEditing() { | ||
cy.expect(cancelEditingConfirmationModal.exists()); | ||
cy.do(Button({ id: 'clickable-cancel-editing-confirmation-confirm' }).click()); | ||
}, | ||
}; |