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

[Test coverage] add to cart simple/virtual products with custom options #395

Merged

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Feb 24, 2019

Description (*)

This PR introduces test coverage for adding a simple/virtual product to the shopping cart with custom options that are currently supported within a scope of GraphQl coverage.

Fixed Issues (if relevant)

  1. Test coverage of Adding simple/virtual product to shopping cart  #382: Test coverage of Adding simple/virtual product to the shopping cart

@TomashKhamlai
Copy link
Contributor

Please add one more commit. Considering that GraphQL is trying to 100% automation coverage I ask you to add something like:

public function testAddSimpleProductWithoutRequiredOptions()
public function testAddVirtualProductWithoutRequiredOptions()

At this moment such requests where options were omitted will return error for every required option in on message. But probably this will be changed here #421. Just let me know if you have no time to keep up, we can create a separate task for coverage and merge this PR with existing coverage. Thank you in advance.

@rogyar
Copy link
Contributor Author

rogyar commented Mar 4, 2019

Sure, will provide additional test cases

@rogyar
Copy link
Contributor Author

rogyar commented Mar 5, 2019

Hi @TomashKhamlai. I've provided the corresponding test cases. Also, I've created an additional issue: #435. We need to cover adding a product to the shopping cart with recently introduced customizable options (once the corresponding changes are merged)

@rogyar rogyar force-pushed the 382-cart-simple-virtual-test-coverage branch from 3c5747a to ac855ab Compare March 6, 2019 06:40
@naydav
Copy link
Contributor

naydav commented Mar 25, 2019

@rogyar
Copy link
Contributor Author

rogyar commented Mar 26, 2019

@naydav should be good now

protected function setUp()
{
$objectManager = Bootstrap::getObjectManager();
$this->quoteResource = $objectManager->get(QuoteResource::class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please replace on object \Magento\Quote\Model\QuoteIdToMaskedQuoteIdInterface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you clarify this point please? I believe this part has been refactored already

//Product already removed
} catch (\Magento\Framework\Exception\StateException $exception) {
} catch (StateException $exception) {
Copy link
Contributor

Choose a reason for hiding this comment

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

When will we have state exception?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case of \Exception in the repository method:

throw new \Magento\Framework\Exception\StateException(

Copy link
Contributor

Choose a reason for hiding this comment

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

But we expected that just NoSuchEntityException could be thrown if will throw another we can't suppress it

@ghost
Copy link

ghost commented Apr 12, 2019

Hi @rogyar, 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.

@naydav naydav deleted the 382-cart-simple-virtual-test-coverage branch April 12, 2019 19:31
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.

4 participants