xcode-ui-testing

Is there a way to reset the app between tests in Swift XCTest UI?

不问归期 提交于 2019-12-17 08:05:19
问题 Is there an API call within XCTest that I can put into the setUP() or tearDown() to reset the app between tests? I looked in the dot syntax of XCUIApplication and all I saw was the .launch() OR is there a way to call a shell script in Swift? I could then call xcrun in-between test methods to reset the simulator. 回答1: You can add a "Run Script" phase to build phases in your test target to uninstall the app before running unit tests against it, unfortunately this is not between test cases,

Is there a way to reset the app between tests in Swift XCTest UI?

早过忘川 提交于 2019-12-17 08:03:15
问题 Is there an API call within XCTest that I can put into the setUP() or tearDown() to reset the app between tests? I looked in the dot syntax of XCUIApplication and all I saw was the .launch() OR is there a way to call a shell script in Swift? I could then call xcrun in-between test methods to reset the simulator. 回答1: You can add a "Run Script" phase to build phases in your test target to uninstall the app before running unit tests against it, unfortunately this is not between test cases,

xcode: Timestamped Event Matching Error: Failed to find matching element

浪尽此生 提交于 2019-12-14 00:15:31
问题 I'm trying to record some XCUITesting functions. I get this error. Timestamped Event Matching Error: Failed to find matching element Is this an Xcode bug and/or issues with the complexity of my UI? 回答1: I was having the same problem for a long time on a very complex app as well: The key is all in isAccessibilityElement being set to YES. UI testing and accessibility go hand-in-hand. The way I think about it is that the device needs to be able to interact with the element, since ostensibly, the

xctool …ERROR: build-tests: '' is not a testing target in this scheme

橙三吉。 提交于 2019-12-13 19:42:53
问题 i try to run my Xcode UI Tests and just a specific method. It isn't possible with the default xcodebuild command line from apple. I found the xctool but the tool didn't found my UITestsTarget. Here my command line: /path/to/xctool -workspace APP.xcworkspace -scheme "APPScheme" test -only UITestsTarget:UITestsClass/UITestsMethod and i got this error: ...ERROR: build-tests: 'UITestsTarget' is not a testing target in this scheme. with xcodebuild list i can see all the informations about project

How do I install the XCUITest runner app and ipa on a real device and get the results?

醉酒当歌 提交于 2019-12-13 12:14:21
问题 How do I install the XCUITest runner app and ipa on a real device and get the results? I have a runner.app that was generated by building it for testing, and a deployed/signed .ipa. Now what I would like to happen is to have it installed on a real device, execute it, and get the device log. 回答1: Edited with answer... It is possible to achieve this. In order to build an ipa of the UI Testing app bundle you can follow these steps: Open your project containing in Xcode. Select the device you'd

UItesting : Click on UIcollectionview then testing it get failed

元气小坏坏 提交于 2019-12-13 03:48:57
问题 I am new at ui-testing. During recording, when I tap on ui-collection view first object is shown on UI and corresponding to code written in test-example method is: XCUIElement *window = [[app childrenMatchingType:XCUIElementTypeWindow] elementBoundByIndex:0]; XCUIElement *element2 = [[[[window childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther].element childrenMatchingType:XCUIElementTypeOther]

How to get all possible values of a pickerWheels on iOS UITest?

*爱你&永不变心* 提交于 2019-12-13 02:38:57
问题 I have a UIPickerView on my app, with a list of values, we can use Colors. The picker has only one wheel, and I manage to select the value by using this code: let app = XCUIApplication() app.launch() app.pickerWheels.element.adjustToPickerWheelValue("Yellow") But what I want to do is to get all the possible values of this wheel in an Array, so I can use the array values to select in the picker. Another good solution would be to make the selection by index instead of by key, but I could not

Xcode 7.3.1 UITests Code Coverage always at 0%

北慕城南 提交于 2019-12-12 12:35:37
问题 I have two separate targets for Unit Testing and UI Testing in my project besides the main app . These two targets have separate schemes so that i can run them on my CI server separately. I check "Gather Code Coverage" in both of this schemes. Initially i made sure everything is working from XCode by building and running these two schemes separately using "Cmd + U" and coverage data is shown properly for both of these schemes.... In my Jenkins CI i have separate jobs for these two schemes

Is it possible to stub HTTP requests in Xcode 7 automated UI tests?

点点圈 提交于 2019-12-12 07:36:50
问题 I've been trying to intercept and stub/mock HTTP requests in Xcode 7 automated UI tests, using tools like OHHTTPStubs, with no luck. Here's an example of how I am trying to capture any HTTP request using OHHTTPStubs in the setUp method of a UI test file: override func setUp() { super.setUp() let matcher: OHHTTPStubsTestBlock = { (request) -> Bool in return true } OHHTTPStubs.stubRequestsPassingTest(matcher) { (response) -> OHHTTPStubsResponse! in return OHHTTPStubsResponse.init() } } Is there

Prevent XCUIElementQuery from being reevaluated

不想你离开。 提交于 2019-12-12 06:09:17
问题 In the WWDC Session about UI Testing in Xcode you can learn that queries are evaluated when you actually synthesise properties or read values. So when are queries evaluated? So they are not actually evaluated just when you create them. They are evaluated on-demand or as they are needed. This means that with an element, the query will be evaluated when you synthesize events or read property values. You can create the element but until you use it, the query won't be evaluated. Similarly if you