Merge branch 'dev' of https://git.verdnatura.es/salix into dev
This commit is contained in:
commit
0c1fa49708
|
@ -137,6 +137,8 @@ export default {
|
||||||
createItemButton: `${components.vnFloatButton}`,
|
createItemButton: `${components.vnFloatButton}`,
|
||||||
searchResult: `${components.vnItemProduct} > vn-horizontal > vn-one`,
|
searchResult: `${components.vnItemProduct} > vn-horizontal > vn-one`,
|
||||||
searchResultPreviewButton: `${components.vnItemProduct}:nth-child(1) > vn-horizontal > vn-horizontal > vn-one:nth-child(2) > vn-icon > i`,
|
searchResultPreviewButton: `${components.vnItemProduct}:nth-child(1) > vn-horizontal > vn-horizontal > vn-one:nth-child(2) > vn-icon > i`,
|
||||||
|
searchResultCloneButton: `${components.vnItemProduct} > vn-horizontal > vn-horizontal > vn-one:nth-child(1) > vn-icon > i`,
|
||||||
|
acceptClonationAlertButton: `vn-dialog.ng-isolate-scope.vn-dialog.shown > div > form > div.buttons > tpl-buttons > button:nth-child(2)`,
|
||||||
searchItemInput: `${components.vnTextfield}`,
|
searchItemInput: `${components.vnTextfield}`,
|
||||||
searchButton: `${components.vnSearchBar} > vn-icon-button > button`,
|
searchButton: `${components.vnSearchBar} > vn-icon-button > button`,
|
||||||
closeItemSummaryPreview: 'body > vn-app > vn-vertical > vn-vertical > ui-view > vn-item-list:nth-child(1) > div > vn-dialog > div > button > vn-icon'
|
closeItemSummaryPreview: 'body > vn-app > vn-vertical > vn-vertical > ui-view > vn-item-list:nth-child(1) > div > vn-dialog > div > button > vn-icon'
|
||||||
|
|
|
@ -14,7 +14,7 @@ describe('Item summary path', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the item Gem of Mind', () => {
|
it('should search for the item Gem of Time', () => {
|
||||||
return nightmare
|
return nightmare
|
||||||
.wait(selectors.itemsIndex.searchResult)
|
.wait(selectors.itemsIndex.searchResult)
|
||||||
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
|
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
import selectors from '../../helpers/selectors.js';
|
||||||
|
import createNightmare from '../../helpers/helpers';
|
||||||
|
|
||||||
|
describe('Item clone 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 Iron Patriot', () => {
|
||||||
|
return nightmare
|
||||||
|
.wait(selectors.itemsIndex.searchResult)
|
||||||
|
.type(selectors.itemsIndex.searchItemInput, 'Iron Patriot')
|
||||||
|
.click(selectors.itemsIndex.searchButton)
|
||||||
|
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
|
||||||
|
.countSearchResults(selectors.itemsIndex.searchResult)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should clone the Iron Patriot`, () => {
|
||||||
|
return nightmare
|
||||||
|
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Iron Patriot')
|
||||||
|
.click(selectors.itemsIndex.searchResultCloneButton)
|
||||||
|
.waitToClick(selectors.itemsIndex.acceptClonationAlertButton)
|
||||||
|
.waitForURL('tags')
|
||||||
|
.parsedUrl()
|
||||||
|
.then(url => {
|
||||||
|
expect(url.hash).toContain('tags');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should search for the item Iron Patriot and find two', () => {
|
||||||
|
return nightmare
|
||||||
|
.wait(selectors.itemsIndex.searchResult)
|
||||||
|
.type(selectors.itemsIndex.searchItemInput, 'Iron Patriot')
|
||||||
|
.click(selectors.itemsIndex.searchButton)
|
||||||
|
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 2)
|
||||||
|
.countSearchResults(selectors.itemsIndex.searchResult)
|
||||||
|
.then(result => {
|
||||||
|
expect(result).toEqual(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue