From 1c70ad3a4b0a47e5d46d2d3bf976168356999589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20Szcz=C4=99ch?= <30683248+szczecha@users.noreply.github.com> Date: Mon, 14 Nov 2022 14:56:50 +0000 Subject: [PATCH] Fix adyen tests (#2545) * update adyen plugin before tests * add payments tag to PR template --- .github/PULL_REQUEST_TEMPLATE.md | 1 + cypress/e2e/configuration/plugins/adyen.js | 17 +++++++++++------ cypress/support/api/requests/Plugins.js | 15 ++++++++++----- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index bbc3462d7..3945601c0 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -53,5 +53,6 @@ To run all tests, just select the stable checkbox. To speed up tests, increase t 20. [ ] translations 21. [ ] navigation 22. [ ] variants +23. [ ] payments CONTAINERS=1 \ No newline at end of file diff --git a/cypress/e2e/configuration/plugins/adyen.js b/cypress/e2e/configuration/plugins/adyen.js index 5fa7ad504..1da28fcf1 100644 --- a/cypress/e2e/configuration/plugins/adyen.js +++ b/cypress/e2e/configuration/plugins/adyen.js @@ -9,6 +9,7 @@ import { createCheckout, } from "../../../support/api/requests/Checkout"; import { getOrder } from "../../../support/api/requests/Order"; +import { updatePlugin } from "../../../support/api/requests/Plugins"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import { addAdyenPayment, @@ -66,15 +67,19 @@ describe("Adyen payments", () => { }); }) .then( - ({ - warehouse: warehouseResp, - shippingZone: shippingZoneResp, - shippingMethod: shippingMethodResp, - }) => { + ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { warehouse = warehouseResp; shippingMethod = shippingMethodResp; }, - ); + ) + .then(() => { + updatePlugin( + "mirumee.payments.adyen", + "adyen-auto-capture", + true, + defaultChannel.id, + ); + }); createTypeAttributeAndCategoryForProduct({ name }) .then(({ productType, attribute, category }) => { createProductInChannel({ diff --git a/cypress/support/api/requests/Plugins.js b/cypress/support/api/requests/Plugins.js index 402ddded1..0821c5f34 100644 --- a/cypress/support/api/requests/Plugins.js +++ b/cypress/support/api/requests/Plugins.js @@ -1,10 +1,15 @@ -export function updatePlugin(id, name, value) { +export function updatePlugin(id, name, value, channel) { + const channelLine = channel ? `channelId: "${channel}"` : ""; + const mutation = `mutation{ - pluginUpdate(id:"${id}", input:{ - configuration:{ - name:"${name}" + pluginUpdate( + id:"${id}", + ${channelLine}, + input:{ + configuration:[{ + name:"${name}", value:"${value}" - } + }] }){ errors{ field