xcode-ui-testing

Swift UITesting error: Invalid escape sequence in literal. \U201c

◇◆丶佛笑我妖孽 提交于 2019-12-30 06:12:09
问题 I am building an automation suite using Xcode 7 with swift. My app loads with the following Alert View: Allow "Light Alarm" to access your location while you use the app? When I record with UI Testing and click this alert I get the following code: app.alerts["Allow \U201cLight Alarm\U201c to access your location while you use the app?"] Note: The quotes has been replaced with \U201c However, when I try and compile I get the following error: "Invalid escape sequence in literal" Anyone know how

Testing if an element is visible with Xcode 7 UITest

馋奶兔 提交于 2019-12-28 05:49:06
问题 I want to verify if an element is visible or not depending on its .hidden property but I don't find a valid way to do that using the new Xcode 7 UI test stuff. I've tried with myelement.exists and myelement.hittable but they doesn't seems to work as I expected. I suppose they work on conjunction with the hidden property. An hidden element shouldn't exists and is not hittable... but this is not the current behaviour (I can understand the exists behaviour... but a hidden element should be not

Connect to an Oracle Database in Swift

岁酱吖の 提交于 2019-12-25 14:08:32
问题 I am using Xcode 7, Swift, and the new UI Automation announced at WWDC 15. I want to test some things in an oracle database after some of my UI automation tests have run. Can this be done? If so how do you do it? I can't seem to find any sort of documentation on the subject. 回答1: The mobile phone doesn't guarantee a permanent and stable network connection and is a big problem for direct connection to DB. For mobile platforms you need to create a web service on a server that will do all the

“UI Testing Failure: Did not receive view did disappear notification within 2.0s” error

假如想象 提交于 2019-12-24 05:59:49
问题 I am trying to record a UI test case and run it back, but I am running into this error. Basically, in my application when I land on the home screen, the user is asked to allow use of notification and location. After I record these events and try to segue to another VC, it records normally like so. [app.alerts[@"\u201cSampleApp\u201d Would Like to Send You Notifications"].collectionViews.buttons[@"Don\u2019t Allow"] tap]; [app.alerts[@"Allow \u201cSampleApp\u201d to access your location while

Cocoapods not linking correctly for 3rd, 4th target (Xcode 7 beta 6)

喜欢而已 提交于 2019-12-24 05:11:32
问题 I'm having a problem with Cocoapods and Xcode 7 beta 6: I have a project with three different test targets (tests, UITests, IntegrationTests). My pods seem to be working just fine with the first target ("tests") but the other targets are having problems: Everything builds just fine if I don't reference any of the Cocoapods in the latter two targets. However, when I try to use one of the pods (XCGLogger in this case), I get linker errors. I checked the build phases, and found that Embed Pods

Xcode7 ui testing: staticTexts[“XX”].swipeRight() swipes not far enough

五迷三道 提交于 2019-12-24 03:16:54
问题 For UI testing I want to perform a swipeRight-gesture to make further buttons accessible. The element I want to swipe is at the bottom of the screen. I access it by: element.staticTexts["TEST TEXT"].swipeRight() When performing the test the swipe goes not far enough. It does not trigger the element to slide completely to the right and show the further buttons I want to tap. I have the feeling that swipeRight() grabs the middle of the static text and performs the gesture. Is there any

Xcode UI Testing allow system alerts series

血红的双手。 提交于 2019-12-23 12:33:32
问题 I have problem, if i try allow series system alert, work only one time, and next alert not "allowing" I googling more time, and know about that post: (Xcode 7 UI Testing: how to dismiss a series of system alerts in code) Nothing.. not work. Here my current code, first alert "allowed" successfully, next alert not detected.. XCUIApplication *app = [[XCUIApplication alloc] init]; app.launchEnvironment = @{ @"isUITest" : @YES, @"withFakeData" : fakeData }; [app launch]; for (int i = 1; i <= self

UI Tests - isSelected is always returning false

喜你入骨 提交于 2019-12-23 08:32:10
问题 We have updated out Swift 2.3 project to Swift 3 recently using Xcode 8.2.1 (8C1002), and now most of our UI Tests related with tableViews and the isSelected property aren't working. It's always returning false, even when the object is selected (we can see it in the iOS Simulator). Has anyone experienced similar issues? Our code used to work normally in Swift 2.3 before the conversion. Here is how we retrieve a tableView cell: let cell = app.tables.cells.element(at: 4) Note: app is a

UI Tests - isSelected is always returning false

。_饼干妹妹 提交于 2019-12-23 08:32:05
问题 We have updated out Swift 2.3 project to Swift 3 recently using Xcode 8.2.1 (8C1002), and now most of our UI Tests related with tableViews and the isSelected property aren't working. It's always returning false, even when the object is selected (we can see it in the iOS Simulator). Has anyone experienced similar issues? Our code used to work normally in Swift 2.3 before the conversion. Here is how we retrieve a tableView cell: let cell = app.tables.cells.element(at: 4) Note: app is a

“Failed to get refreshed snapshot” error when UI testing with a UIPickerView

孤人 提交于 2019-12-23 04:48:30
问题 I have a time selector view that uses a UIPickerView with 6 sections, hours, minutes, seconds and fixed label wheels between them. When I try to run a UI test against this view in XCode 7, the simulator freezes and I eventually see the error: "Failed to get refreshed snapshot" My test currently just attempts to interact with the cancel button in the view: app.buttons["Cancel"].tap() I've also tried waiting for the cancel button to exist. Removing the picker view from the UIView stops the test