From 3eaec1bba99a56c353d53bc58218ce980d7ad53c Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Wed, 21 Feb 2018 12:47:48 +0100 Subject: [PATCH] finished e2e path for botanical --- .../05_create_item_botanical.spec.js | 49 ++++++++++++++++++- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/e2e/paths/item-module/05_create_item_botanical.spec.js b/e2e/paths/item-module/05_create_item_botanical.spec.js index 0c7e67fe9..b8766aa80 100644 --- a/e2e/paths/item-module/05_create_item_botanical.spec.js +++ b/e2e/paths/item-module/05_create_item_botanical.spec.js @@ -1,7 +1,7 @@ import selectors from '../../helpers/selectors.js'; import createNightmare from '../../helpers/helpers'; -fdescribe('create item botanical path', () => { +describe('create item botanical path', () => { const nightmare = createNightmare(); 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 .type(selectors.itemBotanical.botanicalInput, 'Cicuta maculata') .waitToClick(selectors.itemBotanical.genusSelect) @@ -81,4 +81,49 @@ fdescribe('create item botanical path', () => { 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'); + }); + }); });