DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Design Patterns for Scalable Test Automation Frameworks
  • Architecture Patterns : Data-Driven Testing
  • Any Version of the Test Pyramid Is a Misconception – Don’t Use Anyone
  • Improving Customer-Facing App Quality Using Tricentis Testim

Trending

  • GitHub Copilot's New AI Coding Agent Saves Developers Time – And Requires Their Oversight
  • How To Build Resilient Microservices Using Circuit Breakers and Retries: A Developer’s Guide To Surviving
  • The Future of Java and AI: Coding in 2025
  • Monolith: The Good, The Bad and The Ugly
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. XCUITest - The Emerging iOS UI Test Automation Framework

XCUITest - The Emerging iOS UI Test Automation Framework

Learn how to join the iOS developers using the XCUITest framework for fast reliable feedback on their iOS mobile UI testing.

By 
Roy Nuriel user avatar
Roy Nuriel
·
Feb. 28, 18 · News
Likes (3)
Comment
Save
Tweet
Share
16.8K Views

Join the DZone community and get the full member experience.

Join For Free

Over the last year, there has been a growing trend of iOS development teams adopting XCUITest and additional frameworks built on top of the XCTest interface.

Development teams have started to adopt XCUITest to get fast and reliable feedback. There are a few clear drivers to this growing adoption:

  1. Intuitive – Using XCUITest is quite intuitive for developers as it runs from within the XCode IDE.
  2. Fast – Test execution against iOS devices is faster than any other UI test automation tool due to the framework architecture.
  3. Reliable – Due to the architecture of the framework, test execution using XCUITest generates more reliable results and eliminates flakiness.
  4. Mature – The APIs and the framework became significantly more mature during the last year.
  5. Test maintenance – Since the app has been instrumented, the framework works directly at the object level which reduces maintenance efforts that usually happen due to changes in the applications.

An iOS Instrumented Testing Frameworks and Terminology Review

  • XCTest – Apple’s official framework for writing unit tests for classes and components at any level. These tests, like the app itself, can be written in Swift/Objective C.
  • XCUITest – A UI testing framework that is built on top of XCTest. It includes additional classes (such as UIAccessibility). These tests can be written in Swift or Objective C. The tests are packaged in a test ipa (iOS packaged application) runner that executes the tests on the AUT(application under test) ipa.
  • KIF (Keep It Functional) – A iOS native app that wraps XCTest as well using undocumented iOS APIs. It requires the developer to add the KIF framework to the project. It has a simple and intuitive syntax. [tester enterText:@”user@example.com” intoViewWithAccessibilityLabel:@”Login User Name”];
    [tester enterText:@”thisismypassword” intoViewWithAccessibilityLabel:@”Login Password”];
  • Earlgrey – Similar to KIF although developed by Google. EarlGrey has an advanced a synchronization mechanism which means you don’t need explicit waits/sleeps. (For example, if tapping a button triggers a network request, EarlGrey will wait for the network request to finish before proceeding with the test). EarlGrey uses matchers extensively (read selection API here), these give you the flexibility to interact with elements and write assertion logic in a variety of ways with simple APIs.
  • Cucumberish – Test automation framework for Behavior Driven Development (BDD) that integrates into XCode and uses the iOS interfaces XCTest/XCUITest.

The Challenge

The challenge we find is that although the above test frameworks can solve significant challenges where other test automation frameworks cannot, in many cases, teams adopt these frameworks before considering the proper setup and infrastructure. The promise of XCUITest depends on the fact that the execution of the tests will be on a robust, reliable, and scalable lab infrastructure.

Even though the adoption of those automation frameworks grow, many teams still execute their tests on simulators/local devices from the developers' workstation. Those teams understand that they get significantly more value from executing XCUITests and therefore continue to consider leveraging them even more by executing them as part of the CI processes in order to provide continuous feedback on real devices and end-user conditions.

XCUITest Advanced Capabilities

Perfecto recently released advanced support for the above frameworks in order to enable development teams to leverage the advantages mentioned above, while leveraging Perfecto’s cloud-based capabilities. In addition, Perfecto extended the XCUITest framework by adding the ability to control and set up the device the same way end users do, by which enabling teams to validate their apps will function as expected in the real world.

unit test Framework Test automation

Published at DZone with permission of Roy Nuriel, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Design Patterns for Scalable Test Automation Frameworks
  • Architecture Patterns : Data-Driven Testing
  • Any Version of the Test Pyramid Is a Misconception – Don’t Use Anyone
  • Improving Customer-Facing App Quality Using Tricentis Testim

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!