UNFINISHED Behat tests
@ -25,5 +25,8 @@
|
||||
},
|
||||
"support": {
|
||||
"issues": "https://github.com/silverstripe/silverstripe-translatable/issues?state=open"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": ["."]
|
||||
}
|
||||
}
|
||||
|
37
tests/behat/FeatureContext.php
Normal 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
@ -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
|
25
tests/behat/features/create-a-translation.feature
Normal 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
|
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 176 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 183 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 173 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 24 KiB |