Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetrieveEntityField generation does not consider ActionGroup as part of namespace #317

Closed
navarr opened this issue Mar 15, 2019 · 5 comments

Comments

@navarr
Copy link
Member

navarr commented Mar 15, 2019

Preconditions

This was verified on Magento 2.3-develop branch

Steps to reproduce

  1. Create an action group similar to such:
<actionGroup name="CreateGroupedProduct">
    <createData entity="_defaultCategory" stepKey="createCategory"/>

    <createData entity="_defaultProduct" stepKey="createFirst">
        <requiredEntity createDataKey="createCategory"/>
    </createData>

    <createData entity="GroupedProduct" stepKey="createGroup">
        <requiredEntity createDataKey="createCategory"/>
    </createData>

    <!-- The Important Part -->
    <createData entity="ProductLinkSimple1" stepKey="createFirstLink">
        <field key="sku">$$createGroup.sku$$</field>
        <field key="linked_product_sku">$$createFirst.sku$$</field>
    </createData>
</actionGroup>
<!-- ... -->
<actionGroup ref="CreateGroupedProduct" stepKey="InGroup" />
<!-- ... -->
  1. Generate Tests

Expected result

$createFirstLinkInGroupFields['sku'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createGroupInGroup', 'sku', 'hook');
$createFirstLinkInGroupFields['linked_product_sku'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createFirstInGroup', 'sku', 'hook');
$I->amGoingTo("create entity that has the stepKey: createFirstLinkInGroup");
PersistedObjectHandler::getInstance()->createEntity(
	"createFirstLinkInGroup",
	"hook",
	"ProductLinkSimple1",
	[],
	$createFirstLinkInGroupFields
);

Actual result

$createFirstLinkInGroupFields['sku'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createGroup', 'sku', 'hook');
$createFirstLinkInGroupFields['linked_product_sku'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createFirst', 'sku', 'hook');
$I->amGoingTo("create entity that has the stepKey: createFirstLinkInGroup");
PersistedObjectHandler::getInstance()->createEntity(
	"createFirstLinkInGroup",
	"hook",
	"ProductLinkSimple1",
	[],
	$createFirstLinkInGroupFields
);

Resulting in the error during run: [Magento\FunctionalTestingFramework\Exceptions\TestReferenceException] Entity with a CreateDataKey of createGroup could not be found

@KevinBKozan
Copy link
Contributor

@navarr Thank you for the submission! We'll create a ticket internally to track progress of this bug fix, and will update this issue to reflect it.

@tomreece
Copy link
Contributor

Our internal ticket https://jira.corp.magento.com/browse/MQE-1627
was marked as DONE so I'll close this issue.

@shreelakshmi28
Copy link

shreelakshmi28 commented May 18, 2020

                                                 error:[Magento\FunctionalTestingFramework\Exceptions\TestReferenceException] Entity with a CreateDataKey of simpleproduct1 could not be found  is displayed on running the test case 

StorefrontCustomerCheckoutTest
in checkout module
how to resolve this issue.

@Ilasigma
Copy link

any solution for this??

@AtharvaB8
Copy link

AtharvaB8 commented Jun 7, 2022

@shreelakshmi28 @Ilasigma Did you find any solution for this issue?

magento-devops-reposync-svc pushed a commit that referenced this issue Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants