botanical e2e path
This commit is contained in:
parent
ade0e3beb0
commit
077d62ad9c
|
@ -0,0 +1,84 @@
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import createNightmare from '../../helpers/helpers';
|
||||||
|
|
||||||
|
fdescribe('create item botanical path', () => {
|
||||||
|
const nightmare = createNightmare();
|
||||||
|
|
||||||
|
it('should access to the items index by clicking the items button', () => {
|
||||||
|
return nightmare
|
||||||
|
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||||
|
.wait(selectors.itemsIndex.createItemButton)
|
||||||
|
.parsedUrl()
|
||||||
|
.then(url => {
|
||||||
|
expect(url.hash).toEqual('#!/item/list');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should search for the item Gem of Time', () => {
|
||||||
|
return nightmare
|
||||||
|
.wait(selectors.itemsIndex.searchResult)
|
||||||
|
.type(selectors.itemsIndex.searchItemInput, 'Mjolnir')
|
||||||
|
.click(selectors.itemsIndex.searchButton)
|
||||||
|
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
|
||||||
|
.countSearchResults(selectors.itemsIndex.searchResult)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should click on the search result to access to the item botanical`, () => {
|
||||||
|
return nightmare
|
||||||
|
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Mjolnir')
|
||||||
|
.waitToClick(selectors.itemsIndex.searchResult)
|
||||||
|
.waitToClick(selectors.itemBotanical.botanicalButton)
|
||||||
|
.waitForURL('botanical')
|
||||||
|
.url()
|
||||||
|
.then(url => {
|
||||||
|
expect(url).toContain('botanical');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should click create a new botanical for the item with id Mjolnir`, () => {
|
||||||
|
return nightmare
|
||||||
|
.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)
|
||||||
|
.waitForSnackbar()
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toContain('Data saved!');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should confirm the botanical for item 5 was created`, () => {
|
||||||
|
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('Cicuta maculata');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should confirm the Genus for item 5 was created`, () => {
|
||||||
|
return nightmare
|
||||||
|
.wait(200)
|
||||||
|
.getInputValue(selectors.itemBotanical.genusSelect)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual('Abelia');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should confirm the Species for item 5 was created`, () => {
|
||||||
|
return nightmare
|
||||||
|
.wait(200)
|
||||||
|
.getInputValue(selectors.itemBotanical.speciesSelect)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual('dealbata');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -56,7 +56,7 @@ describe('create item barcodes path', () => {
|
||||||
.click(selectors.itemBasicData.basicDataButton)
|
.click(selectors.itemBasicData.basicDataButton)
|
||||||
.wait(selectors.itemBasicData.nameInput)
|
.wait(selectors.itemBasicData.nameInput)
|
||||||
.click(selectors.itemBarcodes.barcodeButton)
|
.click(selectors.itemBarcodes.barcodeButton)
|
||||||
.wait(1000)
|
.wait(200)
|
||||||
.getInputValue(selectors.itemBarcodes.thirdCodeInput)
|
.getInputValue(selectors.itemBarcodes.thirdCodeInput)
|
||||||
.then(result => {
|
.then(result => {
|
||||||
expect(result).toEqual('5');
|
expect(result).toEqual('5');
|
||||||
|
|
Loading…
Reference in New Issue