1

私はここで新しいです:)。現在、htmelements v. 1.9 および chromedriver v. 2.30.0 で thucydides v. 0.9.203 を使用して独自のテスト フレームワークを作成しており、ドライバーと thucydides 間の互換性に問題があります。以下の pom.xml ファイルを見つけてください。どこで間違いを犯すのでしょうか?

 <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <thucydides.version>0.9.203</thucydides.version>
    <webdriver.chrome.driver>chrome</webdriver.chrome.driver>
    <maven.test.failure.ignore>true</maven.test.failure.ignore>
    <htmlelements.version>1.9</htmlelements.version>
    <testSourceDirectory>src/test/java</testSourceDirectory>
</properties>
<dependencies>
    <dependency>
        <groupId>net.thucydides</groupId>
        <artifactId>thucydides-core</artifactId>
        <version>${thucydides.version}</version>
    </dependency>
    <dependency>
        <groupId>net.thucydides</groupId>
        <artifactId>thucydides-junit</artifactId>
        <version>${thucydides.version}</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.21</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-matchers</artifactId>
        <version>${htmlelements.version}</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-chrome-driver</artifactId>
        <version>2.30.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-exec</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.properties</groupId>
        <artifactId>properties-loader</artifactId>
        <version>1.3</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-thucydides</artifactId>
        <version>1.11</version>
    </dependency>
    <dependency>
        <groupId>ru.yandex.qatools.htmlelements</groupId>
        <artifactId>htmlelements-java</artifactId>
        <version>${htmlelements.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <systemPropertyVariables>
                    <webdriver.driver>chrome</webdriver.driver>
                </systemPropertyVariables>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.5.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>net.thucydides.maven.plugins</groupId>
            <artifactId>maven-thucydides-plugin</artifactId>
            <version>${thucydides.version}</version>
            <executions>
                <execution>
                    <id>thucydides-reports</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

さらに、Exceptionテストの実行中にこれがあります:

Failed to instantiate page of type class com.epam.frameworks.thusydides.basics.pages.FilteringPage (null)

また、次の FilteringPage と Steps コードがあります。

public class FilteringPage extends PageObject {

    public FilteringPage(WebDriver driver) {
        super(driver);
    }

    public FilterBlock filterBlock;
}

public class FilterBlockSteps extends ScenarioSteps {

    public FilterBlockSteps(Pages pages){
        super(pages);
    }

    private FilteringPage onFilteringPage(){
        return pages().get(FilteringPage.class);
    }

    @Step("Ввод начальной цены {0}")
    public void setFilterStartPrice(String price) {
        onFilteringPage().filterBlock.priceFrom.sendKeys(price);
    }

    @Step("Ввод конечной цены {0}")
    public void setFilterFinishPrice(String price) {
        onFilteringPage().filterBlock.priceTo.sendKeys(price);
    }

    @StepGroup
    public void filtering(String priceFrom, String priceTo){
        setFilterStartPrice(priceFrom);
        setFilterFinishPrice(priceTo);
    }
}
4

0 に答える 0