From 42b8cc9e06a51cde9835ef285d723176aaa44139 Mon Sep 17 00:00:00 2001 From: diosmosis Date: Thu, 10 Oct 2013 17:40:45 -0400 Subject: Updating tests README.md to reflect new Screenshot testing mechanism. --- tests/README.md | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) (limited to 'tests/README.md') diff --git a/tests/README.md b/tests/README.md index cb9536d040..f27a0d758f 100644 --- a/tests/README.md +++ b/tests/README.md @@ -194,37 +194,26 @@ run the following commands: **Requirements:** -In order to run UI tests, you need to have CutyCapt installed on your machine. If you're -using Ubuntu, you can install it with the following command: +In order to run UI tests, you need to have [phantomjs](http://phantomjs.org) version 1.9.0 or greater +installed on your machine. You can download phantomjs [here](http://phantomjs.org/download.html). - $ sudo apt-get install cutycapt - -If you're on a server without the X window system, you can still run UI tests, but you -will need xvfb to do so. On Ubuntu, you can install xvfb with: +phantomjs is headless, so even if you're on a server without the X window system, you can still run the +UI tests. - $ sudo apt-get install xvfb - -To render the app & generate exact same screenshots as Travis, installing fonts may be useful. On Ubuntu: +To generate screenshots identical to those generated by Travis, installing fonts may be useful. On Ubuntu: $ sudo apt-get install msttcorefonts -Removing this font helped: - $ sudo apt-get remove ttf-bitstream-vera +In one case, removing this font was necessary to get tests to pass: + $ sudo apt-get remove ttf-bitstream-vera **Running Tests** -Unfortunately, since different machines result in different screenshots, there is no expected -set of screenshots. You must generate these yourself using an older commit. To do this, first -find a commit where you know the UI works. Then run: - - $ cd PHPUnit - $ ./populate-expected-screenshots.sh $commit_hash - -Once you have expected screenshots, you can test the UI by running: +You can test the UI by running: $ cd PHPUnit $ phpunit UI -** Learn more ** +**Learn more** Check out this blog post to learn more about Screenshot Tests in Piwik: [QA Screenshot Testing blog post](http://piwik.org/blog/2013/10/our-latest-improvement-to-qa-screenshot-testing/) -- cgit v1.2.3