xcode-ui-testing

Wrong cells count for collection view in UI Tests

北城以北 提交于 2019-12-04 05:57:38
I have a test for a collection view that works like this: func testDeleteItem() { app.collectionViews.staticTexts["Item"].tap() app.buttons["Delete"].tap() XCTAssertEqual(app.collectionViews.cells.count, 2) XCTAssertFalse(app.collectionViews.cells.staticTexts["Item"].exists) } After the tap, there is a new screen with the delete button. When the button is tapped, the screen dismisses itself and reloads the collection view. Everything goes as expected in the UI, but I get both asserts failing. In the first count it is still 3 and in the second item it still exists. I have found the solution,

Xcode ui test: staticTexts start with

与世无争的帅哥 提交于 2019-12-04 05:44:48
I want to check if an element on my ui which start with a prefix is present. How is it possible to implement it in Xcode 7 UI Tests? app.tables["AAA"].staticTexts["Fax: 0049XXXXXXXX"].exists I have three element into a tableview cell and only one (the third or last one) starts with the prefix Fax: 0049. How can i check the present of this element? I tried with app.tables["AAA"].cells.staticTexts.elementBoundByIndex(2).exists But nothing, some ideas? Cheers Joe Masilotti You can use a BEGINSWITH predicate to check if an element starts with a prefix. let app = XCUIApplication() let faxPredicate

In XCTest UI Testing, how to check the background color of button, label , views?

走远了吗. 提交于 2019-12-04 05:14:14
I am trying to validate if the background color can be obtained in XCTest UI Testing, I am looking to compare the background color with the set value, so that i don't have to rely on image comparison XCTest is for functional testing, rather than asserting visual requirements. To test requirements such as background color, use a unit test to initialize the view controller in question and check the view's background color there. You don't need to rely on image comparison, and unit tests are a lot faster. 来源: https://stackoverflow.com/questions/38667435/in-xctest-ui-testing-how-to-check-the

XCode bot error: Early unexpected exit, operation never finished bootstrapping -

試著忘記壹切 提交于 2019-12-04 03:23:27
I have a project written in swift, and i have the main target and two test targets, one for unit testing using quick framework and it has 3 KIF tests. the other target has the XCUItests. so whenever i run XCode bot integration with our XCode CI Server, i get the following error: Bot Issue for Acceptance Bot (error) Integration #63 of Acceptance Bot Open in Xcode: xcbot://iosci/botID/1229919cecfcd510f090e37aed014a23/integrationID/16a3709d3ae008a68a65ff2fe9bb5a7b Assertion: Test target MyUITests encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will

Scheme language setting ignored in iOS unit and ui tests

橙三吉。 提交于 2019-12-04 00:59:55
My final goal is to issue xcodebuild test from command line picking different schemes for different languages. Currently I have two schemes, the only difference between them is the application language. In one scheme it is English, in the other is Spanish. If I use xCode to run the application it works nice, it is launched with the language specified in the scheme I have picked, both EN or ES are okay. If I run the tests from xCode, language setting is ignored. Whichever scheme I pick, it doesn't matter, it is always displayed as the device language. The same on simulator. The same when

Xcode 7 beta 4 - Crashes on UI recording

浪子不回头ぞ 提交于 2019-12-03 18:11:18
问题 While trying to do UI recording for my UI tests, the app crashed after 1 event that was not recorded. Looking into the crash report, I found this error: UNCAUGHT EXCEPTION (NSInternalInconsistencyException): ancestorFinder is not being processed by childNodeFinders Anyone also getting this and maybe someone knows a fix for this? 回答1: Unfortunately that's just life with beta software, did you try reinstalling Xcode 7 beta 4. If it still doesn't work, might be a beta thing. Solution Look

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

家住魔仙堡 提交于 2019-12-03 17:28:45
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 responder. When you tap the retrun key for the password text field (labeled "Go"), the panel is "dismissed"

How to write UI tests covering login with Facebook in Xcode?

谁都会走 提交于 2019-12-03 14:52:37
问题 I would like to write a UI test in Xcode covering a login with FBDSKLoginKit. However, Facebook iOS SDK uses SFSafariViewController presented to the user in order to authenticate her and unfortunately, there's no way how to interact with SFSafariViewController in UI tests in Xcode 7. Any ideas how to test the facebook login without interacting with SFSafariViewController ? 回答1: Swift 3 Xcode 8 solution func testFacebookLogin() { let app = XCUIApplication() // set up an expectation predicate

Xcode 7 UI Tests, Recording button is greyed out

夙愿已清 提交于 2019-12-03 14:33:36
问题 I am trying to add UI tests to my existing project using Xcode 7. However the UI test recording button is always greyed out. What I am missing here? I tried restarting Xcode, cleaning and rebuilding the project and adding a new UI test target. Does anyone else experience the same behaviour? 回答1: FWIW: I had this problem and it turns out I was trying to run the simulator in the wrong OS. I was trying to use iOS8.x, and UITesting only works in iOS9+. Switch the simulator version, and the record

‘NSInternalInconsistencyException’ when running UITesting with Xcode 7

…衆ロ難τιáo~ 提交于 2019-12-03 14:25:56
问题 Ok, I’ve not been able to run this test in any betas so far. Some of the issues I’ve encountered are here and here Now, I feel like I’m missing something. Here’s my progress so far Enabled “UI testing” option while creating a new project. This, in fact adds a target for me. So I should be good to go - or so I thought. The swift file under UI Testing had already “XCTest” imported and was a subclass of “XCTestCase”. setup() launches the application XCUIApplication().launch() And I added the