When you run tests on iOS, you can mock HTTP request with several ways. We can use such mocking for XCUITest as well. For example, you can achieve the way using below libraries. https://github.com/envoy/Embassy https://github.com/envoy/Ambassador https://github.com/KazuCocoa/myCurrencyExchange/blob/master/myCurrencyExchangeUITests/ is the result. If you’d like to achieve similar things based on EarlGrey, you should switch the mocking libraries…More
Tag Archives: iOS
[iOS][Appium]How to debug, set break points, WebDriverAgent
Debugging WebDriverAgent is tricky. Appium uses the library to run tests against iOS. In this article, I’d like to leave how to debug WebDriverAgent using Appium. You can set break points in arbitrary lines on WebDriverAgent via Xcode following below. On Xcode Clone the repository and finish the setup Open WebDriverAgent.xcodeproj with Xcode Open Edit…More
[iOS][Appium]Process Arguments by Appium for XCUITest, iOS
Today, I’d like to leave a tip. I’ve implemented test cases using this article for over 3 years. It helped us to control test environment more stable and fast. XCUITest can set process arguments for Instrumentation. According to https://github.com/appium/appium-xcuitest-driver#desired-capabilities, you can set processArguments in capability and the test app can get the value via ProcessInfo.…More
[iOS]xctestrunner by Google
Note for me. https://github.com/google/xctestrunner Runner written by Python. It helps running test commands.More
[iOS]xccov and JSON format
Before Xcode 9.2, we can get formatted coverage data using https://github.com/SlatherOrg/slather, for example. The library formats llvm-cov. But from Xcode 9.3, xccov is introduced officially. The command can run via xcrun. xccov is a new command-line utility for inspecting the contents of Xcode coverage reports. It can be used to view coverage data in both…More
iOS 11 Programmingを今更だけれど読んだ
そういえば、半年以上はもう経ってますよね… 飛行機の待ち時間とかにざっと読んだり、所々、きになるところは写経しながら読んだ。知っているところ、知らないところと様々あったのですが、あの時期にこれだけのものをリリースしたのってやっぱりすごい… 個人的には、Decodable付近の話が一番実際の仕事にも結びつく感じでよかったです。PDFKit付近は、簡単なアプリ作成も兼ねて作ってみようかなと思いました。技術書系も大体はebupで購入してGoogleBooksにあげている生活なのですが、たまにPDFのものを手に入れることもありますし。そんな時に自分で作ったものでサクッと読むとかやっぱり面白いですよね。(そこまで簡単にPDFを組み込める、というところが特に面白かった) iOS 11 Programming 著者:堤 修一,吉田 悠一,池田 翔,坂田 晃一,加藤 尋樹,川邉 雄介,岸川 克己,所 友太,永野 哲久,加藤 寛人, 製本版,電子版 PEAKSで購入する そういえば、Metalもそうだったんだ、確かにというところが多くてとても為になりました。 ありがとうございました。More
[Appium]get performance for iOS
So long ago, I tried to monitor iOS performances using instrument commands. But I gave up once because of host machine’s load. But https://github.com/appium/appium-xcuitest-driver/pull/637 is created and that is awesome… I just remember seeing the PR and I’ve published this article in my memory… https://github.com/appium/appium/pull/10348 https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/Recording,Pausing,andStoppingTraces.html#//apple_ref/doc/uid/TP40004652-CH12-SW1More
[iOS]memo for ios-device-control
Around 5 months ago, Google has opensourced ios-device-control to make iOS related work automate. The repository supports both real devices and simulators. https://github.com/google/ios-device-control It provides some examples and [https://github.com/google/ios-device-control/blob/master/java/com/google/iosdevicecontrol/examples/ExampleSimulatorDeviceControl.java] is one example with Simulator. When we run the example, we can see the following outputs. Google has EarlGrey for test automation against UI level and…More
[Swift] Identify not XCTest against XCUITest and EarlGrey
XCTestでは、Swiftの時にAppDelegateを取得しようとするとクラッシュする問題があります。 そのために、 などを使い、XCTestである場合はmockしたAppDelegateを使うなどの対策を行うことがあります。ただ、この場合だと、 XCUITest や EarlGrey によるテストを行うときもこの判定に引っかかります。 以下の差分には、XCUITestとEarlGreyに置ける上記判定を入れています。両方とも同様に判定が行われます。 https://github.com/KazuCocoa/test.examples/commit/cd3ec48b741320071471b27b3ad6254ce4fbacd5 これを避けるために、例えば環境変数でEarlGreyであることを指定する、などが必要。 https://github.com/KazuCocoa/test.examples/commit/aa527223208d4d56260fa0111ccf158554c0d12f プロセスに対する環境変数、iOSのテストだとちょくちょくお世話になることがあると思うので、覚えておくと良さそう。xcodebuildなどに対して環境変数を与えると同じようなことになりますが、これはプロセスに対する環境変数なので注意が必要(プロセス外で定義した環境変数は参照されない) reference https://stackoverflow.com/questions/26946677/uiapplication-sharedapplication-delegate-as-appdelegate-causes-exc-bad-access?answertab=active#tab-top https://stackoverflow.com/questions/39478895/can-you-pass-environment-variables-into-xcodebuild?rq=1 https://stackoverflow.com/questions/27930137/ios-swift-separate-appdelegate-for-xctest/27981726#27981726More
[iOS]Large Photo Libraries for Testing
from https://developer.apple.com/videos/play/wwdc2017/505/ If you’d like to test with a large number of photos, you can generate dummy photos by https://developer.apple.com/sample-code/wwdc/2017/Creating-Large-Photo-Libraries-for-Testing.zip . Download it and run on the target device. The app is presented in https://developer.apple.com/videos/play/wwdc2017/505/ . https://developer.apple.com/documentation/photos/phassetMore