32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-27 18:24:56 +00:00

Merge pull request #164 from javigomez/158

Add environments for different resolutions
This commit is contained in:
javier gomez 2015-11-04 12:52:28 +01:00
commit f1de317317
4 changed files with 37 additions and 6 deletions

View File

@ -40,4 +40,4 @@ script:
- mv jbuild.dist.ini jbuild.ini - mv jbuild.dist.ini jbuild.ini
- vendor/bin/robo build - vendor/bin/robo build
- mv tests/acceptance.suite.dist.yml tests/acceptance.suite.yml - mv tests/acceptance.suite.dist.yml tests/acceptance.suite.yml
- vendor/bin/robo run:tests true - vendor/bin/robo run:tests --use-htaccess

View File

@ -37,6 +37,20 @@ $ vendor/bin/robo
$ vendor/bin/robo run:tests $ vendor/bin/robo run:tests
``` ```
## Additional options
You can run the tests against different resolutions. The default acceptance YAML configuration file provides three options:
* "desktop": default, 1024x768px
* "tablet": tablet in portrait mode, 768x1024px
* "phone": phone in portrait mode, 480x640px
To set a specific resolution, set is as an option of the command:
`$ vendor/bin/robo run:tests --env=tablet`
Note: the first parameter is used by Travis and you should always set it to "0" when you run your tests locally.
##For Windows: ##For Windows:
You need to install: You need to install:

View File

@ -75,13 +75,14 @@ class RoboFile extends \Robo\Tasks
/** /**
* Executes all the Selenium System Tests in a suite on your machine * Executes all the Selenium System Tests in a suite on your machine
* *
* @param bool $use_htaccess Renames and enable embedded Joomla .htaccess file * @param array $opts Array of configuration options:
* * - 'use-htaccess': renames and enable embedded Joomla .htaccess file
* - 'env': set a specific environment to get configuration from
* @return mixed * @return mixed
*/ */
public function runTests($use_htaccess = false) public function runTests($opts = ['use-htaccess' => false, 'env' => 'desktop'])
{ {
$this->createTestingSite($use_htaccess); $this->createTestingSite($opts['use-htaccess']);
$this->getComposer(); $this->getComposer();
@ -96,6 +97,7 @@ class RoboFile extends \Robo\Tasks
->arg('--steps') ->arg('--steps')
->arg('--debug') ->arg('--debug')
->arg('--fail-fast') ->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg('tests/acceptance/install/') ->arg('tests/acceptance/install/')
->run() ->run()
->stopOnFail(); ->stopOnFail();
@ -104,6 +106,7 @@ class RoboFile extends \Robo\Tasks
->arg('--steps') ->arg('--steps')
->arg('--debug') ->arg('--debug')
->arg('--fail-fast') ->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg('tests/acceptance/administrator/') ->arg('tests/acceptance/administrator/')
->run() ->run()
->stopOnFail(); ->stopOnFail();
@ -112,9 +115,11 @@ class RoboFile extends \Robo\Tasks
->arg('--steps') ->arg('--steps')
->arg('--debug') ->arg('--debug')
->arg('--fail-fast') ->arg('--fail-fast')
->arg('--env ' . $opts['env'])
->arg('tests/acceptance/frontend/') ->arg('tests/acceptance/frontend/')
->run() ->run()
->stopOnFail(); ->stopOnFail();
/* /*
// Uncomment this lines if you need to debug selenium errors // Uncomment this lines if you need to debug selenium errors
$seleniumErrors = file_get_contents('selenium.log'); $seleniumErrors = file_get_contents('selenium.log');

View File

@ -39,4 +39,16 @@ modules:
repo_folder: '/home/travis/build/joomla-extensions/weblinks/' # Path to the Extension repository. To be used by tests to install via Install from folder repo_folder: '/home/travis/build/joomla-extensions/weblinks/' # Path to the Extension repository. To be used by tests to install via Install from folder
counter_test_url: 'http://localhost/tests/joomla-cms3' # the url for the weblink item used to test hits counter counter_test_url: 'http://localhost/tests/joomla-cms3' # the url for the weblink item used to test hits counter
url: 'http://localhost/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here url: 'http://localhost/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED" error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED"
env:
desktop: ~
tablet:
modules:
config:
JoomlaBrowser:
window_size: 768x1024
phone:
modules:
config:
JoomlaBrowser:
window_size: 480x640