Skip to content

Commit

Permalink
Minor decomplexification of the selenium emulation build scripts.
Browse files Browse the repository at this point in the history
Notably, this change pulls the generated JS files into the
com.thoughtworks.selenium.webdriven package rather than sub-packages.
  • Loading branch information
shs96c committed Jan 5, 2014
1 parent 493d5df commit d32323e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
public class JavascriptLibrary {

static final String PREFIX = "/" + JavascriptLibrary.class.getPackage()
.getName().replace(".", "/") + "/selenium_atoms/";
.getName().replace(".", "/") + "/";
private final ConcurrentHashMap<String, String> scripts = new ConcurrentHashMap<String, String>();

private static final String injectableSelenium =
"/com/thoughtworks/selenium/webdriven/scripts/injectableSelenium.js";
"/com/thoughtworks/selenium/webdriven/injectableSelenium.js";
private static final String htmlUtils =
"/com/thoughtworks/selenium/webdriven/scripts/htmlutils.js";
"/com/thoughtworks/selenium/webdriven/htmlutils.js";

/**
* Loads the named Selenium script and returns it wrapped in an anonymous function.
Expand Down
69 changes: 15 additions & 54 deletions java/client/src/com/thoughtworks/selenium/webdriven/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ java_library(name = "webdriven",
":emulation-api",
],
embedded = [
":scripts",
":selenium_atoms",
"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",
])


Expand All @@ -25,55 +38,3 @@ java_library(name = "emulation-api",
"//java/client/src/org/openqa/selenium:webdriver-api",
"//third_party/java/guava-libraries",
])


export_file(name = "injectableSelenium",
srcs = [ "injectableSelenium.js" ])


export_file(name = "htmlutils",
srcs = [ "htmlutils.js" ])


folder(name = "scripts",
deps = [
"injectableSelenium.js",
"htmlutils.js",
],
outs = [
"scripts/injectableSelenium.js",
"scripts/htmlutils.js",
])


folder(name = "selenium_atoms",
deps = [
"//javascript/selenium-atoms:findElement.js",
"//javascript/selenium-atoms:findOption.js",
"//javascript/selenium-atoms:fireEvent.js",
"//javascript/selenium-atoms:fireEventAt.js",
"//javascript/selenium-atoms:getAttribute.js",
"//javascript/selenium-atoms:getText.js",
"//javascript/selenium-atoms:linkLocator.js",
"//javascript/selenium-atoms:isElementPresent.js",
"//javascript/selenium-atoms:isSomethingSelected.js",
"//javascript/selenium-atoms:isTextPresent.js",
"//javascript/selenium-atoms:isVisible.js",
"//javascript/selenium-atoms:type.js",
"//third_party/js/sizzle:sizzle.js",
],
outs = [
"selenium_atoms/findElement.js",
"selenium_atoms/findOption.js",
"selenium_atoms/fireEvent.js",
"selenium_atoms/fireEventAt.js",
"selenium_atoms/getAttribute.js",
"selenium_atoms/getText.js",
"selenium_atoms/linkLocator.js",
"selenium_atoms/isElementPresent.js",
"selenium_atoms/isSomethingSelected.js",
"selenium_atoms/isTextPresent.js",
"selenium_atoms/isVisible.js",
"selenium_atoms/type.js",
"selenium_atoms/sizzle.js",
])
4 changes: 1 addition & 3 deletions java/client/src/org/openqa/selenium/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ java_library(name = "webdriver-backed-selenium",
deps = [
":selenium-api",
"//java/client/src/com/thoughtworks/selenium",
"//java/client/src/com/thoughtworks/selenium/webdriven",
"//java/client/src/org/openqa/selenium/internal/seleniumemulation",
],
embedded = [
"//java/client/src/com/thoughtworks/selenium/webdriven:scripts",
])

java_library(name = "client-combined",
Expand Down

0 comments on commit d32323e

Please sign in to comment.