#1888 nightmarejs extension
This commit is contained in:
parent
ed5458a264
commit
43c1c34cf3
|
@ -428,6 +428,16 @@ let actions = {
|
||||||
|
|
||||||
waitForSpinnerLoad: function() {
|
waitForSpinnerLoad: function() {
|
||||||
return this.waitUntilNotPresent('vn-topbar vn-spinner');
|
return this.waitUntilNotPresent('vn-topbar vn-spinner');
|
||||||
|
},
|
||||||
|
|
||||||
|
waitForWatcherData: function(selector) {
|
||||||
|
return this.wait(selector)
|
||||||
|
.wait(selector => {
|
||||||
|
const watcher = document.querySelector(selector);
|
||||||
|
let orgData = watcher.$ctrl.orgData;
|
||||||
|
return !angular.equals({}, orgData) && orgData != null;
|
||||||
|
}, selector)
|
||||||
|
.waitForSpinnerLoad();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,8 @@ export default {
|
||||||
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
|
addObservationButton: 'vn-client-address-edit div[name="observations"] vn-icon-button[icon="add_circle"]',
|
||||||
saveButton: `button[type=submit]`,
|
saveButton: `button[type=submit]`,
|
||||||
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
|
cancelCreateAddressButton: 'button[ui-sref="client.card.address.index"]',
|
||||||
cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button'
|
cancelEditAddressButton: 'vn-client-address-edit > form > vn-button-bar > vn-button > button',
|
||||||
|
watcher: 'vn-client-address-edit vn-watcher'
|
||||||
},
|
},
|
||||||
clientWebAccess: {
|
clientWebAccess: {
|
||||||
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
|
webAccessButton: 'vn-left-menu a[ui-sref="client.card.webAccess"]',
|
||||||
|
|
|
@ -138,7 +138,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => {
|
it(`should click on the 1st edit icon to confirm EQtax is checked`, async() => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.clientAddresses.firstEditAddress)
|
.waitToClick(selectors.clientAddresses.firstEditAddress)
|
||||||
.waitForSpinnerLoad()
|
.waitForWatcherData(selectors.clientAddresses.watcher)
|
||||||
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
||||||
|
|
||||||
expect(result).toBe('checked');
|
expect(result).toBe('checked');
|
||||||
|
@ -149,7 +149,7 @@ describe('Client Edit fiscalData path', () => {
|
||||||
const result = await nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.clientAddresses.addressesButton)
|
.waitToClick(selectors.clientAddresses.addressesButton)
|
||||||
.waitToClick(selectors.clientAddresses.secondEditAddress)
|
.waitToClick(selectors.clientAddresses.secondEditAddress)
|
||||||
.waitForSpinnerLoad()
|
.waitForWatcherData(selectors.clientAddresses.watcher)
|
||||||
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
.checkboxState(selectors.clientAddresses.equalizationTaxCheckbox);
|
||||||
|
|
||||||
expect(result).toBe('checked');
|
expect(result).toBe('checked');
|
||||||
|
|
Loading…
Reference in New Issue