finished e2e path for botanical

This commit is contained in:
Carlos Jimenez 2018-02-21 12:47:48 +01:00
parent 0288e07638
commit 3eaec1bba9
1 changed files with 47 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import selectors from '../../helpers/selectors.js'; import selectors from '../../helpers/selectors.js';
import createNightmare from '../../helpers/helpers'; import createNightmare from '../../helpers/helpers';
fdescribe('create item botanical path', () => { describe('create item botanical path', () => {
const nightmare = createNightmare(); const nightmare = createNightmare();
it('should access to the items index by clicking the items button', () => { it('should access to the items index by clicking the items button', () => {
@ -38,7 +38,7 @@ fdescribe('create item botanical path', () => {
}); });
}); });
it(`should click create a new botanical for the item with id Mjolnir`, () => { it(`should create a new botanical for the item with id Mjolnir`, () => {
return nightmare return nightmare
.type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata')
.waitToClick(selectors.itemBotanical.genusSelect) .waitToClick(selectors.itemBotanical.genusSelect)
@ -81,4 +81,49 @@ fdescribe('create item botanical path', () => {
expect(result).toEqual('dealbata'); expect(result).toEqual('dealbata');
}); });
}); });
it(`should edit botanical for the item with id Mjolnir`, () => {
return nightmare
.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)
.waitForSnackbar()
.then(result => {
expect(result).toContain('Data saved!');
});
});
it(`should confirm the botanical for item 5 was edited`, () => {
return nightmare
.click(selectors.itemBasicData.basicDataButton)
.wait(selectors.itemBasicData.nameInput)
.click(selectors.itemBotanical.botanicalButton)
.wait(200)
.getInputValue(selectors.itemBotanical.botanicalInput)
.then(result => {
expect(result).toEqual('Herp Derp');
});
});
it(`should confirm the Genus for item 5 was edited`, () => {
return nightmare
.wait(200)
.getInputValue(selectors.itemBotanical.genusSelect)
.then(result => {
expect(result).toEqual('Abies');
});
});
it(`should confirm the Species for item 5 was edited`, () => {
return nightmare
.wait(200)
.getInputValue(selectors.itemBotanical.speciesSelect)
.then(result => {
expect(result).toEqual('decurrens');
});
});
}); });