UNFINISHED Behat tests

This commit is contained in:
Ingo Schommer 2012-11-15 12:01:07 +01:00
parent 1bb392c8dc
commit a08fbd944e
14 changed files with 91 additions and 1 deletions

View File

@ -25,5 +25,8 @@
},
"support": {
"issues": "https://github.com/silverstripe/silverstripe-translatable/issues?state=open"
}
},
"autoload": {
"classmap": ["."]
}
}

View File

@ -0,0 +1,37 @@
<?php
namespace SilverStripe\Translatable\Test\Behaviour;
use SilverStripe\BehatExtension\Context\SilverStripeContext,
SilverStripe\BehatExtension\Context\BasicContext,
SilverStripe\BehatExtension\Context\LoginContext,
SilverStripe\Test\Behaviour\CmsFormsContext,
SilverStripe\Test\Behaviour\CmsUiContext;
// PHPUnit
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Framework/Assert/Functions.php';
/**
* Features context
*
* Context automatically loaded by Behat.
* Uses subcontexts to extend functionality.
*/
class FeatureContext extends SilverStripeContext
{
/**
* Initializes context.
* Every scenario gets it's own context object.
*
* @param array $parameters context parameters (set them up through behat.yml)
*/
public function __construct(array $parameters)
{
$this->useContext('BasicContext', new BasicContext($parameters));
$this->useContext('LoginContext', new LoginContext($parameters));
$this->useContext('CmsFormsContext', new CmsFormsContext($parameters));
$this->useContext('CmsUiContext', new CmsUiContext($parameters));
parent::__construct($parameters);
}
}

25
tests/behat/behat.yml Normal file
View File

@ -0,0 +1,25 @@
default:
context:
class: SilverStripe\Cms\Test\Behaviour\FeatureContext
parameters:
admin_url: /admin/
login_url: /Security/login
screenshot_path: %behat.paths.features%/screenshots/
extensions:
SilverStripe\BehatExtension\Extension:
framework_path: ../../../framework
ajax_steps:
- go to
- follow
- press
- click
- submit
Behat\MinkExtension\Extension:
# Adjust this to your local environment
base_url: http://localhost/ss-3.0
files_path: %behat.paths.features%/files/
default_session: selenium2
javascript_session: selenium2
goutte: ~
selenium2:
browser: firefox

View File

@ -0,0 +1,25 @@
@database-defaults
Feature: Create a translation
As a content translator
I want to translate an existing page into a new language in the CMS
So that I manage its content separately
Background:
Given I am logged in with "ADMIN" permissions
And I go to "/admin/pages"
Then I should see "About Us" in CMS Tree
@javascript
Scenario: I can create a new page for a new language
When I follow "About Us"
And I click the "Translations" CMS tab
And I fill in "New language" dropdown with "German"
And I press the "Create" button
Then I should see an edit page form
And I should see "German" in the "#Form_LangForm #Locale" element
And I should see "About Us" in CMS Tree
When I fill in "Über uns" for "Title"
And I press the "Save & Publish" button
Then I should see an edit page form
And I should see "Über uns" in CMS Tree
And I should not see "About Us" in CMS Tree

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB