5. • bin/behat –init (it will create folder features)
• bin/behat -dl
default | When I click :arg1 link
default | When I am waiting for ajax
default | When I should see place facebook button
default | Given I am an anonymous user
default | Given I am not logged in
……………………………………..
•Create file
custom_module.feature
6. Gherkin
• {A} - the benefit or value of the feature
• {B} – the role (or person) who will
benefit
• {C} - short feature description
• Feature: {custom_title}
• In order to {A}
• As a {B}
• I need to {C}
Feature: Homepage
In order to see if the custom homepage works
As a website user
I need to be able to see the home page
7. Scenario
Scenario: Name
Given ... Initial State
And ... Initial State
When ... Make action
And ... Another action
Then ... Check result
And ... Check result
8. Feature: Custom module
In order to see custom block on the front page
As a website user
I need to be able to enable custom module
@api
Scenario: Install custom module
Given I am logged in as a user with the "administrator" role
When I visit "/admin/modules"
And I should see the text “Block Example"
And I check the box "modules[block_example][enable]"
When I press the "Install" button
Then I should see the text "has been enabled."
Scenario Example 1
9.
10. Scenario Example 2
@javascript @api
Scenario: place the block in the content region
Given I am logged in as a user with the
"administrator" role
Given the cache has been cleared
Given I visit "/admin/structure/block"
When I click "edit-blocks-region-content-title"
And I am waiting for ajax
Then I should see the text "have been updated"