• 2020-02-22
  • 2020-03-02

The UI Testing of the Mac App – Test the Dialog

This article says about the test of the dialog with the UI Testing. Wait until appear The dialog will be opened when you click the button, launch the application, select the menu item and so on. The dialog will be appeared by many ways. However, there is a common thing, waiting until appear. The time interval is slightly changed by the machine spec or the state of the machine. To wait until the dialog appeared without effects from them, the code can be following:

  • 2020-02-21
  • 2020-02-21

Change the mock object with a command line argument

The UI Testing is powerful function that Xcode has. The UI Testing is the one of the unit test, it generate events such as the mouse down event or a key down event, the application responds to them same as user operations. It tests the user interface such as a window content. How ever, it is hard for me. For example, the mock. The mock is used to test functions that are hard to automatically test. For example, the function to communicate with a web server or the real devices. The mock returns results that the application want without real communication with the real servers or devices.. You need to test functions that are replaced with the mock, but it is not important when you test the user interface. To use the mock, the application use a protocol instead of a real class. For example, when the application communicates with the web server which has APIs, create the API protocol, the real class is adopt to this protocol. Also, the mock is adopt to this protocol, then you can use the mock when you test. There is a problem. How to replace with the mock? Use a command line argument […]