tddwizard / magento2-fixtures

Fixture library for Magento 2 integration tests by @schmengler (@integer-net)
http://tddwizard.com/
MIT License
141 stars 28 forks source link

Can we create and assign custom source and stocks to the product in unit test? #85

Open rohit-jiva-ag opened 1 year ago

rohit-jiva-ag commented 1 year ago

Hi Everyone, Can we create and assign custom source and stocks to the product in unit test as I want to test some case which has custom source and stocks and based on it's quantity I am asserting some values.

So like can we that using tddwizard in magento2?

Thanks

schmengler commented 1 year ago

Hi Rohit!

I was working on multi source integration a while back but ended up not needing it anymore. Check out the branch https://github.com/tddwizard/magento2-fixtures/tree/multi-source-inventory – with this you can at least assign a source when creating shipments. But you still need to create custom stocks on your own

rohit-jiva-ag commented 1 year ago

Hi @schmengler Thanks for the information It will be helpful, Is any other way like If I can create custom source and stocks once globally like in setUP()? Or any other way and then I just need to assign a source in a test cases where required. And not required to create sources and stocks on each test case?

Thanks