From 2b4a819faea6f604b3c7bf7f7b7d306bcf8ebcd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anna=20Szcz=C4=99ch?= <30683248+szczecha@users.noreply.github.com> Date: Mon, 9 Jan 2023 12:28:12 +0100 Subject: [PATCH] Fix for cleaning customers function in e2e (#2952) --- cypress/support/api/requests/Customer.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/support/api/requests/Customer.js b/cypress/support/api/requests/Customer.js index 310137467..f51faba36 100644 --- a/cypress/support/api/requests/Customer.js +++ b/cypress/support/api/requests/Customer.js @@ -33,11 +33,13 @@ export function createCustomer(email, customerName, address, isActive = false) { } export function deleteCustomersStartsWith(startsWith) { - getCustomers(startsWith).then(resp => { + const serverStoredEmail = startsWith.toLowerCase(); + + getCustomers(serverStoredEmail).then(resp => { if (resp.body.data.customers) { const customers = resp.body.data.customers.edges; customers.forEach(element => { - if (element.node.email.includes(startsWith)) { + if (element.node.email.includes(serverStoredEmail)) { deleteCustomer(element.node.id); } });