selenium-rspec-dsl 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/common/shared/common.rb +167 -0
- data/config/aggregate_reports.rb +124 -0
- data/config/array_extension.rb +13 -0
- data/config/multi_process_behaviour_runner.rb +50 -0
- data/config/selenium-setup.rb +32 -0
- data/config/site_config.rb +8 -0
- data/sites/button.rb +31 -0
- data/sites/buttonAjax.rb +14 -0
- data/sites/buttonJQuery.rb +26 -0
- data/sites/buttonMultiWindow.rb +99 -0
- data/sites/buttonNonLoad.rb +11 -0
- data/sites/checkbox.rb +22 -0
- data/sites/checkboxExtjs.rb +10 -0
- data/sites/checkboxGwt.rb +24 -0
- data/sites/dropdown.rb +28 -0
- data/sites/dropdownAjax.rb +40 -0
- data/sites/dropdownExtjs.rb +32 -0
- data/sites/dropdownJQuery.rb +40 -0
- data/sites/dropdownLoad.rb +25 -0
- data/sites/element.rb +172 -0
- data/sites/form.rb +7 -0
- data/sites/image.rb +7 -0
- data/sites/label.rb +32 -0
- data/sites/link.rb +32 -0
- data/sites/linkMultiWindow.rb +160 -0
- data/sites/linkNonLoad.rb +11 -0
- data/sites/listbox.rb +16 -0
- data/sites/page.rb +16 -0
- data/sites/panel.rb +7 -0
- data/sites/radiobutton.rb +10 -0
- data/sites/tabPanel.rb +7 -0
- data/sites/table.rb +48 -0
- data/sites/tableExtjs.rb +42 -0
- data/sites/test/googleResults_screen.rb +15 -0
- data/sites/test/googleSearch_screen.rb +27 -0
- data/sites/textbox.rb +16 -0
- data/sites/tree.rb +7 -0
- data/sites/treeGwt.rb +32 -0
- data/spec/spec.opts +6 -0
- data/spec/spec_helper.rb +40 -0
- data/spec/test/testPass_spec.rb +36 -0
- data/spec/test/testPending_spec.rb +13 -0
- data/vendor/selenium-client-1.2.17/README.markdown +328 -0
- data/vendor/selenium-client-1.2.17/examples/rspec/google_spec.rb +41 -0
- data/vendor/selenium-client-1.2.17/examples/script/google.rb +25 -0
- data/vendor/selenium-client-1.2.17/examples/testunit/google_test.rb +39 -0
- data/vendor/selenium-client-1.2.17/lib/nautilus/shell.rb +32 -0
- data/vendor/selenium-client-1.2.17/lib/selenium.rb +14 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client.rb +27 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/base.rb +118 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/driver.rb +11 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/extensions.rb +118 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/generated_driver.rb +1711 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/idiomatic.rb +488 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/javascript_expression_builder.rb +116 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/javascript_frameworks/jquery.rb +13 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/javascript_frameworks/prototype.rb +13 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/protocol.rb +96 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/client/selenium_helper.rb +34 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/command_error.rb +4 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/protocol_error.rb +4 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rake/default_tasks.rb +16 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rake/remote_control_start_task.rb +70 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rake/remote_control_stop_task.rb +44 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rake/tasks.rb +6 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/remote_control/remote_control.rb +33 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/reporting/file_path_strategy.rb +78 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/reporting/html_report.rb +123 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/reporting/selenium_test_report_formatter.rb +87 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/reporting/system_capture.rb +72 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/rspec_extensions.rb +96 -0
- data/vendor/selenium-client-1.2.17/lib/selenium/rspec/spec_helper.rb +35 -0
- data/vendor/selenium-client-1.2.17/lib/tcp_socket_extension.rb +32 -0
- data/vendor/selenium-client-1.2.17/test/all_unit_tests.rb +3 -0
- data/vendor/selenium-grid-1.0.4/Capfile +107 -0
- data/vendor/selenium-grid-1.0.4/README +10 -0
- data/vendor/selenium-grid-1.0.4/Rakefile +190 -0
- data/vendor/selenium-grid-1.0.4/build.xml +182 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Multiple Environments Demo Setup.svg +518 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Multiple Machine Demo Setup.svg +371 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Rakefile +18 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Requesting a Specific Environment.svg +576 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Selenium Grid Setup.svg +539 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Selenium Grid.css +68 -0
- data/vendor/selenium-grid-1.0.4/doc/resources/Traditional Selenium Setup.svg +295 -0
- data/vendor/selenium-grid-1.0.4/doc/website/Rakefile +37 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Multiple Environment Demo Setup - Small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Multiple Environment Demo Setup.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Multiple Machine Demo Setup - Small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Multiple Machine Demo Setup.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Requesting a Specific Environment - Small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Requesting a Specific Environment.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Selenium Grid Logo.graffle +1015 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Selenium Grid Setup - Small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Selenium Grid Setup.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Traditional Selenium Setup - Small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/diagrams/Traditional Selenium Setup.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/faq.markdown +686 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/ant_version_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/ant_version_win_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/background_better.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/background_feedback.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/background_participate.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/background_start_tracks.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/background_started.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/check_path_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/check_path_win_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/dot_profile_editing_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/dot_profile_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-ant-install.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-ant-profile-update.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-ant-verify.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-ant-version.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-java-version.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-navigate-path.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-selenium-install.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/linux/linux-selenium-sanity-check.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install/win/selenium-check.bmp +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/install_ant_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/installing_grid_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/java_version_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/java_version_win_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/sanity_check_osx_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/sanity_check_win_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium-grid-logo-huge-white.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium-grid-logo-huge.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium-grid-logo-large.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium-grid-logo-small.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium-grid-logo.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/selenium_grid_logo_large.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/images/update_path_win_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/doc/website/javascripts/shadedborder.js +267 -0
- data/vendor/selenium-grid-1.0.4/doc/website/stylesheets/document.css +82 -0
- data/vendor/selenium-grid-1.0.4/doc/website/stylesheets/faq.css +97 -0
- data/vendor/selenium-grid-1.0.4/doc/website/stylesheets/home.css +133 -0
- data/vendor/selenium-grid-1.0.4/doc/website/stylesheets/openqa.css +72 -0
- data/vendor/selenium-grid-1.0.4/doc/website/stylesheets/site.css +74 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/Capfile +276 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/etc/background.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/etc/background.svg +163 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/cloud.rb +35 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/ec2.rb +7 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/ec2_client.rb +54 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/hub.rb +22 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/remote_command.rb +47 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/lib/selenium_grid/aws/server.rb +56 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/all_test.rb +2 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/cloud_test.rb +27 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/ec2_client_test.rb +137 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/hub_test.rb +24 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/remote_command_test.rb +46 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/server_test.rb +22 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/test/unit/test_helper.rb +4 -0
- data/vendor/selenium-grid-1.0.4/examples/ec2/vnc_password +1 -0
- data/vendor/selenium-grid-1.0.4/examples/java/Java Example.iml +18 -0
- data/vendor/selenium-grid-1.0.4/examples/java/build.xml +90 -0
- data/vendor/selenium-grid-1.0.4/examples/java/src/com/thoughtworks/selenium/grid/examples/java/GoogleImageTestBase.java +46 -0
- data/vendor/selenium-grid-1.0.4/examples/java/src/com/thoughtworks/selenium/grid/examples/java/ParisTest.java +50 -0
- data/vendor/selenium-grid-1.0.4/examples/java/src/com/thoughtworks/selenium/grid/examples/java/PerigordTest.java +42 -0
- data/vendor/selenium-grid-1.0.4/examples/java/target/classes/com/thoughtworks/selenium/grid/examples/java/GoogleImageTestBase.class +0 -0
- data/vendor/selenium-grid-1.0.4/examples/java/target/classes/com/thoughtworks/selenium/grid/examples/java/ParisTest.class +0 -0
- data/vendor/selenium-grid-1.0.4/examples/java/target/classes/com/thoughtworks/selenium/grid/examples/java/PerigordTest.class +0 -0
- data/vendor/selenium-grid-1.0.4/examples/java/testng-slow.xml +9 -0
- data/vendor/selenium-grid-1.0.4/examples/java/testng.xml +9 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/README +66 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/Rakefile +101 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/Ruby Example.iml +17 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/flickr_example.rb +16 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/lib/array_extension.rb +13 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/lib/multi_process_behaviour_runner.rb +28 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/paris_spec.rb +34 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/perigord_spec.rb +22 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/spec_helper.rb +59 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_04b8969da99c51289f692b41abbf271b_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_04b8969da99c51289f692b41abbf271b_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_280fd974268e3aecb89fbfbee25b5322_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_280fd974268e3aecb89fbfbee25b5322_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_8808fb9026e023f809d50ddc9cf00cd3_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_8808fb9026e023f809d50ddc9cf00cd3_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_94b209474d36add5ba908f308c63aa15_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_94b209474d36add5ba908f308c63aa15_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_a18dd8ce90cb4681d55b2148326ff085_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_a18dd8ce90cb4681d55b2148326ff085_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_b877a400a718a915c95038427389e0d9_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_b877a400a718a915c95038427389e0d9_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_c1c6e8109e89867b52f6e123b8847b85_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_c1c6e8109e89867b52f6e123b8847b85_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_c9e7156818e496f6abb983a9a1725295_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_c9e7156818e496f6abb983a9a1725295_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_d6b2848186a7e4a73e19692c0fab2ae5_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_d6b2848186a7e4a73e19692c0fab2ae5_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_e30337afe445f0b6ebd29ecfaf4cd9f0_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_e30337afe445f0b6ebd29ecfaf4cd9f0_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_edc2da92cbf119e95eae988bb6f80792_page_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/examples/ruby/tmp/resources/test_report/example_edc2da92cbf119e95eae988bb6f80792_system_screenshot.png +0 -0
- data/vendor/selenium-grid-1.0.4/grid_configuration.yml +46 -0
- data/vendor/selenium-grid-1.0.4/lib/build/common-build.xml +228 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/file_extensions.rb +9 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/java/classpath.rb +28 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/java/vm.rb +31 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/s_grid/hub.rb +29 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/s_grid/remote_control.rb +40 -0
- data/vendor/selenium-grid-1.0.4/lib/ruby/tcp_socket_extensions.rb +23 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-demo-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-demo-standalone-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-hub-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-hub-standalone-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-remote-control-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-remote-control-standalone-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-tools-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/selenium-grid-tools-standalone-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/lib/testng.policy +11 -0
- data/vendor/selenium-grid-1.0.4/log/test.txt +1 -0
- data/vendor/selenium-grid-1.0.4/project.properties +4 -0
- data/vendor/selenium-grid-1.0.4/sample-scripts/kill-rcs.sh +3 -0
- data/vendor/selenium-grid-1.0.4/sample-scripts/launch-rc.sh +4 -0
- data/vendor/selenium-grid-1.0.4/sample-scripts/launch-rcs.sh +5 -0
- data/vendor/selenium-grid-1.0.4/sample-scripts/launch-remote-controls.rb +20 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/Command line test.html +218 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/classes.html +44 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/groups.html +5 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/index.html +6 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/main.html +2 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/methods-alphabetical.html +12 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/methods-not-run.html +2 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/methods.html +12 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/reporter-output.html +1 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/testng.xml.html +1 -0
- data/vendor/selenium-grid-1.0.4/target/reports/Selenium Grid Demo In Parallel/toc.html +30 -0
- data/vendor/selenium-grid-1.0.4/target/reports/emailable-report.html +117 -0
- data/vendor/selenium-grid-1.0.4/target/reports/index.html +9 -0
- data/vendor/selenium-grid-1.0.4/vendor/commons-logging-1.0.4.jar +0 -0
- data/vendor/selenium-grid-1.0.4/vendor/selenium-java-client-driver-1.0.1.jar +0 -0
- data/vendor/selenium-grid-1.0.4/vendor/selenium-server-1.0.3.jar +0 -0
- data/vendor/selenium-grid-1.0.4/vendor/testng-5.7-jdk15.jar +0 -0
- metadata +296 -0
@@ -0,0 +1,488 @@
|
|
1
|
+
module Selenium
|
2
|
+
module Client
|
3
|
+
|
4
|
+
# Provide a more idiomatic API than the generated Ruby driver.
|
5
|
+
#
|
6
|
+
# Work in progress...
|
7
|
+
module Idiomatic
|
8
|
+
|
9
|
+
# Return the text content of an HTML element (rendered text shown to
|
10
|
+
# the user). Works for any HTML element that contains text.
|
11
|
+
#
|
12
|
+
#
|
13
|
+
# This command uses either the textContent (Mozilla-like browsers)
|
14
|
+
# or the innerText (IE-like browsers) of the element, which is the
|
15
|
+
# rendered text shown to the user.
|
16
|
+
#
|
17
|
+
# * 'locator' is an Selenium element locator
|
18
|
+
#
|
19
|
+
def text(locator)
|
20
|
+
string_command "getText", [locator,]
|
21
|
+
end
|
22
|
+
alias :text_content :text
|
23
|
+
|
24
|
+
# Return the title of the current HTML page.
|
25
|
+
def title
|
26
|
+
string_command "getTitle"
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns the absolute URL of the current page.
|
30
|
+
def location
|
31
|
+
string_command "getLocation"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Waits for a new page to load.
|
35
|
+
#
|
36
|
+
# Selenium constantly keeps track of new pages loading, and sets a
|
37
|
+
# "newPageLoaded" flag when it first notices a page load. Running
|
38
|
+
# any other Selenium command after turns the flag to false. Hence,
|
39
|
+
# if you want to wait for a page to load, you must wait immediately
|
40
|
+
# after a Selenium command that caused a page-load.
|
41
|
+
#
|
42
|
+
# * 'timeout_in_seconds' is a timeout in seconds, after which this
|
43
|
+
# command will return with an error
|
44
|
+
def wait_for_page(timeout_in_seconds=nil)
|
45
|
+
remote_control_command "waitForPageToLoad",
|
46
|
+
[actual_timeout_in_milliseconds(timeout_in_seconds),]
|
47
|
+
end
|
48
|
+
alias_method :wait_for_page_to_load, :wait_for_page
|
49
|
+
|
50
|
+
# Waits for a popup window to appear and load up.
|
51
|
+
#
|
52
|
+
# window_id is the JavaScript window "name" of the window that will appear (not the text of the title bar)
|
53
|
+
# timeout_in_seconds is a timeout in seconds, after which the action will return with an error
|
54
|
+
def wait_for_popup(window_id, timeout_in_seconds=nil)
|
55
|
+
remote_control_command "waitForPopUp",
|
56
|
+
[window_id, actual_timeout_in_milliseconds(timeout_in_seconds) ,]
|
57
|
+
end
|
58
|
+
|
59
|
+
# Flexible wait semantics. ait is happening browser side. Useful for testing AJAX application.
|
60
|
+
#
|
61
|
+
# * wait :wait_for => :page # will wait for a new page to load
|
62
|
+
# * wait :wait_for => :popup, :window => 'a window id' # will wait for a new popup window to appear. Also selects the popup window for you provide `:select => true`
|
63
|
+
# * wait :wait_for => :ajax # will wait for all ajax requests to be completed using semantics of default javascript framework
|
64
|
+
# * wait :wait_for => :ajax, :javascript_framework => :jquery # will wait for all ajax requests to be completed overriding default javascript framework
|
65
|
+
# * wait :wait_for => :effects # will wait for all javascript effects to be rendered using semantics of default javascript framework
|
66
|
+
# * wait :wait_for => :effects, :javascript_framework => :prototype # will wait for all javascript effects to be rendered overriding default javascript framework
|
67
|
+
# * wait :wait_for => :element, :element => 'new_element_id' # will wait for an element to be present/appear
|
68
|
+
# * wait :wait_for => :no_element, :element => 'new_element_id' # will wait for an element to be not be present/disappear
|
69
|
+
# * wait :wait_for => :text, :text => 'some text' # will wait for some text to be present/appear
|
70
|
+
# * wait :wait_for => :text, :text => /A Regexp/ # will wait for some text to be present/appear
|
71
|
+
# * wait :wait_for => :text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to be 'some text'
|
72
|
+
# * wait :wait_for => :no_text, :text => 'some text' # will wait for the text to be not be present/disappear
|
73
|
+
# * wait :wait_for => :no_text, :text => /A Regexp/ # will wait for the text to be not be present/disappear
|
74
|
+
# * wait :wait_for => :no_text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to not be 'some text'
|
75
|
+
# * wait :wait_for => :value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to be 'some value'
|
76
|
+
# * wait :wait_for => :no_value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to not be 'some value'
|
77
|
+
# * wait :wait_for => :visible, :element => 'a_locator' # will wait for element to be visible
|
78
|
+
# * wait :wait_for => :not_visible, :element => 'a_locator' # will wait for element to not be visible
|
79
|
+
# * wait :wait_for => :condition, :javascript => 'some expression' # will wait for the javascript expression to be true
|
80
|
+
#
|
81
|
+
# Using options you can also define an explicit timeout (:timeout_in_seconds key). Otherwise the default driver timeout
|
82
|
+
# is used.
|
83
|
+
def wait_for(options)
|
84
|
+
if options[:wait_for] == :page
|
85
|
+
wait_for_page options[:timeout_in_seconds]
|
86
|
+
elsif options[:wait_for] == :ajax
|
87
|
+
wait_for_ajax options
|
88
|
+
elsif options[:wait_for] == :element
|
89
|
+
wait_for_element options[:element], options
|
90
|
+
elsif options[:wait_for] == :no_element
|
91
|
+
wait_for_no_element options[:element], options
|
92
|
+
elsif options[:wait_for] == :text
|
93
|
+
wait_for_text options[:text], options
|
94
|
+
elsif options[:wait_for] == :no_text
|
95
|
+
wait_for_no_text options[:text], options
|
96
|
+
elsif options[:wait_for] == :effects
|
97
|
+
wait_for_effects options
|
98
|
+
elsif options[:wait_for] == :popup
|
99
|
+
wait_for_popup options[:window], options[:timeout_in_seconds]
|
100
|
+
select_window options[:window] if options[:select]
|
101
|
+
elsif options[:wait_for] == :value
|
102
|
+
wait_for_field_value options[:element], options[:value], options
|
103
|
+
elsif options[:wait_for] == :no_value
|
104
|
+
wait_for_no_field_value options[:element], options[:value], options
|
105
|
+
elsif options[:wait_for] == :visible
|
106
|
+
wait_for_visible options[:element], options
|
107
|
+
elsif options[:wait_for] == :not_visible
|
108
|
+
wait_for_not_visible options[:element], options
|
109
|
+
elsif options[:wait_for] == :condition
|
110
|
+
wait_for_condition options[:javascript], options[:timeout_in_seconds]
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# Gets the entire text of the page.
|
115
|
+
def body_text
|
116
|
+
string_command "getBodyText"
|
117
|
+
end
|
118
|
+
|
119
|
+
# Clicks on a link, button, checkbox or radio button.
|
120
|
+
#
|
121
|
+
# 'locator' is an element locator
|
122
|
+
#
|
123
|
+
# Using 'options' you can automatically wait for an event to happen after the
|
124
|
+
# click. e.g.
|
125
|
+
#
|
126
|
+
# * click "a_locator", :wait_for => :page # will wait for a new page to load
|
127
|
+
# * click "a_locator", :wait_for => :popup, :window => 'a window id' # will wait for a new popup window to appear. Also selects the popup window for you provide `:select => true`
|
128
|
+
# * click "a_locator", :wait_for => :ajax # will wait for all ajax requests to be completed using semantics of default javascript framework
|
129
|
+
# * click "a_locator", :wait_for => :ajax, :javascript_framework => :jquery # will wait for all ajax requests to be completed overriding default javascript framework
|
130
|
+
# * click "a_locator", :wait_for => :effects # will wait for all javascript effects to be rendered using semantics of default javascript framework
|
131
|
+
# * click "a_locator", :wait_for => :effects, :javascript_framework => :prototype # will wait for all javascript effects to be rendered overriding default javascript framework
|
132
|
+
# * click "a_locator", :wait_for => :element, :element => 'new_element_id' # will wait for an element to be present/appear
|
133
|
+
# * click "a_locator", :wait_for => :no_element, :element => 'new_element_id' # will wait for an element to be not be present/disappear
|
134
|
+
# * click "a_locator", :wait_for => :text, :text => 'some text' # will wait for some text to be present/appear
|
135
|
+
# * click "a_locator", :wait_for => :text, :text => /A Regexp/ # will wait for some text to be present/appear
|
136
|
+
# * click "a_locator", :wait_for => :text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to be 'some text'
|
137
|
+
# * click "a_locator", :wait_for => :no_text, :text => 'some text' # will wait for the text to be not be present/disappear
|
138
|
+
# * click "a_locator", :wait_for => :no_text, :text => /A Regexp/ # will wait for the text to be not be present/disappear
|
139
|
+
# * click "a_locator", :wait_for => :no_text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to not be 'some text'
|
140
|
+
# * click "a_locator", :wait_for => :value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to be 'some value'
|
141
|
+
# * click "a_locator", :wait_for => :no_value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to not be 'some value'
|
142
|
+
# * click "a_locator", :wait_for => :visible, :element => 'a_locator' # will wait for element to be visible
|
143
|
+
# * click "a_locator", :wait_for => :not_visible, :element => 'a_locator' # will wait for element to not be visible
|
144
|
+
# * click "a_locator", :wait_for => :condition, :javascript => 'some expression' # will wait for the javascript expression to be true
|
145
|
+
#
|
146
|
+
# Using options you can also define an explicit timeout (:timeout_in_seconds key). Otherwise the default driver timeout
|
147
|
+
# is used.
|
148
|
+
def click(locator, options={})
|
149
|
+
remote_control_command "click", [locator,]
|
150
|
+
wait_for options
|
151
|
+
end
|
152
|
+
|
153
|
+
# Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.
|
154
|
+
#
|
155
|
+
# * 'pattern' is a pattern to match with the text of the page
|
156
|
+
def text?(pattern)
|
157
|
+
boolean_command "isTextPresent", [pattern,]
|
158
|
+
end
|
159
|
+
|
160
|
+
# Verifies that the specified element is somewhere on the page.
|
161
|
+
#
|
162
|
+
# * 'locator' is an element locator
|
163
|
+
def element?(locator)
|
164
|
+
boolean_command "isElementPresent", [locator,]
|
165
|
+
end
|
166
|
+
|
167
|
+
# Determines if the specified element is visible. An
|
168
|
+
# element can be rendered invisible by setting the CSS "visibility"
|
169
|
+
# property to "hidden", or the "display" property to "none", either for the
|
170
|
+
# element itself or one if its ancestors. This method will fail if
|
171
|
+
# the element is not present.
|
172
|
+
#
|
173
|
+
# 'locator' is an element locator
|
174
|
+
def visible?(locator)
|
175
|
+
boolean_command "isVisible", [locator,]
|
176
|
+
end
|
177
|
+
|
178
|
+
# Gets the (whitespace-trimmed) value of an input field
|
179
|
+
# (or anything else with a value parameter).
|
180
|
+
# For checkbox/radio elements, the value will be "on" or "off"
|
181
|
+
# depending on whether the element is checked or not.
|
182
|
+
#
|
183
|
+
# * 'locator' is an element locator
|
184
|
+
def field(locator)
|
185
|
+
string_command "getValue", [locator,]
|
186
|
+
end
|
187
|
+
|
188
|
+
# Alias for +field+
|
189
|
+
def value(locator)
|
190
|
+
field locator
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns whether a toggle-button (checkbox/radio) is checked.
|
194
|
+
# Fails if the specified element doesn't exist or isn't a toggle-button.
|
195
|
+
#
|
196
|
+
# * 'locator' is an element locator pointing to a checkbox or radio button
|
197
|
+
def checked?(locator)
|
198
|
+
boolean_command "isChecked", [locator,]
|
199
|
+
end
|
200
|
+
|
201
|
+
# Whether an alert occurred
|
202
|
+
def alert?
|
203
|
+
boolean_command "isAlertPresent"
|
204
|
+
end
|
205
|
+
|
206
|
+
# Retrieves the message of a JavaScript alert generated during the previous action,
|
207
|
+
# or fail if there were no alerts.
|
208
|
+
#
|
209
|
+
# Getting an alert has the same effect as manually clicking OK. If an
|
210
|
+
# alert is generated but you do not consume it with getAlert, the next Selenium action
|
211
|
+
# will fail.
|
212
|
+
#
|
213
|
+
# Under Selenium, JavaScript alerts will NOT pop up a visible alert
|
214
|
+
# dialog.
|
215
|
+
#
|
216
|
+
# Selenium does NOT support JavaScript alerts that are generated in a
|
217
|
+
# page's onload() event handler. In this case a visible dialog WILL be
|
218
|
+
# generated and Selenium will hang until someone manually clicks OK.
|
219
|
+
#
|
220
|
+
def alert
|
221
|
+
string_command "getAlert"
|
222
|
+
end
|
223
|
+
|
224
|
+
# Whether a confirmation has been auto-acknoledged (i.e. confirm() been called)
|
225
|
+
def confirmation?
|
226
|
+
boolean_command "isConfirmationPresent"
|
227
|
+
end
|
228
|
+
|
229
|
+
# Retrieves the message of a JavaScript confirmation dialog generated during
|
230
|
+
# the previous action.
|
231
|
+
#
|
232
|
+
# By default, the confirm function will return true, having the same effect
|
233
|
+
# as manually clicking OK. This can be changed by prior execution of the
|
234
|
+
# chooseCancelOnNextConfirmation command.
|
235
|
+
#
|
236
|
+
# If an confirmation is generated but you do not consume it with getConfirmation,
|
237
|
+
# the next Selenium action will fail.
|
238
|
+
#
|
239
|
+
# NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
|
240
|
+
# dialog.
|
241
|
+
#
|
242
|
+
# NOTE: Selenium does NOT support JavaScript confirmations that are
|
243
|
+
# generated in a page's onload() event handler. In this case a visible
|
244
|
+
# dialog WILL be generated and Selenium will hang until you manually click
|
245
|
+
# OK.
|
246
|
+
def confirmation
|
247
|
+
string_command "getConfirmation"
|
248
|
+
end
|
249
|
+
|
250
|
+
# Whether a prompt occurred
|
251
|
+
def prompt?
|
252
|
+
boolean_command "isPromptPresent"
|
253
|
+
end
|
254
|
+
|
255
|
+
# Retrieves the message of a JavaScript question prompt dialog generated during
|
256
|
+
# the previous action.
|
257
|
+
#
|
258
|
+
# Successful handling of the prompt requires prior execution of the
|
259
|
+
# answerOnNextPrompt command. If a prompt is generated but you
|
260
|
+
# do not get/verify it, the next Selenium action will fail.
|
261
|
+
#
|
262
|
+
# NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
|
263
|
+
# dialog.
|
264
|
+
#
|
265
|
+
# NOTE: Selenium does NOT support JavaScript prompts that are generated in a
|
266
|
+
# page's onload() event handler. In this case a visible dialog WILL be
|
267
|
+
# generated and Selenium will hang until someone manually clicks OK.
|
268
|
+
def prompt
|
269
|
+
string_command "getPrompt"
|
270
|
+
end
|
271
|
+
|
272
|
+
# Returns the result of evaluating the specified JavaScript snippet whithin the browser.
|
273
|
+
# The snippet may have multiple lines, but only the result of the last line will be returned.
|
274
|
+
#
|
275
|
+
# Note that, by default, the snippet will run in the context of the "selenium"
|
276
|
+
# object itself, so <tt>this</tt> will refer to the Selenium object. Use <tt>window</tt> to
|
277
|
+
# refer to the window of your application, e.g. <tt>window.document.getElementById('foo')</tt>
|
278
|
+
# If you need to use
|
279
|
+
# a locator to refer to a single element in your application page, you can
|
280
|
+
# use <tt>this.browserbot.findElement("id=foo")</tt> where "id=foo" is your locator.
|
281
|
+
#
|
282
|
+
# * 'script' is the JavaScript snippet to run
|
283
|
+
def js_eval(script)
|
284
|
+
string_command "getEval", [script,]
|
285
|
+
end
|
286
|
+
|
287
|
+
# Set the Remote Control timeout (as opposed to the client side driver timeout).
|
288
|
+
# This timout specifies the amount of time that Selenium Core will wait for actions to complete.
|
289
|
+
#
|
290
|
+
# The default timeout is 30 seconds.
|
291
|
+
# 'timeout' is a timeout in seconds, after which the action will return with an error
|
292
|
+
#
|
293
|
+
# Actions that require waiting include "open" and the "waitFor*" actions.
|
294
|
+
def remote_control_timeout_in_seconds=(timeout_in_seconds)
|
295
|
+
remote_control_command "setTimeout", [actual_timeout_in_milliseconds(timeout_in_seconds),]
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the text from a cell of a table. The cellAddress syntax
|
299
|
+
# tableLocator.row.column, where row and column start at 0.
|
300
|
+
#
|
301
|
+
# * 'tableCellAddress' is a cell address, e.g. "foo.1.4"
|
302
|
+
def table_cell_text(tableCellAddress)
|
303
|
+
string_command "getTable", [tableCellAddress,]
|
304
|
+
end
|
305
|
+
|
306
|
+
# Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
|
307
|
+
# The snippet may have multiple lines, but only the result of the last line
|
308
|
+
# will be considered.
|
309
|
+
#
|
310
|
+
# Note that, by default, the snippet will be run in the runner's test window, not in the window
|
311
|
+
# of your application. To get the window of your application, you can use
|
312
|
+
# the JavaScript snippet <tt>selenium.browserbot.getCurrentWindow()</tt>, and then
|
313
|
+
# run your JavaScript in there
|
314
|
+
#
|
315
|
+
#
|
316
|
+
# * 'script' is the JavaScript snippet to run
|
317
|
+
# * 'timeout_in_seconds' is a timeout in seconds, after which this command will return with an error
|
318
|
+
def wait_for_condition(script, timeout_in_seconds = nil)
|
319
|
+
remote_control_command "waitForCondition",
|
320
|
+
[script, actual_timeout_in_milliseconds(timeout_in_seconds),]
|
321
|
+
end
|
322
|
+
|
323
|
+
# Simulates the user clicking the "back" button on their browser.
|
324
|
+
# Using 'options' you can automatically wait for an event to happen after the
|
325
|
+
# click. e.g.
|
326
|
+
#
|
327
|
+
# * go_back :wait_for => :page # will wait for a new page to load
|
328
|
+
# * go_back :wait_for => :popup, :window => 'a window id' # will wait for a new popup window to appear. Also selects the popup window for you provide `:select => true`
|
329
|
+
# * go_back :wait_for => :ajax # will wait for all ajax requests to be completed using semantics of default javascript framework
|
330
|
+
# * go_back :wait_for => :ajax, :javascript_framework => :jquery # will wait for all ajax requests to be completed overriding default javascript framework
|
331
|
+
# * go_back :wait_for => :effects # will wait for all javascript effects to be rendered using semantics of default javascript framework
|
332
|
+
# * go_back :wait_for => :effects, :javascript_framework => :prototype # will wait for all javascript effects to be rendered overriding default javascript framework
|
333
|
+
# * go_back :wait_for => :element, :element => 'new_element_id' # will wait for an element to be present/appear
|
334
|
+
# * go_back :wait_for => :no_element, :element => 'new_element_id' # will wait for an element to be not be present/disappear
|
335
|
+
# * go_back :wait_for => :text, :text => 'some text' # will wait for some text to be present/appear
|
336
|
+
# * go_back "a_locator", :wait_for => :text, :text => /A Regexp/ # will wait for some text to be present/appear
|
337
|
+
# * go_back :wait_for => :text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to be 'some text'
|
338
|
+
# * go_back :wait_for => :no_text, :text => 'some text' # will wait for the text to be not be present/disappear
|
339
|
+
# * go_back "a_locator", :wait_for => :no_text, :text => /A Regexp/ # will wait for the text to be not be present/disappear
|
340
|
+
# * go_back :wait_for => :no_text, :element => 'a_locator', :text => 'some text' # will wait for the content of 'a_locator' to not be 'some text'
|
341
|
+
# * go_back :wait_for => :condition, :javascript => 'some expression' # will wait for the javascript expression to be true
|
342
|
+
# * go_back :wait_for => :value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to be 'some value'
|
343
|
+
# * go_back :wait_for => :visible, :element => 'a_locator' # will wait for element to be visible
|
344
|
+
# * go_back :wait_for => :not_visible, :element => 'a_locator' # will wait for element to not be visible
|
345
|
+
# * go_back :wait_for => :no_value, :element => 'a_locator', :value => 'some value' # will wait for the field value of 'a_locator' to not be 'some value'
|
346
|
+
#
|
347
|
+
# Using options you can also define an explicit timeout (:timeout_in_seconds key). Otherwise the default driver timeout
|
348
|
+
# is used.
|
349
|
+
def go_back(options={})
|
350
|
+
remote_control_command "goBack"
|
351
|
+
wait_for options
|
352
|
+
end
|
353
|
+
|
354
|
+
# Return all cookies for the current page under test.
|
355
|
+
def cookies
|
356
|
+
string_command "getCookie"
|
357
|
+
end
|
358
|
+
|
359
|
+
# Returns the value of the cookie with the specified name, or throws an error if the cookie is not present.
|
360
|
+
#
|
361
|
+
# 'name' is the name of the cookie
|
362
|
+
def cookie(name)
|
363
|
+
string_command "getCookieByName", [name,]
|
364
|
+
end
|
365
|
+
|
366
|
+
# Returns true if a cookie with the specified name is present, or false otherwise.
|
367
|
+
#
|
368
|
+
# 'name' is the name of the cookie
|
369
|
+
def cookie?(name)
|
370
|
+
boolean_command "isCookiePresent", [name,]
|
371
|
+
end
|
372
|
+
|
373
|
+
# Create a new cookie whose path and domain are same with those of current page
|
374
|
+
# under test, unless you specified a path for this cookie explicitly.
|
375
|
+
#
|
376
|
+
# 'nameValuePair' is name and value of the cookie in a format "name=value"
|
377
|
+
# 'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'.
|
378
|
+
# the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.
|
379
|
+
def create_cookie(name_value_pair, options="")
|
380
|
+
if options.kind_of? Hash
|
381
|
+
options = options.keys.collect {|key| "#{key}=#{options[key]}" }.sort.join(", ")
|
382
|
+
end
|
383
|
+
remote_control_command "createCookie", [name_value_pair,options,]
|
384
|
+
end
|
385
|
+
|
386
|
+
# Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you
|
387
|
+
# need to delete it using the exact same path and domain that were used to create the cookie.
|
388
|
+
# If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also
|
389
|
+
# note that specifying a domain that isn't a subset of the current domain will usually fail.
|
390
|
+
#
|
391
|
+
# Since there's no way to discover at runtime the original path and domain of a given cookie,
|
392
|
+
# we've added an option called 'recurse' to try all sub-domains of the current domain with
|
393
|
+
# all paths that are a subset of the current path. Beware; this option can be slow. In
|
394
|
+
# big-O notation, it operates in O(n*m) time, where n is the number of dots in the domain
|
395
|
+
# name and m is the number of slashes in the path.
|
396
|
+
#
|
397
|
+
# 'name' is the name of the cookie to be deleted
|
398
|
+
# 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.
|
399
|
+
def delete_cookie(name, options="")
|
400
|
+
if options.kind_of? Hash
|
401
|
+
ordered_keys = options.keys.sort {|a,b| a.to_s <=> b.to_s }
|
402
|
+
options = ordered_keys.collect {|key| "#{key}=#{options[key]}" }.join(", ")
|
403
|
+
end
|
404
|
+
remote_control_command "deleteCookie", [name,options,]
|
405
|
+
end
|
406
|
+
|
407
|
+
# Returns the IDs of all windows that the browser knows about.
|
408
|
+
def all_window_ids
|
409
|
+
string_array_command "getAllWindowIds"
|
410
|
+
end
|
411
|
+
|
412
|
+
|
413
|
+
# Returns the names of all windows that the browser knows about.
|
414
|
+
def all_window_names
|
415
|
+
string_array_command "getAllWindowNames"
|
416
|
+
end
|
417
|
+
|
418
|
+
|
419
|
+
# Returns the titles of all windows that the browser knows about.
|
420
|
+
def all_window_titles
|
421
|
+
string_array_command "getAllWindowTitles"
|
422
|
+
end
|
423
|
+
|
424
|
+
# Returns a string representation of the network traffic seen by the
|
425
|
+
# browser, including headers, AJAX requests, status codes, and timings.
|
426
|
+
# When this function is called, the traffic log is cleared, so the
|
427
|
+
# returned content is only the traffic seen since the last call.
|
428
|
+
#
|
429
|
+
# The network traffic is returned in the format it was requested. Valid
|
430
|
+
# values are: :json, :xml, or :plain.
|
431
|
+
#
|
432
|
+
# Warning: For browser_network_traffic to work you need to start your
|
433
|
+
# browser session with the option "captureNetworkTraffic=true", which
|
434
|
+
# will force ALL traffic to go to the Remote Control proxy even for
|
435
|
+
# more efficient browser modes like `*firefox` and `*safari`.
|
436
|
+
def browser_network_traffic(format = :plain)
|
437
|
+
raise "format must be :plain, :json, or :xml" \
|
438
|
+
unless [:plain, :json, :xml].include?(format)
|
439
|
+
|
440
|
+
remote_control_command "captureNetworkTraffic", [format.to_s]
|
441
|
+
end
|
442
|
+
|
443
|
+
# Allows choice of a specific XPath libraries for Xpath evualuation
|
444
|
+
# in the browser (e.g. to resolve XPath locators).
|
445
|
+
#
|
446
|
+
# `library_name' can be:
|
447
|
+
# * :ajaxslt : Google's library
|
448
|
+
# * :javascript-xpath : Cybozu Labs' faster library
|
449
|
+
# * :default : Selenium default library.
|
450
|
+
def browser_xpath_library=(library_name)
|
451
|
+
raise "library name must be :ajaxslt, :javascript-xpath, or :default" \
|
452
|
+
unless [:ajaxslt, :'javascript-xpath', :default].include?(library_name)
|
453
|
+
remote_control_command "useXpathLibrary", [library_name.to_s]
|
454
|
+
end
|
455
|
+
|
456
|
+
#
|
457
|
+
# Turn on/off the automatic hightlighting of the element driven or
|
458
|
+
# inspected by Selenium core. Useful when recording videos
|
459
|
+
#
|
460
|
+
def highlight_located_element=(enabled)
|
461
|
+
boolean = (true == enabled)
|
462
|
+
js_eval "selenium.browserbot.shouldHighlightLocatedElement = #{boolean}"
|
463
|
+
end
|
464
|
+
|
465
|
+
# Get execution delay in milliseconds, i.e. a pause delay following
|
466
|
+
# each selenium operation. By default, there is no such delay
|
467
|
+
# (value is 0).
|
468
|
+
def execution_delay
|
469
|
+
string_command "getSpeed"
|
470
|
+
end
|
471
|
+
|
472
|
+
# Set the execution delay in milliseconds, i.e. a pause delay following
|
473
|
+
# each selenium operation. By default, there is no such delay.
|
474
|
+
#
|
475
|
+
# Setting an execution can be useful to troubleshoot of capture videos
|
476
|
+
def execution_delay=(delay_in_milliseconds)
|
477
|
+
remote_control_command "setSpeed", [delay_in_milliseconds]
|
478
|
+
end
|
479
|
+
|
480
|
+
def actual_timeout_in_milliseconds(timeout_in_seconds)
|
481
|
+
actual_timeout = (timeout_in_seconds ||
|
482
|
+
default_timeout_in_seconds).to_i
|
483
|
+
actual_timeout * 1000
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
end
|
488
|
+
end
|