Tôi có một số thử nghiệm được tạo bằng jBehave và WebDriver.Làm thế nào để thực hiện nhiều kiểm tra cùng một lúc với jBehave?
Khi tôi thực hiện chúng qua Maven, việc thực hiện là secuencially:
THI 1
- mở navigator
- Execute tất cả các bước của câu chuyện đầu tiên
- Đóng navigator
KIỂM TRA 2
- mở navigator
- Execute tất cả các bước của câu chuyện thứ hai
- Đóng navigator
...
Tôi quan tâm đến thực hiện các bài kiểm tra cùng một lúc. Theo tài liệu, điều này là có thể.
http://jbehave.org/reference/stable/multi-threading.html
Tôi đã thử thêm các ký hiệu để lớp "Stories", và cũng có thể thực hiện lệnh mvn với chủ đề = 5, nhưng không hoạt động.
@UsingEmbedder(threads=5)
public class EtsyDotComStories extends JUnitStories {
...
@Override
protected List<String> storyPaths() {
return new StoryFinder().findPaths(codeLocationFromClass(this.getClass()).getFile(), asList("**/*.story"), null);
}
}
mvn clean install -s settings.xml -Pjava-spring,codehaus,threads=5
Có thể thực hiện nhiều kiểm tra cùng một lúc không?
EDIT:
Added phần thực hiện maven:
<plugins>
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<version>${jbehave.core.version}</version>
<executions>
<execution>
<id>embeddable-stories</id>
<phase>integration-test</phase>
<configuration>
<includes>
<include>**/*Stories.java</include>
</includes>
<ignoreFailureInStories>true</ignoreFailureInStories>
<ignoreFailureInView>false</ignoreFailureInView>
<threads>5</threads>
<executorsClass>org.jbehave.core.embedder.executors.SameThreadExecutors</executorsClass>
</configuration>
<goals>
<goal>run-stories-as-embeddables</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>11.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
thể bạn cũng hãy chia sẻ một phần của pom của bạn, để xem làm thế nào bạn khởi động JBehave? EtsyDotcomStories có chứa nhiều cấu hình hơn những gì bạn đã đăng không? – AndreasEK
@AndreasEK Đã thêm một phần của pom được thực hiện. Nếu bạn cần thêm thông tin, hãy cho tôi biết. Cảm ơn. EtsyDotcomStories không có nhiều ký hiệu hơn nhưng có rất nhiều mã bên trong. Nếu bạn cần, tôi có thể thử thêm vào câu hỏi. –