Skip to content

Commit

Permalink
Run the atom tests using buck
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Oct 7, 2016
1 parent 1afc18b commit b29be53
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 19 deletions.
11 changes: 6 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ task :ide_proxy_remove => [ "se_ide:remove_proxy" ]
task :ide_bamboo => ["se_ide:assemble_ide_in_bamboo"]

task :test_javascript => [
'//javascript/atoms:test:run',
'//javascript/webdriver:test:run',
'//javascript/webdriver:es6_test:run',
'//javascript/selenium-atoms:test:run',
'//javascript/selenium-core:test:run']
'calcdeps',
'//javascript/atoms:atoms-chrome:run',
'//javascript/webdriver:webdriver-chrome:run',
'//javascript/webdriver:es6_test_chrome:run',
'//javascript/selenium-atoms:selenium-atoms:run',
'//javascript/selenium-core:selenium-core-chrome:run']
task :test_chrome => [ "//java/client/test/org/openqa/selenium/chrome:chrome:run" ]
task :test_chrome_atoms => [
'//javascript/atoms:test_chrome:run',
Expand Down
7 changes: 1 addition & 6 deletions java/client/test/org/openqa/selenium/javascript/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ java_library(name = 'javascript',
'//third_party/java/hamcrest:hamcrest',
'//third_party/java/junit:junit',
'//third_party/java/guava:guava',

# "//java/client/test/org/openqa/selenium:base",
# "//java/client/test/org/openqa/selenium/environment",
# "//java/client/test/org/openqa/selenium/testing/drivers",
# "//third_party/java/guava",
# "//third_party/java/junit",
],
visibility = [
'//javascript/...',
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ public JavaScriptTestSuite(Class<?> testClass) throws InitializationError, IOExc

long timeout = Math.max(0, Long.getLong("js.test.timeout", 0));

Supplier<WebDriver> driverSupplier = new Supplier<WebDriver>() {
@Override
public WebDriver get() {
checkNotNull(webDriver, "WebDriver has not been started yet!");
return webDriver;
}
};
Supplier<WebDriver> driverSupplier =
() -> checkNotNull(webDriver, "WebDriver has not been started yet!");

children = createChildren(driverSupplier, timeout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.List;
import java.util.stream.Collectors;


/**
* Builder for test suites that run JavaScript tests.
*/
Expand Down
25 changes: 24 additions & 1 deletion javascript/atoms/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

js_library(name = 'action',
srcs = [
'action.js',
Expand Down Expand Up @@ -219,3 +218,27 @@ js_library(name = 'xpath',
'//third_party/js/wgxpath:wgxpath',
],
)

browsers = {
'firefox': 'ff',
'chrome': 'chrome',
'ie': 'ie'}
for browser in browsers.keys():
java_test(
name = 'atoms-%s' % browser,
vm_args = [
'-Dselenium.browser=%s' % browsers[browser],
'-Djs.test.timeout=120000',
'-Djs.test.dir=%s' % get_base_path(),
],
test_classes = [
'org.openqa.selenium.javascript.ClosureTestSuite',
],
deps = [
'//java/client/test/org/openqa/selenium/javascript:javascript',
'//java/client/src/org/openqa/selenium/chrome:chrome',
'//java/client/src/org/openqa/selenium/edge:edge',
'//java/client/src/org/openqa/selenium/ie:ie',
'//java/client/src/org/openqa/selenium/firefox:firefox',
],
)
24 changes: 24 additions & 0 deletions javascript/selenium-atoms/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,27 @@ js_fragment(name = 'type',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:type' ],
)

browsers = {
'firefox': 'ff',
'chrome': 'chrome',
'ie': 'ie'}
for browser in browsers.keys():
java_test(
name = 'selenium-atoms-%s' % browser,
vm_args = [
'-Dselenium.browser=%s' % browsers[browser],
'-Djs.test.timeout=120000',
'-Djs.test.dir=%s' % get_base_path(),
],
test_classes = [
'org.openqa.selenium.javascript.ClosureTestSuite',
],
deps = [
'//java/client/test/org/openqa/selenium/javascript:javascript',
'//java/client/src/org/openqa/selenium/chrome:chrome',
'//java/client/src/org/openqa/selenium/edge:edge',
'//java/client/src/org/openqa/selenium/ie:ie',
'//java/client/src/org/openqa/selenium/firefox:firefox',
],
)
24 changes: 24 additions & 0 deletions javascript/selenium-core/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,27 @@ export_file(
name = 'RemoteRunner.hta',
src = 'RemoteRunner.html',
)

browsers = {
'firefox': 'ff',
'chrome': 'chrome',
'ie': 'ie'}
for browser in browsers.keys():
java_test(
name = 'selenium-core-%s' % browser,
vm_args = [
'-Dselenium.browser=%s' % browsers[browser],
'-Djs.test.timeout=120000',
'-Djs.test.dir=%s' % get_base_path(),
],
test_classes = [
'org.openqa.selenium.javascript.ClosureTestSuite',
],
deps = [
'//java/client/test/org/openqa/selenium/javascript:javascript',
'//java/client/src/org/openqa/selenium/chrome:chrome',
'//java/client/src/org/openqa/selenium/edge:edge',
'//java/client/src/org/openqa/selenium/ie:ie',
'//java/client/src/org/openqa/selenium/firefox:firefox',
],
)
24 changes: 24 additions & 0 deletions javascript/webdriver/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,27 @@ js_library(name = 'stacktrace',
'//third_party/closure:closure',
],
)

browsers = {
'firefox': 'ff',
'chrome': 'chrome',
'ie': 'ie'}
for browser in browsers.keys():
java_test(
name = 'webdriver-%s' % browser,
vm_args = [
'-Dselenium.browser=%s' % browsers[browser],
'-Djs.test.timeout=120000',
'-Djs.test.dir=%s' % get_base_path(),
],
test_classes = [
'org.openqa.selenium.javascript.ClosureTestSuite',
],
deps = [
'//java/client/test/org/openqa/selenium/javascript:javascript',
'//java/client/src/org/openqa/selenium/chrome:chrome',
'//java/client/src/org/openqa/selenium/edge:edge',
'//java/client/src/org/openqa/selenium/ie:ie',
'//java/client/src/org/openqa/selenium/firefox:firefox',
],
)

0 comments on commit b29be53

Please sign in to comment.