cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-12469) Camera Appium tests should run on iOS 10
Date Mon, 20 Feb 2017 18:08:44 GMT

    [ https://issues.apache.org/jira/browse/CB-12469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15874893#comment-15874893
] 

ASF GitHub Bot commented on CB-12469:
-------------------------------------

Github user filmaj commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/254#discussion_r102069422
  
    --- Diff: appium-tests/ios/ios.spec.js ---
    @@ -82,11 +86,43 @@ describe('Camera tests iOS.', function () {
                 .elementByXPath('//*[@label="Use"]')
                 .click()
                 .fail(function () {
    -                // For some reason "Choose" element is not clickable by standard Appium
methods
    +                if (isXCUI) {
    +                    return driver
    +                        .waitForElementByAccessibilityId('Choose', MINUTE / 3)
    +                        .click();
    +                }
    +                // For some reason "Choose" element is not clickable by standard Appium
methods on iOS <= 9
                     return wdHelper.tapElementByXPath('//UIAButton[@label="Choose"]', driver);
                 });
         }
     
    +    function clickPhoto() {
    +        if (isXCUI) {
    +            // iOS >=10
    +            return driver
    +                .context(CONTEXT_NATIVE_APP)
    +                .elementsByXPath('//XCUIElementTypeCell')
    +                .then(function(photos) {
    +                    if (photos.length == 0) {
    +                        return driver
    +                            .sleep(0) // driver.source is not a function o.O
    +                            .source()
    +                            .then(function (src) {
    +                                console.log(src);
    +                                gracefullyFail('Couldn\'t find an image to click');
    +                            });
    +                    }
    +                    // intentionally clicking the second photo here
    +                    // the first one is not clickable for some reason
    +                    return photos[1].click();
    --- End diff --
    
    Are we guaranteed to have more than one photo?


> Camera Appium tests should run on iOS 10
> ----------------------------------------
>
>                 Key: CB-12469
>                 URL: https://issues.apache.org/jira/browse/CB-12469
>             Project: Apache Cordova
>          Issue Type: Test
>          Components: Appium, Plugin Camera
>            Reporter: Alexander Sorokin
>            Assignee: Alexander Sorokin
>              Labels: triaged
>
> Currently Appium tests for Camera can only run on iOS 9, which is a glaring flaw.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message