From 17afad594c06cdbbf1ec9c6e8cf072775956426c Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Thu, 19 Nov 2020 12:04:47 +0200 Subject: [PATCH 1/9] MC-37502: Create automated test for "Move Order to Archive" --- ...order_with_invoice_shipment_creditmemo.php | 143 ++++++++++++++++++ ...h_invoice_shipment_creditmemo_rollback.php | 43 ++++++ 2 files changed, 186 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php new file mode 100644 index 0000000000000..4a2c28b3d0fd3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -0,0 +1,143 @@ +requireDataFixture('Magento/Sales/_files/default_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +/** @var CreditmemoItemInterfaceFactory $creditmemoItemFactory */ +$creditmemoItemFactory = $objectManager->get(CreditmemoItemInterfaceFactory::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var CreditmemoItemRepositoryInterface $creditmemoItemRepository */ +$creditmemoItemRepository = $objectManager->get(CreditmemoItemRepositoryInterface::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US' +]; +$product = $productRepository->get('simple'); +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod('checkmo') + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100000001') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +$creditmemo = $creditmemoFactory->createByOrder($order, $order->getData()); +$creditmemo->setOrder($order); +$creditmemo->setState(Creditmemo::STATE_OPEN); +$creditmemo->setIncrementId($order->getIncrementId()); +$creditmemoRepository->save($creditmemo); + +$orderItem->setName('Test item') + ->setQtyRefunded(2) + ->setQtyInvoiced(2) + ->setOriginalPrice($product->getPrice()); +$creditItem = $creditmemoItemFactory->create(); +$creditItem->setCreditmemo($creditmemo) + ->setName('Creditmemo item') + ->setOrderItemId($orderItem->getId()) + ->setQty(2) + ->setPrice($product->getPrice()); +$creditmemoItemRepository->save($creditItem); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php new file mode 100644 index 0000000000000..56670ecc2a470 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -0,0 +1,43 @@ +get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From 6d56b4d3609243147be73a89bdf3e74ccfede7fb Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Thu, 19 Nov 2020 13:19:33 +0200 Subject: [PATCH 2/9] MC-37500: Create automated test for "Shipment Sales Archive" --- .../Section/AdminShipmentsGridFiltersSection.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml diff --git a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml b/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml new file mode 100644 index 0000000000000..6e5b197286bf3 --- /dev/null +++ b/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml @@ -0,0 +1,14 @@ + + + + +
+ +
+
From e6357812c2dc27d9c47dab42c422cf876a374b0a Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Thu, 19 Nov 2020 14:59:51 +0200 Subject: [PATCH 3/9] MC-37502: Create automated test for "Move Order to Archive" --- .../Sales/_files/order_with_invoice_shipment_creditmemo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php index 4a2c28b3d0fd3..f84a8b65e13fd 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -9,6 +9,7 @@ use Magento\Customer\Api\Data\AddressInterface; use Magento\Customer\Api\Data\CustomerInterface; use Magento\Framework\DB\Transaction; +use Magento\OfflinePayments\Model\Checkmo; use Magento\Sales\Api\CreditmemoItemRepositoryInterface; use Magento\Sales\Api\CreditmemoRepositoryInterface; use Magento\Sales\Api\Data\CreditmemoItemInterfaceFactory; @@ -60,9 +61,10 @@ AddressInterface::CITY => 'Los Angeles', CustomerInterface::EMAIL => 'admin@example.com', AddressInterface::TELEPHONE => '11111111', - AddressInterface::COUNTRY_ID => 'US' + AddressInterface::COUNTRY_ID => 'US', ]; $product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ $addressFactory = $objectManager->get(AddressFactory::class); $billingAddress = $addressFactory->create(['data' => $addressData]); $billingAddress->setAddressType(Address::TYPE_BILLING); @@ -71,7 +73,7 @@ /** @var OrderPaymentInterfaceFactory $paymentFactory */ $paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); $payment = $paymentFactory->create(); -$payment->setMethod('checkmo') +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) ->setAdditionalInformation('last_trans_id', '11122') ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); /** @var OrderItemInterface $orderItem */ From 5b2ab2fdcff76aafec82935856fc2e2a45087777 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Fri, 20 Nov 2020 16:28:05 +0200 Subject: [PATCH 4/9] MC-37502: Create automated test for "Move Order to Archive" --- .../_files/order_with_invoice_shipment_creditmemo.php | 8 ++++++-- .../order_with_invoice_shipment_creditmemo_rollback.php | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php index f84a8b65e13fd..c95b21c1433bf 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo.php @@ -27,6 +27,7 @@ use Magento\Sales\Model\Order\Creditmemo; use Magento\Sales\Model\Order\CreditmemoFactory; use Magento\Sales\Model\Order\ShipmentFactory; +use Magento\Store\Model\StoreManagerInterface; use Magento\TestFramework\Helper\Bootstrap; use Magento\TestFramework\Workaround\Override\Fixture\Resolver; @@ -34,6 +35,8 @@ Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); $objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); /** @var ProductRepositoryInterface $productRepository */ $productRepository = $objectManager->get(ProductRepositoryInterface::class); $productRepository->cleanCache(); @@ -89,7 +92,7 @@ ->setName('Test item'); /** @var OrderInterface $order */ $order = $objectManager->get(OrderInterfaceFactory::class)->create(); -$order->setIncrementId('100000001') +$order->setIncrementId('100000111') ->setState(Order::STATE_PROCESSING) ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) ->setSubtotal(100) @@ -103,7 +106,8 @@ ->setBillingAddress($billingAddress) ->setShippingAddress($shippingAddress) ->addItem($orderItem) - ->setPayment($payment); + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); $orderRepository->save($order); $invoice = $invoiceService->prepareInvoice($order); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php index 56670ecc2a470..f9330bc99ac14 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -40,4 +40,7 @@ $registry->unregister('isSecureArea'); $registry->register('isSecureArea', false); +$creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); +$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); + Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From 36debb3d05e13b07b27a057d8ea6a311f67a830e Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Sat, 21 Nov 2020 12:12:01 +0200 Subject: [PATCH 5/9] MC-37504: Create automated test for "Mass Action Archive Order" --- .../Magento/Sales/_files/order_closed.php | 148 ++++++++++++++++++ .../Sales/_files/order_closed_rollback.php | 46 ++++++ .../Magento/Sales/_files/order_complete.php | 116 ++++++++++++++ .../Sales/_files/order_complete_rollback.php | 40 +++++ .../_files/order_state_hold_rollback.php | 10 ++ 5 files changed, 360 insertions(+) create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php create mode 100644 dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php new file mode 100644 index 0000000000000..1708d89881592 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed.php @@ -0,0 +1,148 @@ +requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +/** @var CreditmemoItemInterfaceFactory $creditmemoItemFactory */ +$creditmemoItemFactory = $objectManager->get(CreditmemoItemInterfaceFactory::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var CreditmemoItemRepositoryInterface $creditmemoItemRepository */ +$creditmemoItemRepository = $objectManager->get(CreditmemoItemRepositoryInterface::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US', +]; +$product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100001111') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); +/** @var CreditmemoFactory $creditmemoFactory */ +$creditmemoFactory = $objectManager->get(CreditmemoFactory::class); +$creditmemo = $creditmemoFactory->createByOrder($order, $order->getData()); +$creditmemo->setOrder($order); +$creditmemo->setState(Creditmemo::STATE_OPEN); +$creditmemo->setIncrementId($order->getIncrementId()); +$creditmemoRepository->save($creditmemo); + +$orderItem->setName('Test item') + ->setQtyRefunded(2) + ->setQtyInvoiced(2) + ->setOriginalPrice($product->getPrice()); +$creditItem = $creditmemoItemFactory->create(); +$creditItem->setCreditmemo($creditmemo) + ->setName('Creditmemo item') + ->setOrderItemId($orderItem->getId()) + ->setQty(2) + ->setPrice($product->getPrice()); +$creditmemoItemRepository->save($creditItem); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php new file mode 100644 index 0000000000000..13263fd442713 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php @@ -0,0 +1,46 @@ +get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var CreditmemoRepositoryInterface $creditmemoRepository */ +$creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100001111'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +$creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); +$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php new file mode 100644 index 0000000000000..bb8f028b41380 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete.php @@ -0,0 +1,116 @@ +requireDataFixture('Magento/Sales/_files/default_rollback.php'); +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple.php'); + +$objectManager = Bootstrap::getObjectManager(); +/** @var StoreManagerInterface $storeManager */ +$storeManager = $objectManager->get(StoreManagerInterface::class); +/** @var ProductRepositoryInterface $productRepository */ +$productRepository = $objectManager->get(ProductRepositoryInterface::class); +$productRepository->cleanCache(); +/** @var OrderRepositoryInterface $orderRepository */ +$orderRepository = $objectManager->get(OrderRepositoryInterface::class); +/** @var InvoiceManagementInterface $invoiceService */ +$invoiceService = $objectManager->get(InvoiceManagementInterface::class); +/** @var ShipmentFactory $shipmentFactory */ +$shipmentFactory = $objectManager->get(ShipmentFactory::class); +$addressData = [ + AddressInterface::REGION => 'CA', + AddressInterface::REGION_ID => '12', + AddressInterface::POSTCODE => '11111', + AddressInterface::LASTNAME => 'lastname', + AddressInterface::FIRSTNAME => 'firstname', + AddressInterface::STREET => 'street', + AddressInterface::CITY => 'Los Angeles', + CustomerInterface::EMAIL => 'admin@example.com', + AddressInterface::TELEPHONE => '11111111', + AddressInterface::COUNTRY_ID => 'US', +]; +$product = $productRepository->get('simple'); +/** @var AddressFactory $addressFactory */ +$addressFactory = $objectManager->get(AddressFactory::class); +$billingAddress = $addressFactory->create(['data' => $addressData]); +$billingAddress->setAddressType(Address::TYPE_BILLING); +$shippingAddress = clone $billingAddress; +$shippingAddress->setId(null)->setAddressType(Address::TYPE_SHIPPING); +/** @var OrderPaymentInterfaceFactory $paymentFactory */ +$paymentFactory = $objectManager->get(OrderPaymentInterfaceFactory::class); +$payment = $paymentFactory->create(); +$payment->setMethod(Checkmo::PAYMENT_METHOD_CHECKMO_CODE) + ->setAdditionalInformation('last_trans_id', '11122') + ->setAdditionalInformation('metadata', ['type' => 'free', 'fraudulent' => false]); +/** @var OrderItemInterface $orderItem */ +$orderItem = $objectManager->get(OrderItemInterfaceFactory::class)->create(); +$orderItem->setProductId($product->getId()) + ->setQtyOrdered(2) + ->setBasePrice($product->getPrice()) + ->setPrice($product->getPrice()) + ->setRowTotal($product->getPrice()) + ->setProductType('simple') + ->setName($product->getName()) + ->setSku($product->getSku()) + ->setName('Test item'); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create(); +$order->setIncrementId('100000333') + ->setState(Order::STATE_PROCESSING) + ->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING)) + ->setSubtotal(100) + ->setGrandTotal(100) + ->setBaseSubtotal(100) + ->setBaseGrandTotal(100) + ->setOrderCurrencyCode('USD') + ->setBaseCurrencyCode('USD') + ->setCustomerIsGuest(true) + ->setCustomerEmail('customer@null.com') + ->setBillingAddress($billingAddress) + ->setShippingAddress($shippingAddress) + ->addItem($orderItem) + ->setPayment($payment) + ->setStoreId($storeManager->getStore('default')->getId()); +$orderRepository->save($order); + +$invoice = $invoiceService->prepareInvoice($order); +$invoice->register(); +$invoice->setIncrementId($order->getIncrementId()); +$order = $invoice->getOrder(); +$order->setIsInProcess(true); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($invoice)->addObject($order)->save(); + +$items = []; +foreach ($order->getItems() as $item) { + $items[$item->getId()] = $item->getQtyOrdered(); +} + +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); +$shipment->register(); +$shipment->setIncrementId($order->getIncrementId()); +$transactionSave = $objectManager->create(Transaction::class); +$transactionSave->addObject($shipment)->addObject($order)->save(); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php new file mode 100644 index 0000000000000..06a36c16b90f7 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_complete_rollback.php @@ -0,0 +1,40 @@ +get(OrderRepositoryInterface::class); +/** @var InvoiceRepositoryInterface $invoiceRepository */ +$invoiceRepository = $objectManager->get(InvoiceRepositoryInterface::class); +/** @var ShipmentRepositoryInterface $shipmentRepository */ +$shipmentRepository = $objectManager->get(ShipmentRepositoryInterface::class); +/** @var OrderInterface $order */ +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000333'); +/** @var Registry $registry */ +$registry = $objectManager->get(Registry::class); +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', true); + +foreach ($order->getInvoiceCollection() as $invoice) { + $invoiceRepository->delete($invoice); +} + +$orderRepository->delete($order); + +$registry->unregister('isSecureArea'); +$registry->register('isSecureArea', false); + +Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php new file mode 100644 index 0000000000000..07d468289f5b4 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_state_hold_rollback.php @@ -0,0 +1,10 @@ +requireDataFixture('Magento/Sales/_files/order_rollback.php'); From 4508c482a2ea3116832679223245ae91e37a60f5 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Mon, 23 Nov 2020 11:36:32 +0200 Subject: [PATCH 6/9] MC-37502: Create automated test for "Move Order to Archive" --- .../_files/order_with_invoice_shipment_creditmemo_rollback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php index f9330bc99ac14..123d44c4610d0 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_invoice_shipment_creditmemo_rollback.php @@ -25,7 +25,7 @@ /** @var CreditmemoRepositoryInterface $creditmemoRepository */ $creditmemoRepository = $objectManager->get(CreditmemoRepositoryInterface::class); /** @var OrderInterface $order */ -$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000001'); +$order = $objectManager->get(OrderInterfaceFactory::class)->create()->loadByIncrementId('100000111'); /** @var Registry $registry */ $registry = $objectManager->get(Registry::class); $registry->unregister('isSecureArea'); From f4320523eaf3c59cd0fc61088f3a0d51170b90f4 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Mon, 23 Nov 2020 20:43:54 +0200 Subject: [PATCH 7/9] MC-37504: Create automated test for "Mass Action Archive Order" --- .../testsuite/Magento/Sales/_files/order_closed_rollback.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php index 13263fd442713..4567294cec0a6 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_closed_rollback.php @@ -41,6 +41,6 @@ $registry->register('isSecureArea', false); $creditMemoGridAggregator = $objectManager->get(\CreditmemoGridAggregator::class); -$creditMemoGridAggregator->purge('100000111', 'order_increment_id'); +$creditMemoGridAggregator->purge('100001111', 'order_increment_id'); Resolver::getInstance()->requireDataFixture('Magento/Catalog/_files/product_simple_rollback.php'); From a07160eba32e4bd0431901f0b7c8171de2a663de Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Wed, 25 Nov 2020 00:15:56 +0200 Subject: [PATCH 8/9] MC-37500: Create automated test for "Shipment Sales Archive" --- app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml | 1 + .../Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) rename app/code/Magento/{Shipping => Sales}/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml (80%) diff --git a/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml b/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml index d35a8ab5c4538..41d58bb61942a 100644 --- a/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml +++ b/app/code/Magento/Sales/Test/Mftf/Page/AdminShipmentPage.xml @@ -10,5 +10,6 @@ xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
+
diff --git a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml b/app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml similarity index 80% rename from app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml rename to app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml index 6e5b197286bf3..ad1ec54e213ee 100644 --- a/app/code/Magento/Shipping/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml +++ b/app/code/Magento/Sales/Test/Mftf/Section/AdminShipmentsGridFiltersSection.xml @@ -9,6 +9,6 @@
- +
From 7b7cf03a5fec86e4a0c79441d70929185bcccfe9 Mon Sep 17 00:00:00 2001 From: Yurii Sapiha Date: Mon, 30 Nov 2020 13:44:23 +0200 Subject: [PATCH 9/9] MC-37085: Create automated test for "Storefront Gallery behaviour for Product with media" --- ...gingFullscreenImageByRibbonActionGroup.xml | 27 + ...ryChangingMainImageByRibbonActionGroup.xml | 27 + ...leryFullscreenThumbnailDragActionGroup.xml | 29 ++ ...tPageGalleryImageDimensionsActionGroup.xml | 34 ++ ...gePositionInThumbnailRibbonActionGroup.xml | 25 + ...PageGalleryMainImageButtonsActionGroup.xml | 28 ++ ...uctPageGalleryThumbnailDragActionGroup.xml | 32 ++ ...ageGalleryDragMainImageBackActionGroup.xml | 19 + ...GalleryDragMainImageForwardActionGroup.xml | 19 + .../Catalog/Test/Mftf/Data/ImageData.xml | 48 ++ .../Catalog/Test/Mftf/Data/ProductData.xml | 1 + .../Section/StorefrontProductMediaSection.xml | 16 +- ...ontProductWithMediaGalleryBehaviorTest.xml | 463 ++++++++++++++++++ 13 files changed, 765 insertions(+), 3 deletions(-) create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml create mode 100644 app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml new file mode 100644 index 0000000000000..6423bf5e319b7 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup.xml @@ -0,0 +1,27 @@ + + + + + + + On the product page change main image by clicking on the images in the ribbon. Fullscreen + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml new file mode 100644 index 0000000000000..b196956135043 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup.xml @@ -0,0 +1,27 @@ + + + + + + + Changing main image on product page media gallery by clicking on the images in the fotorama ribbon + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml new file mode 100644 index 0000000000000..86803aed4cfb6 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup.xml @@ -0,0 +1,29 @@ + + + + + + + On the product page check functional of drag actions in the fotorama ribbon during fullscreen + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml new file mode 100644 index 0000000000000..7b6a8e14455ca --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImageDimensionsActionGroup.xml @@ -0,0 +1,34 @@ + + + + + + + On the product page grab dimensions of the displayed product image, and image section. Assert that image is less or equals + + + + + + + + + + getImageHeight + getSectionHeight + + + getImageWidth + getSectionWidth + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml new file mode 100644 index 0000000000000..6473f348648f2 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup.xml @@ -0,0 +1,25 @@ + + + + + + Check the expected image position in the fotorama ribbon on the product page + + + + + + + + + $grabSrcFromThumbnailImageByPosition + |{{image}}[_\d]*.{{extension}}| + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml new file mode 100644 index 0000000000000..d4cc3097946be --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryMainImageButtonsActionGroup.xml @@ -0,0 +1,28 @@ + + + + + + + Assert the buttons functionality "change image" on the product media gallery on the product page + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml new file mode 100644 index 0000000000000..2e62d973ea090 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/AssertStorefrontProductPageGalleryThumbnailDragActionGroup.xml @@ -0,0 +1,32 @@ + + + + + + + Check functional of drag actions in the thumbnail ribbon on the product page + + + + + + + + + + + + + + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml new file mode 100644 index 0000000000000..4925d6627a0b3 --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageBackActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + Drag back main image in the media gallery of product page + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml new file mode 100644 index 0000000000000..a75a25e31717b --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/ActionGroup/StorefrontProductPageGalleryDragMainImageForwardActionGroup.xml @@ -0,0 +1,19 @@ + + + + + + + Drag forward main image in the media gallery of product page + + + + + + diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml index a2391dda54809..e1072001b56e5 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ImageData.xml @@ -25,4 +25,52 @@ adobe-thumb jpg + + magento-small + adobe-small.jpg + adobe-small + jpg + + + magento-thumb + adobe-thumb.jpg + adobe-thumb + jpg + + + jpgimage + jpg.jpg + jpg + jpg + + + largeimage + large.jpg + large + jpg + + + magentoimage + magento.jpg + magento + jpg + + + magentostage + magentoStage.jpg + magentoStage + jpg + + + mediumimage + medium.jpg + medium + jpg + + + magentoimage + png.png + png + png + diff --git a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml index e7760a9b90f0c..f4e468a939111 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml @@ -370,6 +370,7 @@ Yes magento-logo.png magento-logo + png MagentoLogo diff --git a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml index 447113ea65bb2..5efa094e2c35e 100644 --- a/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml +++ b/app/code/Magento/Catalog/Test/Mftf/Section/StorefrontProductMediaSection.xml @@ -16,11 +16,21 @@ - - - + + + + + + + + + + + + +
diff --git a/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml new file mode 100644 index 0000000000000..0fd5a7117167c --- /dev/null +++ b/app/code/Magento/Catalog/Test/Mftf/Test/StorefrontProductWithMediaGalleryBehaviorTest.xml @@ -0,0 +1,463 @@ + + + + + + + + + + <description value="Assert media behaviour for product with different media on storefront"/> + <severity value="CRITICAL"/> + <testCaseId value="MC-26305"/> + <group value="catalog"/> + <group value="productVideo"/> + <skip> + <issueId value="MC-33903"/> + </skip> + </annotations> + <before> + <createData entity="SimpleProduct2" stepKey="createProduct"/> + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> + </before> + <after> + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> + </after> + <!--Add images and video to product--> + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openAdminProductEditPage"> + <argument name="productId" value="$createProduct.id$"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addBaseImage"> + <argument name="image" value="TestImageAdobe"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage1"> + <argument name="image" value="AdobeSmallImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage2"> + <argument name="image" value="AdobeThumbImage"/> + </actionGroup> + <actionGroup ref="AdminAddProductVideoWithPreviewActionGroup" stepKey="addVideo"> + <argument name="video" value="VimeoProductVideo"/> + <argument name="image" value="{{TestImageNew.file}}"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage4"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage5"> + <argument name="image" value="JpgImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage6"> + <argument name="image" value="LargeImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage7"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage8"> + <argument name="image" value="MagentoImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage9"> + <argument name="image" value="Magento3"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage10"> + <argument name="image" value="TestImageNew"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage11"> + <argument name="image" value="ProductImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage12"> + <argument name="image" value="MediumImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage13"> + <argument name="image" value="MediumImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage14"> + <argument name="image" value="PngImage"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage15"> + <argument name="image" value="Magento2"/> + </actionGroup> + <actionGroup ref="AddProductImageActionGroup" stepKey="addImage16"> + <argument name="image" value="Magento3"/> + </actionGroup> + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductForm"/> + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToStorefrontProductPage"> + <argument name="productUrl" value="$createProduct.custom_attributes[url_key]$"/> + </actionGroup> + <!--Assert positioning images in the ribbon Step 2.3--> + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaAnyMedia}}" stepKey="waitForThumbnailsAppear"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition1"> + <argument name="image" value="{{TestImageAdobe.filename}}"/> + <argument name="extension" value="{{TestImageAdobe.file_extension}}"/> + <argument name="position" value="1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition2"> + <argument name="image" value="{{AdobeSmallImage.filename}}"/> + <argument name="extension" value="{{AdobeSmallImage.file_extension}}"/> + <argument name="position" value="2"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition3"> + <argument name="image" value="{{AdobeThumbImage.filename}}"/> + <argument name="extension" value="{{AdobeThumbImage.file_extension}}"/> + <argument name="position" value="3"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition4"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="4"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition5"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="5"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition6"> + <argument name="image" value="{{JpgImage.filename}}"/> + <argument name="extension" value="{{JpgImage.file_extension}}"/> + <argument name="position" value="6"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition7"> + <argument name="image" value="{{LargeImage.filename}}"/> + <argument name="extension" value="{{LargeImage.file_extension}}"/> + <argument name="position" value="7"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition8"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="8"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition9"> + <argument name="image" value="{{MagentoImage.filename}}"/> + <argument name="extension" value="{{MagentoImage.file_extension}}"/> + <argument name="position" value="9"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition10"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="10"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition11"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="11"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition12"> + <argument name="image" value="{{ProductImage.filename}}"/> + <argument name="extension" value="{{ProductImage.file_extension}}"/> + <argument name="position" value="12"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition13"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="13"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition14"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="14"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition15"> + <argument name="image" value="{{PngImage.filename}}"/> + <argument name="extension" value="{{PngImage.file_extension}}"/> + <argument name="position" value="15"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition16"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="16"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertImagePosition17"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="17"/> + </actionGroup> + <!--Assert fullscreen image isn't displayed. Step 2.1--> + <actionGroup ref="StorefrontAssertActiveProductImageActionGroup" stepKey="seeActiveBaseImage"> + <argument name="fileName" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <dontSeeElement selector="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}" stepKey="dontSeeFullscreenProductImage"/> + <!--Assert thumbnail drag actions. Steps 3-4--> + <actionGroup ref="AssertStorefrontProductPageGalleryThumbnailDragActionGroup" stepKey="assertThumbnailDragAction"> + <argument name="dragPointImage" value="{{TestImageNew.filename}}"/> + <argument name="currentImage" value="{{TestImageAdobe.filename}}"/> + <argument name="firstImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Verify if looping is unavailable. Step 5--> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButton"/> + <seeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="seeNextButton"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="firstClickNextFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(MagentoImage.filename)}}" stepKey="see9thImageInRibbon"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="secondClickNextFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(MagentoImage.filename)}}" stepKey="seeLastImageInRibbon"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(TestImageAdobe.filename)}}" stepKey="seeActiveImageDontChangeAfterClickNext"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaNextButton}}" stepKey="dontSeeNextButtonAfterClickNext"/> + <click selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="firstClickPrevFotorama"/> + <click selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="secondClickPrevFotorama"/> + <seeElement selector="{{StorefrontProductMediaSection.productImage(TestImageAdobe.filename)}}" stepKey="seeActiveImageDefaultStay2"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageInFotorama(TestImageAdobe.filename)}}" stepKey="seeFirstImageInRibbon"/> + <dontSeeElement selector="{{StorefrontProductMediaSection.fotoramaPrevButton}}" stepKey="dontSeePrevButtonAfterClick"/> + <!--Change image by thumbnail ribbon. Step 6--> + <actionGroup ref="AssertStorefrontProductPageGalleryChangingMainImageByRibbonActionGroup" stepKey="assertThumbnailClicking"> + <argument name="startImage" value="{{TestImageAdobe.filename}}"/> + <argument name="expectedImage" value="{{AdobeSmallImage.filename}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageOnPreview"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change image by image buttons. Step 7--> + <actionGroup ref="AssertStorefrontProductPageGalleryMainImageButtonsActionGroup" stepKey="assertButtonActions"> + <argument name="startImage" value="{{TestImageAdobe.filename}}"/> + <argument name="expectedImage" value="{{AdobeSmallImage.filename}}"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterButtonActions"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Check that images <= that image section. Step 7.4--> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions0"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert0"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions1"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert1"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions2"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert2"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions3"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert3"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions4"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert4"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions5"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert5"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions6"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert6"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions7"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert7"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions8"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert8"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions9"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert9"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions10"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert10"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions11"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert11"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions12"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert12"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions13"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert13"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions14"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert14"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions15"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert15"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertImageDimensions16"/> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="clickOnNextImageButtonDimensionsAssert16"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoop"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change image using the drag actions. Step 8--> + <actionGroup ref="StorefrontProductPageGalleryDragMainImageBackActionGroup" stepKey="dragBack"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterDragBack"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + <actionGroup ref="StorefrontProductPageGalleryDragMainImageForwardActionGroup" stepKey="dragForward"/> + <moveMouseOver selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="hoverOnImageAfterDragActions"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterDragForward"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Assert the image looping by image buttons. Step 9--> + <click selector="{{StorefrontProductMediaSection.imagePrevButton}}" stepKey="loopBack"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoopBack"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="loopForward"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeImageAfterLoopForward"> + <argument name="productImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Open the fullscreen image. Steps 10-11--> + <click selector="{{StorefrontProductMediaSection.imageNextButton}}" stepKey="setNonDefaultImage"/> + <click selector="{{StorefrontProductMediaSection.mainImageForJsActions}}" stepKey="openFullscreenImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(AdobeSmallImage.filename)}}" stepKey="assertFullscreenImage"/> + <waitForElementVisible selector="{{StorefrontProductMediaSection.fotoramaAnyMedia}}" stepKey="waitForThumbnailsFullscreen"/> + <!--Assert positioning images in the ribbon Step 11.3--> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition1"> + <argument name="image" value="{{TestImageAdobe.filename}}"/> + <argument name="extension" value="{{TestImageAdobe.file_extension}}"/> + <argument name="position" value="1"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition2"> + <argument name="image" value="{{AdobeSmallImage.filename}}"/> + <argument name="extension" value="{{AdobeSmallImage.file_extension}}"/> + <argument name="position" value="2"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition3"> + <argument name="image" value="{{AdobeThumbImage.filename}}"/> + <argument name="extension" value="{{AdobeThumbImage.file_extension}}"/> + <argument name="position" value="3"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition4"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="4"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition5"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="5"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition6"> + <argument name="image" value="{{JpgImage.filename}}"/> + <argument name="extension" value="{{JpgImage.file_extension}}"/> + <argument name="position" value="6"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition7"> + <argument name="image" value="{{LargeImage.filename}}"/> + <argument name="extension" value="{{LargeImage.file_extension}}"/> + <argument name="position" value="7"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition8"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="8"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition9"> + <argument name="image" value="{{MagentoImage.filename}}"/> + <argument name="extension" value="{{MagentoImage.file_extension}}"/> + <argument name="position" value="9"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition10"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="10"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition11"> + <argument name="image" value="{{TestImageNew.filename}}"/> + <argument name="extension" value="{{TestImageNew.file_extension}}"/> + <argument name="position" value="11"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition12"> + <argument name="image" value="{{ProductImage.filename}}"/> + <argument name="extension" value="{{ProductImage.file_extension}}"/> + <argument name="position" value="12"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition13"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="13"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition14"> + <argument name="image" value="{{MediumImage.filename}}"/> + <argument name="extension" value="{{MediumImage.file_extension}}"/> + <argument name="position" value="14"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition15"> + <argument name="image" value="{{PngImage.filename}}"/> + <argument name="extension" value="{{PngImage.file_extension}}"/> + <argument name="position" value="15"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition16"> + <argument name="image" value="{{Magento2.filename}}"/> + <argument name="extension" value="{{Magento2.file_extension}}"/> + <argument name="position" value="16"/> + </actionGroup> + <actionGroup ref="AssertStorefrontProductPageGalleryImagePositionInThumbnailRibbonActionGroup" stepKey="assertFullscreenThumbnailImagePosition17"> + <argument name="image" value="{{Magento3.filename}}"/> + <argument name="extension" value="{{Magento3.file_extension}}"/> + <argument name="position" value="17"/> + </actionGroup> + <!--Assert the fullscreen thumbnail ribbon drag actions step 12--> + <actionGroup ref="AssertStorefrontProductPageGalleryFullscreenThumbnailDragActionGroup" stepKey="assertFullscreenThumbnailDragAction"> + <argument name="dragPointImage" value="{{TestImageNew.filename}}"/> + <argument name="currentImage" value="{{AdobeSmallImage.filename}}"/> + <argument name="firstImage" value="{{TestImageAdobe.filename}}"/> + </actionGroup> + <!--Change fullscreen image by clicking on thumbnail ribbon. Step 15--> + <actionGroup ref="AssertStorefrontProductPageGalleryChangingFullscreenImageByRibbonActionGroup" stepKey="assertThumbnailClickFullscreen"> + <argument name="startImage" value="{{AdobeSmallImage.filename}}"/> + <argument name="expectedImage" value="{{LargeImage.filename}}"/> + </actionGroup> + <!--Change fullscreen image using the image buttons. Steps 16 and 18--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="goToFirstImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="seeFirstFullscreenImage"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="loopToLastImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(Magento3.filename)}}" stepKey="assertLastImageAfterLoop"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="loopToFirstImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="assertFirstImageAfterLoop"/> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert0"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions0"> + <argument name="source" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <!-- Check that images <= that image section. Step 16.5--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert1"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions1"> + <argument name="source" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert2"/> + <click selector="{{StorefrontProductMediaSection.fotoramaNextButtonVideo}}" stepKey="skipVideo"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions3"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert4"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions4"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert5"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions5"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert6"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions6"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert7"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions7"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert8"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions8"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert9"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions9"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert10"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions10"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert11"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions11"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert12"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions12"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert13"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions13"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert14"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions14"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert15"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions15"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <click selector="{{StorefrontProductMediaSection.imageFullscreenNextButton}}" stepKey="clickOnNextImageButtonFullscreenDimensionsAssert16"/> + <actionGroup ref="AssertStorefrontProductPageGalleryImageDimensionsActionGroup" stepKey="assertFullscreenImageDimensions16"> + <argument name="imageSource" value="{{StorefrontProductMediaSection.mainImageForJsActionsFullscreen}}"/> + </actionGroup> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(TestImageAdobe.filename)}}" stepKey="assertFirstImageAfterSecondLoop"/> + <!-- TODO: Change fullscreen image by drag/swipe action: after MQE-2333 implementation --> + <!--Steps 19-20--> + <click selector="{{StorefrontProductMediaSection.imageFullscreenPrevButton}}" stepKey="selectLastImage"/> + <seeElement selector="{{StorefrontProductMediaSection.productImageFullscreen(Magento3.filename)}}" stepKey="assertLastImageFullscreen"/> + <click selector="{{StorefrontProductMediaSection.closeFullscreenImage}}" stepKey="closeFullScreenImage"/> + <actionGroup ref="AssertStorefrontProductImageAppearsOnProductPagePreviewActionGroup" stepKey="seeLastImageAfterFullscreen"> + <argument name="productImage" value="{{Magento3.filename}}"/> + </actionGroup> + </test> +</tests>