ui-testing

iOS UI Unit Testing (XCode7)

筅森魡賤 提交于 2020-01-05 14:20:15
问题 I'm a bit confused with the new UI Unit Testing scheme that apple released in their XCode7 Beta. I think it's an awesome idea, but I have a couple questions. this is one testing method I have... func testMetricsProperties() { // Used some of the metrics for testing for reference let app = XCUIApplication() app.scrollViews.descendantsMatchingType(.Unknown).containingType(.StaticText, identifier:"rim").childrenMatchingType(.Button).element.tap() app.textFields["_XCUI:Secure"].typeText("") app

Error inflating class Fragment when testing fragment using DataBinding

安稳与你 提交于 2020-01-04 06:39:08
问题 Can someone help me on this? In my test I want to check if the login button is displayed on the StartPage. I've been struggling with this error for a while today and I don't know how it should be resolved.What am I missing here? Maybe this problem is somehow similar to this question: Espresso test fails with java.lang.String cannot be cast to com.abc.events.databinding.SponsorDetailBinding android.view.InflateException: Binary XML file line #6: Error inflating class fragment at android.view

How to do UI testing for kotlin file with dagger in android?

ぃ、小莉子 提交于 2020-01-02 07:23:14
问题 Below is my stack trace, I have gone through all the questions and answers on SO but can't find any solution java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null) at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:74) at java.lang.reflect.Proxy.invoke(Proxy.java:1006) at $Proxy6.isTypeMockable(Unknown Source) at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:29) at org

Check the position of the XCUIElement on screen while testing iOS Application using XCTest

一世执手 提交于 2020-01-02 05:32:07
问题 I am testing an iOS Application and currently I am checking the existence of a particular XCUIElement using isHittable . I wanted to know if we can also check the position of the XCUIElement on the view. For instance, if we have a button in the bottom right corner of the view, can we check if it is actually in the bottom right corner using XCTest framework? I had a look at the Apple Documentation for XCTest framework but did not get any clue. Any help will be greatly appreciated. 回答1:

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

Swift UITesting error: Invalid escape sequence in literal. \U201c

◇◆丶佛笑我妖孽 提交于 2019-12-30 06:12:09
问题 I am building an automation suite using Xcode 7 with swift. My app loads with the following Alert View: Allow "Light Alarm" to access your location while you use the app? When I record with UI Testing and click this alert I get the following code: app.alerts["Allow \U201cLight Alarm\U201c to access your location while you use the app?"] Note: The quotes has been replaced with \U201c However, when I try and compile I get the following error: "Invalid escape sequence in literal" Anyone know how

Testing if an element is visible with Xcode 7 UITest

馋奶兔 提交于 2019-12-28 05:49:06
问题 I want to verify if an element is visible or not depending on its .hidden property but I don't find a valid way to do that using the new Xcode 7 UI test stuff. I've tried with myelement.exists and myelement.hittable but they doesn't seems to work as I expected. I suppose they work on conjunction with the hidden property. An hidden element shouldn't exists and is not hittable... but this is not the current behaviour (I can understand the exists behaviour... but a hidden element should be not

How to write an Android UI test where the contents of views are determined at runtime?

浪尽此生 提交于 2019-12-24 05:59:45
问题 The Situation I'm writing a timetable-viewing application and the first feature to be implemented is choosing the course for which to view the timetable. The user chooses the name of their course from a list and is taken to another screen to further specify which year, group etc. of the course they're currently in. The screens to choose your course and edit your course details are as follows: The Goal Inspired by the Google I/O 17 talk on Test-Driven Development on Android, what I wish to

Xcode7 ui testing: staticTexts[“XX”].swipeRight() swipes not far enough

五迷三道 提交于 2019-12-24 03:16:54
问题 For UI testing I want to perform a swipeRight-gesture to make further buttons accessible. The element I want to swipe is at the bottom of the screen. I access it by: element.staticTexts["TEST TEXT"].swipeRight() When performing the test the swipe goes not far enough. It does not trigger the element to slide completely to the right and show the further buttons I want to tap. I have the feeling that swipeRight() grabs the middle of the static text and performs the gesture. Is there any

How to test if a fragment is visible with Espresso

寵の児 提交于 2019-12-23 20:09:13
问题 I wrote a very simple Activity with a Button. When the button is clicked, I will start a new Fragment . Now I want to test this logic in my Espresso UI Test. So I wrote this UI Test for my Activity @RunWith(AndroidJUnit4::class) @LargeTest class MainMenuUiTest { @get: Rule val activityTestRule: ActivityTestRule<MainActivity> = ActivityTestRule(MainActivity::class.java) @Test fun switchToFragment() { onView(withId(R.id.btn)).perform() } } How can I test that my Fragment is displayed when the