Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

428 - Test coverage: GetAvailableShippingMethodsTest #472

Merged
merged 13 commits into from
Mar 30, 2019

Conversation

atwixfirster
Copy link
Contributor

Issue: #428

  1. Split \Magento\GraphQl\Quote\GetAvailableShippingMethodsTest into 2 scenarions
  • \Magento\GraphQl\Quote\Customer\GetAvailableShippingMethodsTest
  • \Magento\GraphQl\Quote\Guest\GetAvailableShippingMethodsTest

Fix for PHP Fatal error:  Uncaught Exception: Exception occurred when running the "\/home\/travis\/build\/magento\/graphql-ce\/dev\/tests\/integration\/testsuite\/Magento\/Sales\/_files\/guest_quote_with_addresses.php" fixture:
URL key for specified store already exists. in /home/travis/build/magento/graphql-ce/dev/tests/api-functional/framework/Magento/TestFramework/Annotation/ApiDataFixture.php:114
@@ -0,0 +1,39 @@
<?php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, sir

@naydav , could you please verify?

Thank you!

atwixfirster and others added 5 commits March 14, 2019 16:16
Merge remote-tracking branch 'origin/2.3-develop' into 428-getAvailableShippingMethodsTest
Fix 1) Magento\GraphQl\Quote\Customer\GetAvailableShippingMethodsTest::testGetAvailableShippingMethods
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
-    'amount' => 0
-    'base_amount' => 0
+    'amount' => 10
+    'base_amount' => 10
     'carrier_code' => 'flatrate'
     'carrier_title' => 'Flat Rate'
     'error_message' => ''
     'method_code' => 'flatrate'
     'method_title' => 'Fixed'
-    'price_incl_tax' => 0
-    'price_excl_tax' => 0
+    'price_incl_tax' => 10
+    'price_excl_tax' => 10
shipping_addresses {
available_shipping_methods {
amount
base_amount
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, check scheme
Looks like we don't have these fields in scheme declaration

Copy link
Contributor Author

@atwixfirster atwixfirster Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we don't have these fields in scheme declaration

@naydav , could you please check app/code/Magento/QuoteGraphQl/etc/schema.graphqls, lines 197-206.

@@ -14,7 +14,7 @@
$product = $objectManager->create(\Magento\Catalog\Model\Product::class);
$product->setTypeId('simple')
->setAttributeSetId($product->getDefaultAttributeSetId())
->setName('Simple Product')
->setName('Simple Product For Guest Quote')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could not change current fixtures
It's BIC and could lead to some failures in already created tests

Copy link
Contributor Author

@atwixfirster atwixfirster Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's BIC and could lead to some failures in already created tests

Travis has passed this change. But If you recommend to not change current fixtures then I can rollback my changes here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could not change current fixtures

fixed

Thank you, @naydav !!

naydav added 2 commits March 29, 2019 11:40
…leShippingMethodsTest

# Conflicts:
#	dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/GetAvailablePaymentMethodsTest.php
#	dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/GetAvailablePaymentMethodsTest.php
@magento-engcom-team magento-engcom-team merged commit b64170a into 2.3-develop Mar 30, 2019
@ghost
Copy link

ghost commented Mar 30, 2019

Hi @atwixfirster, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants