From 5f466137ad6ac596600e3ff53c9b786815398445 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 27 May 2017 17:36:13 +0200 Subject: node_modules, clean up package.json --- node_modules/selenium-webdriver/.npmignore | 2 - node_modules/selenium-webdriver/CHANGES.md | 784 --- node_modules/selenium-webdriver/LICENSE | 202 - node_modules/selenium-webdriver/NOTICE | 2 - node_modules/selenium-webdriver/README.md | 232 - node_modules/selenium-webdriver/chrome.js | 787 --- node_modules/selenium-webdriver/edge.js | 301 -- .../selenium-webdriver/example/async_await_test.js | 68 - .../selenium-webdriver/example/chrome_android.js | 43 - .../example/chrome_mobile_emulation.js | 43 - .../selenium-webdriver/example/firefox_channels.js | 73 - .../selenium-webdriver/example/google_search.js | 50 - .../example/google_search_generator.js | 50 - .../example/google_search_test.js | 61 - node_modules/selenium-webdriver/example/logging.js | 35 - .../selenium-webdriver/example/parallel_flows.js | 54 - node_modules/selenium-webdriver/firefox/binary.js | 344 -- .../selenium-webdriver/firefox/extension.js | 187 - node_modules/selenium-webdriver/firefox/index.js | 722 --- node_modules/selenium-webdriver/firefox/profile.js | 430 -- node_modules/selenium-webdriver/http/index.js | 255 - node_modules/selenium-webdriver/http/util.js | 175 - node_modules/selenium-webdriver/ie.js | 441 -- node_modules/selenium-webdriver/index.js | 691 --- node_modules/selenium-webdriver/io/exec.js | 153 - node_modules/selenium-webdriver/io/index.js | 300 -- node_modules/selenium-webdriver/lib/README | 5 - node_modules/selenium-webdriver/lib/actions.js | 604 --- .../selenium-webdriver/lib/atoms/getAttribute.js | 12 - .../selenium-webdriver/lib/atoms/is-displayed.js | 107 - node_modules/selenium-webdriver/lib/by.js | 285 -- .../selenium-webdriver/lib/capabilities.js | 450 -- node_modules/selenium-webdriver/lib/command.js | 245 - node_modules/selenium-webdriver/lib/devmode.js | 34 - node_modules/selenium-webdriver/lib/error.js | 568 --- node_modules/selenium-webdriver/lib/events.js | 210 - .../selenium-webdriver/lib/firefox/webdriver.json | 70 - .../selenium-webdriver/lib/firefox/webdriver.xpi | Bin 712979 -> 0 bytes node_modules/selenium-webdriver/lib/http.js | 582 --- node_modules/selenium-webdriver/lib/input.js | 171 - node_modules/selenium-webdriver/lib/logging.js | 676 --- node_modules/selenium-webdriver/lib/promise.js | 3412 ------------- node_modules/selenium-webdriver/lib/proxy.js | 127 - node_modules/selenium-webdriver/lib/session.js | 80 - node_modules/selenium-webdriver/lib/symbols.js | 38 - node_modules/selenium-webdriver/lib/test/build.js | 151 - .../ClickTest_testClicksASurroundingStrongTag.html | 11 - .../selenium-webdriver/lib/test/data/Page.aspx | 17 - .../selenium-webdriver/lib/test/data/Page.aspx.cs | 22 - .../selenium-webdriver/lib/test/data/Redirect.aspx | 11 - .../lib/test/data/Redirect.aspx.cs | 9 - .../lib/test/data/Settings.StyleCop | 759 --- .../selenium-webdriver/lib/test/data/Web.Config | 59 - .../lib/test/data/actualXhtmlPage.xhtml | 14 - .../lib/test/data/ajaxy_page.html | 81 - .../selenium-webdriver/lib/test/data/alerts.html | 85 - .../selenium-webdriver/lib/test/data/banner.gif | Bin 2109 -> 0 bytes .../selenium-webdriver/lib/test/data/beach.jpg | Bin 14085 -> 0 bytes .../selenium-webdriver/lib/test/data/blank.html | 1 - .../lib/test/data/bodyTypingTest.html | 41 - .../lib/test/data/booleanAttributes.html | 19 - .../lib/test/data/child/childPage.html | 8 - .../test/data/child/grandchild/grandchildPage.html | 8 - .../lib/test/data/clickEventPage.html | 26 - .../lib/test/data/click_frames.html | 10 - .../lib/test/data/click_jacker.html | 38 - .../lib/test/data/click_out_of_bounds.html | 23 - .../test/data/click_out_of_bounds_overflow.html | 85 - .../lib/test/data/click_rtl.html | 19 - .../lib/test/data/click_source.html | 18 - .../lib/test/data/click_tests/click_iframe.html | 6 - .../lib/test/data/click_tests/click_in_iframe.html | 8 - .../test/data/click_tests/disabled_element.html | 12 - .../data/click_tests/disappearing_element.html | 62 - .../lib/test/data/click_tests/google_map.html | 15 - .../lib/test/data/click_tests/google_map.png | Bin 26209 -> 0 bytes .../data/click_tests/html5_submit_buttons.html | 16 - .../lib/test/data/click_tests/issue5237.html | 9 - .../lib/test/data/click_tests/issue5237_frame.html | 1 - .../test/data/click_tests/issue5237_target.html | 10 - .../lib/test/data/click_tests/link_that_wraps.html | 11 - .../lib/test/data/click_tests/mapped_page1.html | 9 - .../lib/test/data/click_tests/mapped_page2.html | 9 - .../lib/test/data/click_tests/mapped_page3.html | 9 - .../data/click_tests/overlapping_elements.html | 70 - .../partially_overlapping_elements.html | 124 - .../lib/test/data/click_tests/span_that_wraps.html | 11 - .../lib/test/data/click_tests/submitted_page.html | 9 - .../click_tests/wrapped_overlapping_elements.html | 13 - .../lib/test/data/click_too_big.html | 10 - .../lib/test/data/click_too_big_in_frame.html | 11 - .../selenium-webdriver/lib/test/data/clicks.html | 35 - .../lib/test/data/closeable_window.html | 8 - .../selenium-webdriver/lib/test/data/cn-test.html | 156 - .../lib/test/data/colorPage.html | 20 - .../selenium-webdriver/lib/test/data/cookies.html | 30 - .../data/coordinates_tests/element_in_frame.html | 9 - .../coordinates_tests/element_in_nested_frame.html | 9 - .../page_with_element_out_of_view.html | 11 - .../coordinates_tests/page_with_empty_element.html | 10 - .../coordinates_tests/page_with_fixed_element.html | 12 - .../page_with_hidden_element.html | 10 - .../page_with_invisible_element.html | 10 - .../page_with_transparent_element.html | 10 - .../test/data/coordinates_tests/simple_page.html | 10 - .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 260 -> 0 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 251 -> 0 bytes .../images/ui-bg_flat_10_000000_40x100.png | Bin 178 -> 0 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 104 -> 0 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 125 -> 0 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 105 -> 0 bytes .../images/ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 3762 -> 0 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 90 -> 0 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 129 -> 0 bytes .../images/ui-icons_222222_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_228ef1_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ef8c08_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffd27a_256x240.png | Bin 4369 -> 0 bytes .../images/ui-icons_ffffff_256x240.png | Bin 4369 -> 0 bytes .../css/ui-lightness/jquery-ui-1.8.10.custom.css | 573 --- .../lib/test/data/cssTransform.html | 61 - .../lib/test/data/cssTransform2.html | 20 - .../lib/test/data/document_write_in_onload.html | 13 - .../test/data/dragAndDropInsideScrolledDiv.html | 67 - .../lib/test/data/dragAndDropTest.html | 102 - .../lib/test/data/dragDropOverflow.html | 104 - .../lib/test/data/draggableLists.html | 67 - .../lib/test/data/droppableItems.html | 65 - .../selenium-webdriver/lib/test/data/dynamic.html | 39 - .../lib/test/data/dynamicallyModifiedPage.html | 42 - .../selenium-webdriver/lib/test/data/errors.html | 15 - .../lib/test/data/firefox/jetpack-sample.xpi | Bin 7289 -> 0 bytes .../lib/test/data/firefox/sample.xpi | Bin 1551 -> 0 bytes .../lib/test/data/fixedFooterNoScroll.html | 13 - .../test/data/fixedFooterNoScrollQuirksMode.html | 12 - .../selenium-webdriver/lib/test/data/formPage.html | 175 - .../lib/test/data/formSelectionPage.html | 46 - .../lib/test/data/form_handling_js_submit.html | 30 - .../lib/test/data/framePage3.html | 7 - .../lib/test/data/frameScrollChild.html | 26 - .../lib/test/data/frameScrollPage.html | 14 - .../lib/test/data/frameScrollParent.html | 11 - .../lib/test/data/frameWithAnimals.html | 11 - .../test/data/frame_switching_tests/bug4876.html | 9 - .../data/frame_switching_tests/bug4876_iframe.html | 9 - .../data/frame_switching_tests/deletingFrame.html | 29 - .../deletingFrame_iframe.html | 8 - .../deletingFrame_iframe2.html | 7 - .../selenium-webdriver/lib/test/data/frameset.html | 14 - .../lib/test/data/framesetPage2.html | 7 - .../lib/test/data/framesetPage3.html | 4 - .../lib/test/data/globalscope.html | 15 - .../selenium-webdriver/lib/test/data/hidden.html | 5 - .../lib/test/data/hidden_partially.html | 45 - .../lib/test/data/html5/blue.jpg | Bin 92 -> 0 bytes .../lib/test/data/html5/database.js | 84 - .../lib/test/data/html5/geolocation.js | 18 - .../lib/test/data/html5/green.jpg | Bin 92 -> 0 bytes .../selenium-webdriver/lib/test/data/html5/red.jpg | Bin 92 -> 0 bytes .../lib/test/data/html5/status.html | 1 - .../lib/test/data/html5/test.appcache | 11 - .../lib/test/data/html5/yellow.jpg | Bin 92 -> 0 bytes .../lib/test/data/html5Page.html | 32 - .../selenium-webdriver/lib/test/data/icon.gif | Bin 127 -> 0 bytes .../lib/test/data/idElements.html | 2 - .../lib/test/data/iframeAtBottom.html | 15 - .../lib/test/data/iframeWithAlert.html | 1 - .../lib/test/data/iframeWithIframe.html | 1 - .../selenium-webdriver/lib/test/data/iframes.html | 11 - .../lib/test/data/injectableContent.html | 22 - .../lib/test/data/javascriptEnhancedForm.html | 30 - .../lib/test/data/javascriptPage.html | 285 -- .../lib/test/data/jquery-1.3.2.js | 4376 ---------------- .../lib/test/data/js/jquery-1.4.4.min.js | 167 - .../test/data/js/jquery-ui-1.8.10.custom.min.js | 782 --- .../data/js/skins/lightgray/content.inline.min.css | 1 - .../test/data/js/skins/lightgray/content.min.css | 1 - .../test/data/js/skins/lightgray/fonts/readme.md | 1 - .../js/skins/lightgray/fonts/tinymce-small.dev.svg | 175 - .../js/skins/lightgray/fonts/tinymce-small.eot | Bin 10316 -> 0 bytes .../js/skins/lightgray/fonts/tinymce-small.svg | 62 - .../js/skins/lightgray/fonts/tinymce-small.ttf | Bin 10128 -> 0 bytes .../js/skins/lightgray/fonts/tinymce-small.woff | Bin 7848 -> 0 bytes .../data/js/skins/lightgray/fonts/tinymce.dev.svg | 153 - .../test/data/js/skins/lightgray/fonts/tinymce.eot | Bin 10024 -> 0 bytes .../test/data/js/skins/lightgray/fonts/tinymce.svg | 63 - .../test/data/js/skins/lightgray/fonts/tinymce.ttf | Bin 9860 -> 0 bytes .../data/js/skins/lightgray/fonts/tinymce.woff | Bin 7664 -> 0 bytes .../test/data/js/skins/lightgray/img/anchor.gif | Bin 53 -> 0 bytes .../test/data/js/skins/lightgray/img/loader.gif | Bin 2608 -> 0 bytes .../test/data/js/skins/lightgray/img/object.gif | Bin 152 -> 0 bytes .../lib/test/data/js/skins/lightgray/img/trans.gif | Bin 43 -> 0 bytes .../test/data/js/skins/lightgray/skin.ie7.min.css | 1 - .../lib/test/data/js/skins/lightgray/skin.min.css | 1 - .../lib/test/data/js/themes/modern/theme.min.js | 1 - .../lib/test/data/js/tinymce.min.js | 10 - .../test/data/key_tests/remove_on_keypress.html | 36 - .../lib/test/data/keyboard_shortcut.html | 36 - .../lib/test/data/linked_image.html | 16 - .../locators_tests/boolean_attribute_selected.html | 13 - .../boolean_attribute_selected_html4.html | 13 - .../lib/test/data/longContentPage.html | 55 - .../selenium-webdriver/lib/test/data/macbeth.html | 5255 -------------------- .../selenium-webdriver/lib/test/data/map.png | Bin 26209 -> 0 bytes .../lib/test/data/map_visibility.html | 8 - .../lib/test/data/markerTransparent.png | Bin 260 -> 0 bytes .../selenium-webdriver/lib/test/data/messages.html | 15 - .../lib/test/data/meta-redirect.html | 11 - .../lib/test/data/missedJsReference.html | 11 - .../lib/test/data/modal_dialogs/modal_1.html | 21 - .../lib/test/data/modal_dialogs/modal_2.html | 21 - .../lib/test/data/modal_dialogs/modal_3.html | 15 - .../lib/test/data/modal_dialogs/modalindex.html | 21 - .../lib/test/data/mouseOver.html | 17 - .../lib/test/data/mousePositionTracker.html | 33 - .../lib/test/data/nestedElements.html | 164 - .../lib/test/data/overflow-body.html | 15 - .../lib/test/data/overflow/x_auto_y_auto.html | 30 - .../lib/test/data/overflow/x_auto_y_hidden.html | 30 - .../lib/test/data/overflow/x_auto_y_scroll.html | 30 - .../lib/test/data/overflow/x_hidden_y_auto.html | 30 - .../lib/test/data/overflow/x_hidden_y_hidden.html | 30 - .../lib/test/data/overflow/x_hidden_y_scroll.html | 30 - .../lib/test/data/overflow/x_scroll_y_auto.html | 30 - .../lib/test/data/overflow/x_scroll_y_hidden.html | 30 - .../lib/test/data/overflow/x_scroll_y_scroll.html | 30 - .../test/data/pageWithOnBeforeUnloadMessage.html | 20 - .../lib/test/data/pageWithOnLoad.html | 6 - .../lib/test/data/pageWithOnUnload.html | 6 - .../data/page_with_link_to_slow_loading_page.html | 6 - .../selenium-webdriver/lib/test/data/plain.txt | 1 - .../lib/test/data/proxy/page1.html | 20 - .../lib/test/data/proxy/page2.html | 24 - .../lib/test/data/proxy/page3.html | 5 - .../lib/test/data/readOnlyPage.html | 24 - .../lib/test/data/rectangles.html | 40 - .../lib/test/data/resultPage.html | 25 - .../lib/test/data/rich_text.html | 161 - .../lib/test/data/safari/frames_benchmark.html | 31 - .../lib/test/data/screen/screen.css | 19 - .../lib/test/data/screen/screen.html | 72 - .../lib/test/data/screen/screen.js | 7 - .../lib/test/data/screen/screen_frame1.html | 72 - .../lib/test/data/screen/screen_frame2.html | 72 - .../lib/test/data/screen/screen_frames.html | 11 - .../lib/test/data/screen/screen_iframes.html | 12 - .../lib/test/data/screen/screen_too_long.html | 68 - .../lib/test/data/screen/screen_x_long.html | 72 - .../lib/test/data/screen/screen_x_too_long.html | 72 - .../lib/test/data/screen/screen_y_long.html | 72 - .../lib/test/data/screen/screen_y_too_long.html | 72 - .../selenium-webdriver/lib/test/data/scroll.html | 27 - .../selenium-webdriver/lib/test/data/scroll2.html | 21 - .../selenium-webdriver/lib/test/data/scroll3.html | 8 - .../selenium-webdriver/lib/test/data/scroll4.html | 7 - .../selenium-webdriver/lib/test/data/scroll5.html | 18 - .../frame_with_height_above_200.html | 26 - .../frame_with_height_above_2000.html | 26 - .../frame_with_nested_scrolling_frame.html | 11 - ...me_with_nested_scrolling_frame_out_of_view.html | 12 - .../scrolling_tests/frame_with_small_height.html | 10 - .../page_with_double_overflow_auto.html | 19 - .../page_with_frame_out_of_view.html | 12 - .../page_with_nested_scrolling_frames.html | 11 - ...e_with_nested_scrolling_frames_out_of_view.html | 12 - .../page_with_non_scrolling_frame.html | 11 - .../scrolling_tests/page_with_scrolling_frame.html | 11 - .../page_with_scrolling_frame_out_of_view.html | 12 - .../data/scrolling_tests/page_with_tall_frame.html | 11 - .../scrolling_tests/page_with_y_overflow_auto.html | 14 - .../lib/test/data/scrolling_tests/target_page.html | 9 - .../lib/test/data/selectPage.html | 58 - .../lib/test/data/selectableItems.html | 65 - .../lib/test/data/sessionCookie.html | 21 - .../lib/test/data/sessionCookieDest.html | 34 - .../selenium-webdriver/lib/test/data/simple.xml | 5 - .../lib/test/data/simpleTest.html | 98 - .../lib/test/data/slowLoadingAlert.html | 10 - .../lib/test/data/slowLoadingResourcePage.html | 12 - .../lib/test/data/slow_loading_iframes.html | 14 - .../lib/test/data/styledPage.html | 28 - .../lib/test/data/svgPiechart.xhtml | 81 - .../selenium-webdriver/lib/test/data/svgTest.svg | 4 - .../selenium-webdriver/lib/test/data/tables.html | 36 - .../selenium-webdriver/lib/test/data/tinymce.html | 10 - .../lib/test/data/transformable.xml | 11 - .../lib/test/data/transformable.xsl | 37 - .../lib/test/data/transparentUpload.html | 70 - .../lib/test/data/underscore.html | 9 - .../lib/test/data/unicode_ltr.html | 8 - .../selenium-webdriver/lib/test/data/upload.html | 45 - .../lib/test/data/userDefinedProperty.html | 8 - .../lib/test/data/veryLargeCanvas.html | 81 - .../lib/test/data/visibility-css.html | 21 - .../lib/test/data/win32frameset.html | 8 - .../window_switching_tests/page_with_frame.html | 12 - .../data/window_switching_tests/simple_page.html | 9 - .../lib/test/data/xhtmlFormPage.xhtml | 17 - .../lib/test/data/xhtmlTest.html | 76 - .../selenium-webdriver/lib/test/fileserver.js | 321 -- .../selenium-webdriver/lib/test/httpserver.js | 120 - node_modules/selenium-webdriver/lib/test/index.js | 303 -- .../selenium-webdriver/lib/test/promise.js | 79 - .../selenium-webdriver/lib/test/resources.js | 44 - node_modules/selenium-webdriver/lib/until.js | 427 -- node_modules/selenium-webdriver/lib/webdriver.js | 2669 ---------- node_modules/selenium-webdriver/net/index.js | 117 - node_modules/selenium-webdriver/net/portprober.js | 205 - .../selenium-webdriver/node_modules/.bin/rimraf | 1 - node_modules/selenium-webdriver/opera.js | 405 -- node_modules/selenium-webdriver/package.json | 42 - node_modules/selenium-webdriver/phantomjs.js | 282 -- node_modules/selenium-webdriver/proxy.js | 32 - node_modules/selenium-webdriver/remote/index.js | 602 --- node_modules/selenium-webdriver/safari.js | 264 - .../selenium-webdriver/test/actions_test.js | 52 - .../selenium-webdriver/test/chrome/options_test.js | 227 - .../selenium-webdriver/test/chrome/service_test.js | 45 - .../selenium-webdriver/test/cookie_test.js | 214 - .../test/element_finding_test.js | 426 -- .../selenium-webdriver/test/execute_script_test.js | 350 -- .../selenium-webdriver/test/fingerprint_test.js | 62 - .../test/firefox/extension_test.js | 96 - .../test/firefox/firefox_test.js | 226 - .../test/firefox/profile_test.js | 185 - .../selenium-webdriver/test/http/http_test.js | 205 - .../selenium-webdriver/test/http/util_test.js | 178 - node_modules/selenium-webdriver/test/io_test.js | 321 -- .../selenium-webdriver/test/lib/by_test.js | 160 - .../test/lib/capabilities_test.js | 111 - .../selenium-webdriver/test/lib/error_test.js | 286 -- .../selenium-webdriver/test/lib/events_test.js | 177 - .../selenium-webdriver/test/lib/http_test.js | 696 --- .../selenium-webdriver/test/lib/logging_test.js | 272 - .../test/lib/promise_aplus_test.js | 78 - .../test/lib/promise_error_test.js | 884 ---- .../test/lib/promise_flow_test.js | 2288 --------- .../test/lib/promise_generator_test.js | 310 -- .../selenium-webdriver/test/lib/promise_test.js | 1109 ----- .../selenium-webdriver/test/lib/testutil.js | 90 - .../selenium-webdriver/test/lib/until_test.js | 478 -- .../selenium-webdriver/test/lib/webdriver_test.js | 2309 --------- .../selenium-webdriver/test/logging_test.js | 167 - .../selenium-webdriver/test/net/index_test.js | 60 - .../selenium-webdriver/test/net/portprober_test.js | 128 - .../selenium-webdriver/test/page_loading_test.js | 172 - .../test/phantomjs/execute_phantomjs_test.js | 59 - node_modules/selenium-webdriver/test/proxy_test.js | 180 - node_modules/selenium-webdriver/test/rect_test.js | 60 - .../selenium-webdriver/test/remote_test.js | 117 - .../selenium-webdriver/test/safari_test.js | 108 - .../selenium-webdriver/test/session_test.js | 54 - .../selenium-webdriver/test/stale_element_test.js | 63 - .../selenium-webdriver/test/tag_name_test.js | 36 - .../selenium-webdriver/test/testing/assert_test.js | 373 -- .../selenium-webdriver/test/testing/index_test.js | 224 - .../selenium-webdriver/test/upload_test.js | 86 - .../selenium-webdriver/test/window_test.js | 161 - node_modules/selenium-webdriver/testing/assert.js | 378 -- node_modules/selenium-webdriver/testing/index.js | 427 -- 360 files changed, 53226 deletions(-) delete mode 100644 node_modules/selenium-webdriver/.npmignore delete mode 100644 node_modules/selenium-webdriver/CHANGES.md delete mode 100644 node_modules/selenium-webdriver/LICENSE delete mode 100644 node_modules/selenium-webdriver/NOTICE delete mode 100644 node_modules/selenium-webdriver/README.md delete mode 100644 node_modules/selenium-webdriver/chrome.js delete mode 100644 node_modules/selenium-webdriver/edge.js delete mode 100644 node_modules/selenium-webdriver/example/async_await_test.js delete mode 100644 node_modules/selenium-webdriver/example/chrome_android.js delete mode 100644 node_modules/selenium-webdriver/example/chrome_mobile_emulation.js delete mode 100644 node_modules/selenium-webdriver/example/firefox_channels.js delete mode 100644 node_modules/selenium-webdriver/example/google_search.js delete mode 100644 node_modules/selenium-webdriver/example/google_search_generator.js delete mode 100644 node_modules/selenium-webdriver/example/google_search_test.js delete mode 100644 node_modules/selenium-webdriver/example/logging.js delete mode 100644 node_modules/selenium-webdriver/example/parallel_flows.js delete mode 100644 node_modules/selenium-webdriver/firefox/binary.js delete mode 100644 node_modules/selenium-webdriver/firefox/extension.js delete mode 100644 node_modules/selenium-webdriver/firefox/index.js delete mode 100644 node_modules/selenium-webdriver/firefox/profile.js delete mode 100644 node_modules/selenium-webdriver/http/index.js delete mode 100644 node_modules/selenium-webdriver/http/util.js delete mode 100644 node_modules/selenium-webdriver/ie.js delete mode 100644 node_modules/selenium-webdriver/index.js delete mode 100644 node_modules/selenium-webdriver/io/exec.js delete mode 100644 node_modules/selenium-webdriver/io/index.js delete mode 100644 node_modules/selenium-webdriver/lib/README delete mode 100644 node_modules/selenium-webdriver/lib/actions.js delete mode 100644 node_modules/selenium-webdriver/lib/atoms/getAttribute.js delete mode 100644 node_modules/selenium-webdriver/lib/atoms/is-displayed.js delete mode 100644 node_modules/selenium-webdriver/lib/by.js delete mode 100644 node_modules/selenium-webdriver/lib/capabilities.js delete mode 100644 node_modules/selenium-webdriver/lib/command.js delete mode 100644 node_modules/selenium-webdriver/lib/devmode.js delete mode 100644 node_modules/selenium-webdriver/lib/error.js delete mode 100644 node_modules/selenium-webdriver/lib/events.js delete mode 100644 node_modules/selenium-webdriver/lib/firefox/webdriver.json delete mode 100644 node_modules/selenium-webdriver/lib/firefox/webdriver.xpi delete mode 100644 node_modules/selenium-webdriver/lib/http.js delete mode 100644 node_modules/selenium-webdriver/lib/input.js delete mode 100644 node_modules/selenium-webdriver/lib/logging.js delete mode 100644 node_modules/selenium-webdriver/lib/promise.js delete mode 100644 node_modules/selenium-webdriver/lib/proxy.js delete mode 100644 node_modules/selenium-webdriver/lib/session.js delete mode 100644 node_modules/selenium-webdriver/lib/symbols.js delete mode 100644 node_modules/selenium-webdriver/lib/test/build.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/ClickTest_testClicksASurroundingStrongTag.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Page.aspx delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Page.aspx.cs delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Redirect.aspx delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Redirect.aspx.cs delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Settings.StyleCop delete mode 100644 node_modules/selenium-webdriver/lib/test/data/Web.Config delete mode 100644 node_modules/selenium-webdriver/lib/test/data/actualXhtmlPage.xhtml delete mode 100644 node_modules/selenium-webdriver/lib/test/data/ajaxy_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/alerts.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/banner.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/beach.jpg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/blank.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/bodyTypingTest.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/booleanAttributes.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/child/childPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/child/grandchild/grandchildPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/clickEventPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_frames.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_jacker.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_out_of_bounds.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_out_of_bounds_overflow.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_rtl.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_source.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/click_iframe.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/click_in_iframe.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/disabled_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/disappearing_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/google_map.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/google_map.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/html5_submit_buttons.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/issue5237.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/issue5237_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/issue5237_target.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/link_that_wraps.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/mapped_page1.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/mapped_page2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/mapped_page3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/overlapping_elements.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/partially_overlapping_elements.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/span_that_wraps.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/submitted_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_tests/wrapped_overlapping_elements.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_too_big.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/click_too_big_in_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/clicks.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/closeable_window.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/cn-test.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/colorPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/cookies.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/element_in_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/element_in_nested_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_element_out_of_view.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_empty_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_fixed_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_hidden_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_invisible_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/page_with_transparent_element.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/coordinates_tests/simple_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-icons_222222_256x240.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-icons_228ef1_256x240.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-icons_ef8c08_256x240.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-icons_ffd27a_256x240.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/images/ui-icons_ffffff_256x240.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/css/ui-lightness/jquery-ui-1.8.10.custom.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/cssTransform.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/cssTransform2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/document_write_in_onload.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/dragAndDropInsideScrolledDiv.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/dragAndDropTest.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/dragDropOverflow.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/draggableLists.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/droppableItems.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/dynamic.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/dynamicallyModifiedPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/errors.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/firefox/jetpack-sample.xpi delete mode 100644 node_modules/selenium-webdriver/lib/test/data/firefox/sample.xpi delete mode 100644 node_modules/selenium-webdriver/lib/test/data/fixedFooterNoScroll.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/fixedFooterNoScrollQuirksMode.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/formPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/formSelectionPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/form_handling_js_submit.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/framePage3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frameScrollChild.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frameScrollPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frameScrollParent.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frameWithAnimals.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frame_switching_tests/bug4876.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frame_switching_tests/bug4876_iframe.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frame_switching_tests/deletingFrame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frame_switching_tests/deletingFrame_iframe.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frame_switching_tests/deletingFrame_iframe2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/frameset.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/framesetPage2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/framesetPage3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/globalscope.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/hidden.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/hidden_partially.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/blue.jpg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/database.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/geolocation.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/green.jpg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/red.jpg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/status.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/test.appcache delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5/yellow.jpg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/html5Page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/icon.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/idElements.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/iframeAtBottom.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/iframeWithAlert.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/iframeWithIframe.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/iframes.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/injectableContent.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/javascriptEnhancedForm.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/javascriptPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/jquery-1.3.2.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/jquery-1.4.4.min.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/jquery-ui-1.8.10.custom.min.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/content.inline.min.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/content.min.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/readme.md delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce-small.dev.svg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce-small.eot delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce-small.svg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce-small.ttf delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce-small.woff delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce.dev.svg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce.eot delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce.svg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce.ttf delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/fonts/tinymce.woff delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/img/anchor.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/img/loader.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/img/object.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/img/trans.gif delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/skin.ie7.min.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/skins/lightgray/skin.min.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/themes/modern/theme.min.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/js/tinymce.min.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/key_tests/remove_on_keypress.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/keyboard_shortcut.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/linked_image.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/locators_tests/boolean_attribute_selected.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/locators_tests/boolean_attribute_selected_html4.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/longContentPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/macbeth.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/map.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/map_visibility.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/markerTransparent.png delete mode 100644 node_modules/selenium-webdriver/lib/test/data/messages.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/meta-redirect.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/missedJsReference.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/modal_dialogs/modal_1.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/modal_dialogs/modal_2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/modal_dialogs/modal_3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/modal_dialogs/modalindex.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/mouseOver.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/mousePositionTracker.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/nestedElements.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow-body.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_auto_y_auto.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_auto_y_hidden.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_auto_y_scroll.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_hidden_y_auto.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_hidden_y_hidden.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_hidden_y_scroll.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_scroll_y_auto.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_scroll_y_hidden.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/overflow/x_scroll_y_scroll.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/pageWithOnBeforeUnloadMessage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/pageWithOnLoad.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/pageWithOnUnload.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/page_with_link_to_slow_loading_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/plain.txt delete mode 100644 node_modules/selenium-webdriver/lib/test/data/proxy/page1.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/proxy/page2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/proxy/page3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/readOnlyPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/rectangles.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/resultPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/rich_text.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/safari/frames_benchmark.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen.css delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen.js delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_frame1.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_frame2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_frames.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_iframes.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_too_long.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_x_long.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_x_too_long.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_y_long.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/screen/screen_y_too_long.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scroll.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scroll2.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scroll3.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scroll4.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scroll5.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/frame_with_height_above_200.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/frame_with_height_above_2000.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/frame_with_nested_scrolling_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/frame_with_small_height.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_double_overflow_auto.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_frame_out_of_view.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_nested_scrolling_frames.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_nested_scrolling_frames_out_of_view.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_non_scrolling_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_scrolling_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_scrolling_frame_out_of_view.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_tall_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/page_with_y_overflow_auto.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/scrolling_tests/target_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/selectPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/selectableItems.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/sessionCookie.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/sessionCookieDest.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/simple.xml delete mode 100644 node_modules/selenium-webdriver/lib/test/data/simpleTest.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/slowLoadingAlert.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/slowLoadingResourcePage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/slow_loading_iframes.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/styledPage.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/svgPiechart.xhtml delete mode 100644 node_modules/selenium-webdriver/lib/test/data/svgTest.svg delete mode 100644 node_modules/selenium-webdriver/lib/test/data/tables.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/tinymce.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/transformable.xml delete mode 100644 node_modules/selenium-webdriver/lib/test/data/transformable.xsl delete mode 100644 node_modules/selenium-webdriver/lib/test/data/transparentUpload.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/underscore.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/unicode_ltr.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/upload.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/userDefinedProperty.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/veryLargeCanvas.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/visibility-css.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/win32frameset.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/window_switching_tests/page_with_frame.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/window_switching_tests/simple_page.html delete mode 100644 node_modules/selenium-webdriver/lib/test/data/xhtmlFormPage.xhtml delete mode 100644 node_modules/selenium-webdriver/lib/test/data/xhtmlTest.html delete mode 100644 node_modules/selenium-webdriver/lib/test/fileserver.js delete mode 100644 node_modules/selenium-webdriver/lib/test/httpserver.js delete mode 100644 node_modules/selenium-webdriver/lib/test/index.js delete mode 100644 node_modules/selenium-webdriver/lib/test/promise.js delete mode 100644 node_modules/selenium-webdriver/lib/test/resources.js delete mode 100644 node_modules/selenium-webdriver/lib/until.js delete mode 100644 node_modules/selenium-webdriver/lib/webdriver.js delete mode 100644 node_modules/selenium-webdriver/net/index.js delete mode 100644 node_modules/selenium-webdriver/net/portprober.js delete mode 120000 node_modules/selenium-webdriver/node_modules/.bin/rimraf delete mode 100644 node_modules/selenium-webdriver/opera.js delete mode 100644 node_modules/selenium-webdriver/package.json delete mode 100644 node_modules/selenium-webdriver/phantomjs.js delete mode 100644 node_modules/selenium-webdriver/proxy.js delete mode 100644 node_modules/selenium-webdriver/remote/index.js delete mode 100644 node_modules/selenium-webdriver/safari.js delete mode 100644 node_modules/selenium-webdriver/test/actions_test.js delete mode 100644 node_modules/selenium-webdriver/test/chrome/options_test.js delete mode 100644 node_modules/selenium-webdriver/test/chrome/service_test.js delete mode 100644 node_modules/selenium-webdriver/test/cookie_test.js delete mode 100644 node_modules/selenium-webdriver/test/element_finding_test.js delete mode 100644 node_modules/selenium-webdriver/test/execute_script_test.js delete mode 100644 node_modules/selenium-webdriver/test/fingerprint_test.js delete mode 100644 node_modules/selenium-webdriver/test/firefox/extension_test.js delete mode 100644 node_modules/selenium-webdriver/test/firefox/firefox_test.js delete mode 100644 node_modules/selenium-webdriver/test/firefox/profile_test.js delete mode 100644 node_modules/selenium-webdriver/test/http/http_test.js delete mode 100644 node_modules/selenium-webdriver/test/http/util_test.js delete mode 100644 node_modules/selenium-webdriver/test/io_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/by_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/capabilities_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/error_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/events_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/http_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/logging_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/promise_aplus_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/promise_error_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/promise_flow_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/promise_generator_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/promise_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/testutil.js delete mode 100644 node_modules/selenium-webdriver/test/lib/until_test.js delete mode 100644 node_modules/selenium-webdriver/test/lib/webdriver_test.js delete mode 100644 node_modules/selenium-webdriver/test/logging_test.js delete mode 100644 node_modules/selenium-webdriver/test/net/index_test.js delete mode 100644 node_modules/selenium-webdriver/test/net/portprober_test.js delete mode 100644 node_modules/selenium-webdriver/test/page_loading_test.js delete mode 100644 node_modules/selenium-webdriver/test/phantomjs/execute_phantomjs_test.js delete mode 100644 node_modules/selenium-webdriver/test/proxy_test.js delete mode 100644 node_modules/selenium-webdriver/test/rect_test.js delete mode 100644 node_modules/selenium-webdriver/test/remote_test.js delete mode 100644 node_modules/selenium-webdriver/test/safari_test.js delete mode 100644 node_modules/selenium-webdriver/test/session_test.js delete mode 100644 node_modules/selenium-webdriver/test/stale_element_test.js delete mode 100644 node_modules/selenium-webdriver/test/tag_name_test.js delete mode 100644 node_modules/selenium-webdriver/test/testing/assert_test.js delete mode 100644 node_modules/selenium-webdriver/test/testing/index_test.js delete mode 100644 node_modules/selenium-webdriver/test/upload_test.js delete mode 100644 node_modules/selenium-webdriver/test/window_test.js delete mode 100644 node_modules/selenium-webdriver/testing/assert.js delete mode 100644 node_modules/selenium-webdriver/testing/index.js (limited to 'node_modules/selenium-webdriver') diff --git a/node_modules/selenium-webdriver/.npmignore b/node_modules/selenium-webdriver/.npmignore deleted file mode 100644 index d5700888a..000000000 --- a/node_modules/selenium-webdriver/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ - diff --git a/node_modules/selenium-webdriver/CHANGES.md b/node_modules/selenium-webdriver/CHANGES.md deleted file mode 100644 index 0260b0604..000000000 --- a/node_modules/selenium-webdriver/CHANGES.md +++ /dev/null @@ -1,784 +0,0 @@ -## v3.4.0 - -### Notice - -This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodriver/releases/tag/v0.15.0) or newer. - -### API Changes - -* Added `Options#getTimeouts()` for retrieving the currently configured session - timeouts (i.e. implicit wait). This method will only work with W3C compatible - WebDriver implementations. -* Deprecated the `Timeouts` class in favor of `Options#setTimeouts()`, which - supports setting multiple timeouts at once. -* Added support for emulating different network conditions (e.g., offline, 2G, WiFi) on Chrome. - -### Changes for W3C WebDriver Spec Compliance - -* Fixed W3C response parsing, which expects response data to always be a JSON - object with a `value` key. -* Added W3C endpoints for interacting with various types of - [user prompts](https://w3c.github.io/webdriver/webdriver-spec.html#user-prompts). -* Added W3C endpoints for remotely executing scripts. -* Added W3C endpoints to get current window handle and all windows handles. - - -## v3.3.0 - -* Added warning log messages when the user creates new managed promises, or - schedules unchained tasks. Users may opt in to printing these log messages - with - - ```js - const {logging} = require('selenium-webdriver'); - logging.installConsoleHandler(); - logging.getLogger('promise.ControlFlow').setLevel(logging.Level.WARNING); - ``` -* If the `JAVA_HOME` environment variable is set, use it to locate java.exe. - - -## v3.2.0 - -* Release skipped to stay in sync with the main Selenium project. - - -## v3.1.0 - -* The `lib` package is once again platform agnostic (excluding `lib/devmode`). -* Deprecated `promise.when(value, callback, errback)`. - Use `promise.fulfilled(value).then(callback, errback)` -* Changed `promise.fulfilled(value)`, `promise.rejected(reason)` and - `promise.defer()` to all use native promises when the promise manager is - disabled. -* Properly handle W3C error responses to new session commands. -* Updated `selenium-webdriver/testing` to export `describe.only` along with - `describe.skip`. -* Fixed `selenium-webdriver/lib/until.ableToSwitchToFrame`. It was previously - dropping arguments and would never work. -* Added the ability to use Firefox Nightly -* If Firefox cannot be found in the default location, look for it on the PATH -* Allow SafariDriver to use Safari Technology Preview. -* Use the proper wire command for WebElement.getLocation() and - WebElement.getSize() for W3C compliant drivers. - - -## v3.0.1 - -* More API adjustments to align with native Promises - - Deprecated `promise.fulfilled(value)`, use `promise.Promise#resolve(value)` - - Deprecated `promise.rejected(reason)`, use `promise.Promise#reject(reason)` -* When a `wait()` condition times out, the returned promise will now be - rejected with an `error.TimeoutError` instead of a generic `Error` object. -* `WebDriver#wait()` will now throw a TypeError if an invalid wait condition is - provided. -* Properly catch unhandled promise rejections with an action sequence (only - impacts when the promise manager is disabled). - - -## v3.0.0 - -* (__NOTICE__) The minimum supported version of Node is now 6.9.0 LTS -* Removed support for the SafariDriver browser extension. This has been - replaced by Apple's safaridriver, which is included wtih Safari 10 - (available on OS X El Capitan and macOS Sierra). - - To use Safari 9 or older, users will have to use an older version of Selenium. - -* geckodriver v0.11.0 or newer is now required for Firefox. -* Fixed potential reference errors in `selenium-webdriver/testing` when users - create a cycle with mocha by running with mocha's `--hook` flag. -* Fixed `WebDriver.switchTo().activeElement()` to use the correct HTTP method - for compatibility with the W3C spec. -* Update the `selenium-webdriver/firefox` module to use geckodriver's - "moz:firefoxOptions" dictionary for Firefox-specific configuration values. -* Extending the `selenium-webdriver/testing` module to support tests defined - using generator functions. -* The promise manager can be disabled by setting an enviornment variable: - `SELENIUM_PROMISE_MANAGER=0`. This is part of a larger plan to remove the - promise manager, as documented at - -* When communicating with a W3C-compliant remote end, use the atoms library for - the `WebElement.getAttribute()` and `WebElement.isDisplayed()` commands. This - behavior is consistent with the java, .net, python, and ruby clients. - - -### API Changes - - * Removed `safari.Options#useLegacyDriver()` - * Reduced the API on `promise.Thenable` for compatibility with native promises: - - Removed `#isPending()` - - Removed `#cancel()` - - Removed `#finally()` - * Changed all subclasses of `webdriver.WebDriver` to overload the static - function `WebDriver.createSession()` instead of doing work in the - constructor. All constructors now inherit the base class' function signature. - Users are still encouraged to use the `Builder` class instead of creating - drivers directly. - * `Builder#build()` now returns a "thenable" WebDriver instance, allowing users - to immediately schedule commands (as before), or issue them through standard - promise callbacks. This is the same pattern already employed for WebElements. - * Removed `Builder#buildAsync()` as it was redundant with the new semantics of - `build()`. - - - -## v3.0.0-beta-3 - -* Fixed a bug where the promise manager would silently drop callbacks after - recovering from an unhandled promise rejection. -* Added the `firefox.ServiceBuilder` class, which may be used to customize the - geckodriver used for `firefox.Driver` instances. -* Added support for Safari 10 safaridriver. safaridriver may be disabled - via tha API, `safari.Options#useLegacyDriver`, to use the safari - extension driver. -* Updated the `lib/proxy` module to support configuring a SOCKS proxy. -* For the `promise.ControlFlow`, fire the "uncaughtException" event in a new - turn of the JS event loop. As a result of this change, any errors thrown by - an event listener will propagate to the global error handler. Previously, - this event was fired with in the context of a (native) promise callback, - causing errors to be silently suppressed in the promise chain. - -### API Changes - -* Added `remote.DriverService.Builder` as a base class for configuring - DriverService instances that run in a child-process. The - `chrome.ServiceBuilder`, `edge.ServiceBuilder`, and `opera.ServiceBuilder` - classes now all extend this base class with browser-specific options. -* For each of the ServiceBuilder clases, renamed `usingPort` and - `withEnvironment` to `setPort` and `setEnvironment`, respectively. -* Renamed `chrome.ServiceBuilder#setUrlBasePath` to `#setPath` -* Changed the signature of the `firefox.Driver` from `(config, flow, executor)` - to `(config, executor, flow)`. -* Exposed the `Condition` and `WebElementCondition` classes from the top-level - `selenium-webdriver` module (these were previously only available from - `lib/webdriver`). - - -### Changes for W3C WebDriver Spec Compliance - -* Updated command mappings for [getting](https://w3c.github.io/webdriver/webdriver-spec.html#get-window-position) - and [setting](https://w3c.github.io/webdriver/webdriver-spec.html#set-window-position) - the window position. - - -## v3.0.0-beta-2 - -### API Changes - -* Moved the `builder.Builder` class into the main module (`selenium-webdriver`). -* Removed the `builder` module. -* Fix `webdriver.WebDriver#setFileDetector` when driving Chrome or Firefox on a - remote machine. - - -## v3.0.0-beta-1 - -* Allow users to set the agent used for HTTP connections through - `builder.Builder#usingHttpAgent()` -* Added new wait conditions: `until.urlIs()`, `until.urlContains()`, - `until.urlMatches()` -* Added work around for [GeckoDriver bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1274924) - raising a type conversion error -* Internal cleanup replacing uses of managed promises with native promises -* Removed the mandatory use of Firefox Dev Edition, when using Marionette driver -* Fixed timeouts' URL -* Properly send HTTP requests when using a WebDriver server proxy -* Properly configure proxies when using the geckodriver -* `http.Executor` now accepts a promised client. The `builder.Builder` class - will now use this instead of a `command.DeferredExecutor` when creating - WebDriver instances. -* For Chrome and Firefox, the `builder.Builder` class will always return an - instanceof `chrome.Driver` and `firefox.Driver`, respectively, even when - configured to use a remote server (from `builder.Builder#usingServer(url)`, - `SELENIUM_REMOTE_URL`, etc). - -### API Changes - -* `promise.Deferred` is no longer a thenable object. -* `Options#addCookie()` now takes a record object instead of 7 individual - parameters. A TypeError will be thrown if addCookie() is called with invalid - arguments. -* When adding cookies, the desired expiry must be provided as a Date or in - _seconds_ since epoch. When retrieving cookies, the expiration is always - returned in seconds. -* Renamed `firefox.Options#useMarionette` to `firefox.Options#useGeckoDriver` -* Removed deprecated modules: - - `selenium-webdriver/error` (use `selenium-webdriver/lib/error`,\ - or the `error` property exported by `selenium-webdriver`) - - `selenium-webdriver/executors` — this was not previously deprecated, but - is no longer used. -* Removed deprecated types: - - `command.DeferredExecutor` — this was not previously deprecated, but is no - longer used. It can be trivially implemented by clients should it be - needed. - - `error.InvalidSessionIdError` (use `error.NoSuchSessionError`) - - `executors.DeferredExecutor` - - `until.Condition` (use `webdriver.Condition`) - - `until.WebElementCondition` (use `webdriver.WebElementCondition`) - - `webdriver.UnhandledAlertError` (use `error.UnexpectedAlertOpenError`) -* Removed deprecated functions: - - `Deferred#cancel()` - - `Deferred#catch()` - - `Deferred#finally()` - - `Deferred#isPending()` - - `Deferred#then()` - - `Promise#thenCatch()` - - `Promise#thenFinally()` - - `WebDriver#isElementPresent()` - - `WebElement#getInnerHtml()` - - `WebElement#getOuterHtml()` - - `WebElement#getRawId()` - - `WebElement#isElementPresent()` -* Removed deprecated properties: - - `WebDriverError#code` - - -## v2.53.2 - -* Changed `io.exists()` to return a rejected promise if the input path is not - a string -* Deprecated `Promise#thenFinally()` - use `Promise#finally()`. The thenFinally - shim added to the promise module in v2.53.0 will be removed in v3.0 - Sorry for the churn! -* FIXED: capabilities serialization now properly handles undefined vs. - false-like values. -* FIXED: properly handle responses from the remote end in - `WebDriver.attachToSession` - -## v2.53.1 - -* FIXED: for consistency with the other language bindings, `remote.FileDetector` - will ignore paths that refer to a directory. - -## v2.53.0 - -### Change Summary - -* Added preliminary support for Marionette, Mozilla's WebDriver implementation - for Firefox. Marionette may be enabled via the API, - `firefox.Options#useMarionette`, or by setting the `SELENIUM_MARIONETTE` - environment variable. -* Moved all logic for parsing and interpreting responses from the remote end - into the individual `command.Executor` implementations. -* For consistency with the other Selenium language bindings, - `WebDriver#isElementPresent()` and `WebElement#isElementPresent()` have - been deprecated. These methods will be removed in v3.0. Use the findElements - command to test for the presence of an element: - - driver.findElements(By.css('.foo')).then(found => !!found.length); -* Added support for W3C-spec compliant servers. -* For consistent naming, deprecating `error.InvalidSessionIdError` in favor of - `error.NoSuchSessionError`. -* Moved the `error` module to `lib/error` so all core modules are co-located. - The top-level `error` module will be removed in v3.0. -* Moved `until.Condition` and `until.WebElementCondition` to the webdriver - module to break a circular dependency. -* Added support for setting the username and password in basic auth pop-up - dialogs (currently IE only). -* Deprecated `WebElement#getInnerHtml()` and `WebEleemnt#getOuterHtml()` -* Deprecated `Promise#thenCatch()` - use `Promise#catch()` instead -* Deprecated `Promise#thenFinally()` - use `promise.thenFinally()` instead -* FIXED: `io.findInPath()` will no longer match against directories that have - the same basename as the target file. -* FIXED: `phantomjs.Driver` now takes a third argument that defines the path to - a log file to use for the phantomjs executable's output. This may be quickly - set at runtime with the `SELENIUM_PHANTOMJS_LOG` environment variable. - -### Changes for W3C WebDriver Spec Compliance - -* Changed `element.sendKeys(...)` to send the key sequence as an array where - each element defines a single key. The legacy wire protocol permits arrays - where each element is a string of arbitrary length. This change is solely - at the protocol level and should have no user-visible effect. - - -## v2.52.0 - -### Notice - -Starting with v2.52.0, each release of selenium-webdriver will support the -latest _minor_ LTS and stable Node releases. All releases between the LTS and -stable release will have best effort support. Further details are available in -the selenium-webdriver package README. - -### Change Summary - -* Add support for Microsoft's Edge web browser -* Added `webdriver.Builder#buildAsync()`, which returns a promise that will be - fulfilled with the newly created WebDriver instance once the associated - browser has been full initialized. This is purely a convenient alternative - to the existing build() method as the WebDriver class will always defer - commands until it has a fully created browser. -* Added `firefox.Profile#setHost()` which may be used to set the host that - the FirefoxDriver's server listens for commands on. The server uses - "localhost" by default. -* Added `promise.Promise#catch()` for API compatibility with native Promises. - `promise.Promise#thenCatch()` is not yet deprecated, but it simply - delegates to `catch`. -* Changed some `io` operations to use native promises. -* Changed `command.Executor#execute()` and `HttpClient#send()` to return - promises instead of using callback passing. -* Replaced the `Serializable` class with an internal, Symbol-defined method. -* Changed the `Capabilities` class to extend the native `Map` type. -* Changed the `Capabilities.has(key)` to only test if a capability has been set - (Map semantics). To check whether the value is true, use `get(key)`. -* Deprecated `executors.DeferredExecutor` in favor of - `lib/command.DeferredExecutor`. -* API documentation is no longer distributed with the npm package, but remains - available at -* Rewrote the `error` module to export an Error subtype for each type of error - defined in the [W3C WebDriver spec](https://w3c.github.io/webdriver/webdriver-spec.html#handling-errors). -* Changed the `http.Request` and `http.Response` classes to store headers in - maps instead of object literals. -* Updated `ws` dependency to version `1.0.1`. -* Removed fluent predicates "is" and "not" from the experimental - `testing/assert` module. -* Wait conditions that locate an element, or that wait on an element's state, - will return a WebElementPromise. -* Lots of internal clean-up to break selenium-webdriver's long standing - dependency on Google's Closure library. - -### Changes for W3C WebDriver Spec Compliance - -* Updated the `By` locators that are not in the W3C spec to delegated to using - CSS selectors: `By.className`, `By.id`, `By.name`, and `By.tagName`. - - -## v2.49-51 - -* _Releases skipped to stay in sync with the rest of the Selenium project_ - - -## v2.48.2 - -* Added `WebElement#takeScreenshot()`. -* More adjustments to promise callback tracking. - -## v2.48.1 - -* FIXED: Adjusted how the control flow tracks promise callbacks to avoid a - potential deadlock. - -## v2.48.0 - -* Node v0.12.x users must run with --harmony. _This is the last release that - will support v0.12.x_ -* FIXED: (Promise/A+ compliance) When a promise is rejected with a thenable, - the promise adopts the thenable as its rejection reason instead of waiting - for it to settle. The previous (incorrect) behavior was hidden by bugs in - the `promises-aplus-tests` compliance test suite that were fixed in version - `2.1.1`. -* FIXED: the `webdriver.promise.ControlFlow` now has a consistent execution - order for tasks/callbacks scheduled in different turns of the JS event loop. - Refer to the `webdriver.promise` documentation for more details. -* FIXED: do not drop user auth from the WebDriver server URL. -* FIXED: a single `firefox.Binary` instance may be used to configure and - launch multiple FirefoxDriver sessions. - - var binary = new firefox.Binary(); - var options = new firefox.Options().setBinary(binary); - var builder = new Builder().setFirefoxOptions(options); - - var driver1 = builder.build(); - var driver2 = builder.build(); - -* FIXED: zip files created for transfer to a remote WebDriver server are no - longer compressed. If the zip contained a file that was already compressed, - the server would return an "invalid code lengths set" error. -* FIXED: Surfaced the `loopback` option to `remote/SeleniumServer`. When set, - the server will be accessed using the current host's loopback address. - -## v2.47.0 - -### Notice - -This is the last release for `selenium-webdriver` that will support ES5. -Subsequent releases will depend on ES6 features that are enabled by -[default](https://nodejs.org/en/docs/es6/) in Node v4.0.0. Node v0.12.x will -continue to be supported, but will require setting the `--harmony` flag. - -### Change Summary - -* Add support for [Node v4.0.0](https://nodejs.org/en/blog/release/v4.0.0/) - * Updated `ws` dependency from `0.7.1` to `0.8.0` -* Bumped the minimum supported version of Node from `0.10.x` to `0.12.x`. This - is in accordance with the Node support policy established in `v2.45.0`. - -## v2.46.1 - -* Fixed internal module loading on Windows. -* Fixed error message format on timeouts for `until.elementLocated()` - and `until.elementsLocated()`. - -## v2.46.0 - -* Exposed a new logging API via the `webdriver.logging` module. For usage, see - `example/logging.js`. -* Added support for using a proxy server for WebDriver commands. - See `Builder#usingWebDriverProxy()` for more info. -* Removed deprecated functions: - * Capabilities#toJSON() - * UnhandledAlertError#getAlert() - * chrome.createDriver() - * phantomjs.createDriver() - * promise.ControlFlow#annotateError() - * promise.ControlFlow#await() - * promise.ControlFlow#clearHistory() - * promise.ControlFlow#getHistory() -* Removed deprecated enum values: `ErrorCode.NO_MODAL_DIALOG_OPEN` and - `ErrorCode.MODAL_DIALOG_OPENED`. Use `ErrorCode.NO_SUCH_ALERT` and - `ErrorCode.UNEXPECTED_ALERT_OPEN`, respectively. -* FIXED: The `promise.ControlFlow` will maintain state for promise chains - generated in a loop. -* FIXED: Correct serialize target elements used in an action sequence. -* FIXED: `promise.ControlFlow#wait()` now has consistent semantics for an - omitted or 0-timeout: it will wait indefinitely. -* FIXED: `remote.DriverService#start()` will now fail if the child process dies - while waiting for the server to start accepting requests. Previously, start - would continue to poll the server address until the timeout expired. -* FIXED: Skip launching Firefox with the `-silent` flag to preheat the profile. - Starting with Firefox 38, this would cause the browser to crash. This step, - which was first introduced for Selenium's java client back with Firefox 2, - no longer appears to be required. -* FIXED: 8564: `firefox.Driver#quit()` will wait for the Firefox process to - terminate before deleting the temporary webdriver profile. This eliminates a - race condition where Firefox would write profile data during shutdown, - causing the `rm -rf` operation on the profile directory to fail. - -## v2.45.1 - -* FIXED: 8548: Task callbacks are once again dropped if the task was cancelled - due to a previously uncaught error within the frame. -* FIXED: 8496: Extended the `chrome.Options` API to cover all configuration - options (e.g. mobile emulation and performance logging) documented on the - ChromeDriver [project site](https://sites.google.com/a/chromium.org/chromedriver/capabilities). - -## v2.45.0 - -### Important Policy Change - -Starting with the 2.45.0 release, selenium-webdriver will support the last -two stable minor releases for Node. For 2.45.0, this means Selenium will -support Node 0.10.x and 0.12.x. Support for the intermediate, un-stable release -(0.11.x) is "best-effort". This policy will be re-evaluated once Node has a -major version release (i.e. 1.0.0). - -### Change Summary - -* Added native browser support for Internet Explorer, Opera 26+, and Safari -* With the release of [Node 0.12.0](http://blog.nodejs.org/2015/02/06/node-v0-12-0-stable/) - (finally!), the minimum supported version of Node is now `0.10.x`. -* The `promise` module is now [Promises/A+](https://promisesaplus.com/) - compliant. The biggest compliance change is that promise callbacks are now - invoked in a future turn of the JS event loop. For example: - - var promise = require('selenium-webdriver').promise; - console.log('start'); - promise.fulfilled().then(function() { - console.log('middle'); - }); - console.log('end'); - - // Output in selenium-webdriver@2.44.0 - // start - // middle - // end - // - // Output in selenium-webdriver@2.45.0 - // start - // end - // middle - - The `promise.ControlFlow` class has been updated to track the asynchronous - breaks required by Promises/A+, so there are no changes to task execution - order. -* Updated how errors are annotated on failures. When a task fails, the - stacktrace from when that task was scheduled is appended to the rejection - reason with a `From: ` prefix (if it is an Error object). For example: - - var driver = new webdriver.Builder().forBrowser('chrome').build(); - driver.get('http://www.google.com/ncr'); - driver.call(function() { - driver.wait(function() { - return driver.isElementPresent(webdriver.By.id('not-there')); - }, 2000, 'element not found'); - }); - - This code will fail an error like: - - Error: element not found - Wait timed out after 2002ms - at - From: Task: element not found - at - From: Task: WebDriver.call(function) - at - -* Changed the format of strings returned by `promise.ControlFlow#getSchedule`. - This function now accepts a boolean to control whether the returned string - should include the stacktraces for when each task was scheduled. -* Deprecating `promise.ControlFlow#getHistory`, - `promise.ControlFlow#clearHistory`, and `promise.ControlFlow#annotateError`. - These functions were all intended for internal use and are no longer - necessary, so they have been made no-ops. -* `WebDriver.wait()` may now be used to wait for a promise to resolve, with - an optional timeout. Refer to the API documentation for more information. -* Added support for copying files to a remote Selenium via `sendKeys` to test - file uploads. Refer to the API documentation for more information. Sample - usage included in `test/upload_test.js` -* Expanded the interactions API to include touch actions. - See `WebDriver.touchActions()`. -* FIXED: 8380: `firefox.Driver` will delete its temporary profile on `quit`. -* FIXED: 8306: Stack overflow in promise callbacks eliminated. -* FIXED: 8221: Added support for defining custom command mappings. Includes - support for PhantomJS's `executePhantomJS` (requires PhantomJS 1.9.7 or - GhostDriver 1.1.0). -* FIXED: 8128: When the FirefoxDriver marshals an object to the page for - `executeScript`, it defines additional properties (required by the driver's - implementation). These properties will no longer be enumerable and should - be omitted (i.e. they won't show up in JSON.stringify output). -* FIXED: 8094: The control flow will no longer deadlock when a task returns - a promise that depends on the completion of sub-tasks. - -## v2.44.0 - -* Added the `until` module, which defines common explicit wait conditions. - Sample usage: - - var firefox = require('selenium-webdriver/firefox'), - until = require('selenium-webdriver/until'); - - var driver = new firefox.Driver(); - driver.get('http://www.google.com/ncr'); - driver.wait(until.titleIs('Google Search'), 1000); - -* FIXED: 8000: `Builder.forBrowser()` now accepts an empty string since some - WebDriver implementations ignore the value. A value must still be specified, - however, since it is a required field in WebDriver's wire protocol. -* FIXED: 7994: The `stacktrace` module will not modify stack traces if the - initial parse fails (e.g. the user defined `Error.prepareStackTrace`) -* FIXED: 5855: Added a module (`until`) that defines several common conditions - for use with explicit waits. See updated examples for usage. - -## v2.43.5 - -* FIXED: 7905: `Builder.usingServer(url)` once again returns `this` for - chaining. - -## v2.43.2-4 - -* No changes; version bumps while attempting to work around an issue with - publishing to npm (a version string may only be used once). - -## v2.43.1 - -* Fixed an issue with flakiness when setting up the Firefox profile that could - prevent the driver from initializing properly. - -## v2.43.0 - -* Added native support for Firefox - the Java Selenium server is no longer - required. -* Added support for generator functions to `ControlFlow#execute` and - `ControlFlow#wait`. For more information, see documentation on - `webdriver.promise.consume`. Requires harmony support (run with - `node --harmony-generators` in `v0.11.x`). -* Various improvements to the `Builder` API. Notably, the `build()` function - will no longer default to attempting to use a server at - `http://localhost:4444/wd/hub` if it cannot start a browser directly - - you must specify the WebDriver server with `usingServer(url)`. You can - also set the target browser and WebDriver server through a pair of - environment variables. See the documentation on the `Builder` constructor - for more information. -* For consistency with the other language bindings, added browser specific - classes that can be used to start a browser without the builder. - - var webdriver = require('selenium-webdriver') - chrome = require('selenium-webdriver/chrome'); - - // The following are equivalent. - var driver1 = new webdriver.Builder().forBrowser('chrome').build(); - var driver2 = new chrome.Driver(); - -* Promise A+ compliance: a promise may no longer resolve to itself. -* For consistency with other language bindings, deprecated - `UnhandledAlertError#getAlert` and added `#getAlertText`. - `getAlert` will be removed in `2.45.0`. -* FIXED: 7641: Deprecated `ErrorCode.NO_MODAL_DIALOG_OPEN` and - `ErrorCode.MODAL_DIALOG_OPENED` in favor of the new - `ErrorCode.NO_SUCH_ALERT` and `ErrorCode.UNEXPECTED_ALERT_OPEN`, - respectively. -* FIXED: 7563: Mocha integration no longer disables timeouts. Default Mocha - timeouts apply (2000 ms) and may be changed using `this.timeout(ms)`. -* FIXED: 7470: Make it easier to create WebDriver instances in custom flows for - parallel execution. - -## v2.42.1 - -* FIXED: 7465: Fixed `net.getLoopbackAddress` on Windows -* FIXED: 7277: Support `done` callback in Mocha's BDD interface -* FIXED: 7156: `Promise#thenFinally` should not suppress original error - -## v2.42.0 - -* Removed deprecated functions `Promise#addCallback()`, - `Promise#addCallbacks()`, `Promise#addErrback()`, and `Promise#addBoth()`. -* Fail with a more descriptive error if the server returns a malformed redirect -* FIXED: 7300: Connect to ChromeDriver using the loopback address since - ChromeDriver 2.10.267517 binds to localhost by default. -* FIXED: 7339: Preserve wrapped test function's string representation for - Mocha's BDD interface. - -## v2.41.0 - -* FIXED: 7138: export logging API from webdriver module. -* FIXED: 7105: beforeEach/it/afterEach properly bind `this` for Mocha tests. - -## v2.40.0 - -* API documentation is now included in the docs directory. -* Added utility functions for working with an array of promises: - `promise.all`, `promise.map`, and `promise.filter` -* Introduced `Promise#thenCatch()` and `Promise#thenFinally()`. -* Deprecated `Promise#addCallback()`, `Promise#addCallbacks()`, - `Promise#addErrback()`, and `Promise#addBoth()`. -* Removed deprecated function `webdriver.WebDriver#getCapability`. -* FIXED: 6826: Added support for custom locators. - -## v2.39.0 - -* Version bump to stay in sync with the Selenium project. - -## v2.38.1 - -* FIXED: 6686: Changed `webdriver.promise.Deferred#cancel()` to silently no-op - if the deferred has already been resolved. - -## v2.38.0 - -* When a promise is rejected, always annotate the stacktrace with the parent - flow state so users can identify the source of an error. -* Updated tests to reflect features not working correctly in the SafariDriver - (cookie management and proxy support; see issues 5051, 5212, and 5503) -* FIXED: 6284: For mouse moves, correctly omit the x/y offsets if not - specified as a function argument (instead of passing (0,0)). -* FIXED: 6471: Updated documentation on `webdriver.WebElement#getAttribute` -* FIXED: 6612: On Unix, use the default IANA ephemeral port range if unable to - retrieve the current system's port range. -* FIXED: 6617: Avoid triggering the node debugger when initializing the - stacktrace module. -* FIXED: 6627: Safely rebuild chrome.Options from a partial JSON spec. - -## v2.37.0 - -* FIXED: 6346: The remote.SeleniumServer class now accepts JVM arguments using - the `jvmArgs` option. - -## v2.36.0 - -* _Release skipped to stay in sync with main Selenium project._ - -## v2.35.2 - -* FIXED: 6200: Pass arguments to the Selenium server instead of to the JVM. - -## v2.35.1 - -* FIXED: 6090: Changed example scripts to use chromedriver. - -## v2.35.0 - -* Version bump to stay in sync with the Selenium project. - -## v2.34.1 - -* FIXED: 6079: The parent process should not wait for spawn driver service - processes (chromedriver, phantomjs, etc.) - -## v2.34.0 - -* Added the `selenium-webdriver/testing/assert` module. This module - simplifies writing assertions against promised values (see - example in module documentation). -* Added the `webdriver.Capabilities` class. -* Added native support for the ChromeDriver. When using the `Builder`, - requesting chrome without specifying a remote server URL will default to - the native ChromeDriver implementation. The - [ChromeDriver server](https://code.google.com/p/chromedriver/downloads/list) - must be downloaded separately. - - // Will start ChromeDriver locally. - var driver = new webdriver.Builder(). - withCapabilities(webdriver.Capabilities.chrome()). - build(); - - // Will start ChromeDriver using the remote server. - var driver = new webdriver.Builder(). - withCapabilities(webdriver.Capabilities.chrome()). - usingServer('http://server:1234/wd/hub'). - build(); - -* Added support for configuring proxies through the builder. For examples, see - `selenium-webdriver/test/proxy_test`. -* Added native support for PhantomJS. -* Changed signature of `SeleniumServer` to `SeleniumServer(jar, options)`. -* Tests are now included in the npm published package. See `README.md` for - execution instructions -* Removed the deprecated `webdriver.Deferred#resolve` and - `webdriver.promise.resolved` functions. -* Removed the ability to connect to an existing session from the Builder. This - feature is intended for use with the browser-based client. - -## v2.33.0 - -* Added support for WebDriver's logging API -* FIXED: 5511: Added webdriver.manage().timeouts().pageLoadTimeout(ms) - -## v2.32.1 - -* FIXED: 5541: Added missing return statement for windows in - `portprober.findFreePort()` - -## v2.32.0 - -* Added the `selenium-webdriver/testing` package, which provides a basic - framework for writing tests using Mocha. See - `selenium-webdriver/example/google_search_test.js` for usage. -* For Promises/A+ compatibility, backing out the change in 2.30.0 that ensured - rejections were always Error objects. Rejection reasons are now left as is. -* Removed deprecated functions originally scheduled for removal in 2.31.0 - * promise.Application.getInstance() - * promise.ControlFlow#schedule() - * promise.ControlFlow#scheduleTimeout() - * promise.ControlFlow#scheduleWait() -* Renamed some functions for consistency with Promises/A+ terminology. The - original functions have been deprecated and will be removed in 2.34.0: - * promise.resolved() -> promise.fulfilled() - * promise.Deferred#resolve() -> promise.Deferred#fulfill() -* FIXED: remote.SeleniumServer#stop now shuts down within the active control - flow, allowing scripts to finish. Use #kill to shutdown immediately. -* FIXED: 5321: cookie deletion commands - -## v2.31.0 - -* Added an example script. -* Added a class for controlling the standalone Selenium server (server -available separately) -* Added a portprober for finding free ports -* FIXED: WebElements now belong to the same flow as their parent driver. - -## v2.30.0 - -* Ensures promise rejections are always Error values. -* Version bump to keep in sync with the Selenium project. - -## v2.29.1 - -* Fixed a bug that could lead to an infinite loop. -* Added a README.md - -## v2.29.0 - -* Initial release for npm: - - npm install selenium-webdriver diff --git a/node_modules/selenium-webdriver/LICENSE b/node_modules/selenium-webdriver/LICENSE deleted file mode 100644 index d43f2c0a4..000000000 --- a/node_modules/selenium-webdriver/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2016 Software Freedom Conservancy (SFC) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/node_modules/selenium-webdriver/NOTICE b/node_modules/selenium-webdriver/NOTICE deleted file mode 100644 index 274450355..000000000 --- a/node_modules/selenium-webdriver/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -Copyright 2011-2016 Software Freedom Conservancy -Copyright 2004-2011 Selenium committers diff --git a/node_modules/selenium-webdriver/README.md b/node_modules/selenium-webdriver/README.md deleted file mode 100644 index 2cf9ac924..000000000 --- a/node_modules/selenium-webdriver/README.md +++ /dev/null @@ -1,232 +0,0 @@ -# selenium-webdriver - -Selenium is a browser automation library. Most often used for testing -web-applications, Selenium may be used for any task that requires automating -interaction with the browser. - -## Installation - -Selenium may be installed via npm with - - npm install selenium-webdriver - -You will need to download additional components to work with each of the major -browsers. The drivers for Chrome, Firefox, PhantomJS, Opera, and -Microsoft's IE and Edge web browsers are all standalone executables that should -be placed on your system [PATH]. Apple's safaridriver is shipped with -Safari 10 for OS X El Capitan and macOS Sierra. You will need to enable Remote -Automation in the Develop menu of Safari 10 before testing. - -> **NOTE:** Mozilla's [geckodriver] is only required for Firefox 47+. -> Everything you need for Firefox 38-46 is included with this package. - - -| Browser | Component | -| ----------------- | ---------------------------------- | -| Chrome | [chromedriver(.exe)][chrome] | -| Internet Explorer | [IEDriverServer.exe][release] | -| Edge | [MicrosoftWebDriver.msi][edge] | -| Firefox 47+ | [geckodriver(.exe)][geckodriver] | -| PhantomJS | [phantomjs(.exe)][phantomjs] | -| Opera | [operadriver(.exe)][opera] | -| Safari | [safaridriver] | - -## Usage - -The sample below and others are included in the `example` directory. You may -also find the tests for selenium-webdriver informative. - - var webdriver = require('selenium-webdriver'), - By = webdriver.By, - until = webdriver.until; - - var driver = new webdriver.Builder() - .forBrowser('firefox') - .build(); - - driver.get('http://www.google.com/ncr'); - driver.findElement(By.name('q')).sendKeys('webdriver'); - driver.findElement(By.name('btnG')).click(); - driver.wait(until.titleIs('webdriver - Google Search'), 1000); - driver.quit(); - -### Using the Builder API - -The `Builder` class is your one-stop shop for configuring new WebDriver -instances. Rather than clutter your code with branches for the various browsers, -the builder lets you set all options in one flow. When you call -`Builder#build()`, all options irrelevant to the selected browser are dropped: - - var webdriver = require('selenium-webdriver'), - chrome = require('selenium-webdriver/chrome'), - firefox = require('selenium-webdriver/firefox'); - - var driver = new webdriver.Builder() - .forBrowser('firefox') - .setChromeOptions(/* ... */) - .setFirefoxOptions(/* ... */) - .build(); - -Why would you want to configure options irrelevant to the target browser? The -`Builder`'s API defines your _default_ configuration. You can change the target -browser at runtime through the `SELENIUM_BROWSER` environment variable. For -example, the `example/google_search.js` script is configured to run against -Firefox. You can run the example against other browsers just by changing the -runtime environment - - # cd node_modules/selenium-webdriver - node example/google_search - SELENIUM_BROWSER=chrome node example/google_search - SELENIUM_BROWSER=safari node example/google_search - -### The Standalone Selenium Server - -The standalone Selenium Server acts as a proxy between your script and the -browser-specific drivers. The server may be used when running locally, but it's -not recommend as it introduces an extra hop for each request and will slow -things down. The server is required, however, to use a browser on a remote host -(most browser drivers, like the IEDriverServer, do not accept remote -connections). - -To use the Selenium Server, you will need to install the -[JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and -download the latest server from [Selenium][release]. Once downloaded, run the -server with - - java -jar selenium-server-standalone-2.45.0.jar - -You may configure your tests to run against a remote server through the Builder -API: - - var driver = new webdriver.Builder() - .forBrowser('firefox') - .usingServer('http://localhost:4444/wd/hub') - .build(); - -Or change the Builder's configuration at runtime with the `SELENIUM_REMOTE_URL` -environment variable: - - SELENIUM_REMOTE_URL="http://localhost:4444/wd/hub" node script.js - -You can experiment with these options using the `example/google_search.js` -script provided with `selenium-webdriver`. - -## Documentation - -API documentation is available online from the [Selenium project][api]. -Additional resources include - -- the #selenium channel on freenode IRC -- the [selenium-users@googlegroups.com][users] list -- [SeleniumHQ](http://www.seleniumhq.org/docs/) documentation - -## Contributing - -Contributions are accepted either through [GitHub][gh] pull requests or patches -via the [Selenium issue tracker][issues]. You must sign our -[Contributor License Agreement][cla] before your changes will be accepted. - -## Node Support Policy - -Each version of selenium-webdriver will support the latest _semver-minor_ -version of the [LTS] and stable Node releases. All _semver-major_ & -_semver-minor_ versions between the LTS and stable release will have "best -effort" support. Following a Selenium release, any _semver-minor_ Node releases -will also have "best effort" support. Releases older than the latest LTS, -_semver-major_ releases, and all unstable release branches (e.g. "v.Next") -are considered strictly unsupported. - -For example, suppose the current LTS and stable releases are v6.9.5 and v7.5.0, -respectively. Then a Selenium release would have the following support levels: - -| Version | Support | -| ------- | ------------- | -| <= 6.8 | _unsupported_ | -| 6.9 | supported | -| 7.0-4 | best effort | -| 7.5 | supported | -| >= 7.5 | best effort | -| v.Next | _unsupported_ | - -### Support Level Definitions - -- _supported:_ A selenium-webdriver release will be API compatible with the - platform API, without the use of runtime flags. - -- _best effort:_ Bugs will be investigated as time permits. API compatibility is - only guaranteed where required by a _supported_ release. This effectively - means the adoption of new JS features, such as ES2015 modules, will depend - on what is supported in Node's LTS. - -- _unsupported:_ Bug submissions will be closed as will-not-fix and API - compatibility is not guaranteed. - -### Projected Support Schedule - -If Node releases a new [LTS] each October and a new major version every 6 -months, the support window for selenium-webdriver will be roughly: - -| Date | LTS | Stable | -| --------- | ---: | -----: | -| (current) | 6.9 | 7.5 | -| 2017-04 | 6.0 | 8.0 | -| 2017-10 | 8.0 | 9.0 | -| 2018-04 | 8.0 | 10.0 | -| 2018-10 | 10.0 | 11.0 | - -## Issues - -Please report any issues using the [Selenium issue tracker][issues]. When using -the issue tracker - -- __Do__ include a detailed description of the problem. -- __Do__ include a link to a [gist](http://gist.github.com/) with any - interesting stack traces/logs (you may also attach these directly to the bug - report). -- __Do__ include a [reduced test case][reduction]. Reporting "unable to find - element on the page" is _not_ a valid report - there's nothing for us to - look into. Expect your bug report to be closed if you do not provide enough - information for us to investigate. -- __Do not__ use the issue tracker to submit basic help requests. All help - inquiries should be directed to the [user forum][users] or #selenium IRC - channel. -- __Do not__ post empty "I see this too" or "Any updates?" comments. These - provide no additional information and clutter the log. -- __Do not__ report regressions on closed bugs as they are not actively - monitored for updates (especially bugs that are >6 months old). Please open a - new issue and reference the original bug in your report. - -## License - -Licensed to the Software Freedom Conservancy (SFC) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The SFC licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. - -[LTS]: https://github.com/nodejs/LTS -[PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29 -[api]: http://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/ -[cla]: http://goo.gl/qC50R -[chrome]: http://chromedriver.storage.googleapis.com/index.html -[gh]: https://github.com/SeleniumHQ/selenium/ -[issues]: https://github.com/SeleniumHQ/selenium/issues -[opera]: https://github.com/operasoftware/operachromiumdriver/releases -[phantomjs]: http://phantomjs.org/ -[edge]: http://go.microsoft.com/fwlink/?LinkId=619687 -[geckodriver]: https://github.com/mozilla/geckodriver/releases/ -[reduction]: http://www.webkit.org/quality/reduction.html -[release]: http://selenium-release.storage.googleapis.com/index.html -[users]: https://groups.google.com/forum/#!forum/selenium-users -[safaridriver]: https://developer.apple.com/library/prerelease/content/releasenotes/General/WhatsNewInSafari/Articles/Safari_10_0.html#//apple_ref/doc/uid/TP40014305-CH11-DontLinkElementID_28 diff --git a/node_modules/selenium-webdriver/chrome.js b/node_modules/selenium-webdriver/chrome.js deleted file mode 100644 index b1e8a29e4..000000000 --- a/node_modules/selenium-webdriver/chrome.js +++ /dev/null @@ -1,787 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Defines a {@linkplain Driver WebDriver} client for the Chrome - * web browser. Before using this module, you must download the latest - * [ChromeDriver release] and ensure it can be found on your system [PATH]. - * - * There are three primary classes exported by this module: - * - * 1. {@linkplain ServiceBuilder}: configures the - * {@link selenium-webdriver/remote.DriverService remote.DriverService} - * that manages the [ChromeDriver] child process. - * - * 2. {@linkplain Options}: defines configuration options for each new Chrome - * session, such as which {@linkplain Options#setProxy proxy} to use, - * what {@linkplain Options#addExtensions extensions} to install, or - * what {@linkplain Options#addArguments command-line switches} to use when - * starting the browser. - * - * 3. {@linkplain Driver}: the WebDriver client; each new instance will control - * a unique browser session with a clean user profile (unless otherwise - * configured through the {@link Options} class). - * - * __Customizing the ChromeDriver Server__ - * - * By default, every Chrome session will use a single driver service, which is - * started the first time a {@link Driver} instance is created and terminated - * when this process exits. The default service will inherit its environment - * from the current process and direct all output to /dev/null. You may obtain - * a handle to this default service using - * {@link #getDefaultService getDefaultService()} and change its configuration - * with {@link #setDefaultService setDefaultService()}. - * - * You may also create a {@link Driver} with its own driver service. This is - * useful if you need to capture the server's log output for a specific session: - * - * let chrome = require('selenium-webdriver/chrome'); - * - * let service = new chrome.ServiceBuilder() - * .loggingTo('/my/log/file.txt') - * .enableVerboseLogging() - * .build(); - * - * let options = new chrome.Options(); - * // configure browser options ... - * - * let driver = chrome.Driver.createSession(options, service); - * - * Users should only instantiate the {@link Driver} class directly when they - * need a custom driver service configuration (as shown above). For normal - * operation, users should start Chrome using the - * {@link selenium-webdriver.Builder}. - * - * __Working with Android__ - * - * The [ChromeDriver][android] supports running tests on the Chrome browser as - * well as [WebView apps][webview] starting in Android 4.4 (KitKat). In order to - * work with Android, you must first start the adb - * - * adb start-server - * - * By default, adb will start on port 5037. You may change this port, but this - * will require configuring a [custom server](#custom-server) that will connect - * to adb on the {@linkplain ServiceBuilder#setAdbPort correct port}: - * - * let service = new chrome.ServiceBuilder() - * .setAdbPort(1234) - * build(); - * // etc. - * - * The ChromeDriver may be configured to launch Chrome on Android using - * {@link Options#androidChrome()}: - * - * let driver = new Builder() - * .forBrowser('chrome') - * .setChromeOptions(new chrome.Options().androidChrome()) - * .build(); - * - * Alternatively, you can configure the ChromeDriver to launch an app with a - * Chrome-WebView by setting the {@linkplain Options#androidActivity - * androidActivity} option: - * - * let driver = new Builder() - * .forBrowser('chrome') - * .setChromeOptions(new chrome.Options() - * .androidPackage('com.example') - * .androidActivity('com.example.Activity')) - * .build(); - * - * [Refer to the ChromeDriver site] for more information on using the - * [ChromeDriver with Android][android]. - * - * [ChromeDriver]: https://sites.google.com/a/chromium.org/chromedriver/ - * [ChromeDriver release]: http://chromedriver.storage.googleapis.com/index.html - * [PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29 - * [android]: https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android - * [webview]: https://developer.chrome.com/multidevice/webview/overview - */ - -'use strict'; - -const fs = require('fs'), - util = require('util'); - -const http = require('./http'), - io = require('./io'), - {Capabilities, Capability} = require('./lib/capabilities'), - command = require('./lib/command'), - logging = require('./lib/logging'), - promise = require('./lib/promise'), - Symbols = require('./lib/symbols'), - webdriver = require('./lib/webdriver'), - portprober = require('./net/portprober'), - remote = require('./remote'); - - -/** - * Name of the ChromeDriver executable. - * @type {string} - * @const - */ -const CHROMEDRIVER_EXE = - process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'; - - -/** - * Custom command names supported by ChromeDriver. - * @enum {string} - */ -const Command = { - LAUNCH_APP: 'launchApp', - GET_NETWORK_CONDITIONS: 'getNetworkConditions', - SET_NETWORK_CONDITIONS: 'setNetworkConditions' -}; - - -/** - * Creates a command executor with support for ChromeDriver's custom commands. - * @param {!Promise} url The server's URL. - * @return {!command.Executor} The new command executor. - */ -function createExecutor(url) { - let client = url.then(url => new http.HttpClient(url)); - let executor = new http.Executor(client); - configureExecutor(executor); - return executor; -} - - -/** - * Configures the given executor with Chrome-specific commands. - * @param {!http.Executor} executor the executor to configure. - */ -function configureExecutor(executor) { - executor.defineCommand( - Command.LAUNCH_APP, - 'POST', - '/session/:sessionId/chromium/launch_app'); - executor.defineCommand( - Command.GET_NETWORK_CONDITIONS, - 'GET', - '/session/:sessionId/chromium/network_conditions'); - executor.defineCommand( - Command.SET_NETWORK_CONDITIONS, - 'POST', - '/session/:sessionId/chromium/network_conditions'); -} - - -/** - * Creates {@link selenium-webdriver/remote.DriverService} instances that manage - * a [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/) - * server in a child process. - */ -class ServiceBuilder extends remote.DriverService.Builder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the chromedriver on the current - * PATH. - * @throws {Error} If provided executable does not exist, or the chromedriver - * cannot be found on the PATH. - */ - constructor(opt_exe) { - let exe = opt_exe || io.findInPath(CHROMEDRIVER_EXE, true); - if (!exe) { - throw Error( - 'The ChromeDriver could not be found on the current PATH. Please ' + - 'download the latest version of the ChromeDriver from ' + - 'http://chromedriver.storage.googleapis.com/index.html and ensure ' + - 'it can be found on your PATH.'); - } - - super(exe); - this.setLoopback(true); // Required - } - - /** - * Sets which port adb is listening to. _The ChromeDriver will connect to adb - * if an {@linkplain Options#androidPackage Android session} is requested, but - * adb **must** be started beforehand._ - * - * @param {number} port Which port adb is running on. - * @return {!ServiceBuilder} A self reference. - */ - setAdbPort(port) { - return this.addArguments('--adb-port=' + port); - } - - /** - * Sets the path of the log file the driver should log to. If a log file is - * not specified, the driver will log to stderr. - * @param {string} path Path of the log file to use. - * @return {!ServiceBuilder} A self reference. - */ - loggingTo(path) { - return this.addArguments('--log-path=' + path); - } - - /** - * Enables verbose logging. - * @return {!ServiceBuilder} A self reference. - */ - enableVerboseLogging() { - return this.addArguments('--verbose'); - } - - /** - * Sets the number of threads the driver should use to manage HTTP requests. - * By default, the driver will use 4 threads. - * @param {number} n The number of threads to use. - * @return {!ServiceBuilder} A self reference. - */ - setNumHttpThreads(n) { - return this.addArguments('--http-threads=' + n); - } - - /** - * @override - */ - setPath(path) { - super.setPath(path); - return this.addArguments('--url-base=' + path); - } -} - - - -/** @type {remote.DriverService} */ -let defaultService = null; - - -/** - * Sets the default service to use for new ChromeDriver instances. - * @param {!remote.DriverService} service The service to use. - * @throws {Error} If the default service is currently running. - */ -function setDefaultService(service) { - if (defaultService && defaultService.isRunning()) { - throw Error( - 'The previously configured ChromeDriver service is still running. ' + - 'You must shut it down before you may adjust its configuration.'); - } - defaultService = service; -} - - -/** - * Returns the default ChromeDriver service. If such a service has not been - * configured, one will be constructed using the default configuration for - * a ChromeDriver executable found on the system PATH. - * @return {!remote.DriverService} The default ChromeDriver service. - */ -function getDefaultService() { - if (!defaultService) { - defaultService = new ServiceBuilder().build(); - } - return defaultService; -} - - -/** - * @type {string} - * @const - */ -let OPTIONS_CAPABILITY_KEY = 'chromeOptions'; - - -/** - * Class for managing ChromeDriver specific options. - */ -class Options { - constructor() { - /** @private {!Object} */ - this.options_ = {}; - - /** @private {!Array<(string|!Buffer)>} */ - this.extensions_ = []; - - /** @private {?logging.Preferences} */ - this.logPrefs_ = null; - - /** @private {?./lib/capabilities.ProxyConfig} */ - this.proxy_ = null; - } - - /** - * Extracts the ChromeDriver specific options from the given capabilities - * object. - * @param {!Capabilities} caps The capabilities object. - * @return {!Options} The ChromeDriver options. - */ - static fromCapabilities(caps) { - let options = new Options(); - - let o = caps.get(OPTIONS_CAPABILITY_KEY); - if (o instanceof Options) { - options = o; - } else if (o) { - options. - addArguments(o.args || []). - addExtensions(o.extensions || []). - detachDriver(o.detach). - excludeSwitches(o.excludeSwitches || []). - setChromeBinaryPath(o.binary). - setChromeLogFile(o.logPath). - setChromeMinidumpPath(o.minidumpPath). - setLocalState(o.localState). - setMobileEmulation(o.mobileEmulation). - setUserPreferences(o.prefs). - setPerfLoggingPrefs(o.perfLoggingPrefs); - } - - if (caps.has(Capability.PROXY)) { - options.setProxy(caps.get(Capability.PROXY)); - } - - if (caps.has(Capability.LOGGING_PREFS)) { - options.setLoggingPrefs( - caps.get(Capability.LOGGING_PREFS)); - } - - return options; - } - - /** - * Add additional command line arguments to use when launching the Chrome - * browser. Each argument may be specified with or without the "--" prefix - * (e.g. "--foo" and "foo"). Arguments with an associated value should be - * delimited by an "=": "foo=bar". - * @param {...(string|!Array)} var_args The arguments to add. - * @return {!Options} A self reference. - */ - addArguments(var_args) { - let args = this.options_.args || []; - args = args.concat.apply(args, arguments); - if (args.length) { - this.options_.args = args; - } - return this; - } - - /** - * List of Chrome command line switches to exclude that ChromeDriver by default - * passes when starting Chrome. Do not prefix switches with "--". - * - * @param {...(string|!Array)} var_args The switches to exclude. - * @return {!Options} A self reference. - */ - excludeSwitches(var_args) { - let switches = this.options_.excludeSwitches || []; - switches = switches.concat.apply(switches, arguments); - if (switches.length) { - this.options_.excludeSwitches = switches; - } - return this; - } - - /** - * Add additional extensions to install when launching Chrome. Each extension - * should be specified as the path to the packed CRX file, or a Buffer for an - * extension. - * @param {...(string|!Buffer|!Array<(string|!Buffer)>)} var_args The - * extensions to add. - * @return {!Options} A self reference. - */ - addExtensions(var_args) { - this.extensions_ = - this.extensions_.concat.apply(this.extensions_, arguments); - return this; - } - - /** - * Sets the path to the Chrome binary to use. On Mac OS X, this path should - * reference the actual Chrome executable, not just the application binary - * (e.g. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"). - * - * The binary path be absolute or relative to the chromedriver server - * executable, but it must exist on the machine that will launch Chrome. - * - * @param {string} path The path to the Chrome binary to use. - * @return {!Options} A self reference. - */ - setChromeBinaryPath(path) { - this.options_.binary = path; - return this; - } - - /** - * Sets whether to leave the started Chrome browser running if the controlling - * ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is - * called. - * @param {boolean} detach Whether to leave the browser running if the - * chromedriver service is killed before the session. - * @return {!Options} A self reference. - */ - detachDriver(detach) { - this.options_.detach = detach; - return this; - } - - /** - * Sets the user preferences for Chrome's user profile. See the "Preferences" - * file in Chrome's user data directory for examples. - * @param {!Object} prefs Dictionary of user preferences to use. - * @return {!Options} A self reference. - */ - setUserPreferences(prefs) { - this.options_.prefs = prefs; - return this; - } - - /** - * Sets the logging preferences for the new session. - * @param {!logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPrefs(prefs) { - this.logPrefs_ = prefs; - return this; - } - - /** - * Sets the performance logging preferences. Options include: - * - * - `enableNetwork`: Whether or not to collect events from Network domain. - * - `enablePage`: Whether or not to collect events from Page domain. - * - `enableTimeline`: Whether or not to collect events from Timeline domain. - * Note: when tracing is enabled, Timeline domain is implicitly disabled, - * unless `enableTimeline` is explicitly set to true. - * - `tracingCategories`: A comma-separated string of Chrome tracing - * categories for which trace events should be collected. An unspecified - * or empty string disables tracing. - * - `bufferUsageReportingInterval`: The requested number of milliseconds - * between DevTools trace buffer usage events. For example, if 1000, then - * once per second, DevTools will report how full the trace buffer is. If - * a report indicates the buffer usage is 100%, a warning will be issued. - * - * @param {{enableNetwork: boolean, - * enablePage: boolean, - * enableTimeline: boolean, - * tracingCategories: string, - * bufferUsageReportingInterval: number}} prefs The performance - * logging preferences. - * @return {!Options} A self reference. - */ - setPerfLoggingPrefs(prefs) { - this.options_.perfLoggingPrefs = prefs; - return this; - } - - /** - * Sets preferences for the "Local State" file in Chrome's user data - * directory. - * @param {!Object} state Dictionary of local state preferences. - * @return {!Options} A self reference. - */ - setLocalState(state) { - this.options_.localState = state; - return this; - } - - /** - * Sets the name of the activity hosting a Chrome-based Android WebView. This - * option must be set to connect to an [Android WebView]( - * https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) - * - * @param {string} name The activity name. - * @return {!Options} A self reference. - */ - androidActivity(name) { - this.options_.androidActivity = name; - return this; - } - - /** - * Sets the device serial number to connect to via ADB. If not specified, the - * ChromeDriver will select an unused device at random. An error will be - * returned if all devices already have active sessions. - * - * @param {string} serial The device serial number to connect to. - * @return {!Options} A self reference. - */ - androidDeviceSerial(serial) { - this.options_.androidDeviceSerial = serial; - return this; - } - - /** - * Configures the ChromeDriver to launch Chrome on Android via adb. This - * function is shorthand for - * {@link #androidPackage options.androidPackage('com.android.chrome')}. - * @return {!Options} A self reference. - */ - androidChrome() { - return this.androidPackage('com.android.chrome'); - } - - /** - * Sets the package name of the Chrome or WebView app. - * - * @param {?string} pkg The package to connect to, or `null` to disable Android - * and switch back to using desktop Chrome. - * @return {!Options} A self reference. - */ - androidPackage(pkg) { - this.options_.androidPackage = pkg; - return this; - } - - /** - * Sets the process name of the Activity hosting the WebView (as given by - * `ps`). If not specified, the process name is assumed to be the same as - * {@link #androidPackage}. - * - * @param {string} processName The main activity name. - * @return {!Options} A self reference. - */ - androidProcess(processName) { - this.options_.androidProcess = processName; - return this; - } - - /** - * Sets whether to connect to an already-running instead of the specified - * {@linkplain #androidProcess app} instead of launching the app with a clean - * data directory. - * - * @param {boolean} useRunning Whether to connect to a running instance. - * @return {!Options} A self reference. - */ - androidUseRunningApp(useRunning) { - this.options_.androidUseRunningApp = useRunning; - return this; - } - - /** - * Sets the path to Chrome's log file. This path should exist on the machine - * that will launch Chrome. - * @param {string} path Path to the log file to use. - * @return {!Options} A self reference. - */ - setChromeLogFile(path) { - this.options_.logPath = path; - return this; - } - - /** - * Sets the directory to store Chrome minidumps in. This option is only - * supported when ChromeDriver is running on Linux. - * @param {string} path The directory path. - * @return {!Options} A self reference. - */ - setChromeMinidumpPath(path) { - this.options_.minidumpPath = path; - return this; - } - - /** - * Configures Chrome to emulate a mobile device. For more information, refer - * to the ChromeDriver project page on [mobile emulation][em]. Configuration - * options include: - * - * - `deviceName`: The name of a pre-configured [emulated device][devem] - * - `width`: screen width, in pixels - * - `height`: screen height, in pixels - * - `pixelRatio`: screen pixel ratio - * - * __Example 1: Using a Pre-configured Device__ - * - * let options = new chrome.Options().setMobileEmulation( - * {deviceName: 'Google Nexus 5'}); - * - * let driver = chrome.Driver.createSession(options); - * - * __Example 2: Using Custom Screen Configuration__ - * - * let options = new chrome.Options().setMobileEmulation({ - * width: 360, - * height: 640, - * pixelRatio: 3.0 - * }); - * - * let driver = chrome.Driver.createSession(options); - * - * - * [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation - * [devem]: https://developer.chrome.com/devtools/docs/device-mode - * - * @param {?({deviceName: string}| - * {width: number, height: number, pixelRatio: number})} config The - * mobile emulation configuration, or `null` to disable emulation. - * @return {!Options} A self reference. - */ - setMobileEmulation(config) { - this.options_.mobileEmulation = config; - return this; - } - - /** - * Sets the proxy settings for the new session. - * @param {./lib/capabilities.ProxyConfig} proxy The proxy configuration to - * use. - * @return {!Options} A self reference. - */ - setProxy(proxy) { - this.proxy_ = proxy; - return this; - } - - /** - * Converts this options instance to a {@link Capabilities} object. - * @param {Capabilities=} opt_capabilities The capabilities to merge - * these options into, if any. - * @return {!Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities) { - let caps = opt_capabilities || Capabilities.chrome(); - caps. - set(Capability.PROXY, this.proxy_). - set(Capability.LOGGING_PREFS, this.logPrefs_). - set(OPTIONS_CAPABILITY_KEY, this); - return caps; - } - - /** - * Converts this instance to its JSON wire protocol representation. Note this - * function is an implementation not intended for general use. - * @return {!Object} The JSON wire protocol representation of this instance. - */ - [Symbols.serialize]() { - let json = {}; - for (let key in this.options_) { - if (this.options_[key] != null) { - json[key] = this.options_[key]; - } - } - if (this.extensions_.length) { - json.extensions = this.extensions_.map(function(extension) { - if (Buffer.isBuffer(extension)) { - return extension.toString('base64'); - } - return io.read(/** @type {string} */(extension)) - .then(buffer => buffer.toString('base64')); - }); - } - return json; - } -} - - -/** - * Creates a new WebDriver client for Chrome. - */ -class Driver extends webdriver.WebDriver { - - /** - * Creates a new session with the ChromeDriver. - * - * @param {(Capabilities|Options)=} opt_config The configuration options. - * @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either - * a DriverService to use for the remote end, or a preconfigured executor - * for an externally managed endpoint. If neither is provided, the - * {@linkplain ##getDefaultService default service} will be used by - * default. - * @param {promise.ControlFlow=} opt_flow The control flow to use, or `null` - * to use the currently active flow. - * @return {!Driver} A new driver instance. - */ - static createSession(opt_config, opt_serviceExecutor, opt_flow) { - let executor; - if (opt_serviceExecutor instanceof http.Executor) { - executor = opt_serviceExecutor; - configureExecutor(executor); - } else { - let service = opt_serviceExecutor || getDefaultService(); - executor = createExecutor(service.start()); - } - - let caps = - opt_config instanceof Options ? opt_config.toCapabilities() : - (opt_config || Capabilities.chrome()); - - return /** @type {!Driver} */( - webdriver.WebDriver.createSession(executor, caps, opt_flow, this)); - } - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector() {} - - /** - * Schedules a command to launch Chrome App with given ID. - * @param {string} id ID of the App to launch. - * @return {!promise.Thenable} A promise that will be resolved - * when app is launched. - */ - launchApp(id) { - return this.schedule( - new command.Command(Command.LAUNCH_APP).setParameter('id', id), - 'Driver.launchApp()'); - } - - /** - * Schedules a command to get Chrome network emulation settings. - * @return {!promise.Thenable} A promise that will be resolved - * when network emulation settings are retrievied. - */ - getNetworkConditions() { - return this.schedule( - new command.Command(Command.GET_NETWORK_CONDITIONS), - 'Driver.getNetworkConditions()'); - } - - /** - * Schedules a command to set Chrome network emulation settings. - * - * __Sample Usage:__ - * - * driver.setNetworkConditions({ - * offline: false, - * latency: 5, // Additional latency (ms). - * download_throughput: 500 * 1024, // Maximal aggregated download throughput. - * upload_throughput: 500 * 1024 // Maximal aggregated upload throughput. - * }); - * - * @param {Object} spec Defines the network conditions to set - * @return {!promise.Thenable} A promise that will be resolved - * when network emulation settings are set. - */ - setNetworkConditions(spec) { - if (!spec || typeof spec !== 'object') { - throw TypeError('setNetworkConditions called with non-network-conditions parameter'); - } - - return this.schedule( - new command.Command(Command.SET_NETWORK_CONDITIONS).setParameter('network_conditions', spec), - 'Driver.setNetworkConditions(' + JSON.stringify(spec) + ')'); - } -} - - -// PUBLIC API - - -exports.Driver = Driver; -exports.Options = Options; -exports.ServiceBuilder = ServiceBuilder; -exports.getDefaultService = getDefaultService; -exports.setDefaultService = setDefaultService; diff --git a/node_modules/selenium-webdriver/edge.js b/node_modules/selenium-webdriver/edge.js deleted file mode 100644 index 9280cabd9..000000000 --- a/node_modules/selenium-webdriver/edge.js +++ /dev/null @@ -1,301 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Defines a {@linkplain Driver WebDriver} client for - * Microsoft's Edge web browser. Before using this module, - * you must download and install the latest - * [MicrosoftEdgeDriver](http://go.microsoft.com/fwlink/?LinkId=619687) server. - * Ensure that the MicrosoftEdgeDriver is on your - * [PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29). - * - * There are three primary classes exported by this module: - * - * 1. {@linkplain ServiceBuilder}: configures the - * {@link ./remote.DriverService remote.DriverService} - * that manages the [MicrosoftEdgeDriver] child process. - * - * 2. {@linkplain Options}: defines configuration options for each new - * MicrosoftEdgeDriver session, such as which - * {@linkplain Options#setProxy proxy} to use when starting the browser. - * - * 3. {@linkplain Driver}: the WebDriver client; each new instance will control - * a unique browser session. - * - * __Customizing the MicrosoftEdgeDriver Server__ - * - * By default, every MicrosoftEdge session will use a single driver service, - * which is started the first time a {@link Driver} instance is created and - * terminated when this process exits. The default service will inherit its - * environment from the current process. - * You may obtain a handle to this default service using - * {@link #getDefaultService getDefaultService()} and change its configuration - * with {@link #setDefaultService setDefaultService()}. - * - * You may also create a {@link Driver} with its own driver service. This is - * useful if you need to capture the server's log output for a specific session: - * - * var edge = require('selenium-webdriver/edge'); - * - * var service = new edge.ServiceBuilder() - * .setPort(55555) - * .build(); - * - * var options = new edge.Options(); - * // configure browser options ... - * - * var driver = edge.Driver.createSession(options, service); - * - * Users should only instantiate the {@link Driver} class directly when they - * need a custom driver service configuration (as shown above). For normal - * operation, users should start MicrosoftEdge using the - * {@link ./builder.Builder selenium-webdriver.Builder}. - * - * [MicrosoftEdgeDriver]: https://msdn.microsoft.com/en-us/library/mt188085(v=vs.85).aspx - */ - -'use strict'; - -const fs = require('fs'), - util = require('util'); - -const http = require('./http'), - io = require('./io'), - capabilities = require('./lib/capabilities'), - promise = require('./lib/promise'), - Symbols = require('./lib/symbols'), - webdriver = require('./lib/webdriver'), - portprober = require('./net/portprober'), - remote = require('./remote'); - -const EDGEDRIVER_EXE = 'MicrosoftWebDriver.exe'; - - -/** - * Option keys. - * @enum {string} - */ -const CAPABILITY_KEY = { - PAGE_LOAD_STRATEGY: 'pageLoadStrategy' -}; - - -/** - * Class for managing MicrosoftEdgeDriver specific options. - */ -class Options { - constructor() { - /** @private {!Object} */ - this.options_ = {}; - - /** @private {?capabilities.ProxyConfig} */ - this.proxy_ = null; - } - - /** - * Extracts the MicrosoftEdgeDriver specific options from the given - * capabilities object. - * @param {!capabilities.Capabilities} caps The capabilities object. - * @return {!Options} The MicrosoftEdgeDriver options. - */ - static fromCapabilities(caps) { - var options = new Options(); - var map = options.options_; - - Object.keys(CAPABILITY_KEY).forEach(function(key) { - key = CAPABILITY_KEY[key]; - if (caps.has(key)) { - map[key] = caps.get(key); - } - }); - - if (caps.has(capabilities.Capability.PROXY)) { - options.setProxy(caps.get(capabilities.Capability.PROXY)); - } - - return options; - } - - /** - * Sets the proxy settings for the new session. - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy) { - this.proxy_ = proxy; - return this; - } - - /** - * Sets the page load strategy for Edge. - * Supported values are "normal", "eager", and "none"; - * - * @param {string} pageLoadStrategy The page load strategy to use. - * @return {!Options} A self reference. - */ - setPageLoadStrategy(pageLoadStrategy) { - this.options_[CAPABILITY_KEY.PAGE_LOAD_STRATEGY] = - pageLoadStrategy.toLowerCase(); - return this; - } - - /** - * Converts this options instance to a {@link capabilities.Capabilities} - * object. - * @param {capabilities.Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!capabilities.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities) { - var caps = opt_capabilities || capabilities.Capabilities.edge(); - if (this.proxy_) { - caps.set(capabilities.Capability.PROXY, this.proxy_); - } - Object.keys(this.options_).forEach(function(key) { - caps.set(key, this.options_[key]); - }, this); - return caps; - } - - /** - * Converts this instance to its JSON wire protocol representation. Note this - * function is an implementation not intended for general use. - * @return {{pageLoadStrategy: (string|undefined)}} - * The JSON wire protocol representation of this instance. - */ - [Symbols.serialize]() { - var json = {}; - for (var key in this.options_) { - if (this.options_[key] != null) { - json[key] = this.options_[key]; - } - } - return json; - } -} - - -/** - * Creates {@link remote.DriverService} instances that manage a - * MicrosoftEdgeDriver server in a child process. - */ -class ServiceBuilder extends remote.DriverService.Builder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the MicrosoftEdgeDriver on the current - * PATH. - * @throws {Error} If provided executable does not exist, or the - * MicrosoftEdgeDriver cannot be found on the PATH. - */ - constructor(opt_exe) { - let exe = opt_exe || io.findInPath(EDGEDRIVER_EXE, true); - if (!exe) { - throw Error( - 'The ' + EDGEDRIVER_EXE + ' could not be found on the current PATH. ' + - 'Please download the latest version of the MicrosoftEdgeDriver from ' + - 'https://www.microsoft.com/en-us/download/details.aspx?id=48212 and ' + - 'ensure it can be found on your PATH.'); - } - - super(exe); - - // Binding to the loopback address will fail if not running with - // administrator privileges. Since we cannot test for that in script - // (or can we?), force the DriverService to use "localhost". - this.setHostname('localhost'); - } -} - - -/** @type {remote.DriverService} */ -var defaultService = null; - - -/** - * Sets the default service to use for new MicrosoftEdgeDriver instances. - * @param {!remote.DriverService} service The service to use. - * @throws {Error} If the default service is currently running. - */ -function setDefaultService(service) { - if (defaultService && defaultService.isRunning()) { - throw Error( - 'The previously configured EdgeDriver service is still running. ' + - 'You must shut it down before you may adjust its configuration.'); - } - defaultService = service; -} - - -/** - * Returns the default MicrosoftEdgeDriver service. If such a service has - * not been configured, one will be constructed using the default configuration - * for an MicrosoftEdgeDriver executable found on the system PATH. - * @return {!remote.DriverService} The default MicrosoftEdgeDriver service. - */ -function getDefaultService() { - if (!defaultService) { - defaultService = new ServiceBuilder().build(); - } - return defaultService; -} - - -/** - * Creates a new WebDriver client for Microsoft's Edge. - */ -class Driver extends webdriver.WebDriver { - /** - * Creates a new browser session for Microsoft's Edge browser. - * - * @param {(capabilities.Capabilities|Options)=} opt_config The configuration - * options. - * @param {remote.DriverService=} opt_service The session to use; will use - * the {@linkplain #getDefaultService default service} by default. - * @param {promise.ControlFlow=} opt_flow The control flow to use, or - * {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. - */ - static createSession(opt_config, opt_service, opt_flow) { - var service = opt_service || getDefaultService(); - var client = service.start().then(url => new http.HttpClient(url)); - var executor = new http.Executor(client); - - var caps = - opt_config instanceof Options ? opt_config.toCapabilities() : - (opt_config || capabilities.Capabilities.edge()); - - return /** @type {!Driver} */(webdriver.WebDriver.createSession( - executor, caps, opt_flow, this, () => service.kill())); - } - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector() {} -} - - -// PUBLIC API - - -exports.Driver = Driver; -exports.Options = Options; -exports.ServiceBuilder = ServiceBuilder; -exports.getDefaultService = getDefaultService; -exports.setDefaultService = setDefaultService; diff --git a/node_modules/selenium-webdriver/example/async_await_test.js b/node_modules/selenium-webdriver/example/async_await_test.js deleted file mode 100644 index dd625db34..000000000 --- a/node_modules/selenium-webdriver/example/async_await_test.js +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Example Mocha tests using async/await. - * - * Usage: - * - * mocha -t 20000 --harmony_async_await \ - * selenium-webdriver/example/async_await_test.js - * - * You can change which browser is started with the SELENIUM_BROWSER environment - * variable: - * - * SELENIUM_BROWSER=chrome \ - * mocha -t 20000 --harmony_async_await \ - * selenium-webdriver/example/async_await_test.js - */ - -'use strict'; - -const assert = require('assert'); -const {Builder, By, promise, until} = require('..'); - -// async/await do not work well when the promise manager is enabled. -// See https://github.com/SeleniumHQ/selenium/issues/3037 -// -// 3037 does not impact these specific examples, but it is still recommended -// that you disable the promise manager when using async/await. -promise.USE_PROMISE_MANAGER = false; - -describe('Google Search', function() { - let driver; - - beforeEach(async function() { - driver = await new Builder().forBrowser('firefox').build(); - }); - - afterEach(async function() { - await driver.quit(); - }); - - it('example', async function() { - await driver.get('https://www.google.com/ncr'); - - await driver.findElement(By.name('q')).sendKeys('webdriver'); - await driver.findElement(By.name('btnG')).click(); - - await driver.wait(until.titleIs('webdriver - Google Search'), 1000); - - let url = await driver.getCurrentUrl(); - assert.equal(url, 'https://www.google.com/#q=webdriver'); - }); -}); diff --git a/node_modules/selenium-webdriver/example/chrome_android.js b/node_modules/selenium-webdriver/example/chrome_android.js deleted file mode 100644 index bc0701cf9..000000000 --- a/node_modules/selenium-webdriver/example/chrome_android.js +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview A basic example of working with Chrome on Android. Before - * running this example, you must start adb and connect a device (or start an - * AVD). - */ - -'use strict'; - -const {Builder, By, promise, until} = require('..'); -const {Options} = require('../chrome'); - -promise.consume(function* () { - let driver; - try { - driver = yield new Builder() - .forBrowser('chrome') - .setChromeOptions(new Options().androidChrome()) - .build(); - yield driver.get('http://www.google.com/ncr'); - yield driver.findElement(By.name('q')).sendKeys('webdriver'); - yield driver.findElement(By.name('btnG')).click(); - yield driver.wait(until.titleIs('webdriver - Google Search'), 1000); - } finally { - yield driver && driver.quit(); - } -}).then(_ => console.log('SUCCESS'), err => console.error('ERROR: ' + err)); diff --git a/node_modules/selenium-webdriver/example/chrome_mobile_emulation.js b/node_modules/selenium-webdriver/example/chrome_mobile_emulation.js deleted file mode 100644 index 790be2bcf..000000000 --- a/node_modules/selenium-webdriver/example/chrome_mobile_emulation.js +++ /dev/null @@ -1,43 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview This is an example of emulating a mobile device using the - * ChromeDriver. - */ - -'use strict'; - -const {Builder, By, promise, until} = require('..'); -const {Options} = require('../chrome'); - -promise.consume(function* () { - let driver; - try { - driver = yield new Builder() - .forBrowser('chrome') - .setChromeOptions( - new Options().setMobileEmulation({deviceName: 'Google Nexus 5'})) - .build(); - yield driver.get('http://www.google.com/ncr'); - yield driver.findElement(By.name('q')).sendKeys('webdriver'); - yield driver.findElement(By.name('btnG')).click(); - yield driver.wait(until.titleIs('webdriver - Google Search'), 1000); - } finally { - yield driver && driver.quit(); - } -}).then(_ => console.log('SUCCESS'), err => console.error('ERROR: ' + err)); diff --git a/node_modules/selenium-webdriver/example/firefox_channels.js b/node_modules/selenium-webdriver/example/firefox_channels.js deleted file mode 100644 index b0a30f545..000000000 --- a/node_modules/selenium-webdriver/example/firefox_channels.js +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview This is an example of working with the different Firefox - * release channels. Before running this example, you will need to have - * installed Firefox's release, nightly, and developer editions: - * - * - https://www.mozilla.org/en-US/firefox/channel/desktop/#aurora - * - https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly - */ - - -'use strict'; - -const {Builder, By, promise, until} = require('..'); -const {Channel, Options} = require('../firefox'); - -let i = 0; -function resposition(driver) { - return driver.manage().window().setSize(600, 400) - .then(_ => driver.manage().window().setPosition(300 * (i++), 0)); -} - -function doSearch(driver) { - // Start on the base about page. - return driver.get('about:') - // Reposition so users can see the three windows. - .then(_ => resposition(driver)) - // Pause so users can see the magic. - .then(_ => promise.delayed(750)) - // Now do the rest. - .then(_ => driver.get('http://www.google.com/ncr')) - .then(_ => driver.findElement(By.name('q')).sendKeys('webdriver')) - .then(_ => driver.findElement(By.name('btnG')).click()) - .then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000)) - .then(_ => driver.quit()); -} - -function createDriver(channel) { - let options = new Options().setBinary(channel); - return new Builder().forBrowser('firefox').setFirefoxOptions(options).build(); -} - -// NOTE: disabling the promise manager so searches all run concurrently. -// For more on the promise manager and its pending deprecation, see -// https://github.com/SeleniumHQ/selenium/issues/2969 -promise.USE_PROMISE_MANAGER = false; - -Promise.all([ - doSearch(createDriver(Channel.RELEASE)), - doSearch(createDriver(Channel.AURORA)), // Developer Edition. - doSearch(createDriver(Channel.NIGHTLY)), -]).then(_ => { - console.log('Success!'); -}, err => { - console.error('An error occured! ' + err); - setTimeout(() => {throw err}, 0); -}); diff --git a/node_modules/selenium-webdriver/example/google_search.js b/node_modules/selenium-webdriver/example/google_search.js deleted file mode 100644 index b9b821328..000000000 --- a/node_modules/selenium-webdriver/example/google_search.js +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview An example WebDriver script. - * - * Before running this script, ensure that Mozilla's geckodriver is present on - * your system PATH: - * - * Usage: - * // Default behavior - * node selenium-webdriver/example/google_search.js - * - * // Target Chrome locally; the chromedriver must be on your PATH - * SELENIUM_BROWSER=chrome node selenium-webdriver/example/google_search.js - * - * // Use a local copy of the standalone Selenium server - * SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar \ - * node selenium-webdriver/example/google_search.js - * - * // Target a remote Selenium server - * SELENIUM_REMOTE_URL=http://www.example.com:4444/wd/hub \ - * node selenium-webdriver/example/google_search.js - */ - -const {Builder, By, until} = require('..'); - -var driver = new Builder() - .forBrowser('firefox') - .build(); - -driver.get('http://www.google.com/ncr') - .then(_ => driver.findElement(By.name('q')).sendKeys('webdriver')) - .then(_ => driver.findElement(By.name('btnG')).click()) - .then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000)) - .then(_ => driver.quit()); diff --git a/node_modules/selenium-webdriver/example/google_search_generator.js b/node_modules/selenium-webdriver/example/google_search_generator.js deleted file mode 100644 index 25df93ab9..000000000 --- a/node_modules/selenium-webdriver/example/google_search_generator.js +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview An example WebDriver script using generator functions. - * - * Before running this script, ensure that Mozilla's geckodriver is present on - * your system PATH: - * - * Usage: - * - * node selenium-webdriver/example/google_search_generator.js - */ - -'use strict'; - -const {Builder, By, promise, until} = require('..'); - -promise.consume(function* () { - let driver; - try { - driver = yield new Builder().forBrowser('firefox').build(); - - yield driver.get('http://www.google.com/ncr'); - - let q = yield driver.findElement(By.name('q')); - yield q.sendKeys('webdriver'); - - let btnG = yield driver.findElement(By.name('btnG')); - yield btnG.click(); - - yield driver.wait(until.titleIs('webdriver - Google Search'), 1000); - } finally { - yield driver && driver.quit(); - } -}).then(_ => console.log('SUCCESS'), err => console.error('ERROR: ' + err)); diff --git a/node_modules/selenium-webdriver/example/google_search_test.js b/node_modules/selenium-webdriver/example/google_search_test.js deleted file mode 100644 index 0ca2f4370..000000000 --- a/node_modules/selenium-webdriver/example/google_search_test.js +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview An example test that may be run using Mocha. - * - * Usage: - * - * mocha -t 10000 selenium-webdriver/example/google_search_test.js - * - * You can change which browser is started with the SELENIUM_BROWSER environment - * variable: - * - * SELENIUM_BROWSER=chrome \ - * mocha -t 10000 selenium-webdriver/example/google_search_test.js - */ - -const {Builder, By, until} = require('..'); -const test = require('../testing'); - -test.describe('Google Search', function() { - let driver; - - test.before(function *() { - driver = yield new Builder().forBrowser('firefox').build(); - }); - - // You can write tests either using traditional promises. - it('works with promises', function() { - return driver.get('http://www.google.com/ncr') - .then(_ => driver.findElement(By.name('q')).sendKeys('webdriver')) - .then(_ => driver.findElement(By.name('btnG')).click()) - .then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000)); - }); - - // Or you can define the test as a generator function. The test will wait for - // any yielded promises to resolve before invoking the next step in the - // generator. - test.it('works with generators', function*() { - yield driver.get('http://www.google.com/ncr'); - yield driver.findElement(By.name('q')).sendKeys('webdriver'); - yield driver.findElement(By.name('btnG')).click(); - yield driver.wait(until.titleIs('webdriver - Google Search'), 1000); - }); - - test.after(() => driver.quit()); -}); diff --git a/node_modules/selenium-webdriver/example/logging.js b/node_modules/selenium-webdriver/example/logging.js deleted file mode 100644 index 633ac90c2..000000000 --- a/node_modules/selenium-webdriver/example/logging.js +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Demonstrates how to use WebDriver's logging sysem. - */ - -'use strict'; - -const {Builder, By, logging, until} = require('..'); - -logging.installConsoleHandler(); -logging.getLogger('webdriver.http').setLevel(logging.Level.ALL); - -var driver = new Builder().forBrowser('firefox').build(); - -driver.get('http://www.google.com/ncr') - .then(_ => driver.findElement(By.name('q')).sendKeys('webdriver')) - .then(_ => driver.findElement(By.name('btnG')).click()) - .then(_ => driver.wait(until.titleIs('webdriver - Google Search'), 1000)) - .then(_ => driver.quit()); diff --git a/node_modules/selenium-webdriver/example/parallel_flows.js b/node_modules/selenium-webdriver/example/parallel_flows.js deleted file mode 100644 index 59ff103fb..000000000 --- a/node_modules/selenium-webdriver/example/parallel_flows.js +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview An example of starting multiple WebDriver clients that run - * in parallel in separate control flows. - * - * This example will only work when the promise manager is enabled - * (see ). - */ - -var webdriver = require('..'), - By = webdriver.By, - until = webdriver.until; - -for (var i = 0; i < 3; i++) { - (function(n) { - var flow = new webdriver.promise.ControlFlow() - .on('uncaughtException', function(e) { - console.log('uncaughtException in flow %d: %s', n, e); - }); - - var driver = new webdriver.Builder(). - forBrowser('firefox'). - setControlFlow(flow). // Comment out this line to see the difference. - build(); - - // Position and resize window so it's easy to see them running together. - driver.manage().window().setSize(600, 400); - driver.manage().window().setPosition(300 * i, 400 * i); - - driver.get('http://www.google.com'); - driver.findElement(By.name('q')).sendKeys('webdriver'); - driver.findElement(By.name('btnG')).click(); - driver.wait(until.titleIs('webdriver - Google Search'), 1000); - - driver.quit(); - })(i); -} - diff --git a/node_modules/selenium-webdriver/firefox/binary.js b/node_modules/selenium-webdriver/firefox/binary.js deleted file mode 100644 index a1360bab7..000000000 --- a/node_modules/selenium-webdriver/firefox/binary.js +++ /dev/null @@ -1,344 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Manages Firefox binaries. This module is considered internal; - * users should use {@link ./firefox selenium-webdriver/firefox}. - */ - -'use strict'; - -const child = require('child_process'), - fs = require('fs'), - path = require('path'), - util = require('util'); - -const isDevMode = require('../lib/devmode'), - Symbols = require('../lib/symbols'), - io = require('../io'), - exec = require('../io/exec'); - - - -/** @const */ -const NO_FOCUS_LIB_X86 = isDevMode ? - path.join(__dirname, '../../../../cpp/prebuilt/i386/libnoblur.so') : - path.join(__dirname, '../lib/firefox/i386/libnoblur.so') ; - -/** @const */ -const NO_FOCUS_LIB_AMD64 = isDevMode ? - path.join(__dirname, '../../../../cpp/prebuilt/amd64/libnoblur64.so') : - path.join(__dirname, '../lib/firefox/amd64/libnoblur64.so') ; - -const X_IGNORE_NO_FOCUS_LIB = 'x_ignore_nofocus.so'; - - -/** - * @param {string} file Path to the file to find, relative to the program files - * root. - * @return {!Promise} A promise for the located executable. - * The promise will resolve to {@code null} if Firefox was not found. - */ -function findInProgramFiles(file) { - let files = [ - process.env['PROGRAMFILES'] || 'C:\\Program Files', - process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)' - ].map(prefix => path.join(prefix, file)); - return io.exists(files[0]).then(function(exists) { - return exists ? files[0] : io.exists(files[1]).then(function(exists) { - return exists ? files[1] : null; - }); - }); -} - - -/** - * Provides methods for locating the executable for a Firefox release channel - * on Windows and MacOS. For other systems (i.e. Linux), Firefox will always - * be located on the system PATH. - * - * @final - */ -class Channel { - /** - * @param {string} darwin The path to check when running on MacOS. - * @param {string} win32 The path to check when running on Windows. - */ - constructor(darwin, win32) { - /** @private @const */ this.darwin_ = darwin; - /** @private @const */ this.win32_ = win32; - /** @private {Promise} */ - this.found_ = null; - } - - /** - * Attempts to locate the Firefox executable for this release channel. This - * will first check the default installation location for the channel before - * checking the user's PATH. The returned promise will be rejected if Firefox - * can not be found. - * - * @return {!Promise} A promise for the location of the located - * Firefox executable. - */ - locate() { - if (this.found_) { - return this.found_; - } - - let found; - switch (process.platform) { - case 'darwin': - found = io.exists(this.darwin_) - .then(exists => exists ? this.darwin_ : io.findInPath('firefox')); - break; - - case 'win32': - found = findInProgramFiles(this.win32_) - .then(found => found || io.findInPath('firefox.exe')); - break; - - default: - found = Promise.resolve(io.findInPath('firefox')); - break; - } - - this.found_ = found.then(found => { - if (found) { - // TODO: verify version info. - return found; - } - throw Error('Could not locate Firefox on the current system'); - }); - return this.found_; - } -} - - -/** - * Firefox's developer channel. - * @const - * @see - */ -Channel.AURORA = new Channel( - '/Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin', - 'Firefox Developer Edition\\firefox.exe'); - -/** - * Firefox's beta channel. Note this is provided mainly for convenience as - * the beta channel has the same installation location as the main release - * channel. - * @const - * @see - */ -Channel.BETA = new Channel( - '/Applications/Firefox.app/Contents/MacOS/firefox-bin', - 'Mozilla Firefox\\firefox.exe'); - -/** - * Firefox's release channel. - * @const - * @see - */ -Channel.RELEASE = new Channel( - '/Applications/Firefox.app/Contents/MacOS/firefox-bin', - 'Mozilla Firefox\\firefox.exe'); - -/** - * Firefox's nightly release channel. - * @const - * @see - */ -Channel.NIGHTLY = new Channel( - '/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin', - 'Nightly\\firefox.exe'); - - -/** - * Copies the no focus libs into the given profile directory. - * @param {string} profileDir Path to the profile directory to install into. - * @return {!Promise} The LD_LIBRARY_PATH prefix string to use - * for the installed libs. - */ -function installNoFocusLibs(profileDir) { - var x86 = path.join(profileDir, 'x86'); - var amd64 = path.join(profileDir, 'amd64'); - - return io.mkdir(x86) - .then(() => copyLib(NO_FOCUS_LIB_X86, x86)) - .then(() => io.mkdir(amd64)) - .then(() => copyLib(NO_FOCUS_LIB_AMD64, amd64)) - .then(function() { - return x86 + ':' + amd64; - }); - - function copyLib(src, dir) { - return io.copy(src, path.join(dir, X_IGNORE_NO_FOCUS_LIB)); - } -} - - -/** - * Provides a mechanism to configure and launch Firefox in a subprocess for - * use with WebDriver. - * - * If created _without_ a path for the Firefox binary to use, this class will - * attempt to find Firefox when {@link #launch()} is called. For MacOS and - * Windows, this class will look for Firefox in the current platform's default - * installation location (e.g. /Applications/Firefox.app on MacOS). For all - * other platforms, the Firefox executable must be available on your system - * `PATH`. - * - * @final - */ -class Binary { - /** - * @param {?(string|Channel)=} opt_exeOrChannel Either the path to a specific - * Firefox binary to use, or a {@link Channel} instance that describes - * how to locate the desired Firefox version. - */ - constructor(opt_exeOrChannel) { - /** @private {?(string|Channel)} */ - this.exe_ = opt_exeOrChannel || null; - - /** @private {!Array.} */ - this.args_ = []; - - /** @private {!Object} */ - this.env_ = {}; - Object.assign(this.env_, process.env, { - MOZ_CRASHREPORTER_DISABLE: '1', - MOZ_NO_REMOTE: '1', - NO_EM_RESTART: '1' - }); - - /** @private {boolean} */ - this.devEdition_ = false; - } - - /** - * @return {(string|undefined)} The path to the Firefox executable to use, or - * `undefined` if WebDriver should attempt to locate Firefox automatically - * on the current system. - */ - getExe() { - return typeof this.exe_ === 'string' ? this.exe_ : undefined; - } - - /** - * Add arguments to the command line used to start Firefox. - * @param {...(string|!Array.)} var_args Either the arguments to add - * as varargs, or the arguments as an array. - */ - addArguments(var_args) { - for (var i = 0; i < arguments.length; i++) { - if (Array.isArray(arguments[i])) { - this.args_ = this.args_.concat(arguments[i]); - } else { - this.args_.push(arguments[i]); - } - } - } - - /** - * @return {!Array} The command line arguments to use when starting - * the browser. - */ - getArguments() { - return this.args_; - } - - /** - * Specifies whether to use Firefox Developer Edition instead of the normal - * stable channel. Setting this option has no effect if this instance was - * created with a path to a specific Firefox binary. - * - * This method has no effect on Unix systems where the Firefox application - * has the same (default) name regardless of version. - * - * @param {boolean=} opt_use Whether to use the developer edition. Defaults to - * true. - * @deprecated Use the {@link Channel} class to indicate the desired Firefox - * version when creating a new binary: `new Binary(Channel.AURORA)`. - */ - useDevEdition(opt_use) { - this.devEdition_ = opt_use === undefined || !!opt_use; - } - - /** - * Returns a promise for the Firefox executable used by this instance. The - * returned promise will be immediately resolved if the user supplied an - * executable path when this instance was created. Otherwise, an attempt will - * be made to find Firefox on the current system. - * - * @return {!Promise} a promise for the path to the Firefox executable - * used by this instance. - */ - locate() { - if (typeof this.exe_ === 'string') { - return Promise.resolve(this.exe_); - } else if (this.exe_ instanceof Channel) { - return this.exe_.locate(); - } - let channel = this.devEdition_ ? Channel.AURORA : Channel.RELEASE; - return channel.locate(); - } - - /** - * Launches Firefox and returns a promise that will be fulfilled when the - * process terminates. - * @param {string} profile Path to the profile directory to use. - * @return {!Promise} A promise for the handle to the started - * subprocess. - */ - launch(profile) { - let env = {}; - Object.assign(env, this.env_, {XRE_PROFILE_PATH: profile}); - - let args = ['-foreground'].concat(this.args_); - - return this.locate().then(function(firefox) { - if (process.platform === 'win32' || process.platform === 'darwin') { - return exec(firefox, {args: args, env: env}); - } - return installNoFocusLibs(profile).then(function(ldLibraryPath) { - env['LD_LIBRARY_PATH'] = ldLibraryPath + ':' + env['LD_LIBRARY_PATH']; - env['LD_PRELOAD'] = X_IGNORE_NO_FOCUS_LIB; - return exec(firefox, {args: args, env: env}); - }); - }); - } - - /** - * Returns a promise for the wire representation of this binary. Note: the - * FirefoxDriver only supports passing the path to the binary executable over - * the wire; all command line arguments and environment variables will be - * discarded. - * - * @return {!Promise} A promise for this binary's wire representation. - */ - [Symbols.serialize]() { - return this.locate(); - } -} - - -// PUBLIC API - - -exports.Binary = Binary; -exports.Channel = Channel; - diff --git a/node_modules/selenium-webdriver/firefox/extension.js b/node_modules/selenium-webdriver/firefox/extension.js deleted file mode 100644 index 3bda759a7..000000000 --- a/node_modules/selenium-webdriver/firefox/extension.js +++ /dev/null @@ -1,187 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** @fileoverview Utilities for working with Firefox extensions. */ - -'use strict'; - -const AdmZip = require('adm-zip'), - fs = require('fs'), - path = require('path'), - xml = require('xml2js'); - -const io = require('../io'); - - -/** - * Thrown when there an add-on is malformed. - */ -class AddonFormatError extends Error { - /** @param {string} msg The error message. */ - constructor(msg) { - super(msg); - /** @override */ - this.name = this.constructor.name; - } -} - - - -/** - * Installs an extension to the given directory. - * @param {string} extension Path to the extension to install, as either a xpi - * file or a directory. - * @param {string} dir Path to the directory to install the extension in. - * @return {!Promise} A promise for the add-on ID once - * installed. - */ -function install(extension, dir) { - return getDetails(extension).then(function(details) { - var dst = path.join(dir, details.id); - if (extension.slice(-4) === '.xpi') { - if (!details.unpack) { - return io.copy(extension, dst + '.xpi').then(() => details.id); - } else { - return Promise.resolve().then(function() { - // TODO: find an async library for inflating a zip archive. - new AdmZip(extension).extractAllTo(dst, true); - return details.id; - }); - } - } else { - return io.copyDir(extension, dst).then(() => details.id); - } - }); -} - - -/** - * Describes a Firefox add-on. - * @typedef {{id: string, name: string, version: string, unpack: boolean}} - */ -var AddonDetails; - -/** @typedef {{$: !Object}} */ -var RdfRoot; - - - -/** - * Extracts the details needed to install an add-on. - * @param {string} addonPath Path to the extension directory. - * @return {!Promise} A promise for the add-on details. - */ -function getDetails(addonPath) { - return readManifest(addonPath).then(function(doc) { - var em = getNamespaceId(doc, 'http://www.mozilla.org/2004/em-rdf#'); - var rdf = getNamespaceId( - doc, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); - - var description = doc[rdf + 'RDF'][rdf + 'Description'][0]; - var details = { - id: getNodeText(description, em + 'id'), - name: getNodeText(description, em + 'name'), - version: getNodeText(description, em + 'version'), - unpack: getNodeText(description, em + 'unpack') || false - }; - - if (typeof details.unpack === 'string') { - details.unpack = details.unpack.toLowerCase() === 'true'; - } - - if (!details.id) { - throw new AddonFormatError('Could not find add-on ID for ' + addonPath); - } - - return details; - }); - - function getNodeText(node, name) { - return node[name] && node[name][0] || ''; - } - - function getNamespaceId(doc, url) { - var keys = Object.keys(doc); - if (keys.length !== 1) { - throw new AddonFormatError('Malformed manifest for add-on ' + addonPath); - } - - var namespaces = /** @type {!RdfRoot} */(doc[keys[0]]).$; - var id = ''; - Object.keys(namespaces).some(function(ns) { - if (namespaces[ns] !== url) { - return false; - } - - if (ns.indexOf(':') != -1) { - id = ns.split(':')[1] + ':'; - } - return true; - }); - return id; - } -} - - -/** - * Reads the manifest for a Firefox add-on. - * @param {string} addonPath Path to a Firefox add-on as a xpi or an extension. - * @return {!Promise} A promise for the parsed manifest. - */ -function readManifest(addonPath) { - var manifest; - - if (addonPath.slice(-4) === '.xpi') { - manifest = new Promise((resolve, reject) => { - let zip = new AdmZip(addonPath); - - if (!zip.getEntry('install.rdf')) { - reject(new AddonFormatError( - 'Could not find install.rdf in ' + addonPath)); - return; - } - - zip.readAsTextAsync('install.rdf', resolve); - }); - } else { - manifest = io.stat(addonPath).then(function(stats) { - if (!stats.isDirectory()) { - throw Error( - 'Add-on path is neither a xpi nor a directory: ' + addonPath); - } - return io.read(path.join(addonPath, 'install.rdf')); - }); - } - - return manifest.then(function(content) { - return new Promise((resolve, reject) => { - xml.parseString(content, (err, data) => { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - }); - }); -} - - -// PUBLIC API - - -exports.install = install; diff --git a/node_modules/selenium-webdriver/firefox/index.js b/node_modules/selenium-webdriver/firefox/index.js deleted file mode 100644 index d5c88274a..000000000 --- a/node_modules/selenium-webdriver/firefox/index.js +++ /dev/null @@ -1,722 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Defines the {@linkplain Driver WebDriver} client for Firefox. - * Before using this module, you must download the latest - * [geckodriver release] and ensure it can be found on your system [PATH]. - * - * Each FirefoxDriver instance will be created with an anonymous profile, - * ensuring browser historys do not share session data (cookies, history, cache, - * offline storage, etc.) - * - * __Customizing the Firefox Profile__ - * - * The {@linkplain Profile} class may be used to configure the browser profile - * used with WebDriver, with functions to install additional - * {@linkplain Profile#addExtension extensions}, configure browser - * {@linkplain Profile#setPreference preferences}, and more. For example, you - * may wish to include Firebug: - * - * const {Builder} = require('selenium-webdriver'); - * const firefox = require('selenium-webdriver/firefox'); - * - * let profile = new firefox.Profile(); - * profile.addExtension('/path/to/firebug.xpi'); - * profile.setPreference('extensions.firebug.showChromeErrors', true); - * - * let options = new firefox.Options().setProfile(profile); - * let driver = new Builder() - * .forBrowser('firefox') - * .setFirefoxOptions(options) - * .build(); - * - * The {@linkplain Profile} class may also be used to configure WebDriver based - * on a pre-existing browser profile: - * - * let profile = new firefox.Profile( - * '/usr/local/home/bob/.mozilla/firefox/3fgog75h.testing'); - * let options = new firefox.Options().setProfile(profile); - * - * The FirefoxDriver will _never_ modify a pre-existing profile; instead it will - * create a copy for it to modify. By extension, there are certain browser - * preferences that are required for WebDriver to function properly and they - * will always be overwritten. - * - * __Using a Custom Firefox Binary__ - * - * On Windows and MacOS, the FirefoxDriver will search for Firefox in its - * default installation location: - * - * - Windows: C:\Program Files and C:\Program Files (x86). - * - MacOS: /Applications/Firefox.app - * - * For Linux, Firefox will always be located on the PATH: `$(where firefox)`. - * - * Several methods are provided for starting Firefox with a custom executable. - * First, on Windows and MacOS, you may configure WebDriver to check the default - * install location for a non-release channel. If the requested channel cannot - * be found in its default location, WebDriver will fallback to searching your - * PATH. _Note:_ on Linux, Firefox is _always_ located on your path, regardless - * of the requested channel. - * - * const {Builder} = require('selenium-webdriver'); - * const firefox = require('selenium-webdriver/firefox'); - * - * let options = new firefox.Options().setBinary(firefox.Channel.NIGHTLY); - * let driver = new Builder() - * .forBrowser('firefox') - * .setFirefoxOptions(options) - * .build(); - * - * On all platforms, you may configrue WebDriver to use a Firefox specific - * executable: - * - * let options = new firefox.Options() - * .setBinary('/my/firefox/install/dir/firefox-bin'); - * - * __Remote Testing__ - * - * You may customize the Firefox binary and profile when running against a - * remote Selenium server. Your custom profile will be packaged as a zip and - * transfered to the remote host for use. The profile will be transferred - * _once for each new session_. The performance impact should be minimal if - * you've only configured a few extra browser preferences. If you have a large - * profile with several extensions, you should consider installing it on the - * remote host and defining its path via the {@link Options} class. Custom - * binaries are never copied to remote machines and must be referenced by - * installation path. - * - * const {Builder} = require('selenium-webdriver'); - * const firefox = require('selenium-webdriver/firefox'); - * - * let options = new firefox.Options() - * .setProfile('/profile/path/on/remote/host') - * .setBinary('/install/dir/on/remote/host/firefox-bin'); - * - * let driver = new Builder() - * .forBrowser('firefox') - * .usingServer('http://127.0.0.1:4444/wd/hub') - * .setFirefoxOptions(options) - * .build(); - * - * __Testing Older Versions of Firefox__ - * - * To test versions of Firefox prior to Firefox 47, you must disable the use of - * the geckodriver using the {@link Options} class. - * - * let options = new firefox.Options().useGeckoDriver(false); - * - * Alternatively, you may disable the geckodriver at runtime by setting the - * environment variable `SELENIUM_MARIONETTE=false`. - * - * [geckodriver release]: https://github.com/mozilla/geckodriver/releases/ - * [PATH]: http://en.wikipedia.org/wiki/PATH_%28variable%29 - */ - -'use strict'; - -const url = require('url'); - -const {Binary, Channel} = require('./binary'), - Profile = require('./profile').Profile, - decodeProfile = require('./profile').decode, - http = require('../http'), - httpUtil = require('../http/util'), - io = require('../io'), - capabilities = require('../lib/capabilities'), - command = require('../lib/command'), - logging = require('../lib/logging'), - promise = require('../lib/promise'), - webdriver = require('../lib/webdriver'), - net = require('../net'), - portprober = require('../net/portprober'), - remote = require('../remote'); - - -/** - * Firefox-specific capability keys. Users should use the {@linkplain Options} - * class instead of referencing these keys directly. _These keys are considered - * implementation details and may be removed or changed at any time._ - * - * @enum {string} - */ -const Capability = { - /** - * Defines the Firefox binary to use. May be set to either a - * {@linkplain Binary} instance, or a string path to the Firefox executable. - */ - BINARY: 'firefox_binary', - - /** - * Specifies whether to use Mozilla's Marionette, or the legacy FirefoxDriver - * from the Selenium project. Defaults to false. - */ - MARIONETTE: 'marionette', - - /** - * Defines the Firefox profile to use. May be set to either a - * {@linkplain Profile} instance, or to a base-64 encoded zip of a profile - * directory. - */ - PROFILE: 'firefox_profile' -}; - - -/** - * Configuration options for the FirefoxDriver. - */ -class Options { - constructor() { - /** @private {Profile} */ - this.profile_ = null; - - /** @private {Binary} */ - this.binary_ = null; - - /** @private {logging.Preferences} */ - this.logPrefs_ = null; - - /** @private {?capabilities.ProxyConfig} */ - this.proxy_ = null; - - /** @private {boolean} */ - this.marionette_ = true; - } - - /** - * Sets the profile to use. The profile may be specified as a - * {@link Profile} object or as the path to an existing Firefox profile to use - * as a template. - * - * @param {(string|!Profile)} profile The profile to use. - * @return {!Options} A self reference. - */ - setProfile(profile) { - if (typeof profile === 'string') { - profile = new Profile(profile); - } - this.profile_ = profile; - return this; - } - - /** - * Sets the binary to use. The binary may be specified as the path to a - * Firefox executable, a specific {@link Channel}, or as a {@link Binary} - * object. - * - * @param {(string|!Binary|!Channel)} binary The binary to use. - * @return {!Options} A self reference. - * @throws {TypeError} If `binary` is an invalid type. - */ - setBinary(binary) { - if (typeof binary === 'string' || binary instanceof Channel) { - binary = new Binary(binary); - } - - if (!(binary instanceof Binary)) { - throw TypeError( - 'binary must be a string path, Channel, or Binary object'); - } - - this.binary_ = binary; - return this; - } - - /** - * Sets the logging preferences for the new session. - * @param {logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPreferences(prefs) { - this.logPrefs_ = prefs; - return this; - } - - /** - * Sets the proxy to use. - * - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy) { - this.proxy_ = proxy; - return this; - } - - /** - * Sets whether to use Mozilla's geckodriver to drive the browser. This option - * is enabled by default and required for Firefox 47+. - * - * @param {boolean} enable Whether to enable the geckodriver. - * @see https://github.com/mozilla/geckodriver - */ - useGeckoDriver(enable) { - this.marionette_ = enable; - return this; - } - - /** - * Converts these options to a {@link capabilities.Capabilities} instance. - * - * @return {!capabilities.Capabilities} A new capabilities object. - */ - toCapabilities() { - var caps = capabilities.Capabilities.firefox(); - if (this.logPrefs_) { - caps.set(capabilities.Capability.LOGGING_PREFS, this.logPrefs_); - } - if (this.proxy_) { - caps.set(capabilities.Capability.PROXY, this.proxy_); - } - if (this.binary_) { - caps.set(Capability.BINARY, this.binary_); - } - if (this.profile_) { - caps.set(Capability.PROFILE, this.profile_); - } - caps.set(Capability.MARIONETTE, this.marionette_); - return caps; - } -} - - -/** - * Enum of available command contexts. - * - * Command contexts are specific to Marionette, and may be used with the - * {@link #context=} method. Contexts allow you to direct all subsequent - * commands to either "content" (default) or "chrome". The latter gives - * you elevated security permissions. - * - * @enum {string} - */ -const Context = { - CONTENT: "content", - CHROME: "chrome", -}; - - -const GECKO_DRIVER_EXE = - process.platform === 'win32' ? 'geckodriver.exe' : 'geckodriver'; - - -/** - * @return {string} . - * @throws {Error} - */ -function findGeckoDriver() { - let exe = io.findInPath(GECKO_DRIVER_EXE, true); - if (!exe) { - throw Error( - 'The ' + GECKO_DRIVER_EXE + ' executable could not be found on the current ' + - 'PATH. Please download the latest version from ' + - 'https://github.com/mozilla/geckodriver/releases/' + - 'WebDriver and ensure it can be found on your PATH.'); - } - return exe; -} - - -/** - * @param {(Profile|string)} profile The profile to prepare. - * @param {number} port The port the FirefoxDriver should listen on. - * @return {!Promise} a promise for the path to the profile directory. - */ -function prepareProfile(profile, port) { - if (typeof profile === 'string') { - return decodeProfile(/** @type {string} */(profile)).then(dir => { - profile = new Profile(dir); - profile.setPreference('webdriver_firefox_port', port); - return profile.writeToDisk(); - }); - } - - profile = profile || new Profile; - profile.setPreference('webdriver_firefox_port', port); - return profile.writeToDisk(); -} - - -function normalizeProxyConfiguration(config) { - if ('manual' === config.proxyType) { - if (config.ftpProxy && !config.ftpProxyPort) { - let hostAndPort = net.splitHostAndPort(config.ftpProxy); - config.ftpProxy = hostAndPort.host; - config.ftpProxyPort = hostAndPort.port; - } - - if (config.httpProxy && !config.httpProxyPort) { - let hostAndPort = net.splitHostAndPort(config.httpProxy); - config.httpProxy = hostAndPort.host; - config.httpProxyPort = hostAndPort.port; - } - - if (config.sslProxy && !config.sslProxyPort) { - let hostAndPort = net.splitHostAndPort(config.sslProxy); - config.sslProxy = hostAndPort.host; - config.sslProxyPort = hostAndPort.port; - } - - if (config.socksProxy && !config.socksProxyPort) { - let hostAndPort = net.splitHostAndPort(config.socksProxy); - config.socksProxy = hostAndPort.host; - config.socksProxyPort = hostAndPort.port; - } - } else if ('pac' === config.proxyType) { - if (config.proxyAutoconfigUrl && !config.pacUrl) { - config.pacUrl = config.proxyAutoconfigUrl; - } - } - return config; -} - - -/** @enum {string} */ -const ExtensionCommand = { - GET_CONTEXT: 'getContext', - SET_CONTEXT: 'setContext', -}; - - -/** - * Creates a command executor with support for Marionette's custom commands. - * @param {!Promise} serverUrl The server's URL. - * @return {!command.Executor} The new command executor. - */ -function createExecutor(serverUrl) { - let client = serverUrl.then(url => new http.HttpClient(url)); - let executor = new http.Executor(client); - configureExecutor(executor); - return executor; -} - - -/** - * Configures the given executor with Firefox-specific commands. - * @param {!http.Executor} executor the executor to configure. - */ -function configureExecutor(executor) { - executor.defineCommand( - ExtensionCommand.GET_CONTEXT, - 'GET', - '/session/:sessionId/moz/context'); - - executor.defineCommand( - ExtensionCommand.SET_CONTEXT, - 'POST', - '/session/:sessionId/moz/context'); -} - - -/** - * Creates {@link selenium-webdriver/remote.DriverService} instances that manage - * a [geckodriver](https://github.com/mozilla/geckodriver) server in a child - * process. - */ -class ServiceBuilder extends remote.DriverService.Builder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the geckodriver on the system PATH. - */ - constructor(opt_exe) { - super(opt_exe || findGeckoDriver()); - this.setLoopback(true); // Required. - } - - /** - * Enables verbose logging. - * - * @param {boolean=} opt_trace Whether to enable trace-level logging. By - * default, only debug logging is enabled. - * @return {!ServiceBuilder} A self reference. - */ - enableVerboseLogging(opt_trace) { - return this.addArguments(opt_trace ? '-vv' : '-v'); - } - - /** - * Sets the path to the executable Firefox binary that the geckodriver should - * use. If this method is not called, this builder will attempt to locate - * Firefox in the default installation location for the current platform. - * - * @param {(string|!Binary)} binary Path to the executable Firefox binary to use. - * @return {!ServiceBuilder} A self reference. - * @see Binary#locate() - */ - setFirefoxBinary(binary) { - let exe = typeof binary === 'string' - ? Promise.resolve(binary) : binary.locate(); - return this.addArguments('-b', exe); - } -} - - -/** - * @typedef {{executor: !command.Executor, - * capabilities: (!capabilities.Capabilities| - * {desired: (capabilities.Capabilities|undefined), - * required: (capabilities.Capabilities|undefined)}), - * onQuit: function(this: void): ?}} - */ -var DriverSpec; - - -/** - * @param {(http.Executor|remote.DriverService|undefined)} executor - * @param {!capabilities.Capabilities} caps - * @param {Profile} profile - * @param {Binary} binary - * @return {DriverSpec} - */ -function createGeckoDriver(executor, caps, profile, binary) { - let firefoxOptions = {}; - caps.set('moz:firefoxOptions', firefoxOptions); - - if (binary) { - if (binary.getExe()) { - firefoxOptions['binary'] = binary.getExe(); - } - - let args = binary.getArguments(); - if (args.length) { - firefoxOptions['args'] = args; - } - } - - if (profile) { - // If the user specified a template directory or any extensions to install, - // we need to encode the profile as a base64 string (which requires writing - // it to disk first). Otherwise, if the user just specified some custom - // preferences, we can send those directly. - if (profile.getTemplateDir() || profile.getExtensions().length) { - firefoxOptions['profile'] = profile.encode(); - - } else { - let prefs = profile.getPreferences(); - if (Object.keys(prefs).length) { - firefoxOptions['prefs'] = prefs; - } - } - } - - let sessionCaps = caps; - if (caps.has(capabilities.Capability.PROXY)) { - let proxy = normalizeProxyConfiguration( - caps.get(capabilities.Capability.PROXY)); - - // Marionette requires proxy settings to be specified as required - // capabilities. See mozilla/geckodriver#97 - let required = new capabilities.Capabilities() - .set(capabilities.Capability.PROXY, proxy); - - caps.delete(capabilities.Capability.PROXY); - sessionCaps = {required, desired: caps}; - } - - /** @type {!command.Executor} */ - let cmdExecutor; - let onQuit = function() {}; - - if (executor instanceof http.Executor) { - configureExecutor(executor); - cmdExecutor = executor; - } else if (executor instanceof remote.DriverService) { - cmdExecutor = createExecutor(executor.start()); - onQuit = () => executor.kill(); - } else { - let builder = new ServiceBuilder(); - if (binary) { - builder.setFirefoxBinary(binary); - } - let service = builder.build(); - cmdExecutor = createExecutor(service.start()); - onQuit = () => service.kill(); - } - - return { - executor: cmdExecutor, - capabilities: sessionCaps, - onQuit - }; -} - - -/** - * @param {!capabilities.Capabilities} caps - * @param {Profile} profile - * @param {!Binary} binary - * @return {DriverSpec} - */ -function createLegacyDriver(caps, profile, binary, flow) { - profile = profile || new Profile; - - let freePort = portprober.findFreePort(); - let preparedProfile = - freePort.then(port => prepareProfile(profile, port)); - let command = preparedProfile.then(dir => binary.launch(dir)); - - let serverUrl = command.then(() => freePort) - .then(function(/** number */port) { - let serverUrl = url.format({ - protocol: 'http', - hostname: net.getLoopbackAddress(), - port: port + '', - pathname: '/hub' - }); - let ready = httpUtil.waitForServer(serverUrl, 45 * 1000); - return ready.then(() => serverUrl); - }); - - return { - executor: createExecutor(serverUrl), - capabilities: caps, - onQuit: function() { - return command.then(command => { - command.kill(); - return preparedProfile.then(io.rmDir) - .then(() => command.result(), - () => command.result()); - }); - } - }; -} - - -/** - * A WebDriver client for Firefox. - */ -class Driver extends webdriver.WebDriver { - /** - * Creates a new Firefox session. - * - * @param {(Options|capabilities.Capabilities|Object)=} opt_config The - * configuration options for this driver, specified as either an - * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash - * object. - * @param {(http.Executor|remote.DriverService)=} opt_executor Either a - * pre-configured command executor to use for communicating with an - * externally managed remote end (which is assumed to already be running), - * or the `DriverService` to use to start the geckodriver in a child - * process. - * - * If an executor is provided, care should e taken not to use reuse it with - * other clients as its internal command mappings will be updated to support - * Firefox-specific commands. - * - * _This parameter may only be used with Mozilla's GeckoDriver._ - * - * @param {promise.ControlFlow=} opt_flow The flow to - * schedule commands through. Defaults to the active flow object. - * @throws {Error} If a custom command executor is provided and the driver is - * configured to use the legacy FirefoxDriver from the Selenium project. - * @return {!Driver} A new driver instance. - */ - static createSession(opt_config, opt_executor, opt_flow) { - let caps; - if (opt_config instanceof Options) { - caps = opt_config.toCapabilities(); - } else { - caps = new capabilities.Capabilities(opt_config); - } - - let binary = caps.get(Capability.BINARY) || new Binary(); - caps.delete(Capability.BINARY); - if (typeof binary === 'string') { - binary = new Binary(binary); - } - - let profile; - if (caps.has(Capability.PROFILE)) { - profile = caps.get(Capability.PROFILE); - caps.delete(Capability.PROFILE); - } - - // Users must now explicitly disable marionette to use the legacy - // FirefoxDriver. - let noMarionette = - caps.get(Capability.MARIONETTE) === false - || /^0|false$/i.test(process.env['SELENIUM_MARIONETTE']); - let useMarionette = !noMarionette; - - let spec; - if (useMarionette) { - spec = createGeckoDriver(opt_executor, caps, profile, binary); - } else { - if (opt_executor) { - throw Error('You may not use a custom command executor with the legacy' - + ' FirefoxDriver'); - } - spec = createLegacyDriver(caps, profile, binary, opt_flow); - } - - return /** @type {!Driver} */(webdriver.WebDriver.createSession( - spec.executor, spec.capabilities, opt_flow, this, spec.onQuit)); - } - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector() { - } - - /** - * Get the context that is currently in effect. - * - * @return {!promise.Thenable} Current context. - */ - getContext() { - return this.schedule( - new command.Command(ExtensionCommand.GET_CONTEXT), - 'get WebDriver.context'); - } - - /** - * Changes target context for commands between chrome- and content. - * - * Changing the current context has a stateful impact on all subsequent - * commands. The {@link Context.CONTENT} context has normal web - * platform document permissions, as if you would evaluate arbitrary - * JavaScript. The {@link Context.CHROME} context gets elevated - * permissions that lets you manipulate the browser chrome itself, - * with full access to the XUL toolkit. - * - * Use your powers wisely. - * - * @param {!promise.Thenable} ctx The context to switch to. - */ - setContext(ctx) { - return this.schedule( - new command.Command(ExtensionCommand.SET_CONTEXT) - .setParameter("context", ctx), - 'set WebDriver.context'); - } -} - - -// PUBLIC API - - -exports.Binary = Binary; -exports.Channel = Channel; -exports.Context = Context; -exports.Driver = Driver; -exports.Options = Options; -exports.Profile = Profile; -exports.ServiceBuilder = ServiceBuilder; diff --git a/node_modules/selenium-webdriver/firefox/profile.js b/node_modules/selenium-webdriver/firefox/profile.js deleted file mode 100644 index b7f6363f9..000000000 --- a/node_modules/selenium-webdriver/firefox/profile.js +++ /dev/null @@ -1,430 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Profile management module. This module is considered internal; - * users should use {@link selenium-webdriver/firefox}. - */ - -'use strict'; - -const AdmZip = require('adm-zip'), - fs = require('fs'), - path = require('path'), - vm = require('vm'); - -const isDevMode = require('../lib/devmode'), - Symbols = require('../lib/symbols'), - io = require('../io'), - extension = require('./extension'); - - -/** @const */ -const WEBDRIVER_PREFERENCES_PATH = isDevMode - ? path.join(__dirname, '../../../firefox-driver/webdriver.json') - : path.join(__dirname, '../lib/firefox/webdriver.json'); - -/** @const */ -const WEBDRIVER_EXTENSION_PATH = isDevMode - ? path.join(__dirname, - '../../../../build/javascript/firefox-driver/webdriver.xpi') - : path.join(__dirname, '../lib/firefox/webdriver.xpi'); - -/** @const */ -const WEBDRIVER_EXTENSION_NAME = 'fxdriver@googlecode.com'; - - - -/** @type {Object} */ -var defaultPreferences = null; - -/** - * Synchronously loads the default preferences used for the FirefoxDriver. - * @return {!Object} The default preferences JSON object. - */ -function getDefaultPreferences() { - if (!defaultPreferences) { - var contents = /** @type {string} */( - fs.readFileSync(WEBDRIVER_PREFERENCES_PATH, 'utf8')); - defaultPreferences = /** @type {!Object} */(JSON.parse(contents)); - } - return defaultPreferences; -} - - -/** - * Parses a user.js file in a Firefox profile directory. - * @param {string} f Path to the file to parse. - * @return {!Promise} A promise for the parsed preferences as - * a JSON object. If the file does not exist, an empty object will be - * returned. - */ -function loadUserPrefs(f) { - return io.read(f).then( - function onSuccess(contents) { - var prefs = {}; - var context = vm.createContext({ - 'user_pref': function(key, value) { - prefs[key] = value; - } - }); - vm.runInContext(contents.toString(), context, f); - return prefs; - }, - function onError(err) { - if (err && err.code === 'ENOENT') { - return {}; - } - throw err; - }); -} - - - -/** - * @param {!Object} prefs The default preferences to write. Will be - * overridden by user.js preferences in the template directory and the - * frozen preferences required by WebDriver. - * @param {string} dir Path to the directory write the file to. - * @return {!Promise} A promise for the profile directory, - * to be fulfilled when user preferences have been written. - */ -function writeUserPrefs(prefs, dir) { - var userPrefs = path.join(dir, 'user.js'); - return loadUserPrefs(userPrefs).then(function(overrides) { - Object.assign(prefs, overrides); - Object.assign(prefs, getDefaultPreferences()['frozen']); - - var contents = Object.keys(prefs).map(function(key) { - return 'user_pref(' + JSON.stringify(key) + ', ' + - JSON.stringify(prefs[key]) + ');'; - }).join('\n'); - - return new Promise((resolve, reject) => { - fs.writeFile(userPrefs, contents, function(err) { - err && reject(err) || resolve(dir); - }); - }); - }); -}; - - -/** - * Installs a group of extensions in the given profile directory. If the - * WebDriver extension is not included in this set, the default version - * bundled with this package will be installed. - * @param {!Array.} extensions The extensions to install, as a - * path to an unpacked extension directory or a path to a xpi file. - * @param {string} dir The profile directory to install to. - * @param {boolean=} opt_excludeWebDriverExt Whether to skip installation of - * the default WebDriver extension. - * @return {!Promise} A promise for the main profile directory - * once all extensions have been installed. - */ -function installExtensions(extensions, dir, opt_excludeWebDriverExt) { - var hasWebDriver = !!opt_excludeWebDriverExt; - var next = 0; - var extensionDir = path.join(dir, 'extensions'); - - return new Promise(function(fulfill, reject) { - io.mkdir(extensionDir).then(installNext, reject); - - function installNext() { - if (next >= extensions.length) { - if (hasWebDriver) { - fulfill(dir); - } else { - install(WEBDRIVER_EXTENSION_PATH); - } - } else { - install(extensions[next++]); - } - } - - function install(ext) { - extension.install(ext, extensionDir).then(function(id) { - hasWebDriver = hasWebDriver || (id === WEBDRIVER_EXTENSION_NAME); - installNext(); - }, reject); - } - }); -} - - -/** - * Decodes a base64 encoded profile. - * @param {string} data The base64 encoded string. - * @return {!Promise} A promise for the path to the decoded profile - * directory. - */ -function decode(data) { - return io.tmpFile().then(function(file) { - var buf = new Buffer(data, 'base64'); - return io.write(file, buf) - .then(io.tmpDir) - .then(function(dir) { - var zip = new AdmZip(file); - zip.extractAllTo(dir); // Sync only? Why?? :-( - return dir; - }); - }); -} - - - -/** - * Models a Firefox profile directory for use with the FirefoxDriver. The - * {@code Profile} directory uses an in-memory model until - * {@link #writeToDisk} or {@link #encode} is called. - */ -class Profile { - /** - * @param {string=} opt_dir Path to an existing Firefox profile directory to - * use a template for this profile. If not specified, a blank profile will - * be used. - */ - constructor(opt_dir) { - /** @private {!Object} */ - this.preferences_ = {}; - - /** @private {boolean} */ - this.nativeEventsEnabled_ = true; - - /** @private {(string|undefined)} */ - this.template_ = opt_dir; - - /** @private {number} */ - this.port_ = 0; - - /** @private {!Array} */ - this.extensions_ = []; - } - - /** - * @return {(string|undefined)} Path to an existing Firefox profile directory - * to use as a template when writing this Profile to disk. - */ - getTemplateDir() { - return this.template_; - } - - /** - * Registers an extension to be included with this profile. - * @param {string} extension Path to the extension to include, as either an - * unpacked extension directory or the path to a xpi file. - */ - addExtension(extension) { - this.extensions_.push(extension); - } - - /** - * @return {!Array} A list of extensions to install in this profile. - */ - getExtensions() { - return this.extensions_; - } - - /** - * Sets a desired preference for this profile. - * @param {string} key The preference key. - * @param {(string|number|boolean)} value The preference value. - * @throws {Error} If attempting to set a frozen preference. - */ - setPreference(key, value) { - var frozen = getDefaultPreferences()['frozen']; - if (frozen.hasOwnProperty(key) && frozen[key] !== value) { - throw Error('You may not set ' + key + '=' + JSON.stringify(value) - + '; value is frozen for proper WebDriver functionality (' - + key + '=' + JSON.stringify(frozen[key]) + ')'); - } - this.preferences_[key] = value; - } - - /** - * Returns the currently configured value of a profile preference. This does - * not include any defaults defined in the profile's template directory user.js - * file (if a template were specified on construction). - * @param {string} key The desired preference. - * @return {(string|number|boolean|undefined)} The current value of the - * requested preference. - */ - getPreference(key) { - return this.preferences_[key]; - } - - /** - * @return {!Object} A copy of all currently configured preferences. - */ - getPreferences() { - return Object.assign({}, this.preferences_); - } - - /** - * Specifies which host the driver should listen for commands on. If not - * specified, the driver will default to "localhost". This option should be - * specified when "localhost" is not mapped to the loopback address - * (127.0.0.1) in `/etc/hosts`. - * - * @param {string} host the host the driver should listen for commands on - */ - setHost(host) { - this.preferences_['webdriver_firefox_allowed_hosts'] = host; - } - - /** - * @return {number} The port this profile is currently configured to use, or - * 0 if the port will be selected at random when the profile is written - * to disk. - */ - getPort() { - return this.port_; - } - - /** - * Sets the port to use for the WebDriver extension loaded by this profile. - * @param {number} port The desired port, or 0 to use any free port. - */ - setPort(port) { - this.port_ = port; - } - - /** - * @return {boolean} Whether the FirefoxDriver is configured to automatically - * accept untrusted SSL certificates. - */ - acceptUntrustedCerts() { - return !!this.preferences_['webdriver_accept_untrusted_certs']; - } - - /** - * Sets whether the FirefoxDriver should automatically accept untrusted SSL - * certificates. - * @param {boolean} value . - */ - setAcceptUntrustedCerts(value) { - this.preferences_['webdriver_accept_untrusted_certs'] = !!value; - } - - /** - * Sets whether to assume untrusted certificates come from untrusted issuers. - * @param {boolean} value . - */ - setAssumeUntrustedCertIssuer(value) { - this.preferences_['webdriver_assume_untrusted_issuer'] = !!value; - } - - /** - * @return {boolean} Whether to assume untrusted certs come from untrusted - * issuers. - */ - assumeUntrustedCertIssuer() { - return !!this.preferences_['webdriver_assume_untrusted_issuer']; - } - - /** - * Sets whether to use native events with this profile. - * @param {boolean} enabled . - */ - setNativeEventsEnabled(enabled) { - this.nativeEventsEnabled_ = enabled; - } - - /** - * Returns whether native events are enabled in this profile. - * @return {boolean} . - */ - nativeEventsEnabled() { - return this.nativeEventsEnabled_; - } - - /** - * Writes this profile to disk. - * @param {boolean=} opt_excludeWebDriverExt Whether to exclude the WebDriver - * extension from the generated profile. Used to reduce the size of an - * {@link #encode() encoded profile} since the server will always install - * the extension itself. - * @return {!Promise} A promise for the path to the new profile - * directory. - */ - writeToDisk(opt_excludeWebDriverExt) { - var profileDir = io.tmpDir(); - if (this.template_) { - profileDir = profileDir.then(function(dir) { - return io.copyDir( - /** @type {string} */(this.template_), - dir, /(parent\.lock|lock|\.parentlock)/); - }.bind(this)); - } - - // Freeze preferences for async operations. - var prefs = {}; - Object.assign(prefs, getDefaultPreferences()['mutable']); - Object.assign(prefs, getDefaultPreferences()['frozen']); - Object.assign(prefs, this.preferences_); - - // Freeze extensions for async operations. - var extensions = this.extensions_.concat(); - - return profileDir.then(function(dir) { - return writeUserPrefs(prefs, dir); - }).then(function(dir) { - return installExtensions(extensions, dir, !!opt_excludeWebDriverExt); - }); - } - - /** - * Write profile to disk, compress its containing directory, and return - * it as a Base64 encoded string. - * - * @return {!Promise} A promise for the encoded profile as - * Base64 string. - * - */ - encode() { - return this.writeToDisk(true).then(function(dir) { - var zip = new AdmZip(); - zip.addLocalFolder(dir, ''); - // Stored compression, see https://en.wikipedia.org/wiki/Zip_(file_format) - zip.getEntries().forEach(function(entry) { - entry.header.method = 0; - }); - - return io.tmpFile().then(function(file) { - zip.writeZip(file); // Sync! Why oh why :-( - return io.read(file); - }); - }).then(function(data) { - return data.toString('base64'); - }); - } - - /** - * Encodes this profile as a zipped, base64 encoded directory. - * @return {!Promise} A promise for the encoded profile. - */ - [Symbols.serialize]() { - return this.encode(); - } -} - - -// PUBLIC API - - -exports.Profile = Profile; -exports.decode = decode; -exports.loadUserPrefs = loadUserPrefs; diff --git a/node_modules/selenium-webdriver/http/index.js b/node_modules/selenium-webdriver/http/index.js deleted file mode 100644 index fa98557a0..000000000 --- a/node_modules/selenium-webdriver/http/index.js +++ /dev/null @@ -1,255 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Defines an {@linkplain cmd.Executor command executor} that - * communicates with a remote end using HTTP + JSON. - */ - -'use strict'; - -const http = require('http'); -const https = require('https'); -const url = require('url'); - -const httpLib = require('../lib/http'); - - -/** - * @typedef {{protocol: (?string|undefined), - * auth: (?string|undefined), - * hostname: (?string|undefined), - * host: (?string|undefined), - * port: (?string|undefined), - * path: (?string|undefined), - * pathname: (?string|undefined)}} - */ -var RequestOptions; - - -/** - * @param {string} aUrl The request URL to parse. - * @return {RequestOptions} The request options. - * @throws {Error} if the URL does not include a hostname. - */ -function getRequestOptions(aUrl) { - let options = url.parse(aUrl); - if (!options.hostname) { - throw new Error('Invalid URL: ' + aUrl); - } - // Delete the search and has portions as they are not used. - options.search = null; - options.hash = null; - options.path = options.pathname; - return options; -} - - -/** - * A basic HTTP client used to send messages to a remote end. - * - * @implements {httpLib.Client} - */ -class HttpClient { - /** - * @param {string} serverUrl URL for the WebDriver server to send commands to. - * @param {http.Agent=} opt_agent The agent to use for each request. - * Defaults to `http.globalAgent`. - * @param {?string=} opt_proxy The proxy to use for the connection to the - * server. Default is to use no proxy. - */ - constructor(serverUrl, opt_agent, opt_proxy) { - /** @private {http.Agent} */ - this.agent_ = opt_agent || null; - - /** - * Base options for each request. - * @private {RequestOptions} - */ - this.options_ = getRequestOptions(serverUrl); - - /** - * @private {?RequestOptions} - */ - this.proxyOptions_ = opt_proxy ? getRequestOptions(opt_proxy) : null; - } - - /** @override */ - send(httpRequest) { - let data; - - let headers = {}; - httpRequest.headers.forEach(function(value, name) { - headers[name] = value; - }); - - headers['Content-Length'] = 0; - if (httpRequest.method == 'POST' || httpRequest.method == 'PUT') { - data = JSON.stringify(httpRequest.data); - headers['Content-Length'] = Buffer.byteLength(data, 'utf8'); - headers['Content-Type'] = 'application/json;charset=UTF-8'; - } - - let path = this.options_.path; - if (path.endsWith('/') && httpRequest.path.startsWith('/')) { - path += httpRequest.path.substring(1); - } else { - path += httpRequest.path; - } - let parsedPath = url.parse(path); - - let options = { - agent: this.agent_ || null, - method: httpRequest.method, - - auth: this.options_.auth, - hostname: this.options_.hostname, - port: this.options_.port, - protocol: this.options_.protocol, - - path: parsedPath.path, - pathname: parsedPath.pathname, - search: parsedPath.search, - hash: parsedPath.hash, - - headers, - }; - - return new Promise((fulfill, reject) => { - sendRequest(options, fulfill, reject, data, this.proxyOptions_); - }); - } -} - - -/** - * Sends a single HTTP request. - * @param {!Object} options The request options. - * @param {function(!httpLib.Response)} onOk The function to call if the - * request succeeds. - * @param {function(!Error)} onError The function to call if the request fails. - * @param {?string=} opt_data The data to send with the request. - * @param {?RequestOptions=} opt_proxy The proxy server to use for the request. - */ -function sendRequest(options, onOk, onError, opt_data, opt_proxy) { - var hostname = options.hostname; - var port = options.port; - - if (opt_proxy) { - let proxy = /** @type {RequestOptions} */(opt_proxy); - - // RFC 2616, section 5.1.2: - // The absoluteURI form is REQUIRED when the request is being made to a - // proxy. - let absoluteUri = url.format(options); - - // RFC 2616, section 14.23: - // An HTTP/1.1 proxy MUST ensure that any request message it forwards does - // contain an appropriate Host header field that identifies the service - // being requested by the proxy. - let targetHost = options.hostname - if (options.port) { - targetHost += ':' + options.port; - } - - // Update the request options with our proxy info. - options.headers['Host'] = targetHost; - options.path = absoluteUri; - options.host = proxy.host; - options.hostname = proxy.hostname; - options.port = proxy.port; - - if (proxy.auth) { - options.headers['Proxy-Authorization'] = - 'Basic ' + new Buffer(proxy.auth).toString('base64'); - } - } - - let requestFn = options.protocol === 'https:' ? https.request : http.request; - var request = requestFn(options, function onResponse(response) { - if (response.statusCode == 302 || response.statusCode == 303) { - try { - var location = url.parse(response.headers['location']); - } catch (ex) { - onError(Error( - 'Failed to parse "Location" header for server redirect: ' + - ex.message + '\nResponse was: \n' + - new httpLib.Response(response.statusCode, response.headers, ''))); - return; - } - - if (!location.hostname) { - location.hostname = hostname; - location.port = port; - } - - request.abort(); - sendRequest({ - method: 'GET', - protocol: location.protocol || options.protocol, - hostname: location.hostname, - port: location.port, - path: location.path, - pathname: location.pathname, - search: location.search, - hash: location.hash, - headers: { - 'Accept': 'application/json; charset=utf-8' - } - }, onOk, onError, undefined, opt_proxy); - return; - } - - var body = []; - response.on('data', body.push.bind(body)); - response.on('end', function() { - var resp = new httpLib.Response( - /** @type {number} */(response.statusCode), - /** @type {!Object} */(response.headers), - body.join('').replace(/\0/g, '')); - onOk(resp); - }); - }); - - request.on('error', function(e) { - if (e.code === 'ECONNRESET') { - setTimeout(function() { - sendRequest(options, onOk, onError, opt_data, opt_proxy); - }, 15); - } else { - var message = e.message; - if (e.code) { - message = e.code + ' ' + message; - } - onError(new Error(message)); - } - }); - - if (opt_data) { - request.write(opt_data); - } - - request.end(); -} - - -// PUBLIC API - -exports.Executor = httpLib.Executor; -exports.HttpClient = HttpClient; -exports.Request = httpLib.Request; -exports.Response = httpLib.Response; diff --git a/node_modules/selenium-webdriver/http/util.js b/node_modules/selenium-webdriver/http/util.js deleted file mode 100644 index 8662bed28..000000000 --- a/node_modules/selenium-webdriver/http/util.js +++ /dev/null @@ -1,175 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Various HTTP utilities. - */ - -'use strict'; - -const Executor = require('./index').Executor, - HttpClient = require('./index').HttpClient, - HttpRequest = require('./index').Request, - Command = require('../lib/command').Command, - CommandName = require('../lib/command').Name, - error = require('../lib/error'), - promise = require('../lib/promise'); - - - -/** - * Queries a WebDriver server for its current status. - * @param {string} url Base URL of the server to query. - * @return {!Promise} A promise that resolves with - * a hash of the server status. - */ -function getStatus(url) { - var client = new HttpClient(url); - var executor = new Executor(client); - var command = new Command(CommandName.GET_SERVER_STATUS); - return executor.execute(command); -} - - -// PUBLIC API - - -/** - * Queries a WebDriver server for its current status. - * @param {string} url Base URL of the server to query. - * @return {!Promise} A promise that resolves with - * a hash of the server status. - */ -exports.getStatus = getStatus; - - -/** - * Waits for a WebDriver server to be healthy and accepting requests. - * @param {string} url Base URL of the server to query. - * @param {number} timeout How long to wait for the server. - * @param {Promise=} opt_cancelToken A promise used as a cancellation signal: - * if resolved before the server is ready, the wait will be terminated - * early with a {@link promise.CancellationError}. - * @return {!Promise} A promise that will resolve when the server is ready, or - * if the wait is cancelled. - */ -exports.waitForServer = function(url, timeout, opt_cancelToken) { - return new Promise((onResolve, onReject) => { - let start = Date.now(); - - let done = false; - let resolve = (status) => { - done = true; - onResolve(status); - }; - let reject = (err) => { - done = true; - onReject(err); - }; - - if (opt_cancelToken) { - opt_cancelToken.then(_ => reject(new promise.CancellationError)); - } - - checkServerStatus(); - function checkServerStatus() { - return getStatus(url).then(status => resolve(status), onError); - } - - function onError(e) { - // Some servers don't support the status command. If they are able to - // response with an error, then can consider the server ready. - if (e instanceof error.UnsupportedOperationError) { - resolve({}); - return; - } - - if (Date.now() - start > timeout) { - reject(Error('Timed out waiting for the WebDriver server at ' + url)); - } else { - setTimeout(function() { - if (!done) { - checkServerStatus(); - } - }, 50); - } - } - }); -}; - - -/** - * Polls a URL with GET requests until it returns a 2xx response or the - * timeout expires. - * @param {string} url The URL to poll. - * @param {number} timeout How long to wait, in milliseconds. - * @param {Promise=} opt_cancelToken A promise used as a cancellation signal: - * if resolved before the a 2xx response is received, the wait will be - * terminated early with a {@link promise.CancellationError}. - * @return {!Promise} A promise that will resolve when a 2xx is received from - * the given URL, or if the wait is cancelled. - */ -exports.waitForUrl = function(url, timeout, opt_cancelToken) { - return new Promise((onResolve, onReject) => { - let client = new HttpClient(url); - let request = new HttpRequest('GET', ''); - let start = Date.now(); - - let done = false; - let resolve = () => { - done = true; - onResolve(); - }; - let reject = (err) => { - done = true; - onReject(err); - }; - - if (opt_cancelToken) { - opt_cancelToken.then(_ => reject(new promise.CancellationError)); - } - - testUrl(); - - function testUrl() { - client.send(request).then(onResponse, onError); - } - - function onError() { - if (Date.now() - start > timeout) { - reject(Error('Timed out waiting for the URL to return 2xx: ' + url)); - } else { - setTimeout(function() { - if (!done) { - testUrl(); - } - }, 50); - } - } - - function onResponse(response) { - if (done) { - return; - } - if (response.status > 199 && response.status < 300) { - resolve(); - return; - } - onError(); - } - }); -}; diff --git a/node_modules/selenium-webdriver/ie.js b/node_modules/selenium-webdriver/ie.js deleted file mode 100644 index 5b86fa58e..000000000 --- a/node_modules/selenium-webdriver/ie.js +++ /dev/null @@ -1,441 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview Defines a {@linkplain Driver WebDriver} client for Microsoft's - * Internet Explorer. Before using the IEDriver, you must download the latest - * [IEDriverServer](http://selenium-release.storage.googleapis.com/index.html) - * and place it on your - * [PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29). You must also apply - * the system configuration outlined on the Selenium project - * [wiki](https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver) - */ - -'use strict'; - -const fs = require('fs'), - util = require('util'); - -const http = require('./http'), - io = require('./io'), - capabilities = require('./lib/capabilities'), - promise = require('./lib/promise'), - webdriver = require('./lib/webdriver'), - portprober = require('./net/portprober'), - remote = require('./remote'); - - -const IEDRIVER_EXE = 'IEDriverServer.exe'; - - - -/** - * IEDriverServer logging levels. - * @enum {string} - */ -const Level = { - FATAL: 'FATAL', - ERROR: 'ERROR', - WARN: 'WARN', - INFO: 'INFO', - DEBUG: 'DEBUG', - TRACE: 'TRACE' -}; - - - -/** - * Option keys: - * https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#ie-specific - * @enum {string} - */ -const Key = { - IGNORE_PROTECTED_MODE_SETTINGS: 'ignoreProtectedModeSettings', - IGNORE_ZOOM_SETTING: 'ignoreZoomSetting', - INITIAL_BROWSER_URL: 'initialBrowserUrl', - ENABLE_PERSISTENT_HOVER: 'enablePersistentHover', - ENABLE_ELEMENT_CACHE_CLEANUP: 'enableElementCacheCleanup', - REQUIRE_WINDOW_FOCUS: 'requireWindowFocus', - BROWSER_ATTACH_TIMEOUT: 'browserAttachTimeout', - FORCE_CREATE_PROCESS: 'ie.forceCreateProcessApi', - BROWSER_COMMAND_LINE_SWITCHES: 'ie.browserCommandLineSwitches', - USE_PER_PROCESS_PROXY: 'ie.usePerProcessProxy', - ENSURE_CLEAN_SESSION: 'ie.ensureCleanSession', - LOG_FILE: 'logFile', - LOG_LEVEL: 'logLevel', - HOST: 'host', - EXTRACT_PATH: 'extractPath', - SILENT: 'silent' -}; - - -/** - * Class for managing IEDriver specific options. - */ -class Options { - constructor() { - /** @private {!Object<(boolean|number|string|!Array)>} */ - this.options_ = {}; - - /** @private {(capabilities.ProxyConfig|null)} */ - this.proxy_ = null; - } - - /** - * Extracts the IEDriver specific options from the given capabilities - * object. - * @param {!capabilities.Capabilities} caps The capabilities object. - * @return {!Options} The IEDriver options. - */ - static fromCapabilities(caps) { - var options = new Options(); - var map = options.options_; - - Object.keys(Key).forEach(function(key) { - key = Key[key]; - if (caps.has(key)) { - map[key] = caps.get(key); - } - }); - - if (caps.has(capabilities.Capability.PROXY)) { - options.setProxy(caps.get(capabilities.Capability.PROXY)); - } - - return options; - } - - /** - * Whether to disable the protected mode settings check when the session is - * created. Disbling this setting may lead to significant instability as the - * browser may become unresponsive/hang. Only "best effort" support is provided - * when using this capability. - * - * For more information, refer to the IEDriver's - * [required system configuration](http://goo.gl/eH0Yi3). - * - * @param {boolean} ignoreSettings Whether to ignore protected mode settings. - * @return {!Options} A self reference. - */ - introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings) { - this.options_[Key.IGNORE_PROTECTED_MODE_SETTINGS] = !!ignoreSettings; - return this; - } - - /** - * Indicates whether to skip the check that the browser's zoom level is set to - * 100%. - * - * @param {boolean} ignore Whether to ignore the browser's zoom level settings. - * @return {!Options} A self reference. - */ - ignoreZoomSetting(ignore) { - this.options_[Key.IGNORE_ZOOM_SETTING] = !!ignore; - return this; - } - - /** - * Sets the initial URL loaded when IE starts. This is intended to be used with - * {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in - * the proper Protected Mode zone. Setting this option may cause browser - * instability or flaky and unresponsive code. Only "best effort" support is - * provided when using this option. - * - * @param {string} url The initial browser URL. - * @return {!Options} A self reference. - */ - initialBrowserUrl(url) { - this.options_[Key.INITIAL_BROWSER_URL] = url; - return this; - } - - /** - * Configures whether to enable persistent mouse hovering (true by default). - * Persistent hovering is achieved by continuously firing mouse over events at - * the last location the mouse cursor has been moved to. - * - * @param {boolean} enable Whether to enable persistent hovering. - * @return {!Options} A self reference. - */ - enablePersistentHover(enable) { - this.options_[Key.ENABLE_PERSISTENT_HOVER] = !!enable; - return this; - } - - /** - * Configures whether the driver should attempt to remove obsolete - * {@linkplain webdriver.WebElement WebElements} from its internal cache on - * page navigation (true by default). Disabling this option will cause the - * driver to run with a larger memory footprint. - * - * @param {boolean} enable Whether to enable element reference cleanup. - * @return {!Options} A self reference. - */ - enableElementCacheCleanup(enable) { - this.options_[Key.ENABLE_ELEMENT_CACHE_CLEANUP] = !!enable; - return this; - } - - /** - * Configures whether to require the IE window to have input focus before - * performing any user interactions (i.e. mouse or keyboard events). This - * option is disabled by default, but delivers much more accurate interaction - * events when enabled. - * - * @param {boolean} require Whether to require window focus. - * @return {!Options} A self reference. - */ - requireWindowFocus(require) { - this.options_[Key.REQUIRE_WINDOW_FOCUS] = !!require; - return this; - } - - /** - * Configures the timeout, in milliseconds, that the driver will attempt to - * located and attach to a newly opened instance of Internet Explorer. The - * default is zero, which indicates waiting indefinitely. - * - * @param {number} timeout How long to wait for IE. - * @return {!Options} A self reference. - */ - browserAttachTimeout(timeout) { - this.options_[Key.BROWSER_ATTACH_TIMEOUT] = Math.max(timeout, 0); - return this; - } - - /** - * Configures whether to launch Internet Explorer using the CreateProcess API. - * If this option is not specified, IE is launched using IELaunchURL, if - * available. For IE 8 and above, this option requires the TabProcGrowth - * registry value to be set to 0. - * - * @param {boolean} force Whether to use the CreateProcess API. - * @return {!Options} A self reference. - */ - forceCreateProcessApi(force) { - this.options_[Key.FORCE_CREATE_PROCESS] = !!force; - return this; - } - - /** - * Specifies command-line switches to use when launching Internet Explorer. - * This is only valid when used with {@link #forceCreateProcessApi}. - * - * @param {...(string|!Array.)} var_args The arguments to add. - * @return {!Options} A self reference. - */ - addArguments(var_args) { - var args = this.options_[Key.BROWSER_COMMAND_LINE_SWITCHES] || []; - args = args.concat.apply(args, arguments); - this.options_[Key.BROWSER_COMMAND_LINE_SWITCHES] = args; - return this; - } - - /** - * Configures whether proxies should be configured on a per-process basis. If - * not set, setting a {@linkplain #setProxy proxy} will configure the system - * proxy. The default behavior is to use the system proxy. - * - * @param {boolean} enable Whether to enable per-process proxy settings. - * @return {!Options} A self reference. - */ - usePerProcessProxy(enable) { - this.options_[Key.USE_PER_PROCESS_PROXY] = !!enable; - return this; - } - - /** - * Configures whether to clear the cache, cookies, history, and saved form data - * before starting the browser. _Using this capability will clear session data - * for all running instances of Internet Explorer, including those started - * manually._ - * - * @param {boolean} cleanSession Whether to clear all session data on startup. - * @return {!Options} A self reference. - */ - ensureCleanSession(cleanSession) { - this.options_[Key.ENSURE_CLEAN_SESSION] = !!cleanSession; - return this; - } - - /** - * Sets the path to the log file the driver should log to. - * @param {string} file The log file path. - * @return {!Options} A self reference. - */ - setLogFile(file) { - this.options_[Key.LOG_FILE] = file; - return this; - } - - /** - * Sets the IEDriverServer's logging {@linkplain Level level}. - * @param {Level} level The logging level. - * @return {!Options} A self reference. - */ - setLogLevel(level) { - this.options_[Key.LOG_LEVEL] = level; - return this; - } - - /** - * Sets the IP address of the driver's host adapter. - * @param {string} host The IP address to use. - * @return {!Options} A self reference. - */ - setHost(host) { - this.options_[Key.HOST] = host; - return this; - } - - /** - * Sets the path of the temporary data directory to use. - * @param {string} path The log file path. - * @return {!Options} A self reference. - */ - setExtractPath(path) { - this.options_[Key.EXTRACT_PATH] = path; - return this; - } - - /** - * Sets whether the driver should start in silent mode. - * @param {boolean} silent Whether to run in silent mode. - * @return {!Options} A self reference. - */ - silent(silent) { - this.options_[Key.SILENT] = silent; - return this; - } - - /** - * Sets the proxy settings for the new session. - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy) { - this.proxy_ = proxy; - return this; - } - - /** - * Converts this options instance to a {@link capabilities.Capabilities} - * object. - * @param {capabilities.Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!capabilities.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities) { - var caps = opt_capabilities || capabilities.Capabilities.ie(); - if (this.proxy_) { - caps.set(capabilities.Capability.PROXY, this.proxy_); - } - Object.keys(this.options_).forEach(function(key) { - caps.set(key, this.options_[key]); - }, this); - return caps; - } -} - - -function createServiceFromCapabilities(capabilities) { - if (process.platform !== 'win32') { - throw Error( - 'The IEDriver may only be used on Windows, but you appear to be on ' + - process.platform + '. Did you mean to run against a remote ' + - 'WebDriver server?'); - } - - let exe = io.findInPath(IEDRIVER_EXE, true); - if (!exe || !fs.existsSync(exe)) { - throw Error( - `${IEDRIVER_EXE} could not be found on the current PATH. Please ` + - `download the latest version of ${IEDRIVER_EXE} from ` + - 'http://selenium-release.storage.googleapis.com/index.html and ' + - 'ensure it can be found on your system PATH.'); - } - - var args = []; - if (capabilities.has(Key.HOST)) { - args.push('--host=' + capabilities.get(Key.HOST)); - } - if (capabilities.has(Key.LOG_FILE)) { - args.push('--log-file=' + capabilities.get(Key.LOG_FILE)); - } - if (capabilities.has(Key.LOG_LEVEL)) { - args.push('--log-level=' + capabilities.get(Key.LOG_LEVEL)); - } - if (capabilities.has(Key.EXTRACT_PATH)) { - args.push('--extract-path=' + capabilities.get(Key.EXTRACT_PATH)); - } - if (capabilities.get(Key.SILENT)) { - args.push('--silent'); - } - - var port = portprober.findFreePort(); - return new remote.DriverService(exe, { - loopback: true, - port: port, - args: port.then(function(port) { - return args.concat('--port=' + port); - }), - stdio: 'ignore' - }); -} - - -/** - * A WebDriver client for Microsoft's Internet Explorer. - */ -class Driver extends webdriver.WebDriver { - /** - * Creates a new session for Microsoft's Internet Explorer. - * - * @param {(capabilities.Capabilities|Options)=} opt_config The configuration - * options. - * @param {promise.ControlFlow=} opt_flow The control flow to use, - * or {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. - */ - static createSession(opt_config, opt_flow) { - var caps = opt_config instanceof Options ? - opt_config.toCapabilities() : - (opt_config || capabilities.Capabilities.ie()); - - var service = createServiceFromCapabilities(caps); - var client = service.start().then(url => new http.HttpClient(url)); - var executor = new http.Executor(client); - - return /** @type {!Driver} */(webdriver.WebDriver.createSession( - executor, caps, opt_flow, this, () => service.kill())); - } - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector() {} -} - - -// PUBLIC API - - -exports.Driver = Driver; -exports.Options = Options; -exports.Level = Level; diff --git a/node_modules/selenium-webdriver/index.js b/node_modules/selenium-webdriver/index.js deleted file mode 100644 index a1e208b46..000000000 --- a/node_modules/selenium-webdriver/index.js +++ /dev/null @@ -1,691 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -/** - * @fileoverview The main user facing module. Exports WebDriver's primary - * public API and provides convenience assessors to certain sub-modules. - */ - -'use strict'; - -const chrome = require('./chrome'); -const edge = require('./edge'); -const firefox = require('./firefox'); -const _http = require('./http'); -const ie = require('./ie'); -const actions = require('./lib/actions'); -const by = require('./lib/by'); -const capabilities = require('./lib/capabilities'); -const command = require('./lib/command'); -const error = require('./lib/error'); -const events = require('./lib/events'); -const input = require('./lib/input'); -const logging = require('./lib/logging'); -const promise = require('./lib/promise'); -const session = require('./lib/session'); -const until = require('./lib/until'); -const webdriver = require('./lib/webdriver'); -const opera = require('./opera'); -const phantomjs = require('./phantomjs'); -const remote = require('./remote'); -const safari = require('./safari'); - -const Browser = capabilities.Browser; -const Capabilities = capabilities.Capabilities; -const Capability = capabilities.Capability; -const Session = session.Session; -const WebDriver = webdriver.WebDriver; - - - -var seleniumServer; - -/** - * Starts an instance of the Selenium server if not yet running. - * @param {string} jar Path to the server jar to use. - * @return {!Promise} A promise for the server's - * address once started. - */ -function startSeleniumServer(jar) { - if (!seleniumServer) { - seleniumServer = new remote.SeleniumServer(jar); - } - return seleniumServer.start(); -} - - -/** - * {@linkplain webdriver.WebDriver#setFileDetector WebDriver's setFileDetector} - * method uses a non-standard command to transfer files from the local client - * to the remote end hosting the browser. Many of the WebDriver sub-types, like - * the {@link chrome.Driver} and {@link firefox.Driver}, do not support this - * command. Thus, these classes override the `setFileDetector` to no-op. - * - * This function uses a mixin to re-enable `setFileDetector` by calling the - * original method on the WebDriver prototype directly. This is used only when - * the builder creates a Chrome or Firefox instance that communicates with a - * remote end (and thus, support for remote file detectors is unknown). - * - * @param {function(new: webdriver.WebDriver, ...?)} ctor - * @return {function(new: webdriver.WebDriver, ...?)} - */ -function ensureFileDetectorsAreEnabled(ctor) { - const mixin = class extends ctor { - /** @param {input.FileDetector} detector */ - setFileDetector(detector) { - webdriver.WebDriver.prototype.setFileDetector.call(this, detector); - } - }; - return mixin; -} - - -/** - * A thenable wrapper around a {@linkplain webdriver.IWebDriver IWebDriver} - * instance that allows commands to be issued directly instead of having to - * repeatedly call `then`: - * - * let driver = new Builder().build(); - * driver.then(d => d.get(url)); // You can do this... - * driver.get(url); // ...or this - * - * If the driver instance fails to resolve (e.g. the session cannot be created), - * every issued command will fail. - * - * @extends {webdriver.IWebDriver} - * @extends {promise.CancellableThenable} - * @interface - */ -class ThenableWebDriver { - /** @param {...?} args */ - static createSession(...args) {} -} - - -/** - * @const {!Map, ...?), - * function(new: ThenableWebDriver, !IThenable, ...?)>} - */ -const THENABLE_DRIVERS = new Map; - - -/** - * @param {function(new: WebDriver, !IThenable, ...?)} ctor - * @param {...?} args - * @return {!ThenableWebDriver} - */ -function createDriver(ctor, ...args) { - let thenableWebDriverProxy = THENABLE_DRIVERS.get(ctor); - if (!thenableWebDriverProxy) { - /** @implements {ThenableWebDriver} */ - thenableWebDriverProxy = class extends ctor { - /** - * @param {!IThenable} session - * @param {...?} rest - */ - constructor(session, ...rest) { - super(session, ...rest); - - const pd = this.getSession().then(session => { - return new ctor(session, ...rest); - }); - - /** - * @param {(string|Error)=} opt_reason - * @override - */ - this.cancel = function(opt_reason) { - if (promise.CancellableThenable.isImplementation(pd)) { - /** @type {!promise.CancellableThenable} */(pd).cancel(opt_reason); - } - }; - - /** @override */ - this.then = pd.then.bind(pd); - - /** @override */ - this.catch = pd.then.bind(pd); - } - }; - promise.CancellableThenable.addImplementation(thenableWebDriverProxy); - THENABLE_DRIVERS.set(ctor, thenableWebDriverProxy); - } - return thenableWebDriverProxy.createSession(...args); -} - - -/** - * Creates new {@link webdriver.WebDriver WebDriver} instances. The environment - * variables listed below may be used to override a builder's configuration, - * allowing quick runtime changes. - * - * - {@code SELENIUM_BROWSER}: defines the target browser in the form - * {@code browser[:version][:platform]}. - * - * - {@code SELENIUM_REMOTE_URL}: defines the remote URL for all builder - * instances. This environment variable should be set to a fully qualified - * URL for a WebDriver server (e.g. http://localhost:4444/wd/hub). This - * option always takes precedence over {@code SELENIUM_SERVER_JAR}. - * - * - {@code SELENIUM_SERVER_JAR}: defines the path to the - * - * standalone Selenium server jar to use. The server will be started the - * first time a WebDriver instance and be killed when the process exits. - * - * Suppose you had mytest.js that created WebDriver with - * - * var driver = new webdriver.Builder() - * .forBrowser('chrome') - * .build(); - * - * This test could be made to use Firefox on the local machine by running with - * `SELENIUM_BROWSER=firefox node mytest.js`. Rather than change the code to - * target Google Chrome on a remote machine, you can simply set the - * `SELENIUM_BROWSER` and `SELENIUM_REMOTE_URL` environment variables: - * - * SELENIUM_BROWSER=chrome:36:LINUX \ - * SELENIUM_REMOTE_URL=http://www.example.com:4444/wd/hub \ - * node mytest.js - * - * You could also use a local copy of the standalone Selenium server: - * - * SELENIUM_BROWSER=chrome:36:LINUX \ - * SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar \ - * node mytest.js - */ -class Builder { - constructor() { - /** @private @const */ - this.log_ = logging.getLogger('webdriver.Builder'); - - /** @private {promise.ControlFlow} */ - this.flow_ = null; - - /** @private {string} */ - this.url_ = ''; - - /** @private {?string} */ - this.proxy_ = null; - - /** @private {!Capabilities} */ - this.capabilities_ = new Capabilities(); - - /** @private {chrome.Options} */ - this.chromeOptions_ = null; - - /** @private {firefox.Options} */ - this.firefoxOptions_ = null; - - /** @private {opera.Options} */ - this.operaOptions_ = null; - - /** @private {ie.Options} */ - this.ieOptions_ = null; - - /** @private {safari.Options} */ - this.safariOptions_ = null; - - /** @private {edge.Options} */ - this.edgeOptions_ = null; - - /** @private {boolean} */ - this.ignoreEnv_ = false; - - /** @private {http.Agent} */ - this.agent_ = null; - } - - /** - * Configures this builder to ignore any environment variable overrides and to - * only use the configuration specified through this instance's API. - * - * @return {!Builder} A self reference. - */ - disableEnvironmentOverrides() { - this.ignoreEnv_ = true; - return this; - } - - /** - * Sets the URL of a remote WebDriver server to use. Once a remote URL has - * been specified, the builder direct all new clients to that server. If this - * method is never called, the Builder will attempt to create all clients - * locally. - * - * As an alternative to this method, you may also set the - * `SELENIUM_REMOTE_URL` environment variable. - * - * @param {string} url The URL of a remote server to use. - * @return {!Builder} A self reference. - */ - usingServer(url) { - this.url_ = url; - return this; - } - - /** - * @return {string} The URL of the WebDriver server this instance is - * configured to use. - */ - getServerUrl() { - return this.url_; - } - - /** - * Sets the URL of the proxy to use for the WebDriver's HTTP connections. - * If this method is never called, the Builder will create a connection - * without a proxy. - * - * @param {string} proxy The URL of a proxy to use. - * @return {!Builder} A self reference. - */ - usingWebDriverProxy(proxy) { - this.proxy_ = proxy; - return this; - } - - /** - * @return {?string} The URL of the proxy server to use for the WebDriver's - * HTTP connections, or `null` if not set. - */ - getWebDriverProxy() { - return this.proxy_; - } - - /** - * Sets the http agent to use for each request. - * If this method is not called, the Builder will use http.globalAgent by default. - * - * @param {http.Agent} agent The agent to use for each request. - * @return {!Builder} A self reference. - */ - usingHttpAgent(agent) { - this.agent_ = agent; - return this; - } - - /** - * @return {http.Agent} The http agent used for each request - */ - getHttpAgent() { - return this.agent_; - } - - /** - * Sets the desired capabilities when requesting a new session. This will - * overwrite any previously set capabilities. - * @param {!(Object|Capabilities)} capabilities The desired capabilities for - * a new session. - * @return {!Builder} A self reference. - */ - withCapabilities(capabilities) { - this.capabilities_ = new Capabilities(capabilities); - return this; - } - - /** - * Returns the base set of capabilities this instance is currently configured - * to use. - * @return {!Capabilities} The current capabilities for this builder. - */ - getCapabilities() { - return this.capabilities_; - } - - /** - * Configures the target browser for clients created by this instance. - * Any calls to {@link #withCapabilities} after this function will - * overwrite these settings. - * - * You may also define the target browser using the {@code SELENIUM_BROWSER} - * environment variable. If set, this environment variable should be of the - * form `browser[:[version][:platform]]`. - * - * @param {(string|Browser)} name The name of the target browser; - * common defaults are available on the {@link webdriver.Browser} enum. - * @param {string=} opt_version A desired version; may be omitted if any - * version should be used. - * @param {string=} opt_platform The desired platform; may be omitted if any - * version may be used. - * @return {!Builder} A self reference. - */ - forBrowser(name, opt_version, opt_platform) { - this.capabilities_.set(Capability.BROWSER_NAME, name); - this.capabilities_.set(Capability.VERSION, opt_version || null); - this.capabilities_.set(Capability.PLATFORM, opt_platform || null); - return this; - } - - /** - * Sets the proxy configuration for the target browser. - * Any calls to {@link #withCapabilities} after this function will - * overwrite these settings. - * - * @param {!capabilities.ProxyConfig} config The configuration to use. - * @return {!Builder} A self reference. - */ - setProxy(config) { - this.capabilities_.setProxy(config); - return this; - } - - /** - * Sets the logging preferences for the created session. Preferences may be - * changed by repeated calls, or by calling {@link #withCapabilities}. - * @param {!(./lib/logging.Preferences|Object)} prefs The - * desired logging preferences. - * @return {!Builder} A self reference. - */ - setLoggingPrefs(prefs) { - this.capabilities_.setLoggingPrefs(prefs); - return this; - } - - /** - * Sets whether native events should be used. - * @param {boolean} enabled Whether to enable native events. - * @return {!Builder} A self reference. - */ - setEnableNativeEvents(enabled) { - this.capabilities_.setEnableNativeEvents(enabled); - return this; - } - - /** - * Sets how elements should be scrolled into view for interaction. - * @param {number} behavior The desired scroll behavior: either 0 to align - * with the top of the viewport or 1 to align with the bottom. - * @return {!Builder} A self reference. - */ - setScrollBehavior(behavior) { - this.capabilities_.setScrollBehavior(behavior); - return this; - } - - /** - * Sets the default action to take with an unexpected alert before returning - * an error. - * @param {string} behavior The desired behavior; should be "accept", - * "dismiss", or "ignore". Defaults to "dismiss". - * @return {!Builder} A self reference. - */ - setAlertBehavior(behavior) { - this.capabilities_.setAlertBehavior(behavior); - return this; - } - - /** - * Sets Chrome specific {@linkplain chrome.Options options} for drivers - * created by this builder. Any logging or proxy settings defined on the given - * options will take precedence over those set through - * {@link #setLoggingPrefs} and {@link #setProxy}, respectively. - * - * @param {!chrome.Options} options The ChromeDriver options to use. - * @return {!Builder} A self reference. - */ - setChromeOptions(options) { - this.chromeOptions_ = options; - return this; - } - - /** - * Sets Firefox specific {@linkplain firefox.Options options} for drivers - * created by this builder. Any logging or proxy settings defined on the given - * options will take precedence over those set through - * {@link #setLoggingPrefs} and {@link #setProxy}, respectively. - * - * @param {!firefox.Options} options The FirefoxDriver options to use. - * @return {!Builder} A self reference. - */ - setFirefoxOptions(options) { - this.firefoxOptions_ = options; - return this; - } - - /** - * @return {firefox.Options} the Firefox specific options currently configured - * for this instance. - */ - getFirefoxOptions() { - return this.firefoxOptions_; - } - - /** - * Sets Opera specific {@linkplain opera.Options options} for drivers created - * by this builder. Any logging or proxy settings defined on the given options - * will take precedence over those set through {@link #setLoggingPrefs} and - * {@link #setProxy}, respectively. - * - * @param {!opera.Options} options The OperaDriver options to use. - * @return {!Builder} A self reference. - */ - setOperaOptions(options) { - this.operaOptions_ = options; - return this; - } - - /** - * Set Internet Explorer specific {@linkplain ie.Options options} for drivers - * created by this builder. Any proxy settings defined on the given options - * will take precedence over those set through {@link #setProxy}. - * - * @param {!ie.Options} options The IEDriver options to use. - * @return {!Builder} A self reference. - */ - setIeOptions(options) { - this.ieOptions_ = options; - return this; - } - - /** - * Set {@linkplain edge.Options options} specific to Microsoft's Edge browser - * for drivers created by this builder. Any proxy settings defined on the - * given options will take precedence over those set through - * {@link #setProxy}. - * - * @param {!edge.Options} options The MicrosoftEdgeDriver options to use. - * @return {!Builder} A self reference. - */ - setEdgeOptions(options) { - this.edgeOptions_ = options; - return this; - } - - /** - * Sets Safari specific {@linkplain safari.Options options} for drivers - * created by this builder. Any logging settings defined on the given options - * will take precedence over those set through {@link #setLoggingPrefs}. - * - * @param {!safari.Options} options The Safari options to use. - * @return {!Builder} A self reference. - */ - setSafariOptions(options) { - this.safariOptions_ = options; - return this; - } - - /** - * @return {safari.Options} the Safari specific options currently configured - * for this instance. - */ - getSafariOptions() { - return this.safariOptions_; - } - - /** - * Sets the control flow that created drivers should execute actions in. If - * the flow is never set, or is set to {@code null}, it will use the active - * flow at the time {@link #build()} is called. - * @param {promise.ControlFlow} flow The control flow to use, or - * {@code null} to - * @return {!Builder} A self reference. - */ - setControlFlow(flow) { - this.flow_ = flow; - return this; - } - - /** - * Creates a new WebDriver client based on this builder's current - * configuration. - * - * This method will return a {@linkplain ThenableWebDriver} instance, allowing - * users to issue commands directly without calling `then()`. The returned - * thenable wraps a promise that will resolve to a concrete - * {@linkplain webdriver.WebDriver WebDriver} instance. The promise will be - * rejected if the remote end fails to create a new session. - * - * @return {!ThenableWebDriver} A new WebDriver instance. - * @throws {Error} If the current configuration is invalid. - */ - build() { - // Create a copy for any changes we may need to make based on the current - // environment. - var capabilities = new Capabilities(this.capabilities_); - - var browser; - if (!this.ignoreEnv_ && process.env.SELENIUM_BROWSER) { - this.log_.fine(`SELENIUM_BROWSER=${process.env.SELENIUM_BROWSER}`); - browser = process.env.SELENIUM_BROWSER.split(/:/, 3); - capabilities.set(Capability.BROWSER_NAME, browser[0]); - capabilities.set(Capability.VERSION, browser[1] || null); - capabilities.set(Capability.PLATFORM, browser[2] || null); - } - - browser = capabilities.get(Capability.BROWSER_NAME); - - if (typeof browser !== 'string') { - throw TypeError( - `Target browser must be a string, but is <${typeof browser}>;` + - ' did you forget to call forBrowser()?'); - } - - if (browser === 'ie') { - browser = Browser.INTERNET_EXPLORER; - } - - // Apply browser specific overrides. - if (browser === Browser.CHROME && this.chromeOptions_) { - capabilities.merge(this.chromeOptions_.toCapabilities()); - - } else if (browser === Browser.FIREFOX && this.firefoxOptions_) { - capabilities.merge(this.firefoxOptions_.toCapabilities()); - - } else if (browser === Browser.INTERNET_EXPLORER && this.ieOptions_) { - capabilities.merge(this.ieOptions_.toCapabilities()); - - } else if (browser === Browser.OPERA && this.operaOptions_) { - capabilities.merge(this.operaOptions_.toCapabilities()); - - } else if (browser === Browser.SAFARI && this.safariOptions_) { - capabilities.merge(this.safariOptions_.toCapabilities()); - - } else if (browser === Browser.EDGE && this.edgeOptions_) { - capabilities.merge(this.edgeOptions_.toCapabilities()); - } - - // Check for a remote browser. - let url = this.url_; - if (!this.ignoreEnv_) { - if (process.env.SELENIUM_REMOTE_URL) { - this.log_.fine( - `SELENIUM_REMOTE_URL=${process.env.SELENIUM_REMOTE_URL}`); - url = process.env.SELENIUM_REMOTE_URL; - } else if (process.env.SELENIUM_SERVER_JAR) { - this.log_.fine( - `SELENIUM_SERVER_JAR=${process.env.SELENIUM_SERVER_JAR}`); - url = startSeleniumServer(process.env.SELENIUM_SERVER_JAR); - } - } - - if (url) { - this.log_.fine('Creating session on remote server'); - let client = Promise.resolve(url) - .then(url => new _http.HttpClient(url, this.agent_, this.proxy_)); - let executor = new _http.Executor(client); - - if (browser === Browser.CHROME) { - const driver = ensureFileDetectorsAreEnabled(chrome.Driver); - return createDriver( - driver, capabilities, executor, this.flow_); - } - - if (browser === Browser.FIREFOX) { - const driver = ensureFileDetectorsAreEnabled(firefox.Driver); - return createDriver( - driver, capabilities, executor, this.flow_); - } - return createDriver( - WebDriver, executor, capabilities, this.flow_); - } - - // Check for a native browser. - switch (browser) { - case Browser.CHROME: - return createDriver(chrome.Driver, capabilities, null, this.flow_); - - case Browser.FIREFOX: - return createDriver(firefox.Driver, capabilities, null, this.flow_); - - case Browser.INTERNET_EXPLORER: - return createDriver(ie.Driver, capabilities, this.flow_); - - case Browser.EDGE: - return createDriver(edge.Driver, capabilities, null, this.flow_); - - case Browser.OPERA: - return createDriver(opera.Driver, capabilities, null, this.flow_); - - case Browser.PHANTOM_JS: - return createDriver(phantomjs.Driver, capabilities, this.flow_); - - case Browser.SAFARI: - return createDriver(safari.Driver, capabilities, this.flow_); - - default: - throw new Error('Do not know how to build driver: ' + browser - + '; did you forget to call usingServer(url)?'); - } - } -} - - -// PUBLIC API - - -exports.ActionSequence = actions.ActionSequence; -exports.Browser = capabilities.Browser; -exports.Builder = Builder; -exports.Button = input.Button; -exports.By = by.By; -exports.Capabilities = capabilities.Capabilities; -exports.Capability = capabilities.Capability; -exports.Condition = webdriver.Condition; -exports.EventEmitter = events.EventEmitter; -exports.FileDetector = input.FileDetector; -exports.Key = input.Key; -exports.Session = session.Session; -exports.ThenableWebDriver = ThenableWebDriver; -exports.TouchSequence = actions.TouchSequence; -exports.WebDriver = webdriver.WebDriver; -exports.WebElement = webdriver.WebElement; -exports.WebElementCondition = webdriver.WebElementCondition; -exports.WebElementPromise = webdriver.WebElementPromise; -exports.error = error; -exports.logging = logging; -exports.promise = promise; -exports.until = until; diff --git a/node_modules/selenium-webdriver/io/exec.js b/node_modules/selenium-webdriver/io/exec.js deleted file mode 100644 index 948749e83..000000000 --- a/node_modules/selenium-webdriver/io/exec.js +++ /dev/null @@ -1,153 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict'; - -const childProcess = require('child_process'); - - -/** - * A hash with configuration options for an executed command. - * - * - `args` - Command line arguments. - * - `env` - Command environment; will inherit from the current process if - * missing. - * - `stdio` - IO configuration for the spawned server process. For more - * information, refer to the documentation of `child_process.spawn`. - * - * @typedef {{ - * args: (!Array|undefined), - * env: (!Object|undefined), - * stdio: (string|!Array| - * undefined) - * }} - */ -var Options; - - -/** - * Describes a command's termination conditions. - */ -class Result { - /** - * @param {?number} code The exit code, or {@code null} if the command did not - * exit normally. - * @param {?string} signal The signal used to kill the command, or - * {@code null}. - */ - constructor(code, signal) { - /** @type {?number} */ - this.code = code; - - /** @type {?string} */ - this.signal = signal; - } - - /** @override */ - toString() { - return `Result(code=${this.code}, signal=${this.signal})`; - } -} - - -const COMMAND_RESULT = /** !WeakMap> */new WeakMap; -const KILL_HOOK = /** !WeakMap */new WeakMap; - -/** - * Represents a command running in a sub-process. - */ -class Command { - /** - * @param {!Promise} result The command result. - * @param {function(string)} onKill The function to call when {@link #kill()} - * is called. - */ - constructor(result, onKill) { - COMMAND_RESULT.set(this, result); - KILL_HOOK.set(this, onKill); - } - - /** - * @return {!Promise} A promise for the result of this - * command. - */ - result() { - return /** @type {!Promise} */(COMMAND_RESULT.get(this)); - } - - /** - * Sends a signal to the underlying process. - * @param {string=} opt_signal The signal to send; defaults to `SIGTERM`. - */ - kill(opt_signal) { - KILL_HOOK.get(this)(opt_signal || 'SIGTERM'); - } -} - - -// PUBLIC API - - -/** - * Spawns a child process. The returned {@link Command} may be used to wait - * for the process result or to send signals to the process. - * - * @param {string} command The executable to spawn. - * @param {Options=} opt_options The command options. - * @return {!Command} The launched command. - */ -module.exports = function exec(command, opt_options) { - var options = opt_options || {}; - - var proc = childProcess.spawn(command, options.args || [], { - env: options.env || process.env, - stdio: options.stdio || 'ignore' - }); - - // This process should not wait on the spawned child, however, we do - // want to ensure the child is killed when this process exits. - proc.unref(); - process.once('exit', onProcessExit); - - let result = new Promise(resolve => { - proc.once('exit', (code, signal) => { - proc = null; - process.removeListener('exit', onProcessExit); - resolve(new Result(code, signal)); - }); - }); - return new Command(result, killCommand); - - function onProcessExit() { - killCommand('SIGTERM'); - } - - function killCommand(signal) { - process.removeListener('exit', onProcessExit); - if (proc) { - proc.kill(signal); - proc = null; - } - } -}; - -// Exported to improve generated API documentation. - -module.exports.Command = Command; -/** @typedef {!Options} */ -module.exports.Options = Options; -module.exports.Result = Result; diff --git a/node_modules/selenium-webdriver/io/index.js b/node_modules/selenium-webdriver/io/index.js deleted file mode 100644 index 17aceac47..000000000 --- a/node_modules/selenium-webdriver/io/index.js +++ /dev/null @@ -1,300 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict'; - -var fs = require('fs'), - path = require('path'), - rimraf = require('rimraf'), - tmp = require('tmp'); - - -/** - * @param {!Function} fn . - * @return {!Promise} . - * @template T - */ -function checkedCall(fn) { - return new Promise((resolve, reject) => { - try { - fn((err, value) => { - if (err) { - reject(err); - } else { - resolve(value); - } - }); - } catch (e) { - reject(e); - } - }); -} - - - -// PUBLIC API - - - -/** - * Recursively removes a directory and all of its contents. This is equivalent - * to {@code rm -rf} on a POSIX system. - * @param {string} dirPath Path to the directory to remove. - * @return {!Promise} A promise to be resolved when the operation has - * completed. - */ -exports.rmDir = function(dirPath) { - return new Promise(function(fulfill, reject) { - var numAttempts = 0; - attemptRm(); - function attemptRm() { - numAttempts += 1; - rimraf(dirPath, function(err) { - if (err) { - if (err.code && err.code === 'ENOTEMPTY' && numAttempts < 2) { - attemptRm(); - return; - } - reject(err); - } else { - fulfill(); - } - }); - } - }); -}; - - -/** - * Copies one file to another. - * @param {string} src The source file. - * @param {string} dst The destination file. - * @return {!Promise} A promise for the copied file's path. - */ -exports.copy = function(src, dst) { - return new Promise(function(fulfill, reject) { - var rs = fs.createReadStream(src); - rs.on('error', reject); - rs.on('end', () => fulfill(dst)); - - var ws = fs.createWriteStream(dst); - ws.on('error', reject); - - rs.pipe(ws); - }); -}; - - -/** - * Recursively copies the contents of one directory to another. - * @param {string} src The source directory to copy. - * @param {string} dst The directory to copy into. - * @param {(RegExp|function(string): boolean)=} opt_exclude An exclusion filter - * as either a regex or predicate function. All files matching this filter - * will not be copied. - * @return {!Promise} A promise for the destination - * directory's path once all files have been copied. - */ -exports.copyDir = function(src, dst, opt_exclude) { - var predicate = opt_exclude; - if (opt_exclude && typeof opt_exclude !== 'function') { - predicate = function(p) { - return !opt_exclude.test(p); - }; - } - - // TODO(jleyba): Make this function completely async. - if (!fs.existsSync(dst)) { - fs.mkdirSync(dst); - } - - var files = fs.readdirSync(src); - files = files.map(function(file) { - return path.join(src, file); - }); - - if (predicate) { - files = files.filter(/** @type {function(string): boolean} */(predicate)); - } - - var results = []; - files.forEach(function(file) { - var stats = fs.statSync(file); - var target = path.join(dst, path.basename(file)); - - if (stats.isDirectory()) { - if (!fs.existsSync(target)) { - fs.mkdirSync(target, stats.mode); - } - results.push(exports.copyDir(file, target, predicate)); - } else { - results.push(exports.copy(file, target)); - } - }); - - return Promise.all(results).then(() => dst); -}; - - -/** - * Tests if a file path exists. - * @param {string} aPath The path to test. - * @return {!Promise} A promise for whether the file exists. - */ -exports.exists = function(aPath) { - return new Promise(function(fulfill, reject) { - let type = typeof aPath; - if (type !== 'string') { - reject(TypeError(`expected string path, but got ${type}`)); - } else { - fs.exists(aPath, fulfill); - } - }); -}; - - -/** - * Calls `stat(2)`. - * @param {string} aPath The path to stat. - * @return {!Promise} A promise for the file stats. - */ -exports.stat = function stat(aPath) { - return checkedCall(callback => fs.stat(aPath, callback)); -}; - - -/** - * Deletes a name from the filesystem and possibly the file it refers to. Has - * no effect if the file does not exist. - * @param {string} aPath The path to remove. - * @return {!Promise} A promise for when the file has been removed. - */ -exports.unlink = function(aPath) { - return new Promise(function(fulfill, reject) { - fs.exists(aPath, function(exists) { - if (exists) { - fs.unlink(aPath, function(err) { - err && reject(err) || fulfill(); - }); - } else { - fulfill(); - } - }); - }); -}; - - -/** - * @return {!Promise} A promise for the path to a temporary directory. - * @see https://www.npmjs.org/package/tmp - */ -exports.tmpDir = function() { - return checkedCall(tmp.dir); -}; - - -/** - * @param {{postfix: string}=} opt_options Temporary file options. - * @return {!Promise} A promise for the path to a temporary file. - * @see https://www.npmjs.org/package/tmp - */ -exports.tmpFile = function(opt_options) { - return checkedCall(callback => { - // |tmp.file| checks arguments length to detect options rather than doing a - // truthy check, so we must only pass options if there are some to pass. - if (opt_options) { - tmp.file(opt_options, callback); - } else { - tmp.file(callback); - } - }); -}; - - -/** - * Searches the {@code PATH} environment variable for the given file. - * @param {string} file The file to locate on the PATH. - * @param {boolean=} opt_checkCwd Whether to always start with the search with - * the current working directory, regardless of whether it is explicitly - * listed on the PATH. - * @return {?string} Path to the located file, or {@code null} if it could - * not be found. - */ -exports.findInPath = function(file, opt_checkCwd) { - let dirs = []; - if (opt_checkCwd) { - dirs.push(process.cwd()); - } - dirs.push.apply(dirs, process.env['PATH'].split(path.delimiter)); - - let foundInDir = dirs.find(dir => { - let tmp = path.join(dir, file); - try { - let stats = fs.statSync(tmp); - return stats.isFile() && !stats.isDirectory(); - } catch (ex) { - return false; - } - }); - - return foundInDir ? path.join(foundInDir, file) : null; -}; - - -/** - * Reads the contents of the given file. - * - * @param {string} aPath Path to the file to read. - * @return {!Promise} A promise that will resolve with a buffer of the - * file contents. - */ -exports.read = function(aPath) { - return checkedCall(callback => fs.readFile(aPath, callback)); -}; - - -/** - * Writes to a file. - * - * @param {string} aPath Path to the file to write to. - * @param {(string|!Buffer)} data The data to write. - * @return {!Promise} A promise that will resolve when the operation has - * completed. - */ -exports.write = function(aPath, data) { - return checkedCall(callback => fs.writeFile(aPath, data, callback)); -}; - - -/** - * Creates a directory. - * - * @param {string} aPath The directory path. - * @return {!Promise} A promise that will resolve with the path of the - * created directory. - */ -exports.mkdir = function(aPath) { - return checkedCall(callback => { - fs.mkdir(aPath, undefined, err => { - if (err && err.code !== 'EEXIST') { - callback(err); - } else { - callback(null, aPath); - } - }); - }); -}; diff --git a/node_modules/selenium-webdriver/lib/README b/node_modules/selenium-webdriver/lib/README deleted file mode 100644 index c39abbece..000000000 --- a/node_modules/selenium-webdriver/lib/README +++ /dev/null @@ -1,5 +0,0 @@ -This directory contains modules internal to selenium-webdriver that are not -intended for general consumption. They may change at any time. - -All files in this directory and the atoms/ subdirectory may only depend on -built-in JavaScript features and other modules in this directory. diff --git a/node_modules/selenium-webdriver/lib/actions.js b/node_modules/selenium-webdriver/lib/actions.js deleted file mode 100644 index 0e34f3783..000000000 --- a/node_modules/selenium-webdriver/lib/actions.js +++ /dev/null @@ -1,604 +0,0 @@ -// Licensed to the Software Freedom Conservancy (SFC) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The SFC licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -'use strict'; - -const command = require('./command'); -const error = require('./error'); -const input = require('./input'); - - -/** - * @param {!IArrayLike} args . - * @return {!Array} . - */ -function flatten(args) { - let result = []; - for (let i = 0; i < args.length; i++) { - let element = args[i]; - if (Array.isArray(element)) { - result.push.apply(result, flatten(element)); - } else { - result.push(element); - } - } - return result; -} - - -const MODIFIER_KEYS = new Set([ - input.Key.ALT, - input.Key.CONTROL, - input.Key.SHIFT, - input.Key.COMMAND -]); - - -/** - * Checks that a key is a modifier key. - * @param {!input.Key} key The key to check. - * @throws {error.InvalidArgumentError} If the key is not a modifier key. - * @private - */ -function checkModifierKey(key) { - if (!MODIFIER_KEYS.has(key)) { - throw new error.InvalidArgumentError('Not a modifier key'); - } -} - - -/** - * Class for defining sequences of complex user interactions. Each sequence - * will not be executed until {@link #perform} is called. - * - * This class should not be instantiated directly. Instead, obtain an instance - * using {@link ./webdriver.WebDriver#actions() WebDriver.actions()}. - * - * Sample usage: - * - * driver.actions(). - * keyDown(Key.SHIFT). - * click(element1). - * click(element2). - * dragAndDrop(element3, element4). - * keyUp(Key.SHIFT). - * perform(); - * - */ -class ActionSequence { - /** - * @param {!./webdriver.WebDriver} driver The driver that should be used to - * perform this action sequence. - */ - constructor(driver) { - /** @private {!./webdriver.WebDriver} */ - this.driver_ = driver; - - /** @private {!Array<{description: string, command: !command.Command}>} */ - this.actions_ = []; - } - - /** - * Schedules an action to be executed each time {@link #perform} is called on - * this instance. - * - * @param {string} description A description of the command. - * @param {!command.Command} command The command. - * @private - */ - schedule_(description, command) { - this.actions_.push({ - description: description, - command: command - }); - } - - /** - * Executes this action sequence. - * - * @return {!./promise.Thenable} A promise that will be resolved once - * this sequence has completed. - */ - perform() { - // Make a protected copy of the scheduled actions. This will protect against - // users defining additional commands before this sequence is actually - // executed. - let actions = this.actions_.concat(); - let driver = this.driver_; - return driver.controlFlow().execute(function() { - let results = actions.map(action => { - return driver.schedule(action.command, action.description); - }); - return Promise.all(results); - }, 'ActionSequence.perform'); - } - - /** - * Moves the mouse. The location to move to may be specified in terms of the - * mouse's current location, an offset relative to the top-left corner of an - * element, or an element (in which case the middle of the element is used). - * - * @param {(!./webdriver.WebElement|{x: number, y: number})} location The - * location to drag to, as either another WebElement or an offset in - * pixels. - * @param {{x: number, y: number}=} opt_offset If the target {@code location} - * is defined as a {@link ./webdriver.WebElement}, this parameter defines - * an offset within that element. The offset should be specified in pixels - * relative to the top-left corner of the element's bounding box. If - * omitted, the element's center will be used as the target offset. - * @return {!ActionSequence} A self reference. - */ - mouseMove(location, opt_offset) { - let cmd = new command.Command(command.Name.MOVE_TO); - - if (typeof location.x === 'number') { - setOffset(/** @type {{x: number, y: number}} */(location)); - } else { - cmd.setParameter('element', location.getId()); - if (opt_offset) { - setOffset(opt_offset); - } - } - - this.schedule_('mouseMove', cmd); - return this; - - /** @param {{x: number, y: number}} offset The offset to use. */ - function setOffset(offset) { - cmd.setParameter('xoffset', offset.x || 0); - cmd.setParameter('yoffset', offset.y || 0); - } - } - - /** - * Schedules a mouse action. - * @param {string} description A simple descriptive label for the scheduled - * action. - * @param {!command.Name} commandName The name of the command. - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if the previous argument is - * provided as a button. - * @return {!ActionSequence} A self reference. - * @private - */ - scheduleMouseAction_( - description, commandName, opt_elementOrButton, opt_button) { - let button; - if (typeof opt_elementOrButton === 'number') { - button = opt_elementOrButton; - } else { - if (opt_elementOrButton) { - this.mouseMove( - /** @type {!./webdriver.WebElement} */ (opt_elementOrButton)); - } - button = opt_button !== void(0) ? opt_button : input.Button.LEFT; - } - - let cmd = new command.Command(commandName). - setParameter('button', button); - this.schedule_(description, cmd); - return this; - } - - /** - * Presses a mouse button. The mouse button will not be released until - * {@link #mouseUp} is called, regardless of whether that call is made in this - * sequence or another. The behavior for out-of-order events (e.g. mouseDown, - * click) is undefined. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).mouseDown() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - mouseDown(opt_elementOrButton, opt_button) { - return this.scheduleMouseAction_('mouseDown', - command.Name.MOUSE_DOWN, opt_elementOrButton, opt_button); - } - - /** - * Releases a mouse button. Behavior is undefined for calling this function - * without a previous call to {@link #mouseDown}. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).mouseUp() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - mouseUp(opt_elementOrButton, opt_button) { - return this.scheduleMouseAction_('mouseUp', - command.Name.MOUSE_UP, opt_elementOrButton, opt_button); - } - - /** - * Convenience function for performing a "drag and drop" manuever. The target - * element may be moved to the location of another element, or by an offset (in - * pixels). - * - * @param {!./webdriver.WebElement} element The element to drag. - * @param {(!./webdriver.WebElement|{x: number, y: number})} location The - * location to drag to, either as another WebElement or an offset in - * pixels. - * @return {!ActionSequence} A self reference. - */ - dragAndDrop(element, location) { - return this.mouseDown(element).mouseMove(location).mouseUp(); - } - - /** - * Clicks a mouse button. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).click() - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - click(opt_elementOrButton, opt_button) { - return this.scheduleMouseAction_('click', - command.Name.CLICK, opt_elementOrButton, opt_button); - } - - /** - * Double-clicks a mouse button. - * - * If an element is provided, the mouse will first be moved to the center of - * that element. This is equivalent to: - * - * sequence.mouseMove(element).doubleClick() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - doubleClick(opt_elementOrButton, opt_button) { - return this.scheduleMouseAction_('doubleClick', - command.Name.DOUBLE_CLICK, opt_elementOrButton, opt_button); - } - - /** - * Schedules a keyboard action. - * - * @param {string} description A simple descriptive label for the scheduled - * action. - * @param {!Array<(string|!input.Key)>} keys The keys to send. - * @return {!ActionSequence} A self reference. - * @private - */ - scheduleKeyboardAction_(description, keys) { - let cmd = new command.Command(command.Name.SEND_KEYS_TO_ACTIVE_ELEMENT) - .setParameter('value', keys); - this.schedule_(description, cmd); - return this; - } - - /** - * Performs a modifier key press. The modifier key is not released - * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be - * targeted at the currently focused element. - * - * @param {!input.Key} key The modifier key to push. Must be one of - * {ALT, CONTROL, SHIFT, COMMAND, META}. - * @return {!ActionSequence} A self reference. - * @throws {error.InvalidArgumentError} If the key is not a valid modifier - * key. - */ - keyDown(key) { - checkModifierKey(key); - return this.scheduleKeyboardAction_('keyDown', [key]); - } - - /** - * Performs a modifier key release. The release is targeted at the currently - * focused element. - * @param {!input.Key} key The modifier key to release. Must be one of - * {ALT, CONTROL, SHIFT, COMMAND, META}. - * @return {!ActionSequence} A self reference. - * @throws {error.InvalidArgumentError} If the key is not a valid modifier - * key. - */ - keyUp(key) { - checkModifierKey(key); - return this.scheduleKeyboardAction_('keyUp', [key]); - } - - /** - * Simulates typing multiple keys. Each modifier key encountered in the - * sequence will not be released until it is encountered again. All key events - * will be targeted at the currently focused element. - * - * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args - * The keys to type. - * @return {!ActionSequence} A self reference. - * @throws {Error} If the key is not a valid modifier key. - */ - sendKeys(var_args) { - let keys = flatten(arguments); - return this.scheduleKeyboardAction_('sendKeys', keys); - } -} - - -/** - * Class for defining sequences of user touch interactions. Each sequence - * will not be executed until {@link #perform} is called. - * - * This class should not be instantiated directly. Instead, obtain an instance - * using {@link ./webdriver.WebDriver#touchActions() WebDriver.touchActions()}. - * - * Sample usage: - * - * driver.touchActions(). - * tapAndHold({x: 0, y: 0}). - * move({x: 3, y: 4}). - * release({x: 10, y: 10}). - * perform(); - * - */ -class TouchSequence { - /** - * @param {!./webdriver.WebDriver} driver The driver that should be used to - * perform this action sequence. - */ - constructor(driver) { - /** @private {!./webdriver.WebDriver} */ - this.driver_ = driver; - - /** @private {!Array<{description: string, command: !command.Command}>} */ - this.actions_ = []; - } - - /** - * Schedules an action to be executed each time {@link #perform} is called on - * this instance. - * @param {string} description A description of the command. - * @param {!command.Command} command The command. - * @private - */ - schedule_(description, command) { - this.actions_.push({ - description: description, - command: command - }); - } - - /** - * Executes this action sequence. - * @return {!./promise.Thenable} A promise that will be resolved once - * this sequence has completed. - */ - perform() { - // Make a protected copy of the scheduled actions. This will protect against - // users defining additional commands before this sequence is actually - // executed. - let actions = this.actions_.concat(); - let driver = this.driver_; - return driver.controlFlow().execute(function() { - let results = actions.map(action => { - return driver.schedule(action.command, action.description); - }); - return Promise.all(results); - }, 'TouchSequence.perform'); - } - - /** - * Taps an element. - * - * @param {!./webdriver.WebElement} elem The element to tap. - * @return {!TouchSequence} A self reference. - */ - tap(elem) { - let cmd = new command.Command(command.Name.TOUCH_SINGLE_TAP). - setParameter('element', elem.getId()); - - this.schedule_('tap', cmd); - return this; - } - - /** - * Double taps an element. - * - * @param {!./webdriver.WebElement} elem The element to double tap. - * @return {!TouchSequence} A self reference. - */ - doubleTap(elem) { - let cmd = new command.Command(command.Name.TOUCH_DOUBLE_TAP). - setParameter('element', elem.getId()); - - this.schedule_('doubleTap', cmd); - return this; - } - - /** - * Long press on an element. - * - * @param {!./webdriver.WebElement} elem The element to long press. - * @return {!TouchSequence} A self reference. - */ - longPress(elem) { - let cmd = new command.Command(command.Name.TOUCH_LONG_PRESS). - setParameter('element', elem.getId()); - - this.schedule_('longPress', cmd); - return this; - } - - /** - * Touch down at the given location. - * - * @param {{x: number, y: number}} location The location to touch down at. - * @return {!TouchSequence} A self reference. - */ - tapAndHold(location) { - let cmd = new command.Command(command.Name.TOUCH_DOWN). - setParameter('x', location.x). - setParameter('y', location.y); - - this.schedule_('tapAndHold', cmd); - return this; - } - - /** - * Move a held {@linkplain #tapAndHold touch} to the specified location. - * - * @param {{x: number, y: number}} location The location to move to. - * @return {!TouchSequence} A self reference. - */ - move(location) { - let cmd = new command.Command(command.Name.TOUCH_MOVE). - setParameter('x', location.x). - setParameter('y', location.y); - - this.schedule_('move', cmd); - return this; - } - - /** - * Release a held {@linkplain #tapAndHold touch} at the specified location. - * - * @param {{x: number, y: number}} location The location to release at. - * @return {!TouchSequence} A self reference. - */ - release(location) { - let cmd = new command.Command(command.Name.TOUCH_UP). - setParameter('x', location.x). - setParameter('y', location.y); - - this.schedule_('release', cmd); - return this; - } - - /** - * Scrolls the touch screen by the given offset. - * - * @param {{x: number, y: number}} offset The offset to scroll to. - * @return {!TouchSequence} A self reference. - */ - scroll(offset) { - let cmd = new command.Command(command.Name.TOUCH_SCROLL). - setParameter('xoffset', offset.x). - setParameter('yoffset', offset.y); - - this.schedule_('scroll', cmd); - return this; - } - - /** - * Scrolls the touch screen, starting on `elem` and moving by the specified - * offset. - * - * @param {!./webdriver.WebElement} elem The element where scroll starts. - * @param {{x: number, y: number}} offset The offset to scroll to. - * @return {!TouchSequence} A self reference. - */ - scrollFromElement(elem, offset) { - let cmd = new command.Command(command.Name.TOUCH_SCROLL). - setParameter('element', elem.getId()). - setParameter('xoffset', offset.x). - setParameter('yoffset', offset.y); - - this.schedule_('scrollFromElement', cmd); - return this; - } - - /** - * Flick, starting anywhere on the screen, at speed xspeed and yspeed. - * - * @param {{xspeed: number, yspeed: number}} speed The speed to flick in each - direction, in pixels per second. - * @return {!TouchSequence} A self reference. - */ - flick(speed) { - let cmd = new command.Command(command.Name.TOUCH_FLICK). - setParameter('xspeed', speed.xspeed). - setParameter('yspeed', speed.yspeed); - - this.schedule_('flick', cmd); - return this; - } - - /** - * Flick starting at elem and moving by x and y at specified speed. - * - * @param {!./webdriver.WebElement} elem The element where flick starts. - * @param {{x: number, y: number}} offset The offset to flick to. - * @param {number} speed The speed to flick at in pixels per second. - * @return {!TouchSequence} A self reference. - */ - flickElement(elem, offset, speed) { - let cmd = new command.Command(command.Name.TOUCH_FLICK). - setParameter('element', elem.getId()). - setParameter('xoffset', offset.x). - setParameter('yoffset', offset.y). - setParameter('speed', speed); - - this.schedule_('flickElement', cmd); - return this; - } -} - - -// PUBLIC API - -module.exports = { - ActionSequence: ActionSequence, - TouchSequence: TouchSequence, -}; diff --git a/node_modules/selenium-webdriver/lib/atoms/getAttribute.js b/node_modules/selenium-webdriver/lib/atoms/getAttribute.js deleted file mode 100644 index b7d006bbe..000000000 --- a/node_modules/selenium-webdriver/lib/atoms/getAttribute.js +++ /dev/null @@ -1,12 +0,0 @@ -// GENERATED CODE - DO NOT EDIT -module.exports = function(){return function(){var aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){if(b.get||b.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)},ba="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global?global:this; -function e(a,c){if(c){for(var b=ba,d=a.split("."),f=0;fa||1342177279>>=1)b+=b;return d}});e("Math.sign",function(a){return a?a:function(a){a=Number(a);return!a||isNaN(a)?a:0d||b.indexOf("Error",d)!=d)b+="Error";this.name=b;b=Error(this.message);b.name=this.name;this.stack=b.stack||""} -(function(){var a=Error;function c(){}c.prototype=a.prototype;m.b=a.prototype;m.prototype=new c;m.prototype.constructor=m;m.a=function(b,c,f){for(var h=Array(arguments.length-2),k=2;kc?1:0};var w;a:{var x=g.navigator;if(x){var y=x.userAgent;if(y){w=y;break a}}w=""}function z(a){return-1!=w.indexOf(a)};function ca(a,c){for(var b=a.length,d=l(a)?a.split(""):a,f=0;fparseFloat(a))?String(c):a}(),J={},K=g.document,L=K&&E?H()||("CSS1Compat"==K.compatMode?parseInt(I,10):5):void 0;!G&&!E||E&&9<=Number(L)||G&&(J["1.9.1"]||(J["1.9.1"]=0<=r(I,"1.9.1")));E&&(J["9"]||(J["9"]=0<=r(I,"9")));var fa=z("Firefox"),ga=A()||z("iPod"),ha=z("iPad"),M=z("Android")&&!(C()||z("Firefox")||B()||z("Silk")),ia=C(),N=z("Safari")&&!(C()||z("Coast")||B()||z("Edge")||z("Silk")||z("Android"))&&!(A()||z("iPad")||z("iPod"));var ma={SCRIPT:1,STYLE:1,HEAD:1,IFRAME:1,OBJECT:1},na={IMG:" ",BR:"\n"};function oa(a,c,b){if(!(a.nodeName in ma))if(3==a.nodeType)b?c.push(String(a.nodeValue).replace(/(\r\n|\r|\n)/g,"")):c.push(a.nodeValue);else if(a.nodeName in na)c.push(na[a.nodeName]);else for(a=a.firstChild;a;)oa(a,c,b),a=a.nextSibling};function O(a){return(a=a.exec(w))?a[1]:""}var pa=function(){if(fa)return O(/Firefox\/([0-9.]+)/);if(E||F||D)return I;if(ia)return O(/Chrome\/([0-9.]+)/);if(N&&!(A()||z("iPad")||z("iPod")))return O(/Version\/([0-9.]+)/);if(ga||ha){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w);if(a)return a[1]+"."+a[2]}else if(M)return(a=O(/Android\s+([0-9.]+)/))?a:O(/Version\/([0-9.]+)/);return""}();var qa;function P(a){ra?qa(a):M?r(sa,a):r(pa,a)}var ra=function(){if(!G)return!1;var a=g.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(f){return!1}var c=a.classes,a=a.interfaces,b=c["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),d=c["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;qa=function(a){b.compare(d,""+a)};return!0}(),Q;if(M){var ta=/Android\s+([0-9\.]+)/.exec(w);Q=ta?ta[1]:"0"}else Q="0"; -var sa=Q,ua=E&&!(8<=Number(L)),va=E&&!(9<=Number(L));M&&P(2.3);M&&P(4);N&&P(6);function R(a,c){c=c.toLowerCase();if("style"==c)return wa(a.style.cssText);if(ua&&"value"==c&&T(a,"INPUT"))return a.value;if(va&&!0===a[c])return String(a.getAttribute(c));var b=a.getAttributeNode(c);return b&&b.specified?b.value:null}var xa=/[;]+(?=(?:(?:[^"]*"){2})*[^"]*$)(?=(?:(?:[^']*'){2})*[^']*$)(?=(?:[^()]*\([^()]*\))*[^()]*$)/; -function wa(a){var c=[];ca(a.split(xa),function(a){var d=a.indexOf(":");0