Skip to content

Parameter references not getting generated in admin page URLs #77

Closed
@ghost

Description

Preconditions

  1. MFTF 2.1.2
  2. PHP 7.0.28

Steps to reproduce

  1. Create a Page file/entity for the backend that references a variable in its URL, e.g. <page name="AdminProductEditPage" url="catalog/product/edit/id/{{id}}/" area="admin" module="Magento_Catalog" parameterized="true">
  2. Inside a test make a reference to that page and pass it an entity that was created during the test. For example have this:
<createData entity="_defaultCategory" stepKey="createCategory"/>
<createData entity="_defaultProduct" stepKey="createSimpleStandaloneProduct">
       <requiredEntity createDataKey="createCategory"/>
</createData>

Then have this:

<amOnPage url="{{AdminProductEditPage.url($$createSimpleStandaloneProduct.id$$)}}" stepKey="goToProductEditPage1"/>

  1. Generate the test that contains those steps.

Expected result

  1. The step that uses the amOnPage action should look like this:

$I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/catalog/product/edit/id/" . $this->createSimpleStandaloneProduct->getCreatedDataByName('id') . "/");

Actual result

  1. The step actually looks like this:

$I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/catalog/product/edit/id/$$createSimpleStandaloneProduct.id$$/");

This only happens on admin pages. Will open a pull request to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions