Difference between revisions of "AppSuite:Test basics"

Line 1: Line 1:
 
Lessons learned painfully while doing testing:
 
Lessons learned painfully while doing testing:
* PhantomJS thinks it is a touch device (Modernizr.touch === true)
+
* PhantomJS thinks it is a '''touch''' device (Modernizr.touch === true)
 
* Almost no CSS is loaded. Don't rely on classes like "hidden" (bootstrap class)
 
* Almost no CSS is loaded. Don't rely on classes like "hidden" (bootstrap class)
 +
* Turn off CSS transition - any DOM-based test might fail (caused by random DOM reflow delay)
 
* Don't clear <body> (e.g. $(document.body).empty()). UI is not robust against that.
 
* Don't clear <body> (e.g. $(document.body).empty()). UI is not robust against that.
 
* The browser window is elastic. It has no fixed size. Usually affects scrolling tests.
 
* The browser window is elastic. It has no fixed size. Usually affects scrolling tests.

Revision as of 20:04, 31 March 2014

Lessons learned painfully while doing testing:

  • PhantomJS thinks it is a touch device (Modernizr.touch === true)
  • Almost no CSS is loaded. Don't rely on classes like "hidden" (bootstrap class)
  • Turn off CSS transition - any DOM-based test might fail (caused by random DOM reflow delay)
  • Don't clear <body> (e.g. $(document.body).empty()). UI is not robust against that.
  • The browser window is elastic. It has no fixed size. Usually affects scrolling tests.
  • If weird things happen, try to check if your app/window/node is really still in the DOM.
  • HTML fixtures cannot be loaded (don't know why yet); just rename your files to *.txt
  • Please mind that your fake server only works inside "description" (not across specs)
  • PhantomJS fails at: Date.parse("2012-01-01"); (see https://code.google.com/p/phantomjs/issues/detail?id=267#c2)
  • The fake server is global, if someone has registered your desired api/call already, your response will never get send