tôi muốn chạy thử nghiệm selen với gradle trên jboss, và tôi đã có thể thực hiện các cấu hình cần thiết và tôi muốn chia sẻ nó với cộng đồng.Làm thế nào để cấu hình các thử nghiệm selen với gradle?
6
A
Trả lời
2
Giải pháp là như sau:
gradle.build:
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'war'
apply plugin: 'findbugs'
//apply from:'http://github.com/breskeby/gradleplugins/raw/master/emmaPlugin/emma.gradle'
apply from: 'emma.gradle'
buildDir = 'build'
sourceCompatibility = 1.7
version = ''
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.gradle.api.plugins:gradle-cargo-plugin:0.6'
}
}
repositories {
mavenCentral()
mavenRepo url: 'http://repository.primefaces.org'
mavenRepo url: 'http://repository.jboss.org/nexus/content/groups/public'
mavenRepo url: 'http://repository.jboss.org/maven2'
mavenRepo url: 'http://maven.springframework.org/release'
mavenRepo url: 'http://repo1.maven.org/maven2'
mavenRepo url: 'http://git.solutionstream.com/nexus/content/repositories/thirdparty'
}
configurations {
compileOnly
weldEmbeddedTestRuntime { extendsFrom testRuntime }
jbossasRemoteTestRuntime { extendsFrom testRuntime, compileOnly }
}
sourceSets {
main {
compileClasspath = configurations.compile + configurations.compileOnly
}
test {
compileClasspath = compileClasspath + configurations.compileOnly
}
selenium {
compileClasspath = compileClasspath + configurations.compileOnly
}
}
dependencies {
//JSF
compile group: 'com.sun.faces', name: 'jsf-api', version: '2.1.22'
compile group: 'com.sun.faces', name: 'jsf-impl', version: '2.1.22'
compile 'org.ocpsoft.rewrite:rewrite-servlet:2.0.3.Final'
compile 'org.ocpsoft.rewrite:rewrite-config-prettyfaces:2.0.3.Final'
//Servlet
compile group: 'javax.servlet', name: 'jstl', version: '1.2'
providedCompile group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: '1.0.0.Final'
compile 'taglibs:standard:1.1.2'
compile group: 'org.springframework', name: 'spring-web', version: '3.2.2.RELEASE'
//Omnifaces
compile 'org.omnifaces:omnifaces:1.5'
//Prime Faces
compile group: 'org.primefaces', name: 'primefaces', version: '4.0-SNAPSHOT'
compile 'org.primefaces.themes:bootstrap:1.0.10'
// DB
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.3.1.RELEASE'
compile group: 'org.springframework', name: 'spring-aspects', version: '3.2.2.RELEASE'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.9'
compile group: 'javax.inject', name: 'javax.inject', version: '1'
compile group: 'javax.enterprise', name: 'cdi-api', version: '1.0-SP4'
compile 'cglib:cglib-nodep:2.2.2'
//Hibernate/JPA
compile 'org.hibernate:hibernate-core:4.1.0.Final'
compile 'org.hibernate:hibernate-entitymanager:4.1.0.Final'
compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final'
//JSR-303
compile 'org.hibernate:hibernate-validator:4.3.1.Final'
// Spring Security
compile 'org.springframework.security:spring-security-core:3.1.4.RELEASE'
compile 'org.springframework.security:spring-security-web:3.1.4.RELEASE'
compile 'org.springframework.security:spring-security-config:3.1.4.RELEASE'
//Utility
compile 'com.google.guava:guava:14.0.1'
compile 'commons-lang:commons-lang:2.6'
compile 'org.apache.commons:commons-email:1.3.1'
compile 'com.typesafe:config:1.0.0'
compile 'joda-time:joda-time:2.2'
compile 'org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:1.8.3'
compile 'org.slf4j:slf4j-api:1.7.2'
compile 'org.slf4j:jcl-over-slf4j:1.7.2'
compile 'org.slf4j:slf4j-log4j12:1.7.2'
//Mustache Templates
compile 'com.github.jknack:handlebars:1.0.0'
//Projects
//compile project(":ExtraValidators")
////TESTING DEPENDENCIES
testCompile 'com.googlecode.jmockit:jmockit:1.2'
testCompile group: 'junit', name: 'junit', version: '4.11'
testCompile 'com.h2database:h2:1.3.172'
//Spring Testing
testCompile 'org.springframework:spring-test:3.2.3.RELEASE'
/* Selenium */
seleniumCompile 'org.seleniumhq.selenium:selenium-java:2.33.0'
seleniumCompile 'junit:junit:4.11'
seleniumCompile 'org.slf4j:slf4j-api:1.7.2'
seleniumCompile 'org.slf4j:slf4j-log4j12:1.7.2'
seleniumCompile 'org.slf4j:jcl-over-slf4j:1.7.2'
/* Remote Jboss */
testCompile group: 'org.jboss.arquillian', name: 'arquillian-junit', version: '1.0.0-SNAPSHOT'
jbossasRemoteTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-jbossas-remote-6', version: '1.0.0-SNAPSHOT'
jbossasRemoteTestRuntime group: 'org.jboss.jbossas', name: 'jboss-as-server', classifier: 'client', version: '6.1.0.Final', transitive: false
jbossasRemoteTestRuntime group: 'org.jboss.jbossas', name: 'jboss-as-profileservice', classifier: 'client', version: '6.1.0.Final'
}
task wrapper(type: Wrapper){
gradleVersion = '1.6'
}
eclipse {
classpath {
downloadSources=true
plusConfigurations += configurations.seleniumCompile
}
}
task selenium(type: Test) {
testClassesDir = sourceSets.selenium.output.classesDir
classpath = sourceSets.selenium.runtimeClasspath + files('src/selenium/resources-jbossas') + configurations.jbossasRemoteTestRuntime
}
bạn cần phải khởi động máy chủ JBoss bằng tay sau đó sử dụng lệnh sạch gradlew selen
7
tôi đã a complete example here on my Github acccoun t .
phụ thuộc của tôi, chỉ sử dụng repo mavenCentral là:
dependencies {
compile group: 'org.sikuli', name: 'sikuli-api', version: '1.0.+'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '3.+'
compile group: 'commons-io', name: 'commons-io', version: '1.3.+'
compile group: 'junit', name: 'junit', version: '4.+'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.+'
compile group: 'net.sf.opencsv', name: 'opencsv', version: '2.+'
}
tôi sẽ chạy JBoss7 như một dịch vụ (trên cửa sổ) thay vì cố gắng để thực hiện nó trực tiếp từ Gradle. Tôi đã viết a script to register a service nếu bạn muốn sử dụng nó. Sau đó, bạn chỉ cần thực hiện một nhiệm vụ gradle để thực thi kịch bản với đối số "start" để bắt đầu dịch vụ.
Các vấn đề liên quan
- 1. Làm thế nào để chạy các thử nghiệm Java Selen với TestNG theo lập trình?
- 2. Khi chạy selen với capybara/rails, làm thế nào để cấu hình máy chủ?
- 3. Chạy thử nghiệm selen song song với Capybara
- 4. Ghi thử nghiệm Selen cho các trường hợp thử nghiệm Plone chức năng
- 5. Làm thế nào tôi có thể cấu hình trình quản trị web selen để sử dụng thiết lập firefox tùy chỉnh cho các thử nghiệm?
- 6. Gradle: Làm thế nào để cấu hình thiết lập multiproject với các dự án side-by-side
- 7. Làm cách nào để chỉ định tệp cấu hình với sbt 0.12.2 cho thử nghiệm sbt?
- 8. Cấu hình mùa xuân và Thử nghiệm
- 9. Cấu hình các nguồn cpp trong gradle
- 10. Phát 2.0 thiết lập FakeApplication với cấu hình thử nghiệm
- 11. Làm thế nào để chạy thử nghiệm dưa chuột-jvm bằng cách sử dụng Gradle
- 12. thử nghiệm junit với gradle cho một dự án android
- 13. cấu hình giả trong các thử nghiệm của Grails
- 14. Làm thế nào để bạn thử nghiệm?
- 15. Dọn dẹp dữ liệu sau khi thử nghiệm selen
- 16. Làm cách nào để cấu hình PyCharm để chạy thử nghiệm py.test?
- 17. Làm thế nào để thử nghiệm tài nguyên $ góc trong các thử nghiệm hoa nhài
- 18. Tôi làm cách nào để định cấu hình studio trực quan để chạy thử nghiệm xUnit.net?
- 19. Hướng dẫn để Thử nghiệm Kịch bản Gradle
- 20. Thử nghiệm đơn vị mùa xuân 3.2 với cấu hình dựa trên Java
- 21. Thử nghiệm selen mà không cần trình duyệt
- 22. Chạy thử nghiệm selen với maven-surefire-plugin hoặc maven-failsafe-plugin?
- 23. Cấu hình thử nghiệm đơn vị Eclipse Maven
- 24. Làm thế nào để cấu hình TeamCity để chạy thử nghiệm đồng thời thay vì từng cái một?
- 25. Làm thế nào để bạn chạy Rails với HTTP cục bộ để thử nghiệm?
- 26. Làm thế nào để tạo các thử nghiệm với các tên khác nhau trong TestNG?
- 27. Làm thế nào để thực hiện Play Framework với thử nghiệm AngularJS e2e hoặc với thử nghiệm Play
- 28. Thực hành tốt nhất để tổ chức kiểm tra selen và thử nghiệm đơn vị
- 29. Thử nghiệm hình SVG?
- 30. Phần cấu hình log4net cho dự án thử nghiệm NUnit
tại sao sử dụng emma khi JaCoCo được xây dựng để chuyển sang chế độ gradle? – Gus