Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
#145 purchase order from sales order in progress
Browse files Browse the repository at this point in the history
#145 Purchase order from sales order
  • Loading branch information
cristinastefan90 committed Jul 16, 2019
1 parent 63c4b18 commit fc6e59f
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions cypress/integration/purchase/purchase_order_from_sales_order.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ describe('Create Purchase order - material receipt - invoice', function() {
const priceListVersionName = `PriceListVersion ${timestamp}`;
const productType = 'Item';
const vendorName = `Vendor ${timestamp}`;

const customerName = `Customer ${timestamp}`;

before(function() {
Builder.createBasicPriceEntities(priceSystemName, priceListVersionName, priceListName, false);
Builder.createBasicPriceEntities(priceSystemName, priceListVersionName, priceListName, true);
cy.fixture('discount/discountschema.json').then(discountSchemaJson => {
Object.assign(new DiscountSchema(), discountSchemaJson)
.setName(discountSchemaName)
Expand Down Expand Up @@ -80,28 +79,21 @@ describe('Create Purchase order - material receipt - invoice', function() {
vendorName
);
/**A customer is needed for sales order */
// new BPartner({ name: customerName })
// .setVendor(true)
// .setVendorPricingSystem(priceSystemName)
// .setVendorDiscountSchema(discountSchemaName)
// .setPaymentTerm('30 days net')
// .addLocation(new BPartnerLocation('Address2').setCity('Cologne').setCountry('Deutschland'))
// .apply();
cy.fixture('sales/simple_customer.json').then(customerJson => {
const bpartner = new BPartner({ ...customerJson, name: customerName })
.setCustomerDiscountSchema(discountSchemaName)
.setBank(undefined);

bpartner.apply();
});
new BPartner({ name: customerName })
.setCustomer(true)
.setCustomerPricingSystem(priceSystemName)
.setCustomerDiscountSchema(discountSchemaName)
.setPaymentTerm('30 days net')
.addLocation(new BPartnerLocation('Address1').setCity('Cologne').setCountry('Deutschland'))
.apply();
cy.readAllNotifications();
});
it('Create a sales order', function() {
cy.visitWindow('143', 'NEW');
cy.get('#lookup_C_BPartner_ID input')
.type(customerName)
.type(vendorName)
.type('\n');
cy.contains('.input-dropdown-list-option', customerName).click();
cy.contains('.input-dropdown-list-option', vendorName).click();

cy.selectInListField('M_PricingSystem_ID', priceSystemName);

Expand All @@ -128,15 +120,17 @@ describe('Create Purchase order - material receipt - invoice', function() {
cy.get('.form-field-Qty')
.find('input')
.should('have.value', '0.1')
.clear()
.type('1{enter}');
// cy.wait('@resetQuickInputFields');
cy.wait(5000);
cy.wait(8000);
/**Complete sales order */
cy.get('.form-field-DocAction ul')
.click({ force: true })
.get('li')
.eq('1')
.click({ force: true });
cy.wait(8000);
cy.executeHeaderActionWithDialog('C_Order_CreatePOFromSOs');
cy.pressStartButton();
});
});

0 comments on commit fc6e59f

Please sign in to comment.