cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From filmaj <...@git.apache.org>
Subject [GitHub] cordova-plugin-camera pull request #254: CB-12469 (ios) Appium tests can now...
Date Tue, 21 Feb 2017 16:08:26 GMT
Github user filmaj commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-camera/pull/254#discussion_r102245774
  
    --- 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 --
    
    Ah, cool!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message