SELENIUM-289: enable dynamic tenant hostname
Marcos Scriven
Branch: issue/SELENIUM-289-enable-dynamic-tenant-hostname
Branch: master
Merged
Merged pull request
Merged in issue/SELENIUM-289-enable-dynamic-tenant-hostname (pull request #48)
Merged in issue/SELENIUM-289-enable-dynamic-tenant-hostname (pull request #48)
I suffered a little from analysis paralysis on this one, and tried a few things before settling on what I've presented here.
One alternative I tried was using CGLIB (since the product-specific test objects are not behind an interface) to return a proxy of the product, such that this worked without modification:
static final JiraTestedProduct JIRA = TestedProductFactory.create(JiraTestedProduct.class); ... MultiTenant.productForHost(JIRA, "hostname").gotoHomePage();
With all calls to the tested product being intercepted to set/unset the host before/after. That worked, but then I was worried it was a overly complex and might have some performance impact when used in anger. Furthermore, I realised it was somewhat pointless since
TestedProduct
has a one-to-one mapping to a browser process.I thus just settled on setting the product on the host, with a convenience rule for resetting the host if necessary.