]
Stefan Miklosovic commented on ARQ-1771:
----------------------------------------
It seems that DroneTestEnricher#ensureInjectionPointPrepared parse Drone point without
custom annotation, only @Drone and annotations with @Qualifier are treated so it thinks
that @Drone @Mobile @Custom is different from @Drone @Mobile so it instantiates it for the
second time with missleading log message.
Putting custom annotation on Drone creates multiple instances
-------------------------------------------------------------
Key: ARQ-1771
URL:
https://issues.jboss.org/browse/ARQ-1771
Project: Arquillian
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Extension - Drone
Affects Versions: drone_2.0.0.Alpha1
Reporter: Stefan Miklosovic
I have a test case like this
{code}
@RunWith(Arquillian.class)
@RunAsClient
public class SomeTestCase
{
@Drone
@Mobile
@Custom
private WebDriver mobile;
// tests
}
{code}
where @Custom is just an annotation:
{code}
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD, ElementType.PARAMETER })
public @interface Custom {
}
{code}
it is _not_ annotated with @Qualifier.
Realize that the same problem arise when using @OperateOnDeployment from Arquillian which
is not annotated with @Qualifier neither.
I am getting this:
http://pastebin.com/raw.php?i=i9DVqeaC
You see that InstrumentationPerformDecider.decidePerformingInstrumentation observes
BeforeDroneInstantiated so when it is treated twice, you are going to instantiate two
Drones which is another argument why Drone does it wrong.
When I declare Drone injection like that, it results into two instances of WebDrivers so
that means it instruments Android package twice with two Selendroids so that mean I am
getting NoUniqueWebDriverException when I want to start some activity because from now on
you have "by accident" two webdrivers instrumenting the same deployment as a
result of a bug where putting custom annotation on Drone instantiates it twice.