<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## tvOS 支持 - 通過 XCUITest 驅動,Appium 1.13.0+ 支持 tvOS 自動化。 - 在 Apple TV 4K 上不支持。因為 [ios-deploy](https://github.com/ios-control/ios-deploy) 不支持無線設備。 <img src="https://user-images.githubusercontent.com/5511591/55161297-876e0200-51a8-11e9-8313-8d9f15a0db9d.gif" width=50%> ## 設置 通過修改`platformName`參數,你可以在tvOS上運行測試。 ```json { "automationName": "XCUITest", "platformName": "tvOS", // here "platformVersion": "12.2", "deviceName": "Apple TV", ... } ``` 小貼士:編譯 WDA 支持 tvOS - 更新到最新版本的 Carthage - 確保機器上有 tvOS 模擬器 - 比如:運行`xcrun simctl list | grep "com.apple.CoreSimulator.SimRuntime.tvOS"`看看結果。 - 如果沒有tvOS模擬器,新版本的 Carthage 會拋出這樣的錯誤: `Could not find any available simulators for tvOS` ## 限制 tvOS上不支持手勢動作,某些命令也不支持,比如`pasteboard`。 我們可以簡單地按`up/down/left/right/home`來聚焦(focus)元素。tvOS 在_focused_的元素上執行動作。你可以通過[Attributes API](http://appium.io../commands/element/attributes/attribute/)得到`focus`的元素。_Get active element_ API 會返回聚焦的元素。 ## 基礎動作 _pressButton_ 和 _get active element_ 是 tvOS 上的基礎動作。由于 tvOS 也有動畫,所以需要考慮使用 `wait` 方法。 ```ruby # Ruby element = @driver.find_element :accessibility_id, 'element on the app' # Returns true if the element is focused, otherwise false element.focused #=> 'true' # Appium moves the focus to the element by pressing the corresponding keys and clicking the element element.click # Get the app state @driver.app_state('test.package.name') # => :running_in_foreground # Press keys @driver.execute_script 'mobile: pressButton', { name: 'Home' } # Move focus and get the focused element @driver.execute_script 'mobile: pressButton', { name: 'Up' } # Get a focused element element = @driver.switch_to.active_element element.label #=> "Settings" ``` ```Python # Python element = driver.find_element_by_accessibility_id('element on the app') element.get_attribute('focused') element.click() driver.query_app_state('test.package.name') driver.execute_script('mobile: pressButton', { 'name': 'Home' }) driver.execute_script('mobile: pressButton', { 'name': 'Up' }) element = driver.switch_to.active_element element.get_attribute('label') ``` ```java // Java WebElement element = driver.findElementByAccessibilityId("element on the app"); element.getAttribute("focused"); element.click(); driver.queryAppState("test.package.name"); driver.executeScript("mobile: pressButton", ImmutableMap.of("name", "Home")); driver.executeScript("mobile: pressButton", ImmutableMap.of("name", "Up")); element = driver.switchTo().activeElement(); element.getAttribute("label"); ``` ```javascript // webdriver.io example const element = $('~SomeAccessibilityId'); element.getAttribute('focused'); element.click(); driver.execute('mobile: pressButton', {name: 'Home'}); driver.execute('mobile: pressButton', {name: 'Up'}); const activeElement = driver.getActiveElement(); activeElement.getAttribute('label'); // WD example const element = await driver.elementByAccessibilityId('element on the app'); await element.getAttribute('focused'); await element.click(); await driver.execute('mobile: pressButton', {name: 'Home'}); await driver.execute('mobile: pressButton', {name: 'Up'}); const activeElement = await driver.active(); await activeElement.getAttribute('label'); ``` ## 更多動作 tvOS 提供基于 [remote controller](https://developer.apple.com/design/human-interface-guidelines/tvos/remote-and-controllers/remote/) 的動作。Appium 通過`mobile: pressButton`提供了 _Buttons_ 等一些列動作,包括 `menu`,`up/down/left/right`,`home`,`playpause` 和 `select`。如果你發送不支持的 button 名字給服務器,在錯誤信息中會羅列支持的動作。 如果提供了 `find element/s` 和 `click`操作 ,Appium 會自動計算 `up/down/left/right` 和 `select` 順序。你不需要每次都關心哪個按鈕被點擊了。 你也可以設置一個焦點或者開始/暫停播放。在 tvOS 中,`menu`按鈕作為返回鍵。 ## 測試運行環境 - 使用模擬器或者真機 - 在支持[HeadSpin](https://headspin.io)的真機上測試或者開發 ## 資源 - 相關問題: - https://github.com/appium/appium/pull/12401 - 比如 [appium-xcuitest-driver#911](https://github.com/appium/appium-xcuitest-driver/pull/911), [appium-xcuitest-driver#939](https://github.com/appium/appium-xcuitest-driver/pull/939), [appium-xcuitest-driver#931](https://github.com/appium/appium-xcuitest-driver/pull/931), [appium/WebDriverAgent/pull/163](https://github.com/appium/WebDriverAgent#163)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看