removed niche usages from e2e paths & selectors

This commit is contained in:
Carlos Jimenez Ruiz 2021-08-30 13:26:54 +02:00
parent d5625d19f1
commit aac06e6f32
12 changed files with 0 additions and 94 deletions

View File

@ -323,7 +323,6 @@ export default {
idCheckbox: '.vn-popover.shown vn-horizontal:nth-child(1) > vn-check', idCheckbox: '.vn-popover.shown vn-horizontal:nth-child(1) > vn-check',
stemsCheckbox: '.vn-popover.shown vn-horizontal:nth-child(2) > vn-check', stemsCheckbox: '.vn-popover.shown vn-horizontal:nth-child(2) > vn-check',
sizeCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check', sizeCheckbox: '.vn-popover.shown vn-horizontal:nth-child(3) > vn-check',
nicheCheckbox: '.vn-popover.shown vn-horizontal:nth-child(4) > vn-check',
typeCheckbox: '.vn-popover.shown vn-horizontal:nth-child(5) > vn-check', typeCheckbox: '.vn-popover.shown vn-horizontal:nth-child(5) > vn-check',
categoryCheckbox: '.vn-popover.shown vn-horizontal:nth-child(6) > vn-check', categoryCheckbox: '.vn-popover.shown vn-horizontal:nth-child(6) > vn-check',
intrastadCheckbox: '.vn-popover.shown vn-horizontal:nth-child(7) > vn-check', intrastadCheckbox: '.vn-popover.shown vn-horizontal:nth-child(7) > vn-check',
@ -420,17 +419,6 @@ export default {
submitBarcodesButton: 'vn-item-barcode button[type=submit]', submitBarcodesButton: 'vn-item-barcode button[type=submit]',
firstCodeRemoveButton: 'vn-item-barcode vn-horizontal:nth-child(1) vn-icon[icon="delete"]' firstCodeRemoveButton: 'vn-item-barcode vn-horizontal:nth-child(1) vn-icon[icon="delete"]'
}, },
itemNiches: {
addNicheButton: 'vn-item-niche vn-icon[icon="add_circle"]',
firstWarehouse: 'vn-item-niche vn-autocomplete[ng-model="niche.warehouseFk"]',
firstCode: 'vn-item-niche vn-horizontal:nth-child(1) vn-textfield[ng-model="niche.code"]',
secondWarehouse: 'vn-item-niche vn-horizontal:nth-child(2) > vn-autocomplete[ng-model="niche.warehouseFk"]',
secondCode: 'vn-item-niche vn-horizontal:nth-child(2) vn-textfield[ng-model="niche.code"]',
secondNicheRemoveButton: 'vn-item-niche vn-horizontal:nth-child(2) > vn-none > vn-icon-button[icon="delete"]',
thirdWarehouse: 'vn-item-niche vn-horizontal:nth-child(3) > vn-autocomplete[ng-model="niche.warehouseFk"]',
thirdCode: 'vn-item-niche vn-horizontal:nth-child(3) vn-textfield[ng-model="niche.code"]',
submitNichesButton: 'vn-item-niche button[type=submit]'
},
itemBotanical: { itemBotanical: {
genus: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]', genus: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.genusFk"]',
species: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]', species: 'vn-item-botanical vn-autocomplete[ng-model="$ctrl.botanical.specieFk"]',
@ -440,7 +428,6 @@ export default {
basicData: 'vn-item-summary [name="basicData"]', basicData: 'vn-item-summary [name="basicData"]',
vat: 'vn-item-summary [name="tax"]', vat: 'vn-item-summary [name="tax"]',
tags: 'vn-item-summary [name="tags"]', tags: 'vn-item-summary [name="tags"]',
niche: 'vn-item-summary [name="niche"]',
botanical: 'vn-item-summary [name="botanical"]', botanical: 'vn-item-summary [name="botanical"]',
barcode: 'vn-item-summary [name="barcode"]' barcode: 'vn-item-summary [name="barcode"]'
}, },

View File

@ -40,13 +40,6 @@ describe('Item summary path', () => {
expect(result).toContain('Brown'); expect(result).toContain('Brown');
}); });
it(`should check the item summary preview shows fields from niche`, async() => {
await page.waitForTextInElement(selectors.itemSummary.niche, 'A1');
const result = await page.waitToGetProperty(selectors.itemSummary.niche, 'innerText');
expect(result).toContain('A1');
});
it(`should check the item summary preview shows fields from botanical`, async() => { it(`should check the item summary preview shows fields from botanical`, async() => {
await page.waitForTextInElement(selectors.itemSummary.botanical, 'Abelia'); await page.waitForTextInElement(selectors.itemSummary.botanical, 'Abelia');
const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText'); const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText');
@ -126,12 +119,6 @@ describe('Item summary path', () => {
expect(result).toContain('Silver'); expect(result).toContain('Silver');
}); });
it(`should check the item summary shows fields from niches section`, async() => {
const result = await page.waitToGetProperty(selectors.itemSummary.niche, 'innerText');
expect(result).toContain('One A4');
});
it(`should check the item summary shows fields from botanical section`, async() => { it(`should check the item summary shows fields from botanical section`, async() => {
const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText'); const result = await page.waitToGetProperty(selectors.itemSummary.botanical, 'innerText');

View File

@ -1,66 +0,0 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Item create niche path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'item');
await page.accessToSearchResult('Ranged weapon longbow 2m');
await page.accessToSection('item.card.niche');
});
afterAll(async() => {
await browser.close();
});
it(`should click create a new niche and delete a former one`, async() => {
await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
await page.waitToClick(selectors.itemNiches.addNicheButton);
await page.waitToClick(selectors.itemNiches.secondNicheRemoveButton);
await page.autocompleteSearch(selectors.itemNiches.thirdWarehouse, 'Warehouse Two');
await page.write(selectors.itemNiches.thirdCode, 'A44');
await page.waitToClick(selectors.itemNiches.submitNichesButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Data saved!');
});
it(`should confirm the first niche is the expected one`, async() => {
await page.reloadSection('item.card.niche');
await page.waitForTextInField(selectors.itemNiches.firstWarehouse, 'Warehouse One');
let result = await page
.waitToGetProperty(selectors.itemNiches.firstWarehouse, 'value');
expect(result).toEqual('Warehouse One');
result = await page
.waitToGetProperty(selectors.itemNiches.firstCode, 'value');
expect(result).toEqual('A11');
});
it(`should confirm the second niche is the expected one`, async() => {
let result = await page
.waitToGetProperty(selectors.itemNiches.secondWarehouse, 'value');
expect(result).toEqual('Warehouse Three');
result = await page
.waitToGetProperty(selectors.itemNiches.secondCode, 'value');
expect(result).toEqual('A33');
});
it(`should confirm the third niche is the expected one`, async() => {
let result = await page
.waitToGetProperty(selectors.itemNiches.thirdWarehouse, 'value');
expect(result).toEqual('Warehouse Two');
result = await page
.waitToGetProperty(selectors.itemNiches.thirdCode, 'value');
expect(result).toEqual('A44');
});
});

View File

@ -26,7 +26,6 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.idCheckbox); await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox); await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
await page.waitToClick(selectors.itemsIndex.sizeCheckbox); await page.waitToClick(selectors.itemsIndex.sizeCheckbox);
await page.waitToClick(selectors.itemsIndex.nicheCheckbox);
await page.waitToClick(selectors.itemsIndex.typeCheckbox); await page.waitToClick(selectors.itemsIndex.typeCheckbox);
await page.waitToClick(selectors.itemsIndex.categoryCheckbox); await page.waitToClick(selectors.itemsIndex.categoryCheckbox);
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox); await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);
@ -59,7 +58,6 @@ describe('Item index path', () => {
await page.waitToClick(selectors.itemsIndex.idCheckbox); await page.waitToClick(selectors.itemsIndex.idCheckbox);
await page.waitToClick(selectors.itemsIndex.stemsCheckbox); await page.waitToClick(selectors.itemsIndex.stemsCheckbox);
await page.waitToClick(selectors.itemsIndex.sizeCheckbox); await page.waitToClick(selectors.itemsIndex.sizeCheckbox);
await page.waitToClick(selectors.itemsIndex.nicheCheckbox);
await page.waitToClick(selectors.itemsIndex.typeCheckbox); await page.waitToClick(selectors.itemsIndex.typeCheckbox);
await page.waitToClick(selectors.itemsIndex.categoryCheckbox); await page.waitToClick(selectors.itemsIndex.categoryCheckbox);
await page.waitToClick(selectors.itemsIndex.intrastadCheckbox); await page.waitToClick(selectors.itemsIndex.intrastadCheckbox);