Example of CasperJS use for a little test
Please see the post in: http://blog.fabricio.inf.br
casperjs test yourtestfile.js
# OR to execute all
casperjs test *.js
- Filename: index.js
- Tests case
- Verify http response code if equals to 200
- Verify if the title text is equals to Fernando Fabricio
- Verify if the element h1 text is equals to \nFernando Fabricio\n (yes, the blogger add this break line in the title :T)
- Filename: index_bulletproof_with_assert_exists.js
- Tests case
- Verify presence of title tag
- Verify presence of h1 tag
- Verify http response code if equals to 200
- Verify if the title text is equals to Fernando Fabricio
- Verify if the element h1 text is equals to \nFernando Fabricio\n (yes, the blogger add this break line in the title :T)
- Filename: index_bulletproof_with_wait_for_selector.js
- Tests case
- Verify http response code if equals to 200
- Verify if the title text is equals to Fernando Fabricio
- Verify if the element h1 text is equals to \nFernando Fabricio\n (yes, the blogger add this break line in the title :T)
- Filename: index_with_screenshot.js
- Tests case
- Verify presence of title tag
- Verify presence of h1 tag
- Verify http response code if equals to 200
- Verify if the title text is equals to Fernando Fabricio
- Verify if the element h1 text is equals to \nFernando Fabricio\n (yes, the blogger add this break line in the title :T)
- Take a screenshot