使用Arquillian持久性与无人机/石墨烯

时间:2012-08-19 23:50:20

标签: java jboss-arquillian

是否有人能够在同一测试中使用Arquillian Graistence(Arquillian Graistence)和Selenium的Arquillian Persistence扩展?我有一个使用Persistence& amp;的项目。无人机/石墨烯扩展和单独他们都工作正常。我可以使用Persistence配置数据库进行集成测试,我可以使用Drone进行UI验证测试。

问题是当我尝试在Drone测试中使用Persistence扩展时。由于某种原因,Persistence扩展似乎不会执行,因为从未填充数据库。是否需要执行一些特殊操作才能使持久扩展在Arquillian的客户端模式下运行?

测试类

@RunWith(Arquillian.class)
@DataSource("java:jboss/datasources/ExampleDS")
@UsingDataSet("OneUserAccount-Admin.yml")
public class LoginIT {

    @Deployment(testable = false)
    public static WebArchive createDeployment() {
        return DeploymentFactory.getTemplateDeployment();
    }
    ...
    @Test
    public void testLogin() {
        this.openPage("login.xhtml");

        final IdLocator userNameField = id("loginform:email");
        final IdLocator passwordField = id("loginform:password");
        final IdLocator loginButton = id("loginform:loginButton");

        this.browser.type(userNameField, userName);
        this.browser.type(passwordField, password);
        waitForHttp(this.browser).click(loginButton);

        //Test Fails Here b/c Validation fails due to the user not being loaded to the database
    }
    ...
}

更新 我试过删除deployment = false并使用@RunAsClient没有运气。我也尝试将@UsingDataSet和@ApplyScriptBefore注释放在测试本身上,但没有运气。

1 个答案:

答案 0 :(得分:2)

在Arquillian论坛上提出同样的问题后,我被告知此功能尚不支持。我将提交一份JIRA请求,以便尽快添加。

https://community.jboss.org/message/754432

相关问题