Upload
henrique-luz
View
104
Download
3
Embed Size (px)
Citation preview
#IATRENDS
E2E TESTING W/ WEBDRIVER I/O
Henrique LuzAgosto/16
AGENDA
‣ Tests from the beginning ‣ Agile testing
- Evolução‣ E2E testing
- Intro- Trade-off
‣ Back-end x Front-end‣ WebDriver I/O‣ Hands-on
TESTS FROM THE BEGINNING
BEFORE▸ Cascata▸ Manuais▸ Caixa-preta▸ Orientados a bugs▸ Feedback tardio
AGILE TESTING
TESTS EVOLUTION
AGILE TESTING
NOW▸ Agile Development
▸ TDD BDD▸ Unitarios + Integração▸ Continuous Delivery▸ Feedback Instantâneo
SUFICIENTE?
DEPENDE!
E2E TESTING
▸ Simula fluxo do usuário▸ UI’s
▸ Interage com toda app▸ Ajuda a validar critérios de aceitação▸ Regressão de testes bem mais rápida
TRADE-OFF▸ Mais custosos▸ Mais lentos▸ Mudanças na UI tendem a impactar
ONDE ESCREVER MEUS TESTES E2E?
MAIS UMA VEZ.. DEPENDE!
Tipo da Aplicação
Tecnologias disponíveis Maturidade do
time
Conhecimento do time
?
? ?
?
??
??
?
?
?
? ???
E2E TESTING
FERRAMENTAS JAVASCRIPT
WEBDRIVER I/O
TESTES DE REGRESSÃO DE UI
DSL FLUENTE
VARIEDADE DE HOOKS
SUPORTA SINCRONISMO
SUPORTA GULP E GRUNT
FORNECE CLI
SETUP FÁCIL
WEBDRIVER I/O
SETUP
1. Create sample folder‣ mkdir iatrends-sample && cd iatrends-sample
2. Download selenium standalone server‣ curl -O http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-
2.53.0.jar
3. Start selenium server‣ java -jar selenium-server-standalone-2.53.0.jar
4. Download Webdriver I/O‣ npm install webdriverio
5. Create a test file (test.js)6. Run tests
‣ node test.js
FEATURES
▸ client.addValue(selector, values)
▸ client.click(selector)▸ client.dragAndDrop(source,
dest)▸ client.submitForm(selector)▸ client.getText(selector,
attrName)▸ client.getUrl()▸ client.getValue(selector)
▸ client.launch()▸ client.orientation([deviceOrientati
on])▸ client.getGeolocation()▸ client.rotate(x, y, duration, radius,
rotation, touchCount)▸ client.swipe([selector][xoffset]
[yoffset][speed]);▸ client.currentActivity();
HANDS-ON