[
https://issues.apache.org/jira/browse/CB-12469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15876203#comment-15876203
]
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_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!
> 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: [email protected]
For additional commands, e-mail: [email protected]