Skip to content

Instantly share code, notes, and snippets.

@sukrosono
Last active September 17, 2016 18:34
Show Gist options
  • Save sukrosono/2230e10c4cf3d28864a2f34f5bcc661f to your computer and use it in GitHub Desktop.
Save sukrosono/2230e10c4cf3d28864a2f34f5bcc661f to your computer and use it in GitHub Desktop.
Problem when trying to test a page
  1. I have to edit web page to used Open Graph Protocol, So our senate website can be optimized when sharing in social media.

  2. I need to test it, and it in DOM structures. And it should be automated, inspired by Vojta Jina. It really tedious manually test the page, change 2 line code then save then reload browser.

  3. I won't change the html to include the test framework, it will be a nightmare if i forgot to remove it.

Recently, I wrote some unit test. I also found enjoying writing them, even at the beginning it seems just waste my time (a lot of days to understanding them, also debug). Personally I realize that unit test is important to my careers. One really i like is, it should prevent coworkers mess up my code and vice versa.

https://github.com/ariya/phantomjs/blob/master/examples/phantomwebintro.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment