-
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
Code changed in jenkins
User: Manuel Franco
Path:
src/main/java/org/jenkinsci/test/acceptance/po/ContainerPageObject.java
src/main/java/org/jenkinsci/test/acceptance/po/Jenkins.java
src/main/java/org/jenkinsci/test/acceptance/po/PageObject.java
http://jenkins-ci.org/commit/acceptance-test-harness/158b7c7c872b2702cb01fd876326318bc12dc4b9
Log:
JENKINS-37615Honor context PageObject when looking for Jenkins instance