From d75d39735aa813b6e342df24d66e45f891cfedf4 Mon Sep 17 00:00:00 2001 From: Vlad Solomon Date: Tue, 13 Aug 2019 09:27:57 +0300 Subject: [PATCH 1/4] Create pricelist_with_currency_CHF_and_precision_3_spec.js --- ..._with_currency_CHF_and_precision_3_spec.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js diff --git a/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js new file mode 100644 index 00000000..55a8ad37 --- /dev/null +++ b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js @@ -0,0 +1,29 @@ +import { PriceList } from '../../support/utils/pricelist'; +import { Pricesystem } from '../../support/utils/pricesystem'; +import { humanReadableNow } from '../../support/utils/utils'; + +describe('Create Pricelist for Automatic End2End Tests with cypress https://github.com/metasfresh/metasfresh-e2e/issues/195', function() { + const date = humanReadableNow(); + const priceSystemName = `TestPriceSystem ${date}`; + const priceListName = `TestPriceList ${date}`; + it('Create new Pricesystem', function() { + cy.fixture('price/pricesystem.json').then(priceSystemJson => { + Object.assign(new Pricesystem(), priceSystemJson) + .setName(priceSystemName) + .apply(); + }); + }); + + it('Create new Pricelist with currency CHF and precision 3', function() { + cy.fixture('price/pricelist.json').then(pricelistJson => { + Object.assign(new PriceList(), pricelistJson) + .setName(priceListName) + .setPriceSystem(priceSystemName) + .setCountry(`Switzerland`) + .setCurrency(`CHF`) + .setPricePrecision(3) + .setIsSalesPriceList(true) + .apply(); + }); + }); +}); From 67bdd2d32775bf85efa3eb24c9685c7fa4286641 Mon Sep 17 00:00:00 2001 From: Vlad Solomon Date: Tue, 13 Aug 2019 15:36:46 +0300 Subject: [PATCH 2/4] Requested changes. - got rid of "magic" - changed the describe --- cypress.json | 2 +- ...icelist_with_currency_CHF_and_precision_3_spec.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cypress.json b/cypress.json index c2b781d0..b4ee2fec 100644 --- a/cypress.json +++ b/cypress.json @@ -4,7 +4,7 @@ "baseUrl_comment1": "baseUrl can be overridden by setting the CYPRESS_baseUrl environment variable", "baseUrl_comment2": "Example: CYPRESS_baseUrl=http://192.168.99.100:30080 npm run cypress:open", "baseUrl_comment3": "See https://docs.cypress.io/guides/guides/environment-variables.html#We-can-move-this-into-an-environment-variable", - "baseUrl": "http://localhost:3000", + "baseUrl": "https://dev639.metasfresh.com", "projectId_comment": "Our recorded test runs can be found here: https://dashboard.cypress.io/#/projects/5yp4q1/runs", "projectId": "5yp4q1", diff --git a/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js index 55a8ad37..f231b184 100644 --- a/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js +++ b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js @@ -2,10 +2,14 @@ import { PriceList } from '../../support/utils/pricelist'; import { Pricesystem } from '../../support/utils/pricesystem'; import { humanReadableNow } from '../../support/utils/utils'; -describe('Create Pricelist for Automatic End2End Tests with cypress https://github.com/metasfresh/metasfresh-e2e/issues/195', function() { +describe('Create a Pricelist with currency CHF and precision 3: https://github.com/metasfresh/metasfresh-e2e/issues/195', function() { const date = humanReadableNow(); const priceSystemName = `TestPriceSystem ${date}`; const priceListName = `TestPriceList ${date}`; + const pricePrecision = 3; + const currency = `CHF`; + const country = `Switzerland`; + it('Create new Pricesystem', function() { cy.fixture('price/pricesystem.json').then(priceSystemJson => { Object.assign(new Pricesystem(), priceSystemJson) @@ -19,9 +23,9 @@ describe('Create Pricelist for Automatic End2End Tests with cypress https://gith Object.assign(new PriceList(), pricelistJson) .setName(priceListName) .setPriceSystem(priceSystemName) - .setCountry(`Switzerland`) - .setCurrency(`CHF`) - .setPricePrecision(3) + .setCountry(country) + .setCurrency(currency) + .setPricePrecision(pricePrecision) .setIsSalesPriceList(true) .apply(); }); From 531f7d63565003e695fddf218ad4c7402a91486c Mon Sep 17 00:00:00 2001 From: Vlad Solomon <52159297+solovmon@users.noreply.github.com> Date: Tue, 13 Aug 2019 16:13:50 +0300 Subject: [PATCH 3/4] Revert --- cypress.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index b4ee2fec..c2b781d0 100644 --- a/cypress.json +++ b/cypress.json @@ -4,7 +4,7 @@ "baseUrl_comment1": "baseUrl can be overridden by setting the CYPRESS_baseUrl environment variable", "baseUrl_comment2": "Example: CYPRESS_baseUrl=http://192.168.99.100:30080 npm run cypress:open", "baseUrl_comment3": "See https://docs.cypress.io/guides/guides/environment-variables.html#We-can-move-this-into-an-environment-variable", - "baseUrl": "https://dev639.metasfresh.com", + "baseUrl": "http://localhost:3000", "projectId_comment": "Our recorded test runs can be found here: https://dashboard.cypress.io/#/projects/5yp4q1/runs", "projectId": "5yp4q1", From 52f008a79e666e98c3a9aa7e6759f7cdc8bdf578 Mon Sep 17 00:00:00 2001 From: Vlad Solomon <52159297+solovmon@users.noreply.github.com> Date: Fri, 16 Aug 2019 04:24:53 +0300 Subject: [PATCH 4/4] Removed unnecessary link. --- .../price/pricelist_with_currency_CHF_and_precision_3_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js index f231b184..86cd35c1 100644 --- a/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js +++ b/cypress/integration/price/pricelist_with_currency_CHF_and_precision_3_spec.js @@ -2,7 +2,7 @@ import { PriceList } from '../../support/utils/pricelist'; import { Pricesystem } from '../../support/utils/pricesystem'; import { humanReadableNow } from '../../support/utils/utils'; -describe('Create a Pricelist with currency CHF and precision 3: https://github.com/metasfresh/metasfresh-e2e/issues/195', function() { +describe('Create a Pricelist with currency CHF and precision 3', function() { const date = humanReadableNow(); const priceSystemName = `TestPriceSystem ${date}`; const priceListName = `TestPriceList ${date}`;