Skip to content

Commit

Permalink
Merge branch 'master' into tvos-ios17-workaround2
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Sep 18, 2024
2 parents 4d0b52f + e7095d5 commit 79264ff
Show file tree
Hide file tree
Showing 18 changed files with 452 additions and 72 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
## [7.26.4](https://github.com/appium/appium-xcuitest-driver/compare/v7.26.3...v7.26.4) (2024-09-17)

### Miscellaneous Chores

* **deps-dev:** bump sinon from 18.0.1 to 19.0.2 ([#2469](https://github.com/appium/appium-xcuitest-driver/issues/2469)) ([e737dde](https://github.com/appium/appium-xcuitest-driver/commit/e737dde53880b70536440cec84037ad58ed7f4ab))

## [7.26.3](https://github.com/appium/appium-xcuitest-driver/compare/v7.26.2...v7.26.3) (2024-09-13)

### Bug Fixes

* Strip colors from server logs ([#2466](https://github.com/appium/appium-xcuitest-driver/issues/2466)) ([661f9d3](https://github.com/appium/appium-xcuitest-driver/commit/661f9d3f0fcb0d483de137fc542de141f077b1dc))

## [7.26.2](https://github.com/appium/appium-xcuitest-driver/compare/v7.26.1...v7.26.2) (2024-09-07)

### Miscellaneous Chores

* Set static event realm ([a08ce4f](https://github.com/appium/appium-xcuitest-driver/commit/a08ce4ffb3e73e21fed4d7a28d0004bcaa899bde))

## [7.26.1](https://github.com/appium/appium-xcuitest-driver/compare/v7.26.0...v7.26.1) (2024-09-06)

### Bug Fixes

* safari process management will be done by WDA for real devices ([#2464](https://github.com/appium/appium-xcuitest-driver/issues/2464)) ([18eddc3](https://github.com/appium/appium-xcuitest-driver/commit/18eddc3c48a8361182511a14e46915d6db71cda2))

## [7.26.0](https://github.com/appium/appium-xcuitest-driver/compare/v7.25.0...v7.26.0) (2024-09-05)

### Features

* Publish different log types over BiDi ([#2458](https://github.com/appium/appium-xcuitest-driver/issues/2458)) ([29e9d5e](https://github.com/appium/appium-xcuitest-driver/commit/29e9d5e18c9fe2523dd586d7a32fdce870a81ff0))

## [7.25.0](https://github.com/appium/appium-xcuitest-driver/compare/v7.24.18...v7.25.0) (2024-08-31)

### Features

* add mobile:simctl to run listed simctl subcommands ([#2461](https://github.com/appium/appium-xcuitest-driver/issues/2461)) ([6aac043](https://github.com/appium/appium-xcuitest-driver/commit/6aac043d6882137e23f44da2ce2773657df3378c))

## [7.24.18](https://github.com/appium/appium-xcuitest-driver/compare/v7.24.17...v7.24.18) (2024-08-26)

### Miscellaneous Chores

* Bump appium-ios-device ([d67869e](https://github.com/appium/appium-xcuitest-driver/commit/d67869ef2243d1a7f0bd4780062e9370ab87d6c8))

## [7.24.17](https://github.com/appium/appium-xcuitest-driver/compare/v7.24.16...v7.24.17) (2024-08-22)

### Miscellaneous Chores

* **deps-dev:** bump webdriverio from 8.40.3 to 9.0.6 ([#2457](https://github.com/appium/appium-xcuitest-driver/issues/2457)) ([4d9ba89](https://github.com/appium/appium-xcuitest-driver/commit/4d9ba8937746b8fa354fc019af3ebfe439e72dee))

## [7.24.16](https://github.com/appium/appium-xcuitest-driver/compare/v7.24.15...v7.24.16) (2024-08-16)

### Miscellaneous Chores
Expand Down
47 changes: 47 additions & 0 deletions docs/reference/bidi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: BiDi Protocol Support
---

XCUITest driver has partial support of the [BiDi Protocol](https://w3c.github.io/webdriver-bidi/) since version 7.26.0.
Only events and commands mentioned below are supported.
All other entities described in the spec throw not implemented errors.

# Supported Events

## log.entryAdded

This event is emitted if the driver retrieves a new entry for any of the below log types. Logs collection might be disabled by the `appium:skipLogCapture` capability.

### crashlog

Events are emitted for both emulator and real devices. The latter only works if [py-ios-device](https://github.com/YueChen-C/py-ios-device) is installed on the server host. Each event contains a particular device crash report entry.
Events are always emitted with the `NATIVE_APP` context.

### syslog

Events are emitted for both emulator and real devices. Each event contains a single device system log line.
Events are always emitted with the `NATIVE_APP` context.

### safariConsole

Events are emitted for both emulator and real devices. Each event contains a single Safari console log line.
Events are always emitted with the appropriate web context name from which they were generated.
Events are only emitted if the `appium:showSafariConsoleLog` capability value is provided.

### safariNetwork

Events are emitted for both emulator and real devices. Each event contains a single Safari network log line.
Events are always emitted with the appropriate web context name from which they were generated.
Events are only emitted if the `appium:showSafariNetworkLog` capability value is provided.

### performance

Events are emitted for both emulator and real devices. Each event contains a single Safari performance log line.
Events are always emitted with the appropriate web context name from which they were generated.
Events are only emitted if the `appium:enablePerformanceLogging` capability value is provided.

### server

Events are emitted for both emulator and real devices. Each event contains a single Appium server log line.
Events are always emitted with the `NATIVE_APP` context.
Events are only emitted if the `get_server_logs` server security feature is enabled.
1 change: 1 addition & 0 deletions docs/reference/capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ about capabilities, refer to the [Appium documentation](https://appium.io/docs/e
|`appium:simpleIsVisibleCheck`|Use native methods for determining visibility of elements. In some cases this takes a long time. Setting this capability to `false` will cause the system to use the position and size of elements to make sure they are visible on the screen. This can, however, lead to false results in some situations. Defaults to `false`. | `true`, `false`|
| **Deprecated** `appium:waitForQuiescence`| It allows to turn on/off waiting for application quiescence in `WebDriverAgent`, while performing queries. The default value is `true`. You can avoid [this kind of issues](https://github.com/appium/appium/issues/11132) if you turn it off. Consider using `waitForIdleTimeout` capability instead for this purpose since Appium 1.20.0 | `false` |
|`appium:mjpegServerPort`|The port number on which WDA broadcasts screenshots stream encoded into MJPEG format from the device under test. It might be necessary to change this value if the default port is busy because of other tests running in parallel. Default value: `9100`|`12000`|
|`appium:mjpegScreenshotUrl` | The URL of a service that provides realtime device screenshots in MJPEG format. If provided then the actual command to retrieve a screenshot will be requesting pictures from this service rather than directly from the server. Appium does not handle port forward etc to the URL. | `http://<ip address to the device>:9100` |
|`appium:screenshotQuality`| Changes the initial quality of display screenshots. This capability affects the screenshoting speed and the actual quality of resulting screenshots. Before version 5.4.0 of WebDriverAgent possible values were: `0`, `1` (default), `2`, where `0` abbreviates lossless PNG, `1` is a high-quality JPEG and `2` is a low-quality JPEG. In the version 5.4.0 one more mode has been added (`3`), which is now the default one. It abbreviates lossless HEIC with fallback to PNG if the device does not support hardware-accelerated HEIC encoding. You can also change the value of screenshotQuality in [settings](settings.md). | `2` |
|`appium:autoAcceptAlerts`| Accept all iOS alerts automatically if they pop up. This includes privacy access permission alerts (location, contacts, photos). Default is `false`. |`true` or `false`|
|`appium:autoDismissAlerts`| Dismiss all iOS alerts automatically if they pop up. This includes privacy access permission alerts (location, contacts, photos). Default is `false`. |`true` or `false`|
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/element-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The XCUITest driver supports the following element attributes:

| <div style="width:6em">Name</div> | Description | <div style="width:8em">Example</div> |
| --- | --- | --- |
| `name` | Could contain either element's [identifier](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500981-identifier?language=objc) or its [label](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500692-label?language=objc), depending on which one is available first. Could also be `null`. It is recommended to prefer the usage of [accessibilityIdentifier](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier) over [accessibilityLabel](https://developer.apple.com/documentation/objectivec/nsobject/1615181-accessibilitylabel) for automation purposes, since the `identifier` property is supposed to stay constant under different locales and does not affect accessibility services such as VoiceOver. | `hello` |
| `name` | Could contain either element's [identifier](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500981-identifier?language=objc) or its [label](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500692-label?language=objc), depending on which one is available first. Could also be `null`. It is recommended to prefer the usage of [accessibilityIdentifier](https://developer.apple.com/documentation/uikit/uiaccessibilityidentification/1623132-accessibilityidentifier) over [accessibilityLabel](https://developer.apple.com/documentation/objectivec/nsobject/1615181-accessibilitylabel) for automation purposes, since the `identifier` property is supposed to stay constant under different locales and does not affect accessibility services such as VoiceOver. In applications written using [ReactNative](https://reactnative.dev/) framework this attribute reflects the value of the `testID` property. | `hello` |
| `label` | Element's [label](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500692-label?language=objc) value. Could be `null`. Since XCUITest driver 4.7.3 (WebDriverAgent 4.8.0), the behavior of this value was better aligned with XCTest, so it could include line breaks (`\n`). Before this version, line breaks were replaced by spaces. | `hello`, `hello\nworld` |
| `type` | Element's [type](https://developer.apple.com/documentation/xctest/xcuielementattributes/1500614-elementtype?language=objc) name | `XCUIElementTypeButton` |
| `visible` | Whether the element is visible. This value is not available in the "vanilla" XCTest and is read directly from the accessibility layer | `false` |
Expand Down
20 changes: 20 additions & 0 deletions docs/reference/execute-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2086,3 +2086,23 @@ Same as for [mobile: startXCTestScreenRecording](#mobile-startxctestscreenrecord
Name | Type | Description | Example
--- | --- | --- | ---
payload | string | Base64-encoded content of the recorded media file if `remotePath` parameter is empty/null or an empty string otherwise. The resulting media is expected to a be a valid QuickTime movie (.mov). | `YXBwaXVt....`

### mobile: simctl

Runs the given command as a subcommand of `xcrun simctl` against the device under test.
Does not work for real devices.

#### Arguments
Name | Type | Required | Description | Example
--- | --- | --- | --- | ---
command | string | yes | a subcommand for the `simctl`. Available commands are boot, get_app_container, getenv, icloud_sync, install, install_app_data, io, keychain, launch, location, logverbose, openurl, pbcopy, pbpaste, privacy, push, shutdown, spawn, status_bar, terminate, ui, and uninstall. Please check each usage details with `xcrun simctl help`. | `'getenv'`
args | array | no | array of string as arguments for the command after `<device>`. For example `getenv` subcommand accept `simctl getenv <device> <variable name>`. The `<device>` will be filled out automatically. This `args` should be the ` <variable name>` part only. | `['HOME']`
timeout | number | no | Command timeout in milliseconds. If the command blocks for longer than this timeout then an exception is going to be thrown. The default timeout is `600000` ms. | `10000`

#### Returned Result

Name | Type | Description | Example
--- | --- | --- | ---
stdout | string | The standard output of the command. | `'/Users/user/Library/Developer/CoreSimulator/Devices/60EB8FDB-92E0-4895-B466-0153C6DE7BAE/data\n'`
stderr | string | The standard error of the command. | `''` (an empty string)
code | string | The status code of the command. | `0`
20 changes: 13 additions & 7 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import {errors, isErrorType} from 'appium/driver';
import {util, timing} from 'appium/support';
import IOSPerformanceLog from '../device-log/ios-performance-log';
import _ from 'lodash';
import { NATIVE_WIN } from '../utils';

const NATIVE_WIN = 'NATIVE_APP';
const WEBVIEW_WIN = 'WEBVIEW';
const WEBVIEW_BASE = `${WEBVIEW_WIN}_`;
const DEFAULT_REMOTE_DEBUGGER_CONNECT_TIMEOUT_MS = 5000;
Expand Down Expand Up @@ -556,12 +556,18 @@ const commands = {

// attempt to start performance logging, if requested
if (this.opts.enablePerformanceLogging && this.remote) {
this.log.debug(`Starting performance log on '${this.curContext}'`);
this.logs.performance = new IOSPerformanceLog({
remoteDebugger: this.remote,
log: this.log,
});
await this.logs.performance.startCapture();
const context = this.curContext;
this.log.debug(`Starting performance log on '${context}'`);
[this.logs.performance,] = this.assignBiDiLogListener(
new IOSPerformanceLog({
remoteDebugger: this.remote,
log: this.log,
}), {
type: 'performance',
context,
}
);
await this.logs.performance?.startCapture();
}

// start safari logging if the logs handlers are active
Expand Down
2 changes: 2 additions & 0 deletions lib/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import recordAudioExtensions from './record-audio';
import recordScreenExtensions from './recordscreen';
import screenshotExtensions from './screenshots';
import sourceExtensions from './source';
import simctl from './simctl';
import timeoutExtensions from './timeouts';
import webExtensions from './web';
import xctestExtensions from './xctest';
Expand Down Expand Up @@ -80,6 +81,7 @@ export default {
proxyHelperExtensions,
recordAudioExtensions,
recordScreenExtensions,
simctl,
screenshotExtensions,
sourceExtensions,
timeoutExtensions,
Expand Down
Loading

0 comments on commit 79264ff

Please sign in to comment.