prestashop-automation-tool
This tool is designed to make selenium testing of PrestaShop shops really easy. It should work with any non-windows OS, but the preferred configuration is a Linux machine with apache2.
#Setup
##Prerequisites
You will need a working ruby environment:
sudo apt-get install ruby ruby-devAnd probably the mysql headers for the mysql2 gem to compile:
sudo apt-get install libmysqlclient-dev##Installation
sudo gem install prestashop-automation-tool#Usage
##First Steps
Browse to a local PrestaShop installation:
cd /var/www/prestashopInitialize the environment:
pat initThis will try to guess the parameters needed from your installation files and ask about what's missing. When the small wizard is done you can edit the pat.conf.json file and correct it if necessary.
Enable some tests:
pat enable installRun the tests:
pat testThe test command will run all tests under tests-enabled, but you can specify a specific file name to run.
##Creating a New Test
To create a test stub, just run this:
pat create my.testThis will put a new test called my.test.rb under tests-enabled containing something like:
require 'prestashop-automation-tool/helper'
describe 'My first test' do
it 'should login as a customer' do
@shop.login_to_front_office
end
endYour test script receives automatically a @shop variable, which is an instance of PrestaShopAutomation::PrestaShop.
Look at the modules under prestashop-automation/lib/actions to see what you can do with this shop!
The database is saved before each test, then restored, so you can consider that each test runs in its own sandbox.
##Where to go next?
###Improve the Framework!
We want more primitives to build complex tests, please contribute to prestashop-automation!
###Commit Useful Tests!
By default, the prestashop-automation-tool-tests repository is cloned into tests-available. The more tests, the happier we are. Please make pull requests!