Skip to content

Fixed admin page url variables generation #78

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

Merged
merged 2 commits into from
Oct 31, 2018
Merged

Fixed admin page url variables generation #78

merged 2 commits into from
Oct 31, 2018

Conversation

rocketweb
Copy link

@rocketweb rocketweb commented Apr 2, 2018

Description

When creating a Page entity that has a parameter in it's url attribute and belongs to the admin area, e.g. <page name="AdminProductEditPage" url="catalog/product/edit/id/{{id}}/" area="admin" module="Magento_Catalog" parameterized="true"> then you call inside a test by using a created entity like this:

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

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

After generating the test, the goToProductEditPage1 step should look like this:

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

But it actually looks like this:

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

So the $$createSimpleStandaloneProduct.id$$ variable isn't being generated. This only happens to pages that belong to the admin area. This PR attempts to fix this by taking the variables the do the str_replace and first replacing the environment variables inside them before continuing with the code execution.

Fixed Issues (if relevant)

  1. Parameter references not getting generated in admin page URLs #77: Parameter references not getting generated in admin page URLs

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Apr 2, 2018

Coverage Status

Coverage remained the same at 57.406% when pulling 9f1c77f on rocketweb:fix-admin-page-url-variable-generation into 825e8e9 on magento:develop.

@okolesnyk okolesnyk added this to the 2.2.1 milestone Apr 18, 2018
@okolesnyk okolesnyk added Partner: Rocket Web Pull Request is created by partner Rocket Web partners-contribution Pull Request is created by Magento Partner labels Apr 23, 2018
@okolesnyk
Copy link
Member

Hello, @rocketweb
Please sign licence/cla, because otherwise I can not process this Pull Request.

@okolesnyk okolesnyk modified the milestones: 2.2.1, 2.2.0, 2.3.0 Jun 18, 2018
@okolesnyk okolesnyk modified the milestones: 2.3.0, 2.3.1 Jul 18, 2018
@okolesnyk
Copy link
Member

@rocketweb Thank you very much, we will include it into 2.3.1 upcoming release.

…ing-framework into fix-admin-page-url-variable-generation
@okolesnyk okolesnyk self-requested a review October 31, 2018 17:59
@okolesnyk okolesnyk merged commit 12d3004 into magento:develop Oct 31, 2018
magento-devops-reposync-svc pushed a commit that referenced this pull request Jul 26, 2021
…2-functional-testing-framework-856

[Imported] Issue 33297: Eliminate AspectMock from DataExtensionUtilTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accept Partner: Rocket Web Pull Request is created by partner Rocket Web partners-contribution Pull Request is created by Magento Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants