AppSuite:Test basics: Difference between revisions

From Open-Xchange
No edit summary
mNo edit summary
Line 2: Line 2:
* 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)
* Turn off CSS transitions - 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:05, 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 transitions - 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