ui-testing

How to get started: testing Java Swing GUI with AssertJ Swing

…衆ロ難τιáo~ 提交于 2019-12-06 12:42:05
While developing a Java desktop application with Swing, I encountered the need to test the UI directly, and not just the underlying controller/model classes via unit tests. This answer (on "What is the best testing tool for Swing-based applications?") suggested using FEST , which is unfortunately discontinued. However, there are a few projects that continued from where FEST left of. One in particular (mentioned in this answer ) caught my attention, as I used it before in unit tests: AssertJ . Apparently there is AssertJ Swing , which is based on FEST and offers some easy to use ways of writing

Android Espresso UI Test with mocked Retrofit API

一世执手 提交于 2019-12-06 09:56:53
问题 I'm creating UI Tests for my Android app using Espresso . I have a login screen which contains just two Fields (user and password) and a Button . I'm using Retrofit but I want to mock the API response so I've created a RetrofitMockClient . For example, in the next Test I type a wrong password intentionally to check that an error message is displayed. @Test public void loginFailed() { onView(withId(R.id.login_user_name)).perform(typeText("myUser")); onView(withId(R.id.login_user_password))

Selenium Webdriver false negative result for testing visibility of an element?

孤街浪徒 提交于 2019-12-06 09:18:34
I have an issue with Selenium Webdriver. I am running my automated test against a web application and have a test to check visibility of an element. When I run the same line of script in CLI , the element is found and is_displayed() returns "TRUE" but When I run it with other test cases through my Python IDE, is_displayed() returns False . I tried implicit and explicit waits but wait is not the issue and the element is already loaded. Here is the test case in my test script: def test_image_element_icon_is_displayed(self): self.assertTrue(self.driver.find_element_by_css_selector("#Image").is

Selenium webdriver highlight element before clicking

橙三吉。 提交于 2019-12-06 06:11:50
I'm working on a set of selenium UI tests that are written in Python. On a previous project I was using WatiN and C#. The WatiN framework had a feature you could enable that would 'highlight' the element you were clicking, selecting or typing into. The element would get a yellow border around it while the action was performed. I found this extremely helpful while troubleshooting broken tests, I could often see from the test run if the wrong element was being clicked. I was wondering if Selenium webdriver has a similar feature that I can turn on. Basically I would like some sort of visual

Espresso test back button while AsyncTask is running

情到浓时终转凉″ 提交于 2019-12-06 03:14:18
I'm writing UI tests for my application using Espresso. I'd like to test the fact that if I click the back button while a server request is in progress the app must remain where it is. It seems not to be possible due to the espresso's architecture that makes the tests execution wait if some background operation (like AsyncTask) has been fired. So, how can I test the following scenario: click on a button that fires an AsyncTask test that while the task is running and I press back button, the app stays there? Is it possibile? thank you That's tricky. With AsyncTasks you cannot use Espresso while

Mock API Requests Xcode 7 Swift Automated UI Testing

两盒软妹~` 提交于 2019-12-05 00:53:41
Is there a way to mock requests when writing automated UI tests in Swift 2.0. As far as I am aware the UI tests should be independent of other functionality. Is there a way to mock the response from server requests in order to test the behaviour of the UI dependant on the response. For example, if the server is down, the UI tests should still run. Quick example, for login, mock if password failed then UI should show alert, however, if the login is successful the next page should be shown. In its current implementation, this is not directly possible with UI Testing. The only interface the

Espresso Tests cannot access class file

∥☆過路亽.° 提交于 2019-12-04 23:35:56
I get the following errors where i try to run a ui test. /Users/etiennelawlor/workspace/MovieHub/app/src/androidTest/java/com/etiennelawlor/moviehub/MoviesFragmentTest.java Error:(34, 28) error: cannot access AppCompatActivity class file for android.support.v7.app.AppCompatActivity not found Error:(34, 58) error: cannot infer type arguments for ActivityTestRule<> Error:(41, 41) error: cannot access IdlingResource class file for android.support.test.espresso.IdlingResource not found Error:(51, 40) error: cannot access RecyclerView class file for android.support.v7.widget.RecyclerView not found

Android Espresso UI Test with mocked Retrofit API

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 17:02:09
I'm creating UI Tests for my Android app using Espresso . I have a login screen which contains just two Fields (user and password) and a Button . I'm using Retrofit but I want to mock the API response so I've created a RetrofitMockClient . For example, in the next Test I type a wrong password intentionally to check that an error message is displayed. @Test public void loginFailed() { onView(withId(R.id.login_user_name)).perform(typeText("myUser")); onView(withId(R.id.login_user_password)).perform(typeText("wrongPassword"), closeSoftKeyboard()); onView(withId(R.id.login_button)).perform(click()

How to start with empty Core Data for every UI Test Assertion in Swift?

我与影子孤独终老i 提交于 2019-12-04 11:42:43
问题 I have an application that makes use of core data. The behavior of the application is different depending on whether that data has been populated yet. I had hoped that, before each test case, the core data would be emptied, making each test case run on a fresh app instance. Test cases shouldn't depend some test device's state, especially because other test cases manipulate this state. Unfortunately, by default, the core data lingers not only between test cases, but also between completely

Xcode UI test manual snapshot

本小妞迷上赌 提交于 2019-12-04 10:02:45
I want to manually take some snapshots from my applications using UI Tests intoduced in Xcode 7. By default, Xcode takes screenshots of every step and in result I got screenshots that was taken in the middle of transitions between view controllers. I want to manually take snapshot in the specific moments. Any ideas how to do this? I know how to take screenshot of UIView, but XCUIApplication doesn't provide any API to get UIView objects. I've created a library for this: https://github.com/zmeyc/UITestUtils The idea is to take the screenshot in the app itself and send it to the test app via