This commit is contained in:
parent
6fe7106e4b
commit
774185e52e
|
@ -772,5 +772,17 @@ export default {
|
|||
uploadIcon: 'vn-travel-thermograph-create vn-icon[icon="cloud_upload"]',
|
||||
createdThermograph: 'vn-travel-thermograph-index vn-tbody > vn-tr',
|
||||
upload: 'vn-travel-thermograph-create button[type=submit]'
|
||||
},
|
||||
agencyBasicData: {
|
||||
name: 'vn-zone-basic-data vn-textfield[ng-model="$ctrl.zone.name"]',
|
||||
agency: 'vn-zone-basic-data vn-autocomplete[ng-model="$ctrl.zone.agencyModeFk"]',
|
||||
maxVolume: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.m3Max"]',
|
||||
travelingDays: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.travelingDays"]',
|
||||
closing: 'vn-zone-basic-data vn-input-time[ng-model="$ctrl.zone.hour"]',
|
||||
price: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.price"]',
|
||||
bonus: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.bonus"]',
|
||||
inflation: 'vn-zone-basic-data vn-input-number[ng-model="$ctrl.zone.inflation"]',
|
||||
volumetric: 'vn-zone-basic-data vn-check[ng-model="$ctrl.zone.isVolumetric"]',
|
||||
saveButton: 'vn-zone-basic-data vn-submit > button',
|
||||
}
|
||||
};
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
import selectors from '../../helpers/selectors.js';
|
||||
import getBrowser from '../../helpers/puppeteer';
|
||||
|
||||
describe('Agency basic data path', () => {
|
||||
let browser;
|
||||
let page;
|
||||
|
||||
beforeAll(async() => {
|
||||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('deliveryBoss', 'zone'); // turns up the agency module name and route aint the same lol
|
||||
await page.accessToSearchResult('10');
|
||||
await page.accessToSection('zone.card.basicData');
|
||||
});
|
||||
|
||||
afterAll(async() => {
|
||||
await browser.close();
|
||||
});
|
||||
|
||||
it('should reach the basic data section', async() => {
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should edit de form and then save', async() => {
|
||||
await page.clearInput(selectors.agencyBasicData.name);
|
||||
await page.write(selectors.agencyBasicData.name, 'Brimstone teleportation');
|
||||
await page.autocompleteSearch(selectors.agencyBasicData.agency, 'Quantum break device');
|
||||
await page.write(selectors.agencyBasicData.maxVolume, '10');
|
||||
await page.clearInput(selectors.agencyBasicData.travelingDays);
|
||||
await page.write(selectors.agencyBasicData.travelingDays, '1');
|
||||
await page.clearInput(selectors.agencyBasicData.closing);
|
||||
await page.type(selectors.agencyBasicData.closing, '2100');
|
||||
await page.clearInput(selectors.agencyBasicData.price);
|
||||
await page.write(selectors.agencyBasicData.price, '999');
|
||||
await page.clearInput(selectors.agencyBasicData.bonus);
|
||||
await page.write(selectors.agencyBasicData.bonus, '100');
|
||||
await page.clearInput(selectors.agencyBasicData.inflation);
|
||||
await page.write(selectors.agencyBasicData.inflation, '200');
|
||||
await page.waitToClick(selectors.agencyBasicData.volumetric);
|
||||
await page.waitToClick(selectors.agencyBasicData.saveButton);
|
||||
});
|
||||
|
||||
it('should reload the section', async() => {
|
||||
await page.reloadSection('zone.card.basicData');
|
||||
let url = await page.expectURL('#!/zone/10/basic-data');
|
||||
|
||||
expect(url).toBe(true);
|
||||
});
|
||||
|
||||
it('should confirm the name was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.name, 'value');
|
||||
|
||||
expect(result).toEqual('Brimstone teleportation');
|
||||
});
|
||||
|
||||
it('should confirm the agency was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.agency, 'value');
|
||||
|
||||
expect(result).toEqual('Quantum break device');
|
||||
});
|
||||
|
||||
it('should confirm the max volume was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.maxVolume, 'value');
|
||||
|
||||
expect(result).toEqual('10');
|
||||
});
|
||||
|
||||
it('should confirm the traveling days were updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.travelingDays, 'value');
|
||||
|
||||
expect(result).toEqual('1');
|
||||
});
|
||||
|
||||
it('should confirm the closing hour was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.closing, 'value');
|
||||
|
||||
expect(result).toEqual('21:00');
|
||||
});
|
||||
|
||||
it('should confirm the price was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.price, 'value');
|
||||
|
||||
expect(result).toEqual('999');
|
||||
});
|
||||
|
||||
it('should confirm the bonus was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.bonus, 'value');
|
||||
|
||||
expect(result).toEqual('100');
|
||||
});
|
||||
|
||||
it('should confirm the inflation was updated', async() => {
|
||||
const result = await page.waitToGetProperty(selectors.agencyBasicData.inflation, 'value');
|
||||
|
||||
expect(result).toEqual('200');
|
||||
});
|
||||
|
||||
it('should confirm the volumetric checkbox was checked', async() => {
|
||||
await page.waitForClassPresent(selectors.agencyBasicData.volumetric, 'checked');
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue