0

使用以下命令从命令行运行jUnit测试时,我经常遇到以下错误:Intellijgradlew clean test aggregate -Dtags="domain:SmokeTests"

The page object class de.telekom.commtech.bart.pages.common.TelekomLandingPageObject looks dodgy: Failed to instantiate page (net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate class org.openqa.selenium.firefox.FirefoxDriver) de.telekom.commtech.bart.steps.AbstractScenarioSteps.getTelekomLandingPageObject(AbstractScenarioSteps.java :52) de.telekom.commtech.bart.steps.inbox.AuthNavigationSteps.landingPageShouldAppear(AuthNavigationSteps.java :245) de.telekom.commtech.bart.testcases.BaseTest.login(BaseTest.java :447) de.telekom.commtech.bart.testcases.adressbook.lefthandnavigation.AdressBookContactsGroupTestCase.setup(AdressBookContactsGroupTestCase.java :46)

我使用最新版本的Serenity Bdd (1.1.42)andFirefox 47.0.2 如果我使用 运行单个测试Run Configuration,我不会收到该错误。我尝试将 Firefox 版本降级为45.0,但效果相同。我还能尝试什么?

编辑build.gradle文件如下所示:

repositories {
    mavenLocal()
    maven {
        name "bart"
        credentials {
            username nexusUser
            password nexusPassword
        }
        url nexusBartRepoUrl
    }
    maven {
        name "Testchameleon"
        url "https://admin.testChameleon.com/artifactory/libs-release-local"
    }
    jcenter()
}

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("net.serenity-bdd:serenity-gradle-plugin:1.1.42")
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.2'
        classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.8'
    }
}

group = 'de.telekom.bart'
description = 'Bart Test Framework'

apply plugin: 'org.asciidoctor.convert'
apply plugin: 'java'
apply plugin: 'net.serenity-bdd.aggregator'

tasks.withType(JavaCompile) {
    sourceCompatibility = "1.8"
    targetCompatibility = "1.8"
    options.deprecation = true
    options.encoding = 'UTF-8'
    options.compilerArgs << "-Xlint:unchecked"
}

dependencies {
    compile('de.telekom.bart:bart-account-manager:2.0.12')
    compile('net.serenity-bdd:serenity-core:1.1.42')
    compile('org.slf4j:slf4j-api:1.7.7')
    compile('org.slf4j:log4j-over-slf4j:1.7.7')
    compile('org.slf4j:jul-to-slf4j:1.7.7')
    compile('org.slf4j:jcl-over-slf4j:1.7.7')
    compile('ch.qos.logback:logback-classic:1.1.3')
    compile('de.testbirds.tech:testcase-api:0.3.20')
    compile('org.mnode.ical4j:ical4j:1.0.7')
    compile('org.apache.commons:commons-lang3:3.1')
    testCompile('net.serenity-bdd:serenity-junit:1.1.42')
    testCompile('org.reflections:reflections:0.9.8')
    testCompile('junit:junit:4.12')
    testCompile('org.assertj:assertj-core:1.7.0')
}
gradle.startParameter.continueOnFailure = true

test {
    maxParallelForks = Runtime.runtime.availableProcessors()

    if (System.properties['https.proxyHost']) {
        systemProperty 'https.proxyHost', System.properties['https.proxyHost']
        systemProperty 'https.proxyPort', System.properties['https.proxyPort']
        systemProperty 'https.nonProxyHosts', System.properties['https.nonProxyHosts']
    }

    if (System.properties['http.proxyHost']) {
        systemProperty 'http.proxyHost', System.properties['http.proxyHost']
        systemProperty 'http.proxyPort', System.properties['http.proxyPort']
        systemProperty 'http.nonProxyHosts', System.properties['http.nonProxyHosts']
    }

    if (System.properties['tags']) {
        systemProperty 'tags', System.properties['tags']
    }

    System.properties.each { key, value ->
        if (key.startsWith('serenity') || key.startsWith('webdriver') || key.startsWith('bart') ||(key.startsWith('test'))) {
            systemProperty key, value
        }
    }

    testLogging {
        showStandardStreams = true
    }
    /* Pass all system properties: */
    systemProperties System.getProperties()

    beforeTest { descriptor ->
        logger.lifecycle("Running test: ${descriptor}")
    }
}

asciidoctor {
    //backends = ['html5', 'pdf']
    backends = ['html5']
    sources {
        include 'index.adoc'
    }
}

task copyDocs(type: Copy, dependsOn: 'asciidoctor') {
    from asciidoctor.outputDir.canonicalPath
    into '/data/www/htdocs/bart-docs'
}

task wrapper(type: Wrapper) {
    gradleVersion = '3.1'
}
4

0 回答 0