Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Padrões e Boas Práticas de Teste de Tela
Search
Celso Crivelaro
March 31, 2018
Programming
0
420
Padrões e Boas Práticas de Teste de Tela
Python Sudeste 2018
Celso Crivelaro
March 31, 2018
Tweet
Share
More Decks by Celso Crivelaro
See All by Celso Crivelaro
Sistemas de Recomendação
celsocrivelaro
2
230
Big Data para Gerentes de Projetos
celsocrivelaro
0
66
FileSystems em Ruby com FUSE
celsocrivelaro
2
68
Projeto de APIs
celsocrivelaro
0
160
Testing Network Conditions with ToxiProxy
celsocrivelaro
1
390
Testing Network Conditions with ToxiProxy
celsocrivelaro
0
83
Actor Model in Ruby
celsocrivelaro
0
260
Separando as regras de negócios do Rails
celsocrivelaro
0
180
InfluxDB + Grafana
celsocrivelaro
0
260
Other Decks in Programming
See All in Programming
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
900
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
1.9k
Cell-Based Architecture
larchanjo
0
150
Tinkerbellから学ぶ、Podで DHCPをリッスンする手法
tomokon
0
140
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
5
1.3k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
450
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
4k
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
1
290
perlをWebAssembly上で動かすと何が嬉しいの??? / Where does Perl-on-Wasm actually make sense?
mackee
0
200
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
130
愛される翻訳の秘訣
kishikawakatsumi
3
350
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.5k
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
73
Embracing the Ebb and Flow
colly
88
4.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
1k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
71
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
680
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
94
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Accessibility Awareness
sabderemane
0
24
The untapped power of vector embeddings
frankvandijk
1
1.5k
Making Projects Easy
brettharned
120
6.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1k
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