Consolidated knockout.js
[openemr.git] / Tests / selenium / README.md
blobdb8350c7c2344f6d0add92cb31c11a7c0510610d
1 # Selenium + PHPUnit Test OpenEMR
3 Author: Sharon Cohen, Oleg Sverdlov
6 This is a guide on how to install and run a simple selenium test (using phpunit) to the Open EMR system.
8 This is just a sample test (and simple one).
10 The example test includes:
12 * Open the browser and go to local OpenEMR installation
13 * Login with default admin credentials
14 * Go to New patient form
15 * Add a new patient with random names(string) and DOB
16 * Accept the creation of the new patient
17 * Check the database that this patient exist in the table patient_data
18 * Close the  browser
20 ### Things to improve:
22 To have a complete set of test they should include:
24 * Login failure
25 * Validation test when creating a new patient
26 * Checking the existence/inexistence of clinical reminders according to personal configuration 
28 ## Installation:
30 The test works for OpenEMR installed on local computer. You'll need Chrome browser :)
31 (Note that with a simple code change, there is also the option of using the Firefox browser)
33 ### Install Composer and packages
35 If you don't have Composer refer to https://getcomposer.org/download/
37 From OpenEMR folder install phpunit and phpunit-selenium via composer
39     composer require --dev phpunit/phpunit
40     composer require --dev phpunit/phpunit-selenium
42 (depending on how you installed Composer you may need to run `php composer.phar` )
44 ### Install Browser driver
46 To use Chrome as a test Browser download the driver from here: https://sites.google.com/a/chromium.org/chromedriver/downloads
48 Move the downloaded file to an executable directory
50     sudo mv chromedriver /usr/local/bin/ 
52     sudo chmod 755 /usr/local/bin/chromedriver
55 ### Install Selenium server
57 Download standalone selenium server from here: http://docs.seleniumhq.org/download/
59 Download and install JRE. You can get JRE from java.com or from your Linux distro repositories. Check you can run it: 
61     java -version
64 ## Running tests
66 *never run the tests on production database!
68 First, run Selenium server in separate process
70     java -jar selenium-server-standalone-<version>.jar
72 Then, run the test:
74     ./vendor/bin/phpunit Tests/selenium/CheckCreateUser.php
76 ## References:
78     https://getcomposer.org/download/
80     https://phpunit.de/manual/current/en/installation.html
82     https://sites.google.com/a/chromium.org/chromedriver/downloads
84     http://docs.seleniumhq.org/download/
86     https://www.sitepoint.com/using-selenium-with-phpunit/
88     https://phpunit.de/manual/3.7/en/selenium.html
90     https://phpunit.de/manual/current/en/database.html