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

#2591 Cypress: Update tests to use new fixture approach #339

Merged
merged 11 commits into from Aug 23, 2019
9 changes: 9 additions & 0 deletions cypress/fixtures/dunning/create_dunning_candidates.json
@@ -0,0 +1,9 @@
{
"dunningTypeName" : "Dunning",
"businessPartnerName" : "Customer Dunning",
"paymentTerm" : "immediately",

"salesInvoiceTargetDocumentType" : "Sales Invoice",
"productName" : "Convenience Salat 250g",
"originalQuantity" : 200
}
8 changes: 8 additions & 0 deletions cypress/fixtures/dunning/create_dunning_documents.json
@@ -0,0 +1,8 @@
{
"dunningTypeName" : "Dunning",
"businessPartnerName" : "Customer Dunning",
"paymentTerm" : "immediately",
"salesInvoiceTargetDocumentType" : "Sales Invoice",
"productName" : "Convenience Salat 250g",
"originalQuantity" : 200
}
4 changes: 4 additions & 0 deletions cypress/fixtures/dunning/create_dunning_type_spec.json
@@ -0,0 +1,4 @@
{
"dunningTypeName" : "dunning test",
"bPartnerName": "Customer Dunning"
}
13 changes: 13 additions & 0 deletions cypress/fixtures/empties/create_empties_receive.json
@@ -0,0 +1,13 @@
{
"businessPartnerName" : "Test Lieferant 1",
"productQuantity" : 222,
"documentType" : "Leergutrücknahme",

"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",

"productCategory" : "ProductCategory",
"productName" : "Product",
"productType" : "Item"
}
15 changes: 15 additions & 0 deletions cypress/fixtures/empties/create_empties_return.json
@@ -0,0 +1,15 @@
{
"businessPartnerName" : "Test Lieferant 1",
"productQuantity" : 222,
"documentType" : "Leergutausgabe",

"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",

"productCategory1" : "ProductCategory",
"productName1" : "Product1",
"productName2" : "Product2",
"productName3" : "Product3",
"productType" : "Item"
}
16 changes: 16 additions & 0 deletions cypress/fixtures/empties/reactivate_and_change_empties_return.json
@@ -0,0 +1,16 @@
{
"businessPartnerName" : "Test Lieferant 1",
"initialProductQuantity" : 222,
"newProductQuantity" : 654,
"documentType" : "Leergutausgabe",

"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",

"productCategory1" : "ProductCategory",
"productName1" : "Product1",
"productName2" : "Product2",
"productName3" : "Product3",
"productType" : "Item"
}
15 changes: 15 additions & 0 deletions cypress/fixtures/empties/reverse_empties_return.json
@@ -0,0 +1,15 @@
{
"businessPartnerName": "Test Lieferant 1",
"productQuantity": 222,
"documentType": "Leergutausgabe",

"priceSystemName": "PriceSystem",
"priceListName": "PriceList",
"priceListVersionName": "PriceListVersion",

"productCategory": "ProductCategory",
"productName1": "Product1",
"productName2": "Product2",
"productName3": "Product3",
"productType": "Item"
}
@@ -0,0 +1,5 @@
{
"productName" : "Product",
"productQty" : 222,
"locatorId" : "Hauptlager_StdWarehouse_Hauptlager_0_0_0"
}
15 changes: 15 additions & 0 deletions cypress/fixtures/payment/create_manual_payment.json
@@ -0,0 +1,15 @@
{
"salesInvoiceTargetDocumentType" : "Sales Invoice",
"salesInvoiceTotalAmount" : 0,
"paymentDocumentType" : "Zahlungseingang",
"paymentTotalAmount" : 0,
"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",

"productCategoryName" : "ProductCategory",
"productName" : "Product",
"productType" : "Service",
"discountSchemaName" : "DiscountSchema",
"bPartnerName" : "BPartner"
}
@@ -0,0 +1,35 @@
{
TheBestPessimist marked this conversation as resolved.
Show resolved Hide resolved

"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",


"attributeName1" : "Attribute1",
"attributeName2" : "Attribute2",
"attributeName3" : "Attribute3",
"attributeValue1" : "AttributeValue1",
"attributeValue2" : "AttributeValue2",
"attributeSetName1" : "AttributeSet1",
"attributeSetName2" : "AttributeSet2",


"productCategoryName1" : "ProductCategory1",
"productCategoryName2" : "ProductCategory2",


"productForPacking1" : "ProductPackingMaterial1",
"productForPacking2" : "ProductPackingMaterial2",
"packingInstructionsName1" : "ProductPackingInstructions1",
"packingInstructionsName2" : "ProductPackingInstructions2",


"productType" : "Item",
"productName1" : "Product1",
"productName2" : "Product2",
"productName3" : "Product3",


"standardPrice" : 123.456,
"taxCategory" : "Regular Tax Rate 19% (Germany)"
}
@@ -0,0 +1,14 @@
{
"priceSystemName" : "PriceSystem",
"priceListVersionName" : "PriceListVersion",
"priceListName" : "PriceList",
"priceListSchemaVersionName" : "PriceListSchemaVersion",
"priceListVersion2ValidFrom" : "01/02/2019",

"categoryName" : "Category",
"productName" : "Product",
"productType" : "Item",

"priceListSchemaName" : "PriceListSchema",
"surchargeAmount" : 222
}
@@ -0,0 +1,6 @@
{
"creditMemoVendor" : "Credit Memo (Vendor)",
"businessPartnerName" : "Test Lieferant 1",
"productName" : "Convenience Salat 250g",
"quantity" : 200
}
@@ -0,0 +1,8 @@
{
"newProductPrice" : "0.123456",
"salesInvoiceTargetDocumentType" : "Sales Invoice",
"businessPartnerName" : "Test Lieferant 1",
"productName" : "Convenience Salat 250g",
"originalQuantity" : 200,
"adjustmentChargePriceDifference": "Nachbelastung - Preisdifferenz"
}
@@ -0,0 +1,8 @@
{
"newProductQuantity" : 50,
"salesInvoiceTargetDocumentType" : "Sales Invoice",
"businessPartnerName" : "Test Lieferant 1",
"productName" : "Convenience Salat 250g",
"originalQuantity" : 200,
"adjustmentChargeQuantityDifference": "Nachbelastung - Mengendifferenz"
}
@@ -0,0 +1,6 @@
{
"newQuantity": "5",
"salesInvoiceTargetDocumentType": "Sales Invoice",
"originalQuantity": 20,
"creditMemoDeliverDiff": "Credit Memo - Deliver Diff"
}
12 changes: 12 additions & 0 deletions cypress/fixtures/sales/credit_memo_for_sales_invoice.json
@@ -0,0 +1,12 @@
{
"priceSystemName" : "PriceSystem",
"priceListName" : "PriceList",
"priceListVersionName" : "PriceListVersion",
"productCategoryName" : "ProductCategory",
"productName" : "Product",
"productType" : "Item",
"discountSchemaName" : "DiscountSchema",
"bPartnerName" : "bPartner",
"salesInvoiceTargetDocumentType" : "Sales Invoice",
"originalQuantity" : 20
}
@@ -0,0 +1,11 @@
{
"businessPartnerName" : "Test Lieferant 1",
"productName" : "Convenience Salat 250g",
"originalQuantity" : 200,
"shipmentNotificationInboxText" : "Lieferung [number] für Partner ${businessPartnerName} wurde erstellt.",
"shipmentNotificationModalText" : "Created: 1 WorkPackage Queue,",
"shipmentQuantityTypeOption" : "Quantity to deliver",
"generateInvoicesNotificationModalText" :
"Fakturlauf mit 1 Rechnungen eingeplant. Es sind bereits 0 zu erstellende Rechnungen in der Warteschlange, die vorher verarbeitet werden.",
"salesInvoiceDocumentType" : "Sales Invoice"
}
@@ -0,0 +1,7 @@
{
"warehouse1" : "Hauptlager",
"warehouse2" : "Lager für Streckengeschäft",
"businessPartnerName" : "Test Lieferant 1",
"productQuantity" : 222,
"productName" : "Convenience Salat 250g"
}
@@ -0,0 +1,10 @@
{
"productName1" : "StockControlPurchase1",
"productName2" : "StockControlPurchase2",
"productName3" : "StockControlPurchase3",
"productCategoryName" : "ProductCategory",
"priceListName" : "PriceList",
"priceSystemName" : "PriceSystem",
"priceListVersionName" : "PriceListVersion",
"productType" : "Item"
}
31 changes: 18 additions & 13 deletions cypress/integration/dunning/create_dunning_candidates.js
Expand Up @@ -23,33 +23,38 @@
/// <reference types="Cypress" />

import { SalesInvoice, SalesInvoiceLine } from '../../support/utils/sales_invoice';
import { humanReadableNow } from '../../support/utils/utils';
import { appendHumanReadableNow } from '../../support/utils/utils';
import { DocumentStatusKey } from '../../support/utils/constants';
import { BPartner } from '../../support/utils/bpartner';
import { DunningCandidates } from '../../page_objects/dunning_candidates';
import { applyFilters, selectNotFrequentFilterWidget, toggleNotFrequentFilters } from '../../support/functions';
import { DunningType } from '../../support/utils/dunning_type';

describe('Create Dunning Candidates', function() {
// human readable date with millis!
const date = humanReadableNow();

const dunningTypeName = `Dunning ${date}`;
// const dunningTypeName = `Dunning 2019-07-05T10:09:30.514Z`;

const businessPartnerName = `Customer Dunning ${date}`;
const paymentTerm = 'immediately';

const salesInvoiceTargetDocumentType = 'Sales Invoice';
const productName = 'Convenience Salat 250g';
const originalQuantity = 200;
let dunningTypeName;
let businessPartnerName;
let paymentTerm;
let salesInvoiceTargetDocumentType;
let productName;
let originalQuantity;

// Test data
let siDocumentNumber;
let siCurrency;
let siDueDate;
let siTotalAmount;

it('Read the fixture', function() {
cy.fixture('dunning/create_dunning_candidates.json').then(f => {
businessPartnerName = appendHumanReadableNow(f['businessPartnerName']);
productName = f['productName'];
originalQuantity = f['originalQuantity'];
dunningTypeName = appendHumanReadableNow(f['dunningTypeName']);
paymentTerm = f['paymentTerm'];
salesInvoiceTargetDocumentType = f['salesInvoiceTargetDocumentType'];
});
});

it('Prepare dunning type', function() {
cy.fixture('settings/dunning_type.json').then(dunningType => {
Object.assign(new DunningType(), dunningType)
Expand Down
28 changes: 18 additions & 10 deletions cypress/integration/dunning/create_dunning_documents.js
Expand Up @@ -23,7 +23,7 @@
/// <reference types="Cypress" />

import { SalesInvoice, SalesInvoiceLine } from '../../support/utils/sales_invoice';
import { humanReadableNow } from '../../support/utils/utils';
import { appendHumanReadableNow } from '../../support/utils/utils';
import { DocumentStatusKey } from '../../support/utils/constants';
import { BPartner } from '../../support/utils/bpartner';
import { DunningCandidates } from '../../page_objects/dunning_candidates';
Expand All @@ -33,23 +33,31 @@ import { DunningDocuments } from '../../page_objects/dunning_documents';
import { salesInvoices } from '../../page_objects/sales_invoices';

describe('Create Dunning Documents', function() {
// human readable date with millis!
const date = humanReadableNow();
let dunningTypeName;

const dunningTypeName = `Dunning ${date}`;
let businessPartnerName;
let paymentTerm;

const businessPartnerName = `Customer Dunning ${date}`;
const paymentTerm = 'immediately';

const salesInvoiceTargetDocumentType = 'Sales Invoice';
const productName = 'Convenience Salat 250g';
const originalQuantity = 200;
let salesInvoiceTargetDocumentType;
let productName;
let originalQuantity;

// Test data
let siDocumentNumber;
let siCurrency;
let siRecordId;

it('Read the fixture', function() {
cy.fixture('dunning/create_dunning_documents.json').then(f => {
businessPartnerName = appendHumanReadableNow(f['businessPartnerName']);
productName = f['productName'];
originalQuantity = f['originalQuantity'];
dunningTypeName = appendHumanReadableNow(f['dunningTypeName']);
paymentTerm = f['paymentTerm'];
salesInvoiceTargetDocumentType = f['salesInvoiceTargetDocumentType'];
});
});

it('Prepare dunning type', function() {
cy.fixture('settings/dunning_type.json').then(dunningType => {
Object.assign(new DunningType(), dunningType)
Expand Down
17 changes: 11 additions & 6 deletions cypress/integration/dunning/create_dunning_type_spec.js
Expand Up @@ -22,16 +22,21 @@

import { DunningType } from '../../support/utils/dunning_type';
import { BPartner } from '../../support/utils/bpartner';
import { appendHumanReadableNow } from '../../support/utils/utils';

describe('create dunning type', function() {
// human readable date with millis!
const date = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();

const dunningTypeName = `dunning test ${date}`;
const bPartnerName = `Customer Dunning ${date}`;
let dunningTypeName;
let bPartnerName;
let bpartnerID = null;

before(function() {
it('Read the fixture', function() {
cy.fixture('dunning/create_dunning_type_spec.json').then(f => {
dunningTypeName = appendHumanReadableNow(f['dunningTypeName']);
bPartnerName = appendHumanReadableNow(f['bPartnerName']);
});
});

it('Create dunning type and bpartner', function() {
cy.fixture('settings/dunning_type.json').then(dunningType => {
Object.assign(new DunningType(), dunningType)
.setName(dunningTypeName)
Expand Down