2018-02-22 10:26:32 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-02-22 10:26:32 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
describe('Item Edit basic data path', () => {
|
|
|
|
const nightmare = createNightmare();
|
|
|
|
|
|
|
|
beforeAll(() => {
|
|
|
|
nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('buyer', 'item')
|
2019-04-17 07:37:55 +00:00
|
|
|
.accessToSearchResult('Melee weapon combat fist 15cm')
|
2019-04-16 12:30:01 +00:00
|
|
|
.accessToSection('item.card.basicData');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2019-02-04 13:47:55 +00:00
|
|
|
it(`should check the descritor edit button is visible for buyer`, async() => {
|
|
|
|
const visibleButton = await nightmare
|
|
|
|
.isVisible(selectors.itemDescriptor.editButton);
|
|
|
|
|
|
|
|
expect(visibleButton).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should edit the item basic data`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
|
|
|
.clearInput(selectors.itemBasicData.nameInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBasicData.nameInput, 'Rose of Purity')
|
2019-05-02 09:23:54 +00:00
|
|
|
.autocompleteSearch(selectors.itemBasicData.typeAutocomplete, 'Anthurium')
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.itemBasicData.intrastatAutocomplete, 'Coral y materiales similares')
|
2018-11-20 13:22:00 +00:00
|
|
|
.clearInput(selectors.itemBasicData.relevancyInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBasicData.relevancyInput, '1')
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.itemBasicData.originAutocomplete, 'Spain')
|
2019-12-13 11:18:20 +00:00
|
|
|
.autocompleteSearch(selectors.itemBasicData.expenseAutocomplete, 'Alquiler VNH')
|
2018-11-20 13:22:00 +00:00
|
|
|
.clearInput(selectors.itemBasicData.longNameInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitToClick(selectors.itemBasicData.isActiveCheckbox)
|
2019-09-18 09:11:47 +00:00
|
|
|
.waitToClick(selectors.itemBasicData.priceInKgCheckbox)
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToClick(selectors.itemBasicData.submitBasicDataButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
2019-01-07 08:33:07 +00:00
|
|
|
}, 15000);
|
2018-11-20 13:22:00 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item name was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-04-16 12:30:01 +00:00
|
|
|
.reloadSection('item.card.basicData')
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.itemBasicData.nameInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Rose of Purity');
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item type was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToGetProperty(`${selectors.itemBasicData.typeAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
2019-05-02 09:23:54 +00:00
|
|
|
expect(result).toEqual('Anthurium');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item intrastad was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToGetProperty(`${selectors.itemBasicData.intrastatAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('5080000 Coral y materiales similares');
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item relevancy was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.itemBasicData.relevancyInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('1');
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item origin was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToGetProperty(`${selectors.itemBasicData.originAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Spain');
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item expence was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-12-13 11:18:20 +00:00
|
|
|
.waitToGetProperty(`${selectors.itemBasicData.expenseAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
expect(result).toEqual('Alquiler VNH');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it(`should confirm the item long name was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2018-11-22 11:34:20 +00:00
|
|
|
.waitToGetProperty(selectors.itemBasicData.longNameInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('RS Rose of Purity');
|
|
|
|
});
|
|
|
|
|
2019-01-07 08:33:07 +00:00
|
|
|
it('should confirm isActive checkbox is unchecked', async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-02-14 19:17:22 +00:00
|
|
|
.checkboxState(selectors.itemBasicData.isActiveCheckbox);
|
2018-11-20 13:22:00 +00:00
|
|
|
|
2019-02-14 19:17:22 +00:00
|
|
|
expect(result).toBe('unchecked');
|
2018-02-22 10:26:32 +00:00
|
|
|
});
|
2019-09-18 09:11:47 +00:00
|
|
|
|
|
|
|
it('should confirm the priceInKg checkbox is checked', async() => {
|
|
|
|
const result = await nightmare
|
|
|
|
.checkboxState(selectors.itemBasicData.priceInKgCheckbox);
|
|
|
|
|
|
|
|
expect(result).toBe('checked');
|
|
|
|
});
|
2018-02-22 10:26:32 +00:00
|
|
|
});
|