xcode-ui-testing

XCUIElement hierarchy within UITableViewCell

余生颓废 提交于 2020-01-05 12:16:07
问题 I encountered a strange behaviour in UI-tests. When I add a custom view into UITableViewCell, some of it's subviews are not accessible. However, it's OK in Xcode's Debug View Hierarchy. Yes, I know about UIAccessibilityContainer but it's not a solution cause of: 1. there are regular subviews in my custom view (views, labels, images), not a drawn content. 2. I can't disable isAccessibilityElement for containerView and enable it for ImageView cause of I need both in the same time. So, when I

From an XCUITest how can I check the on/off state of a UISwitch?

为君一笑 提交于 2020-01-03 16:58:58
问题 I recently ran into a situation where I needed to be able to check the current on/off state (NOT whether it is enabled for user interaction) of a UISwitch from within an existing bucket of XCUITests, not an XCTest, and toggle it to a pre-determined state. I had added app state restoration to an old existing app and this is now interfering with a number of existing testcases between runs that expected the UISwitches in particular default states. Unlike XCTest, within XCUITest you do not have

iOS Run UITesting in sequence (file and function level)

[亡魂溺海] 提交于 2020-01-03 02:46:09
问题 I have created UITesting like this. I need to run those 3 file in sequence and I need to name like this. I think it is quite bad. I want to name more logically (instead of Test1,etc). Is it possible to rename and run in sequence? Another one is I need to name my method alphabetically. I want to name randomly and run in sequence. How shall I do? - (void)test2CreatePost - (void)test3ClickLikeInNewsfeed 回答1: You could achieve this by nesting your functions. // Note that this function contains

Using Alamofire in UI Test Target

蹲街弑〆低调 提交于 2020-01-02 09:28:15
问题 The below code snippet using Alamofire works fine in iOS app but the code does not work in iOS UI Testing target. let configuration = NSURLSessionConfiguration.defaultSessionConfiguration() configuration.HTTPAdditionalHeaders = Alamofire.Manager.defaultHTTPHeaders manager = Alamofire.Manager(configuration: configuration) manager!.request(.GET, "https://www.google.com") .responseString { response in print(response.request) // original URL request print(response.response) // URL response print

How to reorder cells under UITests?

ぐ巨炮叔叔 提交于 2020-01-02 07:55:13
问题 Along with UITests and UITableView I need to reorder cells. Is it possible? I tried myTable.swipeDown() but it is called in that place of cell which do not respond for reordering. How can I do this? Is it possible at all? 回答1: If you have set the accessibility properties of the custom cell set correctly then the reorder control should be accessible. Let's assume the cell's set their accessibility labels/identifiers to "LondonStreet" and "BakerStreet", respectively. You can reorder the cells

Access to project code from XCTestCase - UI Test

拥有回忆 提交于 2020-01-02 03:25:21
问题 I'm trying to setup UI Test in my project. I'm making a UI test that tries to login through my apps login prompt. In order to ensure that the login prompt is shown when the test launches, I'm trying to run ServerManager.logout() , which is in the project's codebase. This will cause the Login prompt to be shown on launch. import XCTest class SmokeTest: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in

Xcode 7 UI test cases for pre Xcode 7 projects

北城余情 提交于 2020-01-02 01:23:07
问题 Apple simplified iOS UI testing in Xcode 7. With new Xcode 7 projects, all you have to do to get the complete configuration for iOS UI testing is to check "Include UI tests" when creating a project. What are the steps to get the same in Xcode 7 for projects that were created before Xcode 7 existed? 回答1: After testing several older projects: Adding a new UI test target is sufficient as suggested by a-live in a comment to the question: File > New > Target > Test > Cocoa Touch UI Testing Bundle

Documentation for UI Testing in XCode 7 [closed]

早过忘川 提交于 2020-01-01 09:11:37
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I was wondering if there is any documentation for the new UI Testing in XCode 7 introduced at WWDC 2015. If there is no documentation, are there any user-produced versions that are worth looking at? Thanks 回答1: Some of the useful links: Apple developer videos Apple Developer Doc mokacoding 回答2: I used appledoc

iOS 9 UI Testing - Test Fails Because Target Control Isn't Available (yet)

放肆的年华 提交于 2020-01-01 06:38:28
问题 I am testing the new UI testing functionality of Xcode 7 (introduced in the WWDC 2015 video "UI Testing in Xcode"). On launch, my app animates a "login panel" into view, by updating the value of its vertical layout constraint: the panel slides up into view from beneath the main view (off screen). The panel contains two text fields, for user name and password . When you tap the return key on the keyboard for the user name text field (labeled "Next"), the password textfield becomes first

Could not determine bundle identifier for xxxTest TEST_HOST

笑着哭i 提交于 2020-01-01 02:47:18
问题 We do have troubles getting our CI to work with Xcode. We encounter the issue Could not determine bundle identifier for xxxTest TEST_HOST: some path that does not exist . What we have done so far: On the CI Machine we are able to run all tests on the device, but if we trigger it with a commit the CI does end in that error. We had that issue on other machines too, when we tried to run the tests of the application. We fixed that by cleaning the machine and reboot the devices.(Had do fix some