Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Padrões e Boas Práticas de Teste de Tela
Search
Celso Crivelaro
March 31, 2018
Programming
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Padrões e Boas Práticas de Teste de Tela
Python Sudeste 2018
Celso Crivelaro
March 31, 2018
More Decks by Celso Crivelaro
See All by Celso Crivelaro
Sistemas de Recomendação
celsocrivelaro
2
250
Big Data para Gerentes de Projetos
celsocrivelaro
0
75
FileSystems em Ruby com FUSE
celsocrivelaro
2
78
Projeto de APIs
celsocrivelaro
0
190
Testing Network Conditions with ToxiProxy
celsocrivelaro
1
410
Testing Network Conditions with ToxiProxy
celsocrivelaro
0
92
Actor Model in Ruby
celsocrivelaro
0
270
Separando as regras de negócios do Rails
celsocrivelaro
0
200
InfluxDB + Grafana
celsocrivelaro
0
280
Other Decks in Programming
See All in Programming
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
520
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Jetpack Compose Mechanisms
skydoves
3
820
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
0
1.5k
Event is what happens
moro
2
840
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
940
The Rails Doctrine Decade
koic
2
590
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
280
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Prompt Engineering for Job Search
mfonobong
0
520
KATA
mclloyd
PRO
35
16k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
710
Unsuck your backbone
ammeep
672
58k
Raft: Consensus for Rubyists
vanstee
142
7.8k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
HDC tutorial
michielstock
2
960
Side Projects
sachag
456
43k
Transcript
Padrões e boas práticas para testes de Tela Celso Crivelaro
@celsocrivelaro
$ whoiam
Tech Lead @ Professor @
None
None
O que você verá nesta talk
Porque fazer testes de tela Causos com testes de telas
Design Patterns para testes Boas práticas
Esta é uma história sobre um time...
Débora Guilherme Fernanda Desenvolvedores
None
None
None
Em um dia comum, subiram uma alteração...
None
None
None
None
#chatiado
Por que isso ocorreu?
None
Como evitar isso?
None
Érico Especialista QA
None
None
https://martinfowler.com/bliki/TestPyramid.html
Página de Entrada Página de Retorno Entrada de Dados Controller
Regras de Negócio Models Integrações
Chrome Driver Código de Teste Firefox Driver
http://selenium-python.readthedocs.io/
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
$ pip install selenium
None
None
None
None
Confiabilidade
https://martinfowler.com/bliki/TestPyramid.html
None
None
Entretanto alguns problemas ocorreram...
Os testes ficaram muito lentos
Inserir novos testes e funcionalidades ficou mais difícil
Testes Instáveis
#chatiado
None
Problema 1: Testes Lentos
None
None
None
Mas se os outros casos quebrarem?
None
None
None
None
None
None
None
None
None
None
Tunning do banco para testes
https://docs.mongodb.com/manual/core/in memory/ https://dev.mysql.com/doc/refman/5.5/en/memo ry-storage-engine.html https://www.postgresql.org/docs/curre nt/static/non-durability.html Tunning para testes
NUNCA use em produção
None
None
Problema 2: Novos testes e leitura
Dificuldade de novas funcionalidades / testes Dificuldade no entendimento
Time fazendo código de produção
Time fazendo código de produção Time fazendo código de testes
Código dos testes precisa ser tão bom quanto o de
produção
Testes mal arquitetados
None
Builder para Setups Complexos
None
http://factoryboy.readthedocs.io/en/latest/
None
Command para testes longos
Unitário Entrada Saída ABC DFE 123 222
Aceitação Checar Tela 1 Clicar Link Checar Tela 2 Checa
Produto Checar Tela 3 Checar Produto cadastrado Preenche Form Clicar Submit Pipeline
Proxies para integrações externas
ProxyPagamento Integração Fluxo de Pagamento ENV=production ProxyPagamento Mock
ProxyPagamento Fluxo de Pagamento ENV=test ProxyPagamento Mock Integração
Dificuldade de entender testes antigos
None
Onde terminam e começam as páginas?
Page Objects
Objeto que representa uma página
Checagens e Ações usando métodos
Preencher campo A com valor "B" Entrar na página XYZ
Clicar em "Enviar" Ir para página ABC Exibir "Dado Cadastrado" Ações Resultados esperados
CadastroUsuario ResultadoCadastro
CadastrarUsuario
CadastrarUsuario Métodos de Ação
CadastrarUsuario Métodos de Verificação
ResultadoCadastro
Teste
Teste Objetos mostram as transições de páginas
Boa Prática: Separar Page Objects dos Testes
Expressividade
Encapsulamento e Reutilização
Qualquer interação: • API REST • Troca de Mensagens •
Email
Problema 3: Testes Instáveis
Ordem
Esperado Resultado
Ordem de armazena mento no banco Checagem Armazenamento
Forçar ordem na listagem Checagem Armazenamento
Tempo de tela
None
http://selenium-python.readthedocs.io/waits.html Implicit Wait
http://selenium-python.readthedocs.io/waits.html Explicit Wait
http://selenium-python.readthedocs.io/waits.html Explicit Wait
Tempo de tela-sistema
None
None
Espere interações de Tela iniciarem e terminarem
Todos Felizes
Consequências Indiretas
Aumento de produtividade
Melhorou o código de produção
None
Scrappers
Obrigado! Celso Crivelaro @celsocrivelaro http://crivelaro.me