xcode-ui-testing

XCode7 UITesting - how to add main target classes to be available from UITestCase (Undefined symbols error)?

落爺英雄遲暮 提交于 2019-12-12 05:16:30
问题 I'm doing UI testing with XCode7 and need a way to reset my app to some initial state. I have a method to do so in one of my .m files that are part of the main target. How can I make classes from the main target to be available from within a UITestCase? I tried regular import, but get a linker error: #import <XCTest/XCTest.h> #import "CertificateManager.h" @interface UITests : XCTestCase @end -(void)testWelcomeScreen { //put the app into initial state [[CertificateManager sharedInstance]

XCTest UI Record and Play - Simulator not updating UI

。_饼干妹妹 提交于 2019-12-12 04:24:20
问题 Apple released a new UI Testing framework 2 days ago during WWDC2015. I'm trying to write a test case and when I try to record the UI testing, to generate the scaffolding code, it looks the code is being generated, however the UI on the simulator is not actually updating. i.e When I tap on a button, the code is generated to actually find the button and tap, but the button is not actually tapped simultaneously on the simulator. So basically I'm not able to go to the next screen on the

performTaskWithPathArgumentsTimeout in XCTest?

陌路散爱 提交于 2019-12-12 02:56:58
问题 Does the new way of UI testing with Xcode have a method like performTaskWithPathArgumentsTimeout? Ultimately, how can I Check Email during Xcode UI Testing? 回答1: It does not. I've scraped the framework's headers to put together some unofficial documentation and it's not present. 来源: https://stackoverflow.com/questions/35678717/performtaskwithpathargumentstimeout-in-xctest

Xcode 7 Beta 6 Pre-release App won't launch (in simulator)

拈花ヽ惹草 提交于 2019-12-12 02:46:28
问题 I'm trying to get UI testing set up for my project - I encountered a crash with previous betas. (See this stack overflow question if you are interested) Anyway, I was quite thrilled to try it with Xcode 7 Beta 5. I created a simple Single Page app, added a text field and button, and ran it in Simulator. The simulator loads but the app doesn't get installed. I've tried it in different simulators, all iOS 9 - same behavior in all of them. Anyone else see this behavior? Am I missing something?

How to test launching a viewcontroller XCTest

て烟熏妆下的殇ゞ 提交于 2019-12-11 20:50:14
问题 I have a framework under test, I want to test a method from public interface which user will call to show a ViewController with xib, I want to unit test this situation using XCTest, call to the method which does above described thing looks like this testClass = [[AdGateMedia alloc] initWith:@"nac" and:@"1234" withParent:view]; [testClass showView]; The parent view controller is instance of calling view controller from host application which is using framework. When testing this parent

Perform a full swipe left action in UI Tests?

谁说我不能喝 提交于 2019-12-11 15:14:31
问题 I have implemented leading and trailing swipe actions in a table view. Now, I'm trying to test them in XCTest UI tests. To test a regular swipe in either direction is easy: tableCell.swipeRight() tableCell.swipeLeft() Using one of these causes the 1st action button to be displayed, and I can then .tap() on the button. However, testing a full swipe is proving a little more challenging. I have played with this extension from How do I swipe faster or more precisely? I have also played with this

Call button on UI Testing?

旧城冷巷雨未停 提交于 2019-12-11 14:17:32
问题 I was wondering if it's possible to tap call button from tel's scheme (e.g tel//555555555). Because if I touch call button I'll have an alert that I need to confirm my call or cancel it. Is it possible? I have this on my code: addUIInterruptionMonitor(withDescription: "Phone Dialog") { (alert) -> Bool in let button = alert.buttons["Llamar"] if button.exists { button.tap() return true } return false } app.tap() XCTAssert(app.buttons["call_button"].exists, "No se encuentra el boton de llamar")

Xcode-Ui-Test: Can i specify a particular test that i want to run from terminal

荒凉一梦 提交于 2019-12-11 11:48:35
问题 i wrote a ui test in new xcode 7 with swift 2.0. I have a script, that i run from terminal to execute the ui-tests. Here is the command line: xcodebuild -workspace App.xcworkspace -scheme "App-Scheme" -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=9.1' test The problem is, this command line run all the test-cases into my test. How is it possible the specify a particular test? Any ideas? Cheers. 回答1: I post this impovement to Apple. As i know, Now the only way - to

How to use GPX file for UI Tests only

守給你的承諾、 提交于 2019-12-11 11:06:58
问题 I'm trying to use a GPX file, for simulating my location when I run UI Tests. I have selected the GPX file under 'Test Location'. But it's not working. I just get an error, which tells me 'Location not available'. I know, I can go into Run -> Debug and then activate 'Allow Location Simulation' and then select the file as 'Default Location'. But since I only want it to be activated for my UITests, and not when I run it normally in the simulator - I don't want to set it as default in the Run

Xcode UITesting crashes

痴心易碎 提交于 2019-12-11 10:23:51
问题 Anyone familiar with the following issue when generating UI tests? Crashed Thread: 26 Dispatch queue: XCUIRecorder_iOS.processingQueue Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY The problem lies in the fact that when trying to press a control, Xcode suddenly crashes. I know this is a widely known error, however, any solutions so far? Thanks! 回答1: I had the same problem and I managed to find a workaround for