This document discusses using Gherkin with XCUITest for iOS automation testing. It begins with an introduction to XCUITest, including recording tests, interacting with elements, and refactoring code. It then demonstrates building a simple test suite for a weather app. Finally, it shows how to implement Gherkin feature files to specify tests in a human-readable format, including steps to set up tests and make assertions. Gherkin allows for acceptance test driven development and collaboration across teams.
In this session, we will introduce you to the concept of unit testing and how we can add new features to our application without breaking anything. We will see how we can add unit test cases for each of our components and the importance of it.
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
Watch a live presentation at http://offer.bitbar.com/getting-started-with-xctest-and-xcuitest-for-ios-app-testing
XCTest has been part of Xcode for few years already, but it is finally catching up and more developers are getting on the bandwagon. XCTest and XCUITest provide feature-rich capabilities for iOS developers and test automation folks to implement different levels of tests using Xcode features and supported programming languages, Objective-C and Swift.
Stay tuned and join our upcoming webinars at http://bitbar.com/testing/webinars/
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
In Angular , events such as button click or any other sort of events can also be handled very easily. The events get triggered from the html page and are sent across to Angular JS class for further processing.
Data binding is a core concept in Angular and allows to define communication between a component and the DOM, making it very easy to define interactive applications without worrying about pushing and pulling data. There are four forms of data binding and they differ in the way the data is flowing.
In this session, we will introduce you to the concept of unit testing and how we can add new features to our application without breaking anything. We will see how we can add unit test cases for each of our components and the importance of it.
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
Watch a live presentation at http://offer.bitbar.com/getting-started-with-xctest-and-xcuitest-for-ios-app-testing
XCTest has been part of Xcode for few years already, but it is finally catching up and more developers are getting on the bandwagon. XCTest and XCUITest provide feature-rich capabilities for iOS developers and test automation folks to implement different levels of tests using Xcode features and supported programming languages, Objective-C and Swift.
Stay tuned and join our upcoming webinars at http://bitbar.com/testing/webinars/
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
In Angular , events such as button click or any other sort of events can also be handled very easily. The events get triggered from the html page and are sent across to Angular JS class for further processing.
Data binding is a core concept in Angular and allows to define communication between a component and the DOM, making it very easy to define interactive applications without worrying about pushing and pulling data. There are four forms of data binding and they differ in the way the data is flowing.
Learn web development with the famous Angular framework from scratch in this Angular 6 online training tutorial.
Get the course here : https://www.eduonix.com/angular-4-the-complete-guide?coupon_code=JY10
RESTful API Testing using Postman, Newman, and JenkinsQASymphony
INCLUDE AUTOMATED RESTFUL API TESTING USING POSTMAN, NEWMAN, AND JENKINS
If you’re going to automate one kind of tests at your company, API testing is the perfect place to start! It’s fast and simple to write as well as fast to execute. If your company writes an API for its software, then you understand the need and importance of testing it. In this webinar, we’ll do a live demonstration of how you can use free tools, such as Postman, Newman, and Jenkins, to enhance your software quality and security.
Elise Carmichael will cover:
Why your API tests should be included with your CI
Real examples using Postman, Newman and Jenkins + Newman
An active Q&A where you can get your automated testing questions answered, live!
To get the most out of this session:
Download these free tools prior to the webinar: Postman, Newman (along with node and npm) and Jenkins
Read up on how to parse JSON objects using javascript
*Can’t attend the webinar live? Register and we will send the recording after the webinar is over.
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...Postman
Presenters: Trent McCann, Engineering Manager, Quality, and Danny Dainton, Senior Quality Engineer
Description: Testing APIs is difficult, it's hard to know where to start. Join us as we take you through some of the different techniques and strategies, using Postman. We will walk you through the basics of Testing using Postman and help answer the questions of "Why do you test?" And "How do you write a test?". We will also talk about making these tests work for you. Pulling it all together and making these tests effective and efficient using Automation practices. Lastly, we will walk you through how to track, trend and some of the hidden benefits of Reporting in Postman, to get the most out of your tests.
BugRaptors enables to perform the communication and data exchange between two separate software systems. We use software for testing to send calls to the API, get output, and note down the system's response. We use Testing Tool to drive the API and write our own code to test the API. API testing is entirely different from GUI testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.
Angular 16 is the biggest release since the initial rollout of Angular, and it changes everything: Bye bye zones, change-detection, life-cycle, children-selectors, Rx and what not.
Recorded webinar based on these slides given by Yaron Biton, Misterbit Coding-Academy’s CTO, can be found at: https://www.youtube.com/watch?v=92K1fgPbku8
Coding-Academy offers advanced web-techs training and software development services: Top-rated Full-stack courses for Angular, React, Vue, Node, Modern architectures, etc. | Available top-notch on-demand-coders trough Misterbit technological solutions | Coding-Academy Bootcamp: Hundreds of employed full-stack developers every year | Anything web, end to end projects | Tech companies and startups | Consulting to management and dev teams | Workshops for managers and leaders.
Learn web development with the famous Angular framework from scratch in this Angular 6 online training tutorial.
Get the course here : https://www.eduonix.com/angular-4-the-complete-guide?coupon_code=JY10
RESTful API Testing using Postman, Newman, and JenkinsQASymphony
INCLUDE AUTOMATED RESTFUL API TESTING USING POSTMAN, NEWMAN, AND JENKINS
If you’re going to automate one kind of tests at your company, API testing is the perfect place to start! It’s fast and simple to write as well as fast to execute. If your company writes an API for its software, then you understand the need and importance of testing it. In this webinar, we’ll do a live demonstration of how you can use free tools, such as Postman, Newman, and Jenkins, to enhance your software quality and security.
Elise Carmichael will cover:
Why your API tests should be included with your CI
Real examples using Postman, Newman and Jenkins + Newman
An active Q&A where you can get your automated testing questions answered, live!
To get the most out of this session:
Download these free tools prior to the webinar: Postman, Newman (along with node and npm) and Jenkins
Read up on how to parse JSON objects using javascript
*Can’t attend the webinar live? Register and we will send the recording after the webinar is over.
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...Postman
Presenters: Trent McCann, Engineering Manager, Quality, and Danny Dainton, Senior Quality Engineer
Description: Testing APIs is difficult, it's hard to know where to start. Join us as we take you through some of the different techniques and strategies, using Postman. We will walk you through the basics of Testing using Postman and help answer the questions of "Why do you test?" And "How do you write a test?". We will also talk about making these tests work for you. Pulling it all together and making these tests effective and efficient using Automation practices. Lastly, we will walk you through how to track, trend and some of the hidden benefits of Reporting in Postman, to get the most out of your tests.
BugRaptors enables to perform the communication and data exchange between two separate software systems. We use software for testing to send calls to the API, get output, and note down the system's response. We use Testing Tool to drive the API and write our own code to test the API. API testing is entirely different from GUI testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.
Angular 16 is the biggest release since the initial rollout of Angular, and it changes everything: Bye bye zones, change-detection, life-cycle, children-selectors, Rx and what not.
Recorded webinar based on these slides given by Yaron Biton, Misterbit Coding-Academy’s CTO, can be found at: https://www.youtube.com/watch?v=92K1fgPbku8
Coding-Academy offers advanced web-techs training and software development services: Top-rated Full-stack courses for Angular, React, Vue, Node, Modern architectures, etc. | Available top-notch on-demand-coders trough Misterbit technological solutions | Coding-Academy Bootcamp: Hundreds of employed full-stack developers every year | Anything web, end to end projects | Tech companies and startups | Consulting to management and dev teams | Workshops for managers and leaders.
Puppeteer - A web scraping & UI Testing ToolMiki Lombardi
Puppeteer is more than a node library.
It comes with a powerful toolset that enable you to test every feature in every environment of your application.
Ember applications are built around an MVC model that prescribes Models, Views, Controllers, and Routes for managing persistence, DOM, application state, and URLs. In an ambitious enough app, that model may fail to cover the whole problem space. Fear not, for in this presentation you will learn how to use Ember’s container and dependency features to move beyond MVC, as well as learning how they tie Ember internals together.
Video: http://www.youtube.com/watch?v=iCZUKFNXA0k&feature=youtu.be&t=1h45m59s
“Can we integrate mobile, web and API testing into a single open-source automation framework? And, we only want all the test scripts to be written in human-readable language, we want them to be easily integrated to CI system. It’s quite a hard question, isn’t it?” If you or your organization also have the same question and still on trying to find solution for that. Then, we believe that this seminar is for you! At the seminar, we will cover the following topics:
The Need of Automation Testing Nowadays
How BDD Cuke and Ruby on Rails can help
A Universal Automation Framework: Mobile, Web, API and CI Integration
Similar to iOS Automation: XCUITest + Gherkin (20)
With localhost, you can write XCUITest without the constraint of shared dependencies. This talk will showcase how you can setup a localhost XCUITest using 4 simple steps. In addition you can also assert outgoing requests and analytic events fired from the app
Mobile Testing Tips - Let's achieve fast feedback loopsKenneth Poon
Let's achieve fast feedback loops
API Contract tests and localhost assertion tests will help give Engineers and QAs more confidence in the mobile product
Network Interception - Write Swift codes to inspect network requests (even wi...Kenneth Poon
Using a custom URLProtocol class and code injection technique, we can now inspect all requests in an iOS Apps (even when SSL certificate pinning is active). In the hand on demo, I used this technique to inspect all requests in Tinder and Twitter iOS apps
This keynote was presented in https://engineers.sg/video/intercepting-network-requests-ios-dev-scout--2639
PropertyGuru is Hiring. iOS / Android Engineer (Bangkok, Thailand)Kenneth Poon
PropertyGuru is Hiring. Join the band of mobile engineering rockstars at South East Asia's Leading Property Portal, PropertyGuru. We are looking for iOS / Android Engineers to join us and be part of the awesome team responsible for serving 16 million users every month.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaYara Milbes
Discover the transformative power of the WhatsApp API in our latest SlideShare presentation, "Top 7 Unique WhatsApp API Benefits." In today's fast-paced digital era, effective communication is crucial for both personal and professional success. Whether you're a small business looking to enhance customer interactions or an individual seeking seamless communication with loved ones, the WhatsApp API offers robust capabilities that can significantly elevate your experience.
In this presentation, we delve into the top 7 distinctive benefits of the WhatsApp API, provided by the leading WhatsApp API service provider in Saudi Arabia. Learn how to streamline customer support, automate notifications, leverage rich media messaging, run scalable marketing campaigns, integrate secure payments, synchronize with CRM systems, and ensure enhanced security and privacy.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
4. XCUITest
• Introduced in Xcode 7 in 2015
• xUnit Test Cases (XCTestCase)
• UITest targets cant see production codes
• Builds and tests are all executed using XCode
(ObjC/Swift)
• Record functionality
1. Introduction (iOS Automation Tools, XCUITest)
6. XCUITest - XCUIElement
1. Introduction (iOS Automation Tools, XCUITest)
XCUIElement
//Elements are objects encapsulating the information needed to dynamically locate a user interface.element in an
application. Elements are described in terms of queries [Apple Documentation - XCTest]
let app = XCUIApplication() //Object that queries views on the app
app.staticTexts //returns XCUIElementQuery “collection” representing “UILabels”
app.buttons //returns XCUIElementQuery “collection” of representing “UIButtons”
app.tables //returns XCUIElementQuery “collection” of representing “UITables”
app.tables.staticTexts
//returns XCUIElementQuery “collection” representing “UILabels” which has superviews of type “UITable”
app.staticTexts[“Hello World”]
//returns a label element with accessibilityIdentifier or text value “Hello World”
app.tables[“myTable”]
//returns a table element with accessibilityIdentifier “myTable”
8. XCUITest - Interactions
1. Introduction (iOS Automation Tools, XCUITest)
let app = XCUIApplication() //Object that queries views on the app
app.staticTexts[“Hello World”].exists //returns true if element exists
app.buttons[“Save”].tap() //taps the “Save” button
app.tables[“myTable”].swipeUp() //swipes up the table
app.textFields[“myField”].typeText(“John Doe”) //types value in textField
Other interactions: pinchWithScale, pressForDuration, doubleTap()
XCTAssertTrue(app.staticTexts[“Hello World”].exists) //Throws exception if label does not exists
9. Requirements
2. Building a simple test suite
Create a Weather App
1. Given I am at the City Search Screen
When I search for a valid city (eg “London”)
Then I should see a weather details page of that city
2. Given I am at the City Search Screen
When I search for an invalid city (eg “NotACity”)
Then I should see an error message
14. Generated Code - Valid City
2. Building a simple test suite
func testUserAbleToSearchForValidCity() {
let app = app2
app.searchFields["Search a city"].tap()
app.searchFields["Search a city"]
let app2 = app
app2.buttons["Search"].tap()
app.searchFields["Search a city"]
let tablesQuery = app2.tables
tablesQuery.staticTexts["London"].tap()
tablesQuery.staticTexts["53"].tap()
tablesQuery.staticTexts["Partly Cloudy"].tap()
}
15. Generated Code - Invalid City
2. Building a simple test suite
func testUserSeesErrorMessageForInvalidCity() {
let app = XCUIApplciation()
app.searchFields["Search a city"].tap()
app.searchFields["Search a city"]
app.buttons["Search"].tap()
app.searchFields["Search a city"]
let errorAlert = app.alerts["Error"]
errorAlert.staticTexts["Error"].tap()
errorAlert.staticTexts[
"Unable to find any matching weather location to the query submitted!”
].tap()
errorAlert.collectionViews["OK"].tap()
}
16. 2. Building a simple test suite
func testUserAbleToSearchForValidCity() {
let app = XCUIApplication()
let searchField = app.searchFields["Search a city"]
searchField.tap()
searchField.typeText("London")
app.buttons["Search"].tap()
self.userWaitsToSeeText("London")
self.userWaitsToSeeText("53")
self.userWaitsToSeeText("Partly Cloudy”)
self.waitForExpectationsWithTimeout(5, handler: nil)
}
private func userWaitsToSeeText(text: String){
self.expectationForPredicate(
NSPredicate(format: "exists == 1"),
evaluatedWithObject: XCUIApplication().tables.staticTexts[text],
handler: nil
)
// XCUIApplication().tables.staticTexts[text].exists <— boolean
}
Refactored Code
17. 2. Building a simple test suite
func testUserSeesErrorMessageForInvalidCity() {
let app = XCUIApplication()
let searchField = app.searchFields["Search a city”]
searchField.tap()
searchField.typeText("NotACity")
app.buttons["Search"].tap()
self.userWaitsToSeeText("Error")
self.userWaitsToSeeText(
"Unable to find any matching weather location to the query submitted!"
)
self.waitForExpectationsWithTimeout(5, handler: nil)
self.userTapsOnAlertButton("OK")
}
private func userTapsOnAlertButton(buttonTitle: String){
XCUIApplication().buttons[buttonTitle].tap()
}
Refactored Code
21. (User Registration)
Given I am at the user registration page
When I enter invalid email address
And I tap “Register“
Then I should see “Invalid Email Address”
Gherkin - Example 1
3. Use Gherkins
22. (Shopping with existing Items in shopping cart)
Given I have 1 Wallet and 1 Belt in my shopping cart
And I am at the Shopping Item Details Page for a Bag
When I select quantity as “1”
And I tap on “Add to Shopping Cart”
Then I should be at Shopping Cart Screen
And I should see “3” total items in my shopping cart
Gherkin - Example 2
3. Use Gherkins
23. 2. Building a simple test suite
Given I am at Weather Search Form Page
When I enter city search for “London”
Then I should be at Weather Details Page
And I wait to see “London”
And I wait to see “53”
Gherkin - Our Acceptance Tests
24. 2. Building a simple test suite
Given I am at Weather Search Form Page
When I enter city search for “NotACity”
Then I wait to see “Error”
And I wait to see “Unable to …”
And I tap on alert button “OK”
Gherkin - Our Acceptance Tests
25. 3. Use Gherkins
• Language used in Behavioural Driven Development (BDD) to
specify software requirements with examples
• Executable, facilitate collaboration with non developers
• Lets add Gherkin to our project in Xcode
https://github.com/net-a-porter-mobile/XCTest-Gherkin
pod 'XCTest-Gherkin'
Gherkin
27. 3. Use Gherkins
Given I am at Weather Search Form Page
When I enter city search for “London”
Then I should be at Weather Details Page
And I wait to see “London”
And I wait to see “53”
step("I (am|should be) at Weather Search Form Page”) {
let weatherSearchPage = WeatherSearchPage(self.test)
}
struct WeatherSearchPage{
init(testCase: XCTestCase){
testCase.expectationForPredicate(
NSPredicate(format: “exists == 1”),
evaluatedWithObject: XCUIApplication().otherElements[“WeatherSearchPage”],
handler: nil
)
testCase.waitForExpectationsWithTimeout(5, handler: nil)
}
}
28. 3. Use Gherkins
Given I am at Weather Search Form Screen
When I enter city search for “London”
Then I should be at Weather Details Page
And I wait to see “London”
And I wait to see “53”
step("I enter city search for ”(.*?)””) { (matches: [String]) in
let weatherSearchPage = WeatherSearchPage(testCase: self.test)
weatherSearchPage.userSearchForCity(matches.first!)
}
struct WeatherSearchPage{
func userSearchForCity(city: String){
let app = XCUIApplication()
let searchField = app.searchFields[“Search a city”]
searchField.tap()
searchField.typeText(city)
app.buttons[“Search”].tap()
}
}
29. 3. Use Gherkins
Given I am at Weather Search Form Page
When I enter city search for “London”
Then I should be at Weather Details Page
And I wait to see “London”
And I wait to see “53”
step("I (am|should be) at Weather Details Page”) {
WeatherDetailsPage(testCase: self.test)
}
struct WeatherDetailsPage{
init(testCase: XCTestCase){
testCase.expectationForPredicate(
NSPredicate(format: “exists == 1”),
evaluatedWithObject: XCUIApplication().otherElements[“Weather Forecast”],
handler: nil
)
testCase.waitForExpectationsWithTimeout(5, handler: nil)
}
}
30. 3. Use Gherkins
Given I am at Weather Search Form Page
When I enter city search for “London”
Then I should be at Weather Details Page
And I wait to see “London”
And I wait to see “53”
step("I wait to see ”(.*?)””) { (matches: [String]) in
self.test.expectationForPredicate(
NSPredicate(format: “exists == 1”),
evaluatedWithObject: XCUIApplication().staticTexts[matches.first!],
handler: nil
)
self.test.waitForExpectationsWithTimeout(5, handler: nil)
}
31. 3. Use Gherkins
Given I am at Weather Search Form Page
When I enter city search for “NotACity”
Then I wait to see “Error”
Then I wait to see “Unable to …”
Then I tap on alert button “OK”
step("I tap on alert button ”(.*?)””) {
XCUIApplication().buttons[matches.first!].tap()
}
32. 3. Use Gherkins
Using an additional pod to simply statements -
https://github.com/joemasilotti/JAMTestHelper
Gherkin
33. 3. Use Gherkins
Using an additional pod to simply statements -
https://github.com/joemasilotti/JAMTestHelper
Gherkin
40. Why should I use Gherkin with
XCUITest?
3. Use Gherkins
• Acceptance Test Driven Development
• Cross platform testing is still possible without need for 3rd
party tools
• Objective C + Swift
The codes mentioned in the later slides can be found here
show of hands: How Many people in the room are testers, developers, non-technical
How many developers write Unit Tests? UI Automated Tests?
Based on a couple of requirements, we will attempt to write XCUITest cases.
Introducing the Gherkin Language and how we can bring this tool to XCUITest
Wanted to share a segment on setting up fixtures for XCUITest
Out of the box test automation Tool introduced in Xcode7. the way you would write tests is by querying for elements/subviews on the main app window
XCUITest uses the XCTest framework which generally xUnitTest patterns. (abt testCases, setup/teardown, assertion
when we run XCUITest, we build/install testTargetApp + testRunner. TestsR will launch+query elements on screen (blackbox)
No Mocking
Helpful for developers to discover how to use the api
Look at the codes… explain
you’ll mainly be working with XCUIElement
you can also use “other elements’ to return a collection of anything that is subclass of UIView
Now that you have some idea of what the api can do, lets go ahead and write our first XCUITest case!
show the plus sign before running
We will record the test case for the first requirement for Valid city
One importantly tip here, you may want to click on the elements during recordings as Xcode will help generate the statements we may need to use later
Explain code
As u can see, Xcode may not always generate the desired codes.
For this case, the codes for typing the search string is missing
As you can see here…. we simply filled in the blanks for the missing/incorrect codes… and we organised them little bit
You can use Scheme to manage your tests.
This allows you to build tests against just 1 test target and use different scheme to decide which tests you want to run.
Smoke vs Regression. Local vs Running in a particular env.
of course, changing env requires you to change api target in your app
If you want to change which env you want your app to be run in, you can use scheme to modify your config
- ** remember to encrypt your config file before you package your .app / .ipa file
If you don't know what’s Gherkin, this is an example of a feature file written in Gherkin
Gherkin is a human readable syntax use to construct acceptance test cases. BDD
Keywords: Feature, Scenario, (below scenario are steps) Given, When Then
Today, focus on how to use Given When Then
- Btw, this is taken from our iOS offline interview assignment where we ask candidates to code, and the interview panel conducts very thorough code review… Look at how you architect/decouple codes, name variables, any abuse of coding structures/design patterns, how you write tests, whether you have proper code coverage
- Btw, this is taken from our iOS offline interview assignment where we ask candidates to code, and the interview panel conducts very thorough code review… Look at how you architect/decouple codes, name variables, any abuse of coding structures/design patterns, how you write tests, whether you have proper code coverage
In our test case file, specify the Given When Then in a test method
create a subclass of StepDefiner that evaluates the GWT steps definition
Specify steps without using “GWT”
specify “am” or “should be” … so that i can reuse it in Given or Then
Where do i put this string? i can go to VC.viewDidLoad
ATTD: Work with QA, PO. They can fill up features. 1st specify features, hook it into CI and get it to pass. in PG we asked PO to write and commit the feature before we start any work
android/ios dev… u only need feature files to bind same requirements together
No need to learn other programming language required by any 3rd party tool
I hope you guys gotten a good picture on how to use XCUITest and Gherkin.
If any of you guys need help or tips to kickstart UITest+Gherkin in your personal or company work, feel free to chat with me later during the break or buzz me via my emails