WIP
- Coupon Add/Edit/Delete rule AJAX - add tests casper JS
This commit is contained in:
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/dit.js
Normal file
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/dit.js
Normal file
@@ -0,0 +1,3 @@
|
||||
//DIT = Environnement d'intégration
|
||||
var copark_base_url = 'http://ws.copark.dit.linux.thelia.fr/';
|
||||
casper.test.done(0);
|
||||
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/local.js
Normal file
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/local.js
Normal file
@@ -0,0 +1,3 @@
|
||||
//LOCAL = ton pc
|
||||
var thelia2_base_url = 'http://www.thelia2.dev/index.php/';
|
||||
casper.test.done(0);
|
||||
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/uat.js
Normal file
3
core/lib/Thelia/Tests/Functionnal/casperjs/conf/uat.js
Normal file
@@ -0,0 +1,3 @@
|
||||
//UAT = Recette client
|
||||
var copark_base_url = 'http://ws.copark.uat.openstudio.fr/';
|
||||
casper.test.done(0);
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
casper.test.comment('Please edit 00_parameters.js to add your configuration');
|
||||
|
||||
var thelia2_login_admin_url = thelia2_base_url + 'admin/login';
|
||||
|
||||
|
||||
//var findMyId = /([0-9]+)$/;
|
||||
//var currentId;
|
||||
|
||||
casper.test.comment('Variables are set');
|
||||
|
||||
casper.test.done(0);
|
||||
25
core/lib/Thelia/Tests/Functionnal/casperjs/exe/10_login.js
Normal file
25
core/lib/Thelia/Tests/Functionnal/casperjs/exe/10_login.js
Normal file
@@ -0,0 +1,25 @@
|
||||
casper.test.comment('Testing login');
|
||||
|
||||
casper.start(thelia2_login_admin_url, function() {
|
||||
this.echo('\nLOGIN');
|
||||
this.test.assertTitle('Welcome - Thelia Back Office', 'Web page title OK');
|
||||
this.sendKeys('form[action*="checklogin"] input[name="thelia_admin_login[username]"]', 'thelia2');
|
||||
this.sendKeys('form[action*="checklogin"] input[name="thelia_admin_login[password]"]', 'thelia2');
|
||||
this.click('form[action*="checklogin"] input[type="submit"]');
|
||||
});
|
||||
|
||||
casper.wait(1000, function() {
|
||||
this.echo("\nWaiting....");
|
||||
});
|
||||
|
||||
casper.then(function(){
|
||||
this.echo('\nDASHBOARD');
|
||||
console.log('Now on : ' + this.getCurrentUrl());
|
||||
this.test.assertTitle('Back-office home - Thelia Back Office', 'Web page title OK');
|
||||
this.test.assertSelectorHasText('#wrapper > div', ' This is the administration home page. Put some interesting statistics here, and display useful information :) ', 'Web page main content OK');
|
||||
});
|
||||
|
||||
//RUN
|
||||
casper.run(function() {
|
||||
this.test.done();
|
||||
});
|
||||
26
core/lib/Thelia/Tests/Functionnal/casperjs/run.sh
Executable file
26
core/lib/Thelia/Tests/Functionnal/casperjs/run.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# @author Guillaume MOREL
|
||||
|
||||
echo "Force dropping database. All data will be lost."
|
||||
|
||||
cd local/config/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Building Models file\e[00m\n"
|
||||
../../bin/propel build -v --output-dir=../../core/lib/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Building SQL CREATE file\e[00m\n"
|
||||
../../bin/propel sql:build -v --output-dir=../../install/
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Reloaded Thelia2 database\e[00m\n"
|
||||
cd ../..
|
||||
rm install/sqldb.map
|
||||
php Thelia thelia:dev:reloadDB
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Installing fixtures\e[00m\n"
|
||||
php install/faker.php
|
||||
|
||||
echo -e "\n\e[01;34m[INFO] Adding admin\e[00m\n"
|
||||
php Thelia thelia:create-admin --login_name thelia2 --password thelia2 --last_name thelia2 --first_name thelia2
|
||||
|
||||
# casperjs test ./exe --pre=./conf/local.js --direct
|
||||
|
||||
4
core/lib/Thelia/Tests/Functionnal/casperjs/run_ci.sh
Executable file
4
core/lib/Thelia/Tests/Functionnal/casperjs/run_ci.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
# @author Quentin Dufour
|
||||
|
||||
/usrcasperjs test ./exe --pre=./conf/dit.js --xunit=reports/report.xml
|
||||
Reference in New Issue
Block a user