Browse Source

Add acceptance tests structure

tags/v1.8.2.4
Adam Bukowski 4 years ago
parent
commit
e0bb25e42d
6 changed files with 30 additions and 2 deletions
  1. +2
    -0
      .gitignore
  2. +1
    -0
      codeception.yml
  3. +10
    -0
      tests/_support/AcceptanceTester.php
  4. +3
    -2
      tests/acceptance.suite.yml
  5. +11
    -0
      tests/acceptance/LoginCept.php
  6. +3
    -0
      tests/config.example.yml

+ 2
- 0
.gitignore View File

@@ -25,3 +25,5 @@ Thumbs.db
# Composer packages directory
vendor
!modules/CRM/Roundcube/RC/vendor

tests/config.yml

+ 1
- 0
codeception.yml View File

@@ -14,6 +14,7 @@ extensions:
- Codeception\Extension\RunFailed
params:
- env
- tests/config.yml
modules:
config:
Db:


+ 10
- 0
tests/_support/AcceptanceTester.php View File

@@ -23,4 +23,14 @@ class AcceptanceTester extends \Codeception\Actor
/**
* Define custom actions here
*/

/**
* Wait for EPESI to finish request
*
* @param int $time
*/
public function waitForEpesi($time = 60)
{
$this->waitForJS('return Epesi.procOn == 0;', $time);
}
}

+ 3
- 2
tests/acceptance.suite.yml View File

@@ -7,6 +7,7 @@
class_name: AcceptanceTester
modules:
enabled:
- PhpBrowser:
url: http://localhost/myapp
- WebDriver:
url: %URL%
browser: phantomjs
- \Helper\Acceptance

+ 11
- 0
tests/acceptance/LoginCept.php View File

@@ -0,0 +1,11 @@
<?php
$I = new AcceptanceTester($scenario);
$I->wantTo('Login');
$I->amOnPage('/');
$I->waitForEpesi();
$I->see('username');
$I->fillField('username', 'admin');
$I->fillField('password', 'admin1');
$I->click('submit_button');
$I->waitForEpesi();
$I->seeElement('.logged_as');

+ 3
- 0
tests/config.example.yml View File

@@ -0,0 +1,3 @@
# Example config file. Copy to config.yml

URL: "http://localhost/epesi/"

Loading…
Cancel
Save