2. Agenda
• O que é o Xamarin UI Test?
• O que eu consigo testar com Xamarin
UI Test?
• Quais os Requisitos?
• REPL(Read-Eval-Print-Loop)
• Comandos(Métodos)
• Demo
• Mobile Center
• Demo
3. Quem vos fala?
• Cleiton Felipe de Moraes
– Casado com uma blogueira literária,
Pai do Pedro e de dois gatos (Nina e Flash)
– Cruzeirense, Graffiteiro,
skatista(já faz um tempo que não ando rs)
– Líder e Co-Fundador da Sorocódigos Comunidade técnica
de Sorocaba e região.
– Associado MTAC (Multi_Platform Technical Audience Contributor)
– Trabalho com desenvolvimento a mais de 6 anos
• Plataforma .Net, PHP, Java e outras mais...
• Atualmente sou Analista Desenvolvedor Sênior na Coreon IT
4. O que é o Xamarin UI Test?
Framework de automação de
testes de UI baseado no
Calabash, que permite
desenvolvedores/programado
res escreverem e executarem
testes escritos em C# com
Nunit para validação de
funcionalidades de app´s IOS
e Android, sejam elas nativas
ou hibridas.
5. Quais os Requisitos?
• Somente app´s Android e IOS
• Mínimo NUnit 2.6.x
• No caso de testes para Android precisa
• Android SDK e JDK
• No caso de IOS não é possível testar no Windows
• Como sempre precisa de um MAC.
6. REPL(Read-Eval-Print-Loop)
É a ferramenta que
vai nos auxiliar a
escrever os testes.
Com ela conseguimos
analisar a árvore de
componentes que
temos
em cada parte da app
e realizar a escrita do
teste já vendo a sua
execução.
7. Comandos(Métodos)
Comandos no Xamarin UI Test são métodos que irão simular ações que
O usuário irá realizar no seu aplicativo como:
Tap – Apenas um toque na tela como em um botão por exemplo.
DoubleTap – Dois toque rápidos na tela
ScrollUp e ScrollDown – Rolar para baixo e para cima como em uma lista
Entre outros...
Xamarin.UITest, an Automated UI Acceptance Testing framework based on Calabash that allows programmers to write and execute tests in C# and NUnit that validate the functionality of iOS and Android Apps.
One of the important tools in creating UITests is the the REPL (read-eval-print-loop). The REPL is a console-like environment in which the developer enters expressions or a commands. It will then evaluate those expressions, and display the results to the user.
The REPL is helpful when creating UITests – it allows us to explore the user interface and create the queries and statements so that the test may interact with the application.
IApp.DoubleTap – Performs two quick taps on the first matched view.
IApp.DragCoordinates – This method simulates a continous drag between two points.
IApp.PinchToZoomIn – This method will perform a pinch gesture on the matched view to zoom in.
IApp.PinchToZoomOut – This method will perform a pinch gesture on the matched view to zoom out.
IApp.ScrollUp / IApp.ScrollDown – Performs a touch gesture that scrolls down or up.
IApp.SwipeLeftToRight / IApp.RightToLeft – This will simulate a left-to-right or a right-to-left gesture swipe.
IApp.Tap – This will tap the first matched element.
IApp.TouchAndHold – This method will continuously touch view.
With a simple command you can simulate all of your users interactions to build out a great test suite that can be run over and over again.
Mobile Center brings together multiple services, commonly used by mobile developers, into a single, integrated product. You can build, test, distribute, and monitor your mobile apps, and also implement push notifications.
Services
Build
Create an installable app package automatically with every push to your repository. Supports GitHub, or Git repos on Bitbucket and Visual Studio Team Services (VSTS). No additional build hardware required.
Test
Run your tests on more than 400 unique device configurations. Tests can be written for iOS and Android apps with Xamarin.UITest, Appium, Espresso (Android), and XCUITest (iOS). Backed by Xamarin Test Cloud.
Distribute
Users can install the app via email distribution lists for testing, much as they'd download an app from the app store.
Crashes
Collect crashes from all devices, prioritize them based on the number of users seeing the crash, and get the full stack traces to help you fix them. Backed by HockeyApp.
Analytics
Get information about the number of daily, weekly, and monthly users, session duration, the top devices and more. Use events to collect rich behavioral analytics data.
Push Notifications
Engage your users by sending them targeted messages to specific sets of users at exactly the right time. Create segments of users based on device and custom properties.