An Adobe Commerce Architect is reviewing API-functional test code. Some tests send errors to indicate that the customer address does not exist. The test codes show the following:
Which step should the Architect take to fix the test errors?
A.
Change the annotation to Use@magentoApiDataFixture Magento/Customer/_files/ instead Or dmagentoDataFixture Magento/Customer/_files/customer_one_address.php
B.
Set the annotation to USe AmagentoPersistDataFixture Magento/Cu5tomer/_f iles/custcwer_one_address.php instead Of @magentoDataFixture Magento/Customer/_f iles/customer_one_address.php
C.
Update the annotation to Specify addreSSjd £niagentoDataFixture Magento/Customer/_files/customer_one_address.php with:{Maddress_id":"$address.id$"}
The issue is being caused by the use of @magentoDataFixture annotation, which creates a temporary data fixture that is rolled back after each test execution1. This means that the customer address created by the fixture is not persisted in the database and cannot be retrieved by subsequent tests. To fix this, the Architect should use @magentoPersistDataFixture annotation, which creates a permanent data fixture that is not rolled back after each test execution2. This way, the customer address created by the fixture will be persisted in the database and can be accessed by subsequent tests. Changing the annotation to use @magentoApiDataFixture or specifying address_id in the annotation will not solve the issue, as they are not related to the persistence of the data fixture3. References: Data fixtures, Persistent data fixtures, API-functional tests
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit