2

Has anyone been able to use Arquillian Persistence extension with Arquillian Graphene/Selenium in the same test? I have a project that is using the Persistence & Drone/Graphene extensions and separately they both work fine. I can configure the database for integration tests with Persistence, and I can do UI Acceptance tests with Drone.

The problem is when I try to use the Persistence extension in a Drone test. For some reason the Persistence extension does not appear to execute as the database is never populated. Is there something special that needs to be done to enable the Persistence Extension to run in client mode with Arquillian?

Test Class

@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 注释放在测试本身上,但没有成功。

4

1 回答 1

2

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

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

于 2012-08-20T12:34:40.003 回答