2018-02-21 11:02:47 +00:00
|
|
|
import selectors from '../../helpers/selectors.js';
|
2018-10-24 08:57:14 +00:00
|
|
|
import createNightmare from '../../helpers/nightmare';
|
2018-02-21 11:02:47 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
describe('Item Create botanical path', () => {
|
|
|
|
const nightmare = createNightmare();
|
2018-02-21 11:02:47 +00:00
|
|
|
|
2018-11-20 13:22:00 +00:00
|
|
|
beforeAll(() => {
|
|
|
|
nightmare
|
2018-12-02 23:45:34 +00:00
|
|
|
.loginAndModule('buyer', 'item')
|
2019-01-10 06:26:10 +00:00
|
|
|
.accessToSearchResult('Object5 Weapon 50')
|
2018-12-02 23:45:34 +00:00
|
|
|
.accessToSection('item.card.botanical');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should create a new botanical for the item`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abelia')
|
|
|
|
.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'dealbata')
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the botanical for the item was created`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-27 20:09:54 +00:00
|
|
|
.reloadSection('item.card.botanical')
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Cicuta maculata');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the Genus for the item was created`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abelia')
|
|
|
|
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Abelia');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the Species for the item was created`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitToGetProperty(`${selectors.itemBotanical.speciesAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('dealbata');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should edit botanical for the item`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.clearInput(selectors.itemBotanical.botanicalInput)
|
2019-01-23 14:33:25 +00:00
|
|
|
.write(selectors.itemBotanical.botanicalInput, 'Herp Derp')
|
2019-01-07 08:33:07 +00:00
|
|
|
.autocompleteSearch(selectors.itemBotanical.genusAutocomplete, 'Abies')
|
|
|
|
.autocompleteSearch(selectors.itemBotanical.speciesAutocomplete, 'decurrens')
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the botanical for the item was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-27 20:09:54 +00:00
|
|
|
.reloadSection('item.card.botanical')
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitForTextInInput(selectors.itemBotanical.botanicalInput, 'Herp Derp')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.botanicalInput, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Herp Derp');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the Genus for the item was edited`, async() => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2019-01-07 08:33:07 +00:00
|
|
|
.waitForTextInInput(`${selectors.itemBotanical.genusAutocomplete} input`, 'Abies')
|
|
|
|
.waitToGetProperty(`${selectors.itemBotanical.genusAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Abies');
|
|
|
|
});
|
|
|
|
|
2019-01-10 06:26:10 +00:00
|
|
|
it(`should confirm the Species for the item 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.itemBotanical.speciesAutocomplete} input`, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('decurrens');
|
2018-02-21 11:47:48 +00:00
|
|
|
});
|
2018-02-21 11:02:47 +00:00
|
|
|
});
|