#763 e2e en item index (summary)
This commit is contained in:
parent
2a9dd98e6a
commit
0a0e3d6c1e
|
@ -168,7 +168,7 @@ export default {
|
||||||
searchResultPreviewButton: `vn-item-product .buttons > [icon="desktop_windows"]`,
|
searchResultPreviewButton: `vn-item-product .buttons > [icon="desktop_windows"]`,
|
||||||
searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone"]`,
|
searchResultCloneButton: `vn-item-product .buttons > [icon="icon-clone"]`,
|
||||||
acceptClonationAlertButton: `vn-item-index [vn-id="clone"] [response="ACCEPT"]`,
|
acceptClonationAlertButton: `vn-item-index [vn-id="clone"] [response="ACCEPT"]`,
|
||||||
searchItemInput: `${components.vnTextfield}`,
|
searchItemInput: `vn-searchbar vn-textfield input`,
|
||||||
searchButton: `vn-searchbar vn-icon[icon="search"]`,
|
searchButton: `vn-searchbar vn-icon[icon="search"]`,
|
||||||
closeItemSummaryPreview: 'vn-item-index [vn-id="preview"] button.close',
|
closeItemSummaryPreview: 'vn-item-index [vn-id="preview"] button.close',
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,165 +5,210 @@ describe('Item', () => {
|
||||||
describe('Summary path', () => {
|
describe('Summary path', () => {
|
||||||
const nightmare = createNightmare();
|
const nightmare = createNightmare();
|
||||||
|
|
||||||
beforeAll(done => {
|
beforeAll(() => {
|
||||||
nightmare
|
nightmare
|
||||||
.waitForLogin('employee');
|
.waitForLogin('employee');
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should access to the items index by clicking the items button', done => {
|
it('should access to the items index by clicking the items button', async () => {
|
||||||
nightmare
|
const url = await nightmare
|
||||||
.click(selectors.moduleAccessView.itemsSectionButton)
|
.click(selectors.moduleAccessView.itemsSectionButton)
|
||||||
.wait(selectors.itemsIndex.createItemButton)
|
.wait(selectors.itemsIndex.createItemButton)
|
||||||
.parsedUrl()
|
.parsedUrl();
|
||||||
.then(url => {
|
|
||||||
expect(url.hash).toEqual('#!/item/index');
|
expect(url.hash).toEqual('#!/item/index');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should search for the item Gem of Time', done => {
|
it('should search for the item Gem of Time', async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.wait(selectors.itemsIndex.searchResult)
|
.wait(selectors.itemsIndex.searchResult)
|
||||||
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
|
.type(selectors.itemsIndex.searchItemInput, 'Gem of Time')
|
||||||
.click(selectors.itemsIndex.searchButton)
|
.click(selectors.itemsIndex.searchButton)
|
||||||
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
|
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
|
||||||
.countElement(selectors.itemsIndex.searchResult)
|
.countElement(selectors.itemsIndex.searchResult);
|
||||||
.then(result => {
|
|
||||||
expect(result).toEqual(1);
|
expect(result).toEqual(1);
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should click on the search result summary button to open the item summary popup`, done => {
|
it(`should click on the search result summary button to open the item summary popup`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
|
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Time')
|
||||||
.isVisible(selectors.itemSummary.basicData)
|
.isVisible(selectors.itemSummary.basicData)
|
||||||
.then(result => {
|
.then((result) => {
|
||||||
expect(result).toBeFalsy();
|
expect(result).toBeFalsy();
|
||||||
return nightmare
|
return nightmare
|
||||||
.waitToClick(selectors.itemsIndex.searchResultPreviewButton)
|
.waitToClick(selectors.itemsIndex.searchResultPreviewButton)
|
||||||
.isVisible(selectors.itemSummary.basicData);
|
.isVisible(selectors.itemSummary.basicData);
|
||||||
})
|
});
|
||||||
.then(result => {
|
|
||||||
expect(result).toBeTruthy();
|
expect(result).toBeTruthy();
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary preview shows fields from basic data`, done => {
|
it(`should check the item summary preview shows fields from basic data`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.basicData, 'Name: Gem of Time')
|
.waitForTextInElement(selectors.itemSummary.basicData, 'Name: Gem of Time')
|
||||||
.getInnerText(selectors.itemSummary.basicData)
|
.getInnerText(selectors.itemSummary.basicData);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Name: Gem of Time');
|
expect(result).toContain('Name: Gem of Time');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary preview shows fields from tags`, done => {
|
it(`should check the item summary preview shows fields from tags`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.tags, 'Color: Yellow')
|
.waitForTextInElement(selectors.itemSummary.tags, 'Color: Yellow')
|
||||||
.getInnerText(selectors.itemSummary.tags)
|
.getInnerText(selectors.itemSummary.tags);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Color: Yellow');
|
expect(result).toContain('Color: Yellow');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary preview shows fields from niche`, done => {
|
it(`should check the item summary preview shows fields from niche`, async () => {
|
||||||
return nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.niche, 'Warehouse One: A1')
|
.waitForTextInElement(selectors.itemSummary.niche, 'Warehouse One: A1')
|
||||||
.getInnerText(selectors.itemSummary.niche)
|
.getInnerText(selectors.itemSummary.niche);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Warehouse One: A1');
|
expect(result).toContain('Warehouse One: A1');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary preview shows fields from botanical`, async() => {
|
it(`should check the item summary preview shows fields from botanical`, async () => {
|
||||||
let result = await nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.botanical, 'Botanical: Hedera helix')
|
.waitForTextInElement(selectors.itemSummary.botanical, 'Botanical: Hedera helix')
|
||||||
.getInnerText(selectors.itemSummary.botanical);
|
.getInnerText(selectors.itemSummary.botanical);
|
||||||
|
|
||||||
expect(result).toContain('Botanical: Hedera helix');
|
expect(result).toContain('Botanical: Hedera helix');
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary preview shows fields from barcode`, done => {
|
it(`should check the item summary preview shows fields from barcode`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.barcode, '1')
|
.waitForTextInElement(selectors.itemSummary.barcode, '1')
|
||||||
.getInnerText(selectors.itemSummary.barcode)
|
.getInnerText(selectors.itemSummary.barcode);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('1');
|
expect(result).toContain('1');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should close the summary popup`, done => {
|
it(`should close the summary popup`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitToClick(selectors.itemsIndex.closeItemSummaryPreview)
|
.waitToClick(selectors.itemsIndex.closeItemSummaryPreview)
|
||||||
.isVisible(selectors.itemSummary.basicData)
|
.isVisible(selectors.itemSummary.basicData);
|
||||||
.then(result => {
|
|
||||||
expect(result).toBeFalsy();
|
expect(result).toBeFalsy();
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should navigate to the one of the items detailed section`, done => {
|
it('should search for the item Gem of Mind', async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
|
.clearInput('body > vn-app > vn-vertical > vn-vertical > ui-view > vn-item-index > div > div > vn-card:nth-child(1) > div > vn-searchbar > form > vn-horizontal > vn-textfield > div > div > div.infix > input')
|
||||||
|
.click(selectors.itemsIndex.searchButton)
|
||||||
|
.type(selectors.itemsIndex.searchItemInput, 'Gem of Mind')
|
||||||
|
.click(selectors.itemsIndex.searchButton)
|
||||||
|
.waitForNumberOfElements(selectors.itemsIndex.searchResult, 1)
|
||||||
|
.countElement(selectors.itemsIndex.searchResult);
|
||||||
|
|
||||||
|
expect(result).toEqual(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now click on the search result summary button to open the item summary popup`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemsIndex.searchResult, 'Gem of Mind')
|
||||||
|
.isVisible(selectors.itemSummary.basicData)
|
||||||
|
.then((result) => {
|
||||||
|
expect(result).toBeFalsy();
|
||||||
|
return nightmare
|
||||||
|
.waitToClick(selectors.itemsIndex.searchResultPreviewButton)
|
||||||
|
.isVisible(selectors.itemSummary.basicData);
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(result).toBeTruthy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now check the item summary preview shows fields from basic data`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemSummary.basicData, 'Name: Gem of Mind')
|
||||||
|
.getInnerText(selectors.itemSummary.basicData);
|
||||||
|
|
||||||
|
expect(result).toContain('Name: Gem of Mind');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now check the item summary preview shows fields from tags`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemSummary.tags, 'Color: Red')
|
||||||
|
.getInnerText(selectors.itemSummary.tags);
|
||||||
|
|
||||||
|
expect(result).toContain('Color: Red');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now check the item summary preview shows fields from niche`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemSummary.niche, 'Warehouse One: A4')
|
||||||
|
.getInnerText(selectors.itemSummary.niche);
|
||||||
|
|
||||||
|
expect(result).toContain('Warehouse One: A4');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now check the item summary preview shows fields from botanical`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemSummary.botanical, 'Botanical: -')
|
||||||
|
.getInnerText(selectors.itemSummary.botanical);
|
||||||
|
|
||||||
|
expect(result).toContain('Botanical: -');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now check the item summary preview shows fields from barcode`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitForTextInElement(selectors.itemSummary.barcode, '4')
|
||||||
|
.getInnerText(selectors.itemSummary.barcode);
|
||||||
|
|
||||||
|
expect(result).toContain('4');
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should now close the summary popup`, async () => {
|
||||||
|
const result = await nightmare
|
||||||
|
.waitToClick(selectors.itemsIndex.closeItemSummaryPreview)
|
||||||
|
.isVisible(selectors.itemSummary.basicData);
|
||||||
|
|
||||||
|
expect(result).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`should navigate to the one of the items detailed section`, async () => {
|
||||||
|
const url = await nightmare
|
||||||
.waitToClick(selectors.itemsIndex.searchResult)
|
.waitToClick(selectors.itemsIndex.searchResult)
|
||||||
.waitForURL('summary')
|
.waitForURL('summary')
|
||||||
.parsedUrl()
|
.parsedUrl();
|
||||||
.then(url => {
|
|
||||||
expect(url.hash).toContain('summary');
|
expect(url.hash).toContain('summary');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary shows fields from basic data section`, done => {
|
it(`should check the item summary shows fields from basic data section`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.waitForTextInElement(selectors.itemSummary.basicData, 'Name: Gem of Time')
|
.waitForTextInElement(selectors.itemSummary.basicData, 'Name: Gem of Mind')
|
||||||
.getInnerText(selectors.itemSummary.basicData)
|
.getInnerText(selectors.itemSummary.basicData);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Name: Gem of Time');
|
expect(result).toContain('Name: Gem of Mind');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary shows fields from tags section`, done => {
|
it(`should check the item summary shows fields from tags section`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.getInnerText(selectors.itemSummary.tags)
|
.getInnerText(selectors.itemSummary.tags);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Color: Yellow');
|
expect(result).toContain('Color: Red');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary shows fields from niches section`, done => {
|
it(`should check the item summary shows fields from niches section`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.getInnerText(selectors.itemSummary.niche)
|
.getInnerText(selectors.itemSummary.niche);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Warehouse One: A1');
|
expect(result).toContain('Warehouse One: A4');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary shows fields from botanical section`, done => {
|
it(`should check the item summary shows fields from botanical section`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.getInnerText(selectors.itemSummary.botanical)
|
.getInnerText(selectors.itemSummary.botanical);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('Botanical: Hedera helix');
|
expect(result).toContain('Botanical: -');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should check the item summary shows fields from barcodes section`, done => {
|
it(`should check the item summary shows fields from barcodes section`, async () => {
|
||||||
nightmare
|
const result = await nightmare
|
||||||
.getInnerText(selectors.itemSummary.barcode)
|
.getInnerText(selectors.itemSummary.barcode);
|
||||||
.then(result => {
|
|
||||||
expect(result).toContain('1');
|
expect(result).toContain('4');
|
||||||
done();
|
|
||||||
}).catch(done.fail);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue