Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Discussion] Add possibility to access frontend and backend on different domains #389

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

Closed
ochnygosch opened this issue Jul 22, 2019 · 7 comments

Comments

@ochnygosch
Copy link
Contributor

We plan to use different domains for the magento storefront and the backend. And we would like to add acceptance tests to our ci pipeline which are as close to production as possible.

Currently there doesn't seem to be a way to separate storefront and backend.

For example it should be possible to write a test like this:

  • Login to backend on (backend.example.com/admin)
  • Create simple product
  • Verfiy on storefront (store.example.com) that the product exists

There are already some places in the codebase where this distinction seemed to have been considered (like in functional.suite.dist.yml), but I haven't found a way to use this configuration in a test.

@okolesnyk
Copy link
Member

Hi @ochnygosch

It is possible to specify different domains for magento storefront and admin panel.
MAGENTO_BASE_URL = https://github.com/magento/magento2-functional-testing-framework/blob/develop/etc/config/.env.example#L5
MAGENTO_BACKEND_BASE_HOST = https://github.com/magento/magento2-functional-testing-framework/blob/develop/etc/config/.env.example#L8

You just need to specify in .env file arguments I listed above.

Please check if it works for you and in case you need something in addition to it open new issue.

Thank you.

@okolesnyk
Copy link
Member

In the tests we differentiate storefront and admin by using area attribute in Page entities. Here you can find more info about it: https://devdocs.magento.com/mftf/docs/page.html#page-tag

@ochnygosch
Copy link
Contributor Author

Hi @okolesnyk
I found this configuration option, but I don't think it will work. (Unfortunately I currently haven't the possibility to investigate further).
MAGENTO_BACKEND_BASE_HOST is not used anywhere in the mftf. The only similar config option I have found is MAGENTO_BACKEND_BASE_URL. Which is used in ModuleResolver, but even there the method getEnabledModules only references MAGENTO_BASE_URL.

As far as I can tell the only thing the area attribute in the page definition does, is prepending the admin controller front name (e.g. "admin") to the page url.

Please let me know if I am missing something.
Thanks for your reply.

@tomreece
Copy link
Contributor

tomreece commented Oct 9, 2019

@soumyau created this internal ticket related to this Github issue:
https://jira.corp.magento.com/browse/MQE-1805

@lbajsarowicz
Copy link
Contributor

@ochnygosch I actually introduced the feature to handle MAGENTO_BACKEND_BASE_HOST config. I'm really sorry that this does not work properly.

I'm going to assign the issue to me and fix the issue you're facing.

@lbajsarowicz lbajsarowicz self-assigned this Jan 11, 2020
@soumyau
Copy link
Contributor

soumyau commented Jun 25, 2020

The fix has been been rolled out in MFTF 2.6.5. Keeping this issue open until it's rolled out for MFTF3.x. Thanks for your contribution @lbajsarowicz!

@jilu1
Copy link
Contributor

jilu1 commented Dec 15, 2020

Community contribution and close this issue.

@jilu1 jilu1 closed this as completed Dec 15, 2020
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

6 participants