Arquillian Graphene浏览器屏幕截图:不能使用带限定符的Drone

时间:2015-02-02 05:36:25

标签: java jboss-arquillian arquillian-drone

我正在使用Arquillian 1.1.6.Final使用JSFArquillian Drone 2.0.0.Alpha3Arquillian Graphene 2.1.0.Alpha2来测试Arquillian Browser Screenshooter 2.1.0.Alpha2。它工作得很好,并按预期给我一个screen shot

使用Arquillian Drone org.jboss.arquillian.drone.api.annotation.Qualifier作为

时出现问题
java.lang.IllegalStateException: There is no context available for qualifier org.jboss.arquillian.drone.api.annotation.Default. 
Available contexts are [interface test.com.scc.aspg.demo.arq.simple.MyExtraBrowser].
at org.jboss.arquillian.graphene.context.GrapheneContextImpl$LazyContext.getContext(GrapheneContextImpl.java:302)
at org.jboss.arquillian.graphene.context.GrapheneContextImpl$LazyContext$1.getTarget(GrapheneContextImpl.java:311)
at org.jboss.arquillian.graphene.proxy.GrapheneProxyHandler.getTarget(GrapheneProxyHandler.java:149)
at org.jboss.arquillian.graphene.proxy.GrapheneContextualHandler.invoke(GrapheneContextualHandler.java:118)
at com.sun.proxy.$Proxy336.unwrap(Unknown Source)
at org.arquillian.extension.recorder.screenshooter.browser.impl.BrowserScreenshooter.getTakingScreenshotsBrowser(BrowserScreenshooter.java:158)

我的代码如下: -

import org.jboss.arquillian.drone.api.annotation.Qualifier;

@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.FIELD, ElementType.PARAMETER })
@Qualifier
public @interface MyExtraBrowser {

}

@RunWith(Arquillian.class)
public class DroneTest {

    @Drone
    @MyExtraBrowser //<---This works without Arquillian Browser Screenshooter
    private WebDriver browser;

    @Test
    @RunAsClient
    public void ensureIndexPage() {
        try{
            browser.get("http://www.google.com")
        } catch (Exception e){
            e.printStackTrace();
        }
    }
}

你能帮忙进一步提出建议吗?

1 个答案:

答案 0 :(得分:1)

这是修复了2.1.0.Alpha2中的错误ARQGRA-467,应该修复它。

有关详细信息,请参阅https://github.com/arquillian/arquillian-recorder/issues/10

也许你应该在那里添加评论。