Working on client projects with very strict budget and resource restrictions, tight deadlines and pressure, many times does not allow for full blown Test Driven Development, Continuous Delivery and other software engineering goodness we would love to have. We will show you easily accessible and quickly implementable options, that allow you to automate your development and testing process, or at least the most painful parts, without blowing the budget. Finally you can relax during deployments of the code to production! :-)
56. BehatBehat
DrupalContext
custom context
<?php
class FeatureContext extends RawDrupalContext
implements SnippetAcceptingContext {
...
/**
* @Then I should see the subheading
*/
public function iShouldSeeSubHeading() {
$this->countElements('.taxonomy-term.vocabulary-sections
.field-name-field-body .field-item', 1, 'Homepage subheading');
}
...
15 . 6
57. BehatBehat
Feature: Homepage
I want to see a home page
As a user
So I can see the latest featured content on the site.
Background:
Given I am not logged in
When I visit "/"
Scenario: User can see Main header
Then I should see the text "welcome to our site"
And I should see the subheading
Scenario: User can see Latest Articles
Then I should see 11 latest homepage articles
15 . 7
58. BehatBehat
Scenario: User can add the content administration
Given I am logged in as a user with the "Content Editor" role
When I go to "node/add/article"
Then I should not see "Page not found"
When I fill in "title" with "Behat testing article"
And I fill in "media[field_listing_image_und_0]" with "314631"
And I press the 'edit-submit' button
Then I should see the following success messages:
| success messages |
| Article Behat testing article has been created. |
And I should be able to register my article with title
"Behat testing article" for cleanup
15 . 8