ui-testing
Testing if an element is visible with Xcode 7 UITest
As of Xcode 7.1 Beta 3, UI Testing does not currently support validating the visibility of an element. I suggest filing a radar to bring the necessary attention to Apple. Xcode 7.1 has fixed this issue. hittable now checks to see if the element is correct.
Click on not fully visible imageButton with Espresso
None of the above worked for me. Here is a custom matcher that completely removes that constraint and allows you to click on the view onView(withId(yourID)).check(matches(allOf( isEnabled(), isClickable()))).perform( new ViewAction() { @Override public Matcher<View> getConstraints() { return ViewMatchers.isEnabled(); // no constraints, they are checked above } @Override public String getDescription() { return “click plus button”; … Read more
Testing ViewPager with Espresso. How perfom action to a button of an Item?
FirstVal, ViewPager is not an AdapterView, it directly extends from ViewGroup. So the method onData() cannot be used on a ViewPager. Solution 1 As it’s a ViewGroup, each items are direct children of its ViewPager. So the process is to reference the first view child using a custom matcher (like this onefirstChildOf()) and playing with … Read more
How to access launchEnvironment and launchArguments set in XCUIApplication, running UI tests in XCode?
If you set launchArguments in a UI Test (Swift): let app = XCUIApplication() app.launchArguments.append(“SNAPSHOT”) app.launch() Then read them in your App using: swift 2.x: if NSProcessInfo.processInfo().arguments.contains(“SNAPSHOT”) { // Do snapshot setup } Swift 3.0 if ProcessInfo.processInfo.arguments.contains(“SNAPSHOT”) { } To set environment variables, use launchEnvironment and NSProcessInfo.processInfo().environment, respectively, instead.
What are fixtures in programming?
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 … Read more