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')
|
|
|
|
.accessToSearchResult('Mjolnir')
|
|
|
|
.accessToSection('item.card.botanical');
|
2018-11-20 13:22:00 +00:00
|
|
|
});
|
|
|
|
|
2018-12-13 10:35:13 +00:00
|
|
|
it(`should create a new botanical for the item Mjolnir`, async () => {
|
2018-11-20 13:22:00 +00:00
|
|
|
const result = await nightmare
|
2018-12-13 11:01:33 +00:00
|
|
|
.wait(selectors.itemBotanical.botanicalInput)
|
2018-04-05 06:55:47 +00:00
|
|
|
.type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
|
|
|
|
.waitToClick(selectors.itemBotanical.genusSelect)
|
|
|
|
.waitToClick(selectors.itemBotanical.genusSelectOptionOne)
|
|
|
|
.waitToClick(selectors.itemBotanical.speciesSelect)
|
|
|
|
.waitToClick(selectors.itemBotanical.speciesSelectOptionOne)
|
|
|
|
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the botanical for item Mjolnir was created`, async () => {
|
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.click(selectors.itemBasicData.basicDataButton)
|
|
|
|
.wait(selectors.itemBasicData.nameInput)
|
|
|
|
.click(selectors.itemBotanical.botanicalButton)
|
|
|
|
.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');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the Genus for item Mjolnir was created`, async () => {
|
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abelia')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.genusSelect, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Abelia');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the Species for item Mjolnir was created`, async () => {
|
|
|
|
const result = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.speciesSelect, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('dealbata');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should edit botanical for the item Mjolnir`, async () => {
|
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.clearInput(selectors.itemBotanical.botanicalInput)
|
|
|
|
.type(selectors.itemBotanical.botanicalInput, 'Herp Derp')
|
|
|
|
.waitToClick(selectors.itemBotanical.genusSelect)
|
|
|
|
.waitToClick(selectors.itemBotanical.genusSelectOptionTwo)
|
|
|
|
.waitToClick(selectors.itemBotanical.speciesSelect)
|
|
|
|
.waitToClick(selectors.itemBotanical.speciesSelectOptionTwo)
|
|
|
|
.waitToClick(selectors.itemBotanical.submitBotanicalButton)
|
2018-11-20 13:22:00 +00:00
|
|
|
.waitForLastSnackbar();
|
|
|
|
|
|
|
|
expect(result).toEqual('Data saved!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the botanical for item Mjolnir was edited`, async () => {
|
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.click(selectors.itemBasicData.basicDataButton)
|
|
|
|
.wait(selectors.itemBasicData.nameInput)
|
|
|
|
.click(selectors.itemBotanical.botanicalButton)
|
|
|
|
.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');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the Genus for item Mjolnir was edited`, async () => {
|
|
|
|
const result = await nightmare
|
2018-04-05 06:55:47 +00:00
|
|
|
.waitForTextInInput(selectors.itemBotanical.genusSelect, 'Abies')
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.genusSelect, 'value');
|
2018-11-20 13:22:00 +00:00
|
|
|
|
|
|
|
expect(result).toEqual('Abies');
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`should confirm the Species for item Mjolnir was edited`, async () => {
|
|
|
|
const result = await nightmare
|
2018-11-22 14:44:33 +00:00
|
|
|
.waitToGetProperty(selectors.itemBotanical.speciesSelect, '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
|
|
|
});
|