Skip to content

Commit

Permalink
Build most of the webdriver-backed selenium using Buck.
Browse files Browse the repository at this point in the history
Still got to the WebDriverBackedSelenium class itself, but the meat now compiles
nicely with Buck. Timings of clean builds on my machine:

CrazyFun: 2m50s
Buck:     1m29s
  • Loading branch information
shs96c committed Jan 5, 2014
1 parent ad53714 commit d40032a
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 10 deletions.
11 changes: 1 addition & 10 deletions java/client/src/com/thoughtworks/selenium/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ java_library(name = 'api',
'CommandProcessor.java',
'Selenium.java',
'SeleniumException.java',
'Wait.java',
],
visibility = ['PUBLIC'],
)
Expand All @@ -22,7 +23,6 @@ java_library(name = 'selenium',
],
exported_deps = [
':api',
':wait',
'//java/client/src/com/thoughtworks/selenium/condition:condition',
],
deps = [
Expand All @@ -34,12 +34,3 @@ java_library(name = 'selenium',
],
visibility = ['PUBLIC'],
)

java_library(name = 'wait',
srcs = [
'Wait.java',
],
deps = [
':api',
])

51 changes: 51 additions & 0 deletions java/client/src/com/thoughtworks/selenium/webdriven/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

java_library(name = 'webdriven',
srcs = [
'CompoundMutator.java',
'FunctionDeclaration.java',
'SeleniumMutator.java',
'VariableDeclaration.java',
],
resources = [
'htmlutils.js',
'injectableSelenium.js',
'//javascript/selenium-atoms:findElement',
'//javascript/selenium-atoms:findOption',
'//javascript/selenium-atoms:fireEvent',
'//javascript/selenium-atoms:fireEventAt',
'//javascript/selenium-atoms:getAttribute',
'//javascript/selenium-atoms:getText',
'//javascript/selenium-atoms:linkLocator',
'//javascript/selenium-atoms:isElementPresent',
'//javascript/selenium-atoms:isSomethingSelected',
'//javascript/selenium-atoms:isTextPresent',
'//javascript/selenium-atoms:isVisible',
'//javascript/selenium-atoms:type',
'//third_party/js/sizzle:sizzle',
],
exported_deps = [
':emulation-api',
],
deps = [
'//java/client/src/com/thoughtworks/selenium:selenium',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//third_party/java/guava-libraries:guava-libraries',
],
)

java_library(name = 'emulation-api',
srcs = [
'ElementFinder.java',
'JavascriptLibrary.java',
'ScriptMutator.java',
'SeleneseCommand.java',
],
deps = [
'//java/client/src/com/thoughtworks/selenium:api',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//third_party/java/guava-libraries:guava-libraries',
],
visibility = [
'//java/client/src/com/thoughtworks/selenium/...',
],
)
22 changes: 22 additions & 0 deletions java/client/src/com/thoughtworks/selenium/webdriven/commands/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

java_library(name = 'timer',
srcs = [ 'Timer.java' ],
deps = [
'//java/client/src/com/thoughtworks/selenium:api',
'//java/client/src/com/thoughtworks/selenium/webdriven:emulation-api',
'//java/client/src/org/openqa/selenium:webdriver-api',
],
)


java_library(name = 'commands',
srcs = glob(['*.java'], excludes = ['Timer.java']),
deps = [
':timer',
'//java/client/src/com/thoughtworks/selenium:api',
'//java/client/src/com/thoughtworks/selenium/webdriven:emulation-api',
'//java/client/src/org/openqa/selenium:webdriver-api',
'//java/client/src/org/openqa/selenium/io:io',
'//third_party/java/guava-libraries:guava-libraries',
],
)
12 changes: 12 additions & 0 deletions javascript/selenium-atoms/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -29,70 +29,82 @@ js_fragment(name = 'findElement',
module = 'core.locators',
function = 'core.locators.findElement',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'findOption',
module = 'core.select.option',
function = 'core.select.option.findOption',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'fireEvent',
module = 'core.events',
function = 'core.events.fire',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'fireEventAt',
module = 'core.events',
function = 'core.events.fireAt',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'getAttribute',
module = 'core.element',
function = 'core.element.getAttribute',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'getText',
module = 'core.text.getText',
function = 'core.text.getText',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'linkLocator',
module = 'core.text',
function = 'core.text.linkLocator',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'isSomethingSelected',
module = 'core.select',
function = 'core.select.isSomethingSelected',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'isElementPresent',
module = 'core.locators',
function = 'core.locators.isElementPresent',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'isTextPresent',
module = 'core.text',
function = 'core.text.isTextPresent',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'isVisible',
module = 'core.browserbot',
function = 'core.browserbot.isVisible',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

js_fragment(name = 'type',
module = 'core.events',
function = 'core.events.setValue',
deps = [':deps'],
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)
6 changes: 6 additions & 0 deletions third_party/js/sizzle/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

export_file(name = 'sizzle',
src = 'sizzle.js',
out = 'sizzle.js',
visibility = [ '//java/client/src/com/thoughtworks/selenium/webdriven:webdriven' ],
)

0 comments on commit d40032a

Please sign in to comment.