Skip to content

Commit a55784e

Browse files
author
AutomatedTester
committed
Add the ability to run python marionette tests
This means that we can now run Marionette tests by doing //py:test_marionette:run and this cuts out a lot of build steps making it super fast and we can have specific ignores for Marionette
1 parent ea71530 commit a55784e

File tree

3 files changed

+29
-10
lines changed

3 files changed

+29
-10
lines changed

py/build.desc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ py_test(
1818
],
1919
browsers = [ "ff" ])
2020

21+
py_test(
22+
name = "marionette_test",
23+
deps = [ ":test_ff" ],
24+
browsers = [ "marionette" ])
25+
2126
py_test(
2227
name = "phantomjs_test",
2328
gd_specific_tests = [ "test/selenium/webdriver/phantomjs/*_tests.py" ],
@@ -73,6 +78,7 @@ py_test(
7378
browsers = [
7479
"chrome",
7580
"ff",
81+
"marionette",
7682
"ie",
7783
"edge",
7884
"blackberry",

rake-tasks/browsers.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@
2121
},
2222
:browser_name => "firefox",
2323
},
24+
"marionette" => {
25+
:python => {
26+
:ignore => "marionette", # py.test string used for ignoring
27+
:dir => "firefox", # Directory to put tests in/read tests from
28+
:file_string => "marionette", # Browser-string to use in test filenames
29+
:class => "Firefox", # As per py/selenium/webdriver/__init__.py
30+
},
31+
:java => {
32+
:class => "org.openqa.selenium.firefox.SynthesizedFirefoxDriver",
33+
:deps => [ "//java/client/test/org/openqa/selenium/testing/drivers" ]
34+
},
35+
:browser_name => "firefox",
36+
},
2437
"ie" => {
2538
:python => {
2639
:ignore => "ie",

rake-tasks/crazy_fun/mappings/python.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def add_all(fun)
1212
fun.add_mapping("py_env", Python::VirtualEnv.new)
1313

1414
fun.add_mapping("py_docs", Python::GenerateDocs.new)
15-
15+
1616
fun.add_mapping("py_install", Python::Install.new)
17-
17+
1818
fun.add_mapping("py_prep", Python::Prep.new)
1919
end
2020
end
@@ -221,39 +221,39 @@ class Install < Tasks
221221
def py_exe
222222
windows? ? "C:\\Python27\\python.exe" : "/usr/bin/python"
223223
end
224-
224+
225225
def handle(fun, dir, args)
226226
task Tasks.new.task_name(dir, args[:name]) do
227227
sh py_exe + " setup.py install", :verbose => true
228228
end
229229
end
230230
end
231-
231+
232232
class Prep < Tasks
233233
def handle(fun, dir, args)
234234
task Tasks.new.task_name(dir, args[:name]) do
235235
firefox_py_home = "py/selenium/webdriver/firefox/"
236236
firefox_build_dir = 'build/javascript/firefox-driver/'
237237
x86 = firefox_py_home + "x86/"
238238
amd64 = firefox_py_home + "amd64/"
239-
239+
240240
if (windows?) then
241241
firefox_build_dir = firefox_build_dir.gsub(/\//, "\\")
242242
firefox_py_home = firefox_py_home .gsub(/\//, "\\")
243243
x86 = x86.gsub(/\//,"\\")
244244
amd64 = amd64.gsub(/\//,"\\")
245245
end
246-
246+
247247
mkdir_p x86 unless File.exists?(x86)
248248
mkdir_p amd64 unless File.exists?(amd64)
249-
249+
250250
cp "cpp/prebuilt/i386/libnoblur.so", x86+"x_ignore_nofocus.so", :verbose => true
251251
cp "cpp/prebuilt/amd64/libnoblur64.so", amd64+"x_ignore_nofocus.so", :verbose => true
252-
252+
253253
cp firefox_build_dir + "webdriver.xpi" , firefox_py_home, :verbose => true
254254
cp firefox_build_dir + "webdriver_prefs.json" , firefox_py_home, :verbose => true
255255
end
256256
end
257257
end
258-
259-
end
258+
259+
end

0 commit comments

Comments
 (0)