-
Bug
-
Resolution: Fixed
-
Minor
-
ATH 1.38
Let's describe the issue with a test. Assumming we already have an injector and a JenkinsController, the following test will fail:
Jenkins j1 = new Jenkins(injector, jenkinsController);
Assert.assertSame(j1, j1.jobs.getJenkins());
The problem is that the jenkins instance returned by the getJenkins() method in the JobsMixIn object (actually inherited from PageObject) is not the instance that was passed as a context in the construction of this last one, but an instance that is looked up (and built if needed) using guice.
This leads to potential inconsistencies for some operations (e.g. jobs.create) that rely on querying its jenkins instance, for example for the version number.
Sometimes as an external user of the ATH I may need to create several instances with different versions, and want each jobs mixin to know exactly to which jenkins they belong to and behave consistently.
- relates to
-
JENKINS-38058 Properly pass context in folder's page objects
- Resolved
- links to