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
Testando Frontend
Search
Fernando Fabricio dos Santos
September 17, 2015
Technology
0
24
Testando Frontend
Testando seu front utilizando ferramentas para teste javascript
Fernando Fabricio dos Santos
September 17, 2015
Tweet
Share
More Decks by Fernando Fabricio dos Santos
See All by Fernando Fabricio dos Santos
Motivos e custos para se manter o PHP atualizado
ferfabricio
0
64
Motivações para se testar o software
ferfabricio
0
26
Other Decks in Technology
See All in Technology
障害対応をちょっとずつよくしていくための 演習の作りかた
heleeen
1
1.7k
Rustで「プリズモイダル法」を利用して「土量計算」をガチでやる
nokonoko1203
1
320
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
5
18k
M5と自作基板をくっつけてみた〜M5 Japan Tour 2024 Spring 福冈 (Fukuoka|福岡)〜
keropiyo
0
170
R3のコードから見る実践LINQ実装最適化・コンカレントプログラミング実例
neuecc
3
2.9k
モーダル間の変換後の一致性とジャンル表を用いた解釈可能性の考察 ~Text-to-MusicとText-To-ImageかつImage-to-Musicを例に~
otanet
0
320
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
2.1k
MapLibreとAmazon Location Service
dayjournal
1
190
One engineer company with Ruby on Rails
rstankov
2
440
Max out Local LLM in Challenging Environments
sashimimochi
1
130
個人のAWSアカウントをマルチ運用してみた
miura55
2
180
M5stackで使用できるpHセンサの開発
shinrinakamura
0
210
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.3k
Web development in the modern age
philhawksworth
203
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
12
1k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
The Cost Of JavaScript in 2023
addyosmani
21
3.9k
Agile that works and the tools we love
rasmusluckow
325
20k
Music & Morning Musume
bryan
41
5.6k
Ruby is Unlike a Banana
tanoku
96
10k
Building Your Own Lightsaber
phodgson
100
5.7k
The Art of Programming - Codeland 2020
erikaheidi
43
12k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Transcript
Testando frontend Utilizando ferramentas JS
https://slimerjs.org/ http://phantomjs.org/ CasperJS Script de navegação e testes para PhantomJS
e SlimerJS http://casperjs.org/
None
Pensando seu teste • O que vai ser testado? •
É um fluxo padrão? É possível reproduzir? • É realmente necessário este teste? Vai adicionar valor ao produto?
Mapeando o fluxo a ser testado • Qual página devo
abrir? • Qual o http-code esperado? • Quais elementos deveriam aparecer na tela? • Qual o comportamento esperado ao clicar em algum elemento?
None
Formulando um caso de teste 1. http-code 200 2. Título
da página igual a: 'Fernando Fabricio' 3. Tag h1 com o conteúdo: 'Fernando Fabricio'
Criando o teste begin(String description, Number planned, Function suite) begin(String
description, Function suite) begin(String description, Number planned, Object config) begin(String description, Object config)
Estrutura do teste start(String url[, Function then]) run(fn onComplete[, int
time])
Assertions assert() assertDoesntExist() assertEquals() assertEval() assertEvalEquals() assertElementCount() assertExists() assertFalsy() assertField()
assertFieldName() assertFieldCSS() assertFieldXPath() assertHttpStatus() assertMatch() assertNot() assertNotEquals() assertNotVisible() assertRaises() assertSelectorDoesntHaveText() assertSelectorHasText() assertResourceExists() assertTextExists() assertTextDoesntExist() assertTitle() assertTitleMatch() assertTruthy() assertType() assertInstanceOf() assertUrlMatch() assertVisible()
Exemplo de teste
Executando o teste casper test <seu arquivo JS> Resultado do
teste formulado:
setUP e tearDown
None
Exemplo de teste
None
Screenshot
None
http://casperjs.readthedocs.org/