-
Notifications
You must be signed in to change notification settings - Fork 40
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
URLs on publish instance do not respect Sling Mapping #39
Comments
That's a really interesting case, @stefanseifert ! I think there are two aspects to this that could be tested, depending on the intention:
For 1. I'd say the best would be to have a dedicated client (i.e.
For 2. it might indeed be tricky, especially that getting the actual mapping config is difficult, as you pointed out. The way we handled this in similar situations was to support a system property which can change the behavior of the clients used in tests: https://github.com/adobe/aem-testing-clients/blob/aem-cloud/src/main/java/com/adobe/cq/testing/junit/rules/ConfigurableInstance.java If the mapping is easy to express (e.g. through a regex), this can be included in the system property as a static configuration. Sensible defaults should also fit most of the cases (like the example you provided). Otherwise, a smarter client/configuration would be to load this mapping from AEM itself, which I don't know how feasible it is and if it's worth. BTW, this seems a sling feature, do you think it would make sense to have this improvement in https://github.com/apache/sling-org-apache-sling-testing-clients/ ? |
yes, i think this would fit in sling testing clients as sling mapping is mainly a sling feature. i think for the purpose of the tests it should be possible to express the shortening with a simple config like a regex, it should be possible to provide it from outside e.g. system environment parameter. |
scenario: we want to to and end-to-end integration test using AEM Testing client involving both author and publish/dispatcher and replication between them. on publish/dispatcher a "multi domain management AEM mapping" is defined similar as described here:
https://helpx.adobe.com/experience-manager/kb/multi-domain-management-aem-mappings-for-url-shortening---aem-6-.html
that means that
with this setup it's currently not easy possible to write an integration test without hardcoding the short urls in the test. the
CQClient
class has concepts for mapping paths to URLs, but this does not take into account a sling mapping configuration applied on the publish instances testing against. thus when using built-in methods likeCQAssert.assertCQPageExistsWithTimeout
they internally alsways build paths with the full URL and fail.of course it's not easy for the
CQClient
instance to read out the real mapping configuration form the running AEM instance (esp. because there are multiple ways to configure this, and a mapping config can get really complex). but it would be nice when it can be configured in a simplified way for the integration test similar to configuring the author/publish URLs.are there any plans/concepts to support this properly?
The text was updated successfully, but these errors were encountered: