ui-testing

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

眉间皱痕 提交于 2019-12-10 11:08:59
问题 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.

Espresso test back button while AsyncTask is running

痴心易碎 提交于 2019-12-10 10:12:32
问题 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

Android Espresso ListView click item

[亡魂溺海] 提交于 2019-12-09 17:03:02
问题 I have ListView with pictures and text. When I try to click item, I get error android.support.test.espresso.AmbiguousViewMatcherException: 'with id: com.cifrasoft.telefm:id/cardsGridView' matches multiple views in the hierarchy. Problem views are marked with '****MATCHES****' below. I use the following code: onData(hasToString(startsWith("Item Text"))) .inAdapterView(withId(R.id.cardsGridView)) .perform(click()); Can I click ListView using position of Adapter , without matches or startWith ?

Xcode UI testing - Uiviews added with addSubview are completely invisible to the UI tests

左心房为你撑大大i 提交于 2019-12-09 07:16:23
问题 I've been giving a try to the new UI tests on XCode 7.3 and I've found what it seems a bug to me. The problem is that views added through the " addSubview " method seems to be completely invisibles to the UI test system. I have this view: And this UIview creating code: let container = UIView(frame: CGRectMake(0, 0, 375, 200)) container.backgroundColor = UIColor.orangeColor() container.isAccessibilityElement = false let label = UILabel(frame: CGRectMake(0, 100, 375, 20)) label.backgroundColor

How wait until toast is finish? Start second test only after toast was hide of prev test

不想你离开。 提交于 2019-12-09 03:27:17
问题 Here my Espresso's tests: @RunWith(AndroidJUnit4::class) class AddTraderActivityNetworkTest { private val context = InstrumentationRegistry.getInstrumentation().getContext() private lateinit var mockServer: MockWebServer @Rule @JvmField var addTraderIntentTestRule: IntentsTestRule<AddTraderActivity> = IntentsTestRule(AddTraderActivity::class.java) @Before fun setup() { mockServer = MockWebServer() mockServer.start(8081) } @Test fun buttonStart_click_clientError_showToast() { mockServer

UITest color of a label (not UI label)

好久不见. 提交于 2019-12-08 15:44:49
问题 Here is a pic of the table I'm working with. I'm just trying to get the color of "requested" (gray) or "draft" (orange). I'm able to get the actual string of "requested" or "draft" by var timeSheetStatus = app.tables.element.cells.elementBoundByIndex(0).staticTexts.elementBoundByIndex(1).label but this is just a string and not a UIlabel (if it were a UILabel I would be able to do label.textColor I believe). How do I get the color of this string so I can assert that it is indeed gray or orange

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

有些话、适合烂在心里 提交于 2019-12-08 02:52:03
问题 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

Selenium webdriver highlight element before clicking

假装没事ソ 提交于 2019-12-08 01:51:04
问题 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

Mock API Requests Xcode 7 Swift Automated UI Testing

偶尔善良 提交于 2019-12-06 21:17:39
问题 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. 回答1

Incomplete universal character name in UI Testing

白昼怎懂夜的黑 提交于 2019-12-06 18:40:52
问题 I am using Xcode 7's new feature : UI Testing. After recording the interaction, Xcode generated the code automatically : - (void)testDoubleTapToolBarItem { [[[XCUIApplication alloc] init].tabBars.buttons[@"\U5173\U6ce8"] doubleTap]; ~~~~~~~~~~~~~~~~ } However, warning showed as well. Any one know how to fix this? Incomplete universal character name Edit: This seems to be a BUG since Xcode 7.0 GM 回答1: You can use the following workaround as this seems to be a bug in xcode: replace all \U to \u