配置Netbeans以运行测试

时间:2017-01-20 07:55:03

标签: java maven selenium netbeans jbehave

我有一个项目对遗留应用程序进行前端测试,除了使用jbehave故事运行的selenium测试外,它没有自己的功能。

我的问题是我无法通过NB中的normall按钮启动调试/运行,我总是要找到Class并单击“Test File”或“Debug Test File”按钮。

我如何确定项目的安全性,以便本课程在项目中获得测试? 或者更好的somone向我解释如何以正确的方式做到这一点。

这是我在尝试文件测试并运行时运行的内容:

cd C:\dev\xxxx\tests\xxxx.test; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_77" cmd /c "\"\"C:\\Program Files\\NetBeans 8.2\\java\\maven\\bin\\mvn.bat\" -Dtest=at.dig.xxxx.tests.workflows.WorkflowStories -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -Prelease-profile surefire:test\""
cd C:\dev\xxxx\tests\xxxx.test; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_77" cmd /c "\"\"C:\\Program Files\\NetBeans 8.2\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath at.dig.xxxx.tests.workflows.WorkflowStories clean test\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_77\\bin\\java.exe\" -DskipTests=true -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -Prelease-profile org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""

这是我的nbactions-release-profile:

<?xml version="1.0" encoding="UTF-8"?>
<actions>
    <action>
        <actionName>run</actionName>
        <packagings>
            <packaging>jar</packaging>
        </packagings>
        <goals>
            <goal>process-classes</goal>
            <goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
        </goals>
        <properties>
                <exec.args>-classpath %classpath at.dig.eprocure.tests.workflows.WorkflowStories</exec.args>
            <exec.executable>java</exec.executable>
        </properties>
    </action>
    <action>
        <actionName>debug</actionName>
        <packagings>
            <packaging>jar</packaging>
        </packagings>
        <goals>
            <goal>process-classes</goal>
            <goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
        </goals>
        <properties>
                <exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath at.dig.eprocure.tests.workflows.WorkflowStories</exec.args>
            <exec.executable>java</exec.executable>
            <jpda.listen>true</jpda.listen>
        </properties>
    </action>
    <action>
        <actionName>profile</actionName>
        <packagings>
            <packaging>jar</packaging>
        </packagings>
        <goals>
            <goal>process-classes</goal>
            <goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
        </goals>
        <properties>
                <exec.args>-classpath %classpath at.dig.eprocure.tests.workflows.WorkflowStories</exec.args>
            <exec.executable>java</exec.executable>
        </properties>
    </action>
</actions>

0 个答案:

没有答案