This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #317 from metasfresh/gh308-app
#308 Materialentnahme complete HU
- Loading branch information
Showing
2 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
151 changes: 151 additions & 0 deletions
151
cypress/integration/logistics/materialentnahme_complete_HU.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
import { BPartner } from '../../support/utils/bpartner'; | ||
import { BPartnerLocation } from '../../support/utils/bpartner_ui'; | ||
import { DiscountSchema } from '../../support/utils/discountschema'; | ||
import { ProductCategory } from '../../support/utils/product'; | ||
import { PackingMaterial } from '../../support/utils/packing_material'; | ||
import { PackingInstructions } from '../../support/utils/packing_instructions'; | ||
import { PackingInstructionsVersion } from '../../support/utils/packing_instructions_version'; | ||
import { Builder } from '../../support/utils/builder'; | ||
import { humanReadableNow } from '../../support/utils/utils'; | ||
import { PurchaseOrder, PurchaseOrderLine } from '../../support/utils/purchase_order'; | ||
import { | ||
applyFilters, | ||
selectNotFrequentFilterWidget, | ||
toggleNotFrequentFilters, | ||
clearNotFrequentFilters, | ||
} from '../../support/functions'; | ||
|
||
const date = humanReadableNow(); | ||
const productForPackingMaterial = `ProductPackingMaterial_${date}`; | ||
const packingInstructionsName = `ProductPackingInstructions_${date}`; | ||
const productName1 = `Product1_${date}`; | ||
const productCategoryName = `ProductCategoryName_${date}`; | ||
const discountSchemaName = `DiscountSchema_${date}`; | ||
const priceSystemName = `PriceSystem_${date}`; | ||
const priceListName = `PriceList_${date}`; | ||
const priceListVersionName = `PriceListVersion_${date}`; | ||
const productType = 'Item'; | ||
const vendorName = `Vendor_${date}`; | ||
const materialentnahme = 'Materialentnahmelager'; | ||
const warehouseName = 'Hauptlager_StdWarehouse_Hauptlager_0_0_0'; | ||
|
||
describe('Change warehouse to Materialentnahmelager', function() { | ||
it('Create price entities', function() { | ||
Builder.createBasicPriceEntities(priceSystemName, priceListVersionName, priceListName, false); | ||
cy.fixture('discount/discountschema.json').then(discountSchemaJson => { | ||
Object.assign(new DiscountSchema(), discountSchemaJson) | ||
.setName(discountSchemaName) | ||
.apply(); | ||
}); | ||
}); | ||
it('Create packing related entities', function() { | ||
// eslint-disable-next-line | ||
Builder.createProductWithPriceUsingExistingCategory(priceListName, productForPackingMaterial, productForPackingMaterial, productType, "24_Gebinde"); | ||
cy.fixture('product/packing_material.json').then(packingMaterialJson => { | ||
Object.assign(new PackingMaterial(), packingMaterialJson) | ||
.setName(productForPackingMaterial) | ||
.setProduct(productForPackingMaterial) | ||
.apply(); | ||
}); | ||
cy.fixture('product/packing_instructions.json').then(packingInstructionsJson => { | ||
Object.assign(new PackingInstructions(), packingInstructionsJson) | ||
.setName(packingInstructionsName) | ||
.apply(); | ||
}); | ||
cy.fixture('product/packing_instructions_version.json').then(pivJson => { | ||
Object.assign(new PackingInstructionsVersion(), pivJson) | ||
.setName(packingInstructionsName) | ||
.setPackingInstructions(packingInstructionsName) | ||
.setPackingMaterial(productForPackingMaterial) | ||
.apply(); | ||
}); | ||
}); | ||
|
||
it('Create category', function() { | ||
cy.fixture('product/simple_productCategory.json').then(productCategoryJson => { | ||
Object.assign(new ProductCategory(), productCategoryJson) | ||
.setName(productCategoryName) | ||
.setValue(productCategoryName) | ||
.apply(); | ||
}); | ||
}); | ||
|
||
it('Create product1', function() { | ||
Builder.createProductWithPriceAndCUTUAllocationUsingExistingCategory( | ||
productCategoryName, | ||
productCategoryName, | ||
priceListName, | ||
productName1, | ||
productName1, | ||
productType, | ||
packingInstructionsName | ||
); | ||
}); | ||
|
||
it('Create vendor', function() { | ||
new BPartner({ name: vendorName }) | ||
.setVendor(true) | ||
.setVendorPricingSystem(priceSystemName) | ||
.setVendorDiscountSchema(discountSchemaName) | ||
.setPaymentTerm('30 days net') | ||
.addLocation(new BPartnerLocation('Address1').setCity('Cologne').setCountry('Deutschland')) | ||
.apply(); | ||
|
||
cy.readAllNotifications(); | ||
}); | ||
}); | ||
|
||
describe('Create a purchase order and Material Receipts', function() { | ||
it('Create a purchase order and visit Material Receipt Candidates', function() { | ||
new PurchaseOrder() | ||
.setBPartner(vendorName) | ||
.setPriceSystem(priceSystemName) | ||
.setPoReference('test') | ||
.addLine(new PurchaseOrderLine().setProduct(productName1).setQuantity(1)) | ||
.apply(); | ||
cy.completeDocument(); | ||
}); | ||
|
||
it('Visit referenced Material Receipt Candidates', function() { | ||
cy.openReferencedDocuments('M_ReceiptSchedule'); | ||
cy.expectNumberOfRows(2); | ||
}); | ||
|
||
it('Create Material Receipt 1', function() { | ||
cy.selectNthRow(0).click(); | ||
cy.executeQuickAction('WEBUI_M_ReceiptSchedule_ReceiveHUs_UsingDefaults', false); | ||
cy.selectNthRow(0, true); | ||
cy.executeQuickAction('WEBUI_M_HU_CreateReceipt_NoParams', false, true); | ||
cy.pressDoneButton(); | ||
}); | ||
it('Check if Materialentnahmelager warehouse exists', function() { | ||
cy.visitWindow('139'); | ||
toggleNotFrequentFilters(); | ||
selectNotFrequentFilterWidget('default'); | ||
cy.writeIntoStringField('Name', materialentnahme, false, null, true); | ||
applyFilters(); | ||
|
||
cy.expectNumberOfRows(1); | ||
}); | ||
it('Change warehouse in handling unit editor', function() { | ||
cy.visitWindow('540189'); | ||
toggleNotFrequentFilters(); | ||
selectNotFrequentFilterWidget('default'); | ||
cy.writeIntoLookupListField('M_Product_ID', productName1, productName1, false, false, null, true); | ||
cy.writeIntoLookupListField('M_Locator_ID', warehouseName, warehouseName, false, false, null, true); | ||
applyFilters(); | ||
|
||
cy.selectNthRow(0).click(); | ||
cy.executeQuickAction('WEBUI_M_HU_MoveToDirectWarehouse', false, false, false); | ||
|
||
clearNotFrequentFilters(); | ||
|
||
toggleNotFrequentFilters(); | ||
selectNotFrequentFilterWidget('default'); | ||
cy.writeIntoLookupListField('M_Product_ID', productName1, productName1, false, false, null, true); | ||
cy.writeIntoLookupListField('M_Locator_ID', materialentnahme, materialentnahme, false, false, null, true); | ||
applyFilters(); | ||
|
||
cy.expectNumberOfRows(2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters