uitest

How to pick an image at some index from UIImagePickerController under UITests in Xcode?

有些话、适合烂在心里 提交于 2020-02-03 22:02:36
问题 Currently I access photo gallery and pick up a photo the following way: extension XCUIApplication { func pickPhotoFromImagePickerAtIndex(index: UInt) { tables.buttons["Moments"].tap() collectionViews["PhotosGridView"].tapCellAtIndex(index) } } Example of use: photosCollectionView.tapCellAtIndex(0) app.pickPhotoFromImagePickerAtIndex(5) This method crashes sometimes. It depends on photos in gallery. Is there any way to do this in more elegant and effective way? 回答1: I assume, that index you

Tapping the first matching text on a recycler view Android espresso Testing

别说谁变了你拦得住时间么 提交于 2020-01-05 07:32:50
问题 I am trying to tap on the first element of a matching text in my app. However at the moment i am receiving an error telling me there are multiple matches due to my current line of code. onView(allOf(withId(R.id.offerSummaryLayout))).perform(RecyclerViewActions.actionOnItem(Matchers.allOf(hasDescendant(withText("Online sale"))), click())); How can I change this so it clicks on the first matching element? Thanks in advance 回答1: If you have multiple matches and you only care about the first one,

Facing “Stalled error ” on Xamarin test cloud when Xamarin.ios Uitest ran from Xamarin Studio

廉价感情. 提交于 2019-12-25 08:30:06
问题 I am facing "Stalled error" when running UITest on Xamarin test cloud from mac machine - Xamarin studio. UITest is written for Xamarin.ios application, which is just having code (the default code) AppLaunches test and code is app.Screenshot("First screen"). My BeforeEachTest looks like as below app = Configureapp.ios.PreferIdeSetting().StartApp(); Inside xamarin studio, unit test window, I have linked the ios app to the UITest project. My project is in configuration debug|iPhone. I have

iOS UITest : How to find UITableViewCell's AccessoryView?

核能气质少年 提交于 2019-12-23 12:49:13
问题 Hello I'm learning UITests now I have a question how can detect accessoryView's tap on the tableViewCell ?? in UITest below is my tableViewCell I want detect detail closure accesorry view's tap like this app.tables.cells.buttons["FTCellAccesoryIdentifier"].tap() but accesorry is a subclass of UIView so i allocate accisibility identifier key in cellForRows function cell.accessoryView?.accessibilityIdentifier ="FTCellAccesoryIdentifier" and my test function is i try app.tables.cells

how to write UI test to test whether image existing when click the first cell in an UITableView?

…衆ロ難τιáo~ 提交于 2019-12-13 14:27:42
问题 There is an UITableView in my storyboard. It contains 5 Table view cells. When I click the first cell, it will go to the second UIView and show the corresponding images. How could I code the UITest part to test whether the image show up when I click the first cell? 回答1: There is a magic part of XCode 7- UIRecording First selected the testCase,and start recording like the Gif Then you will see,UIRecording create UITest code for you,In my case,I get let app = XCUIApplication() app.tables/*

How to obtain reference to TextField in UI Tests in Xcode 7

倖福魔咒の 提交于 2019-12-04 11:26:29
问题 I am trying to use UI tests in xcode 7 beta. I have a storyboard with two text fields. Both text fields have outlets and different Restoration IDs. I recorded the test but generated code is quite unreadable and it doesn't work: app.otherElements.containingType(.TextField, identifier:"y").childrenMatchingType(.TextField).elementBoundByIndex(0).typeText("hello") I also tried the following and will work based on Placeholder text?!? app.textFields["PlaceholderText"].typeText("hello") What is the

How to obtain reference to TextField in UI Tests in Xcode 7

孤街醉人 提交于 2019-12-03 06:13:19
I am trying to use UI tests in xcode 7 beta. I have a storyboard with two text fields. Both text fields have outlets and different Restoration IDs. I recorded the test but generated code is quite unreadable and it doesn't work: app.otherElements.containingType(.TextField, identifier:"y").childrenMatchingType(.TextField).elementBoundByIndex(0).typeText("hello") I also tried the following and will work based on Placeholder text?!? app.textFields["PlaceholderText"].typeText("hello") What is the right way to obtain a reference to a TextField in UI tests? You need to set accessibility identifier in

The bundle UITests couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle

心已入冬 提交于 2019-11-29 21:13:45
I can't run my test case due to this following errors : The bundle “UITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. Library not loaded: @rpath/Alamofire.framework/Alamofire. Reason: image not found Try searching and solving since two days but couldn't get through this issue can someone please help. I was able to reproduce this issue with the project generated by Xcode 10.1. I used Swift 4.2 and CocoaPods as a dependency manager. I had the following Podfile: # Uncomment the next line to define a global platform for your project

What are fixtures in programming?

女生的网名这么多〃 提交于 2019-11-29 18:55:37
I heard this term many times before (when talking about programming) but couldn't find any explanation what does it mean. Any good articles or explanations? I didn't find anything worth mentioning. m01 I think you're referring to test fixtures : The purpose of a test fixture is to ensure that there is a well known and fixed environment in which tests are run so that results are repeatable. Some people call this the test context. Examples of fixtures: - Loading a database with a specific, known set of data - Erasing a hard disk and installing a known clean operating system installation -

The bundle UITests couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle

牧云@^-^@ 提交于 2019-11-28 16:35:18
问题 I can't run my test case due to this following errors : The bundle “UITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. Library not loaded: @rpath/Alamofire.framework/Alamofire. Reason: image not found Try searching and solving since two days but couldn't get through this issue can someone please help. 回答1: I was able to reproduce this issue with the project generated by Xcode 10.1. I used Swift 4.2 and CocoaPods as a dependency