appium-safari-driver 1.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.azure-pipelines.yml +30 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +3 -0
  4. package/.github/dependabot.yml +11 -0
  5. package/README.md +138 -13
  6. package/azure-templates/node_setup_steps.yml +6 -0
  7. package/build/index.js +32 -31
  8. package/build/lib/commands/find.js +16 -473
  9. package/build/lib/commands/index.js +13 -65
  10. package/build/lib/desired-caps.js +48 -0
  11. package/build/lib/driver.js +58 -198
  12. package/build/lib/logger.js +12 -7
  13. package/build/lib/safari.js +197 -0
  14. package/build/lib/server.js +23 -30
  15. package/build/lib/utils.js +19 -273
  16. package/build/test/functional/desktop-driver-e2e-specs.js +56 -0
  17. package/build/test/functional/mobile-driver-e2e-specs.js +83 -0
  18. package/build/test/unit/driver-specs.js +20 -0
  19. package/build/test/unit/utils-specs.js +51 -0
  20. package/build/test/utils.js +18 -0
  21. package/gulpfile.js +10 -4
  22. package/index.js +8 -11
  23. package/lib/commands/find.js +10 -199
  24. package/lib/commands/index.js +8 -24
  25. package/lib/desired-caps.js +37 -0
  26. package/lib/driver.js +57 -62
  27. package/lib/logger.js +3 -2
  28. package/lib/safari.js +175 -0
  29. package/lib/server.js +7 -8
  30. package/lib/utils.js +13 -131
  31. package/package.json +47 -32
  32. package/test/functional/desktop-driver-e2e-specs.js +48 -0
  33. package/test/functional/mobile-driver-e2e-specs.js +73 -0
  34. package/test/unit/driver-specs.js +9 -0
  35. package/test/unit/utils-specs.js +43 -0
  36. package/test/utils.js +5 -0
  37. package/.jscsrc +0 -11
  38. package/.jshintrc +0 -11
  39. package/.npmignore +0 -2
  40. package/LICENSE +0 -13
  41. package/build/lib/commands/alert.js +0 -134
  42. package/build/lib/commands/context.js +0 -1135
  43. package/build/lib/commands/element.js +0 -452
  44. package/build/lib/commands/execute.js +0 -198
  45. package/build/lib/commands/general.js +0 -362
  46. package/build/lib/commands/gesture.js +0 -851
  47. package/build/lib/commands/logging.js +0 -96
  48. package/build/lib/commands/navigation.js +0 -101
  49. package/build/lib/commands/orientation.js +0 -74
  50. package/build/lib/commands/safari.js +0 -99
  51. package/build/lib/commands/screenshot.js +0 -169
  52. package/build/lib/commands/web.js +0 -1125
  53. package/build/test/functional/driver-e2e-specs.js +0 -186
  54. package/build/test/unit/webdriveragent-specs.js +0 -17
  55. package/lib/commands/alert.js +0 -49
  56. package/lib/commands/context.js +0 -447
  57. package/lib/commands/element.js +0 -158
  58. package/lib/commands/execute.js +0 -83
  59. package/lib/commands/general.js +0 -143
  60. package/lib/commands/gesture.js +0 -402
  61. package/lib/commands/logging.js +0 -40
  62. package/lib/commands/navigation.js +0 -34
  63. package/lib/commands/orientation.js +0 -28
  64. package/lib/commands/safari.js +0 -55
  65. package/lib/commands/screenshot.js +0 -60
  66. package/lib/commands/web.js +0 -446
  67. package/test/.jshintrc +0 -22
  68. package/test/functional/driver-e2e-specs.js +0 -69
  69. package/test/unit/webdriveragent-specs.js +0 -9
@@ -0,0 +1,30 @@
1
+ # https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/macos/
2
+ variables:
3
+ VM_IMAGE: macOS-10.15
4
+ XCODE_VERSION: 12.1
5
+ PLATFORM_VERSION: 14.1
6
+ DEVICE_NAME: iPhone 11 Pro Max
7
+ DEFAULT_NODE_VERSION: "12.x"
8
+
9
+ pool:
10
+ vmImage: "$(VM_IMAGE)"
11
+
12
+ stages:
13
+ - stage: Unit_Tests_And_Linters
14
+ jobs:
15
+ - job: Node_Unit_Tests
16
+ steps:
17
+ - template: azure-templates/node_setup_steps.yml
18
+ - script: npm install
19
+ - script: npm run test
20
+
21
+ - stage: Integration_Tests
22
+ jobs:
23
+ - job: Node_Integration_Tests
24
+ variables:
25
+ CI: true
26
+ _FORCE_LOGS: 1
27
+ steps:
28
+ - template: azure-templates/node_setup_steps.yml
29
+ - script: npm install
30
+ - script: npm run e2e-test
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ WebDriverAgent
2
+ coverage
package/.eslintrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "appium"
3
+ }
@@ -0,0 +1,11 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: npm
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "11:00"
8
+ open-pull-requests-limit: 10
9
+ commit-message:
10
+ prefix: "chore"
11
+ include: "scope"
package/README.md CHANGED
@@ -1,21 +1,146 @@
1
- appium-safar-driver
2
- ===================
1
+ appium-safari-driver
2
+ ====
3
3
 
4
- Work in progress, stay tuned!
5
- A better abstraction for connecting to the Safari Inspector on ios simulators
4
+ This is Appium driver for automating Safari on [Mac OS X](https://developer.apple.com/documentation/webkit/testing_with_webdriver_in_safari?language=objc) and iOS [since version 13](https://webkit.org/blog/9395/webdriver-is-coming-to-safari-in-ios-13/).
5
+ The driver only supports Safari automation using [W3C WebDriver protocol](https://www.w3.org/TR/webdriver/).
6
+ Under the hood this driver is a wrapper/proxy over Apple's `safaridriver` binary. Check the output of `man safaridriver` command to get more details on the supported features and possible pitfalls.
6
7
 
7
- For developers on the repo:
8
- driver-e2e-specs.js requires that a simulator is already running, and is running safari.
9
- It didn't make much sense to add the simulator start/stop functionality to this driver since it's not quite a standalone driver but more for proxying to from other running drivers.
8
+ ## Usage
10
9
 
11
- ## Watch
10
+ It is mandatory to run the `safaridriver --enable` command from the Mac OS terminal and provide your administrator password before any automated session will be executed.
11
+ In order to automate Safari on real devices it is also necessary to enable Remote Automation switch in `Settings → Safari → Advanced → Remote Automation` for these particular devices.
12
12
 
13
- ```
14
- npm run watch
15
- ```
13
+ Then you need to decide where the automated test is going to be executed. Safari driver supports the following target platforms:
14
+ - Mac OS (High Sierra or newer)
15
+ - iOS Simulator (iOS version 13 or newer)
16
+ - iOS Real Device (iOS version 13 or newer)
17
+
18
+ Safari driver allows to define multiple criterions for platform selection and also to fine-tune your automation session properties. This could be done via the following session capabilities:
19
+
20
+ Capability Name | Description
21
+ --- | ---
22
+ platformName | safaridriver binary can only create WebDriver sessions for desktop or mobile Safari and can only run on Mac OS. Value of platformName could equal to 'Mac' or 'iOS' in order to start Safari driver session for the corresponding platform. Values of platformName are compared case-insensitively.
23
+ automationName | Value of automationName must equal to 'Safari' in order to start Safari driver session. Values of automationName are compared case-insensitively.
24
+ browserName | safaridriver can only create WebDriver sessions for Safari. Any value passed to this capability will be changed to 'Safari'.
25
+ browserVersion | safaridriver will only create a session using hosts whose Safari version matches the value of browserVersion. Browser version numbers are prefix-matched. For example, if the value of browserVersion is '12', this will allow hosts with a Safari version of '12.0.1' or '12.1'.
26
+ safari:platformVersion | safaridriver will only create a session using hosts whose OS version matches the value of safari:platformVersion. OS version numbers are prefix-matched. For example, if the value of safari:platformVersion is '12', this will allow hosts with an OS version of '12.0' or '12.1' but not '10.12'.
27
+ safari:platformBuildVersion | safaridriver will only create a session using hosts whose OS build version matches the value of safari:platformBuildVersion. example of a macOS build version is '18E193'. On macOS, the OS build version can be determined by running the sw_vers(1) utility.
28
+ safari:useSimulator | If the value of safari:useSimulator is true, safaridriver will only use iOS Simulator hosts. If the value of safari:useSimulator is false, safaridriver will not use iOS Simulator hosts. NOTE: An Xcode installation is required in order to run WebDriver tests on iOS Simulator hosts.
29
+ safari:deviceType | If the value of safari:deviceType is 'iPhone', safaridriver will only create a session using an iPhone device or iPhone simulator. If the value of safari:deviceType is 'iPad', safaridriver will only create a session using an iPad device or iPad simulator. Values of safari:deviceType are compared case-insensitively.
30
+ safari:deviceName | safaridriver will only create a session using hosts whose device name matches the value of safari:deviceName. Device names are compared case-insensitively. NOTE: Device names for connected devices are shown in iTunes. If Xcode is installed, device names for connected devices are available via the output of instruments(1) and in the Devices and Simulators window (accessed in Xcode via "Window > Devices and Simulators").
31
+ safari:deviceUDID | safaridriver will only create a session using hosts whose device UDID matches the value of safari:deviceUDID. Device UDIDs are compared case-insensitively. NOTE: If Xcode is installed, UDIDs for connected devices are available via the output of instruments(1) and in the Devices and Simulators window (accessed in Xcode via "Window > Devices and Simulators").
32
+ safari:automaticInspection | This capability instructs Safari to preload the Web Inspector and JavaScript debugger in the background prior to returning a newly-created window. To pause the test's execution in JavaScript and bring up Web Inspector's Debugger tab, you can simply evaluate a debugger; statement in the test page.
33
+ safari:automaticProfiling | This capability instructs Safari to preload the Web Inspector and start a Timeline recording in the background prior to returning a newly-created window. To view the recording, open the Web Inspector through Safari's Develop menu.
34
+ webkit:WebRTC | This capability allows a test to temporarily change Safari's policies for WebRTC and Media Capture. The value of the webkit:WebRTC capability is a dictionary with the following sub-keys, all of which are optional: `DisableInsecureMediaCapture` - Normally, Safari refuses to allow media capture over insecure connections. This restriction is relaxed by default for WebDriver sessions for testing purposes (for example, a test web server not configured for HTTPS). When this capability is specified, Safari will revert to the normal behavior of preventing media capture over insecure connections. `DisableICECandidateFiltering` - To protect a user's privacy, Safari normally filters out WebRTC ICE candidates that correspond to internal network addresses when capture devices are not in use. This capability suppresses ICE candidate filtering so that both internal and external network addresses are always sent as ICE candidates.
35
+
36
+
37
+ ## Example
38
+
39
+ ```python
40
+ # Python3 + PyTest
41
+ import pytest
42
+ import time
43
+
44
+ from appium import webdriver
45
+ from selenium.webdriver.common.by import By
46
+
47
+
48
+ def generate_caps():
49
+ common_caps = {
50
+ # It does not really matter what to put there, although setting 'Safari' might cause a failure
51
+ # depending on the particular client library
52
+ 'browserName': 'AppiumSafari',
53
+ # automationName capability presence is mandatory for this Safari Driver to be selected
54
+ 'automationName': 'Safari',
55
+ }
56
+ real_device_caps = {
57
+ **common_caps,
58
+ 'platformName': 'iOS',
59
+ # This capability is optional
60
+ 'safari:deviceType': 'iPhone',
61
+ # Do not forget to verify that Remote Automation is enabled for this device
62
+ 'safari:deviceUDID': '<MyDeviceUDID>',
63
+ 'safari:useSimulator': False,
64
+ }
65
+ simulator_caps = {
66
+ **common_caps,
67
+ 'platformName': 'iOS',
68
+ 'safari:platformVersion': '14.1',
69
+ 'safari:deviceName': 'iPad Air 2',
70
+ 'safari:useSimulator': True,
71
+ }
72
+ desktop_browser_caps = {
73
+ **common_caps,
74
+ 'platformName': 'Mac',
75
+ }
76
+ return [real_device_caps, simulator_caps, desktop_browser_caps]
77
+
78
+
79
+ @pytest.fixture(params=generate_caps())
80
+ def driver(request):
81
+ drv = webdriver.Remote('http://localhost:4723/wd/hub', request.param)
82
+ yield drv
83
+ drv.quit()
16
84
 
17
- ## Test
18
85
 
86
+ class TimeoutError(Exception):
87
+ pass
88
+
89
+
90
+ def wait_until_truthy(func, timeout_sec=5.0, interval_sec=0.5):
91
+ started = time.time()
92
+ original_error = None
93
+ while time.time() - started < timeout_sec:
94
+ original_error = None
95
+ try:
96
+ result = func()
97
+ if result:
98
+ return result
99
+ except Exception as e:
100
+ original_error = e
101
+ time.sleep(interval_sec)
102
+ if original_error is None:
103
+ raise TimeoutError(f'Condition unmet after {timeout_sec}s timeout')
104
+ raise original_error
105
+
106
+
107
+ def test_feature_status_page_search(driver):
108
+ driver.get('https://webkit.org/status/')
109
+
110
+ # Enter "CSS" into the search box.
111
+ # Ensures that at least one result appears in search
112
+ # !!! Remember there are no ID and NAME locators in W3C standard
113
+ # These two have been superseded by CSS ones
114
+ search_box = driver.find_element_by_css('#search')
115
+ search_box.send_keys('CSS')
116
+ value = search_box.get_attribute('value')
117
+ assert len(value) > 0
118
+ search_box.submit()
119
+ # Count the visible results when filters are applied
120
+ # so one result shows up in at most one filter
121
+ assert wait_until_truthy(lambda: len(driver.execute_script("return document.querySelectorAll('li.feature:not(.is-hidden)')")) > 0)
122
+
123
+
124
+ def test_feature_status_page_filters(driver):
125
+ driver.get('https://webkit.org/status/')
126
+
127
+ assert wait_until_truthy(lambda: len(driver.execute_script("return document.querySelectorAll('.filter-toggle')")) == 7)
128
+
129
+ # Make sure every filter is turned off.
130
+ for checked_filter in filter(lambda f: f.is_selected(), filters):
131
+ checked_filter.click()
132
+
133
+ # Make sure you can select every filter.
134
+ for filt in filters:
135
+ filt.click()
136
+ assert filt.is_selected()
137
+ filt.click()
19
138
  ```
20
- npm test
139
+
140
+ ## Development
141
+
142
+ ```bash
143
+ # clone repo, then in repo dir:
144
+ npm install
145
+ gulp watch
21
146
  ```
@@ -0,0 +1,6 @@
1
+ steps:
2
+ - task: NodeTool@0
3
+ inputs:
4
+ versionSpec: "$(DEFAULT_NODE_VERSION)"
5
+ - script: sudo xcode-select --switch "/Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer"
6
+ # - script: safaridriver --enable
package/build/index.js CHANGED
@@ -1,48 +1,49 @@
1
- require('source-map-support').install();
1
+ "use strict";
2
2
 
3
- 'use strict';
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
- var _regeneratorRuntime = require('babel-runtime/regenerator')['default'];
6
-
7
- var _interopRequireDefault = require('babel-runtime/helpers/interop-require-default')['default'];
8
-
9
- Object.defineProperty(exports, '__esModule', {
5
+ Object.defineProperty(exports, "__esModule", {
10
6
  value: true
11
7
  });
8
+ Object.defineProperty(exports, "SafariDriver", {
9
+ enumerable: true,
10
+ get: function () {
11
+ return _driver.default;
12
+ }
13
+ });
14
+ Object.defineProperty(exports, "startServer", {
15
+ enumerable: true,
16
+ get: function () {
17
+ return _server.startServer;
18
+ }
19
+ });
20
+ exports.default = void 0;
12
21
 
13
- var _yargs = require('yargs');
14
-
15
- var _yargs2 = _interopRequireDefault(_yargs);
22
+ require("source-map-support/register");
16
23
 
17
- var _asyncbox = require('asyncbox');
24
+ var _driver = _interopRequireDefault(require("./lib/driver"));
18
25
 
19
- var _libDriver = require('./lib/driver');
26
+ var _server = require("./lib/server");
20
27
 
21
- var _libServer = require('./lib/server');
28
+ var _yargs = _interopRequireDefault(require("yargs"));
22
29
 
23
- var DEFAULT_HOST = "localhost";
24
- var DEFAULT_PORT = 4723;
30
+ var _asyncbox = require("asyncbox");
25
31
 
26
- function main() {
27
- var port, host;
28
- return _regeneratorRuntime.async(function main$(context$1$0) {
29
- while (1) switch (context$1$0.prev = context$1$0.next) {
30
- case 0:
31
- port = _yargs2['default'].argv.port || DEFAULT_PORT;
32
- host = _yargs2['default'].argv.host || DEFAULT_HOST;
33
- return context$1$0.abrupt('return', (0, _libServer.startServer)(port, host));
32
+ const DEFAULT_HOST = 'localhost';
33
+ const DEFAULT_PORT = 4797;
34
34
 
35
- case 3:
36
- case 'end':
37
- return context$1$0.stop();
38
- }
39
- }, null, this);
35
+ async function main() {
36
+ let port = _yargs.default.argv.port || _yargs.default.argv.p || DEFAULT_PORT;
37
+ let host = _yargs.default.argv.host || _yargs.default.argv.h || DEFAULT_HOST;
38
+ return await (0, _server.startServer)(port, host);
40
39
  }
41
40
 
42
41
  if (require.main === module) {
43
42
  (0, _asyncbox.asyncify)(main);
44
43
  }
45
44
 
46
- exports.SafariDriver = _libDriver.SafariDriver;
47
- exports['default'] = _libDriver.SafariDriver;
48
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztxQkFFa0IsT0FBTzs7Ozt3QkFDQSxVQUFVOzt5QkFDTixjQUFjOzt5QkFDZixjQUFjOztBQUUxQyxJQUFNLFlBQVksR0FBRyxXQUFXLENBQUM7QUFDakMsSUFBTSxZQUFZLEdBQUcsSUFBSSxDQUFDOztBQUUxQixTQUFlLElBQUk7TUFDYixJQUFJLEVBQ0osSUFBSTs7OztBQURKLFlBQUksR0FBRyxtQkFBTSxJQUFJLENBQUMsSUFBSSxJQUFJLFlBQVk7QUFDdEMsWUFBSSxHQUFHLG1CQUFNLElBQUksQ0FBQyxJQUFJLElBQUksWUFBWTs0Q0FDbkMsNEJBQVksSUFBSSxFQUFFLElBQUksQ0FBQzs7Ozs7OztDQUMvQjs7QUFFRCxJQUFJLE9BQU8sQ0FBQyxJQUFJLEtBQUssTUFBTSxFQUFFO0FBQzNCLDBCQUFTLElBQUksQ0FBQyxDQUFDO0NBQ2hCOztRQUVRLFlBQVkiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0cmFuc3BpbGU6bWFpblxuXG5pbXBvcnQgeWFyZ3MgZnJvbSAneWFyZ3MnO1xuaW1wb3J0IHsgYXN5bmNpZnkgfSBmcm9tICdhc3luY2JveCc7XG5pbXBvcnQgeyBTYWZhcmlEcml2ZXIgfSBmcm9tICcuL2xpYi9kcml2ZXInO1xuaW1wb3J0IHsgc3RhcnRTZXJ2ZXIgfSBmcm9tICcuL2xpYi9zZXJ2ZXInO1xuXG5jb25zdCBERUZBVUxUX0hPU1QgPSBcImxvY2FsaG9zdFwiO1xuY29uc3QgREVGQVVMVF9QT1JUID0gNDcyMztcblxuYXN5bmMgZnVuY3Rpb24gbWFpbiAoKSB7XG4gIGxldCBwb3J0ID0geWFyZ3MuYXJndi5wb3J0IHx8IERFRkFVTFRfUE9SVDtcbiAgbGV0IGhvc3QgPSB5YXJncy5hcmd2Lmhvc3QgfHwgREVGQVVMVF9IT1NUO1xuICByZXR1cm4gc3RhcnRTZXJ2ZXIocG9ydCwgaG9zdCk7XG59XG5cbmlmIChyZXF1aXJlLm1haW4gPT09IG1vZHVsZSkge1xuICBhc3luY2lmeShtYWluKTtcbn1cblxuZXhwb3J0IHsgU2FmYXJpRHJpdmVyIH07XG5cbmV4cG9ydCBkZWZhdWx0IFNhZmFyaURyaXZlcjtcbiJdfQ==
45
+ var _default = _driver.default;
46
+ exports.default = _default;require('source-map-support').install();
47
+
48
+
49
+ //# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbIkRFRkFVTFRfSE9TVCIsIkRFRkFVTFRfUE9SVCIsIm1haW4iLCJwb3J0IiwieWFyZ3MiLCJhcmd2IiwicCIsImhvc3QiLCJoIiwicmVxdWlyZSIsIm1vZHVsZSIsI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