e2e path for entry.buy.card.index import
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-03-12 11:56:02 +01:00
parent f92db8c5a0
commit 8018b20d95
5 changed files with 201 additions and 1 deletions

View File

@ -0,0 +1,127 @@
{
"invoices": [
{
"tx_company": "TESSAROSES S.A.",
"id_invoice": "20062926",
"id_purchaseorder": "20106319",
"tx_customer_ref": "",
"id_customer": "56116",
"id_customer_floricode": "",
"nm_bill": "VERDNATURA LEVANTE SL",
"nm_ship": "VERDNATURA LEVANTE SL",
"nm_cargo": "OYAMBARILLO",
"dt_purchaseorder": "06/19/2020",
"dt_fly": "06/20/2020",
"dt_invoice": "06/19/2020",
"nm_incoterm": "FOB UIO",
"tx_awb": "729-6340 2846",
"tx_hawb": "LA0061832844",
"tx_oe": "05520204000335992",
"nu_totalstemsPO": "850",
"mny_flower": "272.5000",
"mny_freight": "0.0000",
"mny_total": "272.5000",
"nu_boxes": "4",
"nu_fulls": "1.75",
"dt_posted": "2020-06-19T13:31:41",
"boxes": [
{
"id_box": "200573095",
"nm_box": "HB",
"tp_box": "HB",
"tx_label": "",
"nu_length": "96",
"nu_width": "32",
"nu_height": "30.5",
"products": [
{
"id_floricode": "27887",
"id_migros_variety": "",
"nm_product": "FREEDOM 60CM 25ST",
"nm_species": "ROSES",
"nm_variety": "FREEDOM",
"nu_length": "60",
"nu_stems_bunch": "25",
"nu_bunches": "10",
"mny_rate_stem": "0.3500",
"mny_freight_unit": "0.0000",
"barcodes": "202727621,202725344,202725345,202725571,202725730,202725731,202725732,202725925,202726131,202726685"
}
]
},
{
"id_box": "200573106",
"nm_box": "HB",
"tp_box": "HB",
"tx_label": "",
"nu_length": "96",
"nu_width": "32",
"nu_height": "30.5",
"products": [
{
"id_floricode": "27887",
"id_migros_variety": "",
"nm_product": "FREEDOM 70CM 25ST",
"nm_species": "ROSES",
"nm_variety": "FREEDOM",
"nu_length": "70",
"nu_stems_bunch": "25",
"nu_bunches": "8",
"mny_rate_stem": "0.4000",
"mny_freight_unit": "0.0000",
"barcodes": "202727077,202727078,202727079,202727080,202727650,202727654,202727656,202727657"
}
]
},
{
"id_box": "200573117",
"nm_box": "HB",
"tp_box": "HB",
"tx_label": "",
"nu_length": "96",
"nu_width": "32",
"nu_height": "30.5",
"products": [
{
"id_floricode": "28409",
"id_migros_variety": "",
"nm_product": "TIBET 40CM 25ST",
"nm_species": "ROSES",
"nm_variety": "TIBET",
"nu_length": "40",
"nu_stems_bunch": "25",
"nu_bunches": "12",
"mny_rate_stem": "0.2500",
"mny_freight_unit": "0.0000",
"barcodes": "202723350,202723351,202723352,202723353,202723354,202723355,202723356,202723357,202726690,202726745,202726813,202726814"
}
]
},
{
"id_box": "200573506",
"nm_box": "QB 2",
"tp_box": "QB",
"tx_label": "",
"nu_length": "80",
"nu_width": "30",
"nu_height": "17.5",
"products": [
{
"id_floricode": "27887",
"id_migros_variety": "",
"nm_product": "FREEDOM 50CM 25ST",
"nm_species": "ROSES",
"nm_variety": "FREEDOM",
"nu_length": "50",
"nu_stems_bunch": "25",
"nu_bunches": "4",
"mny_rate_stem": "0.3000",
"mny_freight_unit": "0.0000",
"barcodes": "202727837,202727839,202727842,202726682"
}
]
}
]
}
]
}

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1015,6 +1015,17 @@ export default {
travelsQuicklink: 'vn-entry-descriptor vn-quick-link[icon="local_airport"] > a',
entriesQuicklink: 'vn-entry-descriptor vn-quick-link[icon="icon-entry"] > a'
},
entryBuys: {
importButton: 'vn-entry-buy-index vn-icon[icon="publish"]',
ref: 'vn-entry-buy-import vn-textfield[ng-model="$ctrl.import.ref"]',
observation: 'vn-entry-buy-import vn-textarea[ng-model="$ctrl.import.observation"]',
file: 'vn-entry-buy-import vn-input-file[ng-model="$ctrl.import.file"]',
firstImportedItem: 'vn-entry-buy-import tbody:nth-child(2) vn-autocomplete[ng-model="buy.itemFk"]',
secondImportedItem: 'vn-entry-buy-import tbody:nth-child(3) vn-autocomplete[ng-model="buy.itemFk"]',
thirdImportedItem: 'vn-entry-buy-import tbody:nth-child(4) vn-autocomplete[ng-model="buy.itemFk"]',
fourthImportedItem: 'vn-entry-buy-import tbody:nth-child(5) vn-autocomplete[ng-model="buy.itemFk"]',
importBuysButton: 'vn-entry-buy-import button[type="submit"]'
},
entryLatestBuys: {
firstBuy: 'vn-entry-latest-buys vn-tbody > a:nth-child(1)',
allBuysCheckBox: 'vn-entry-latest-buys vn-thead vn-check',

View File

@ -38,7 +38,7 @@ describe('Travel thermograph path', () => {
it('should select the file to upload', async() => {
let currentDir = process.cwd();
let filePath = `${currentDir}/storage/dms/ecc/3.jpeg`;
let filePath = `${currentDir}/e2e/assets/thermograph.jpeg`;
const [fileChooser] = await Promise.all([
page.waitForFileChooser(),

View File

@ -0,0 +1,62 @@
import selectors from '../../helpers/selectors.js';
import getBrowser from '../../helpers/puppeteer';
describe('Entry import buys path', () => {
let browser;
let page;
beforeAll(async() => {
browser = await getBrowser();
page = browser.page;
await page.loginAndModule('buyer', 'entry');
await page.accessToSearchResult('1');
});
afterAll(async() => {
await browser.close();
});
it('should count the summary buys and find there only one at this point', async() => {
const buysCount = await page.countElement(selectors.entrySummary.anyBuyLine);
expect(buysCount).toEqual(1);
});
it('should navigate to the buy section and then click the import button opening the import form', async() => {
await page.accessToSection('entry.card.buy.index');
await page.waitToClick(selectors.entryBuys.importButton);
await page.waitForState('entry.card.buy.import');
});
it('should fill the form, import the designated JSON file and select items for each import and confirm import', async() => {
await page.write(selectors.entryBuys.ref, 'a reference');
await page.write(selectors.entryBuys.observation, 'an observation');
let currentDir = process.cwd();
let filePath = `${currentDir}/e2e/assets/07_import_buys.json`;
const [fileChooser] = await Promise.all([
page.waitForFileChooser(),
page.waitToClick(selectors.entryBuys.file)
]);
await fileChooser.accept([filePath]);
await page.autocompleteSearch(selectors.entryBuys.firstImportedItem, 'Ranged Reinforced weapon pistol 9mm');
await page.autocompleteSearch(selectors.entryBuys.secondImportedItem, 'Melee Reinforced weapon heavy shield 1x0.5m');
await page.autocompleteSearch(selectors.entryBuys.thirdImportedItem, 'Container medical box 1m');
await page.autocompleteSearch(selectors.entryBuys.fourthImportedItem, 'Container ammo box 1m');
await page.waitToClick(selectors.entryBuys.importBuysButton);
const message = await page.waitForSnackbar();
const state = await page.getState();
expect(message.text).toContain('Data saved!');
expect(state).toBe('entry.card.buy.index');
});
it('should navigate to the entry summary and count the buys to find 4 buys have been added', async() => {
await page.waitToClick('vn-icon[icon="preview"]');
await page.waitForNumberOfElements(selectors.entrySummary.anyBuyLine, 5);
});
});