Actions

Testing Area/Behat Testing/Basics: Difference between revisions

From Mahara Wiki

< Testing Area‎ | Behat Testing
No edit summary
No edit summary
Line 1: Line 1:
[[Category:Behat]]
[[Category:Behat]]
<h1>How to write a Behat test</h1>
<h1>How to write a Behat test</h1>
Behat tests are written in Gerkin language, which is English readable. To write the test start with the feature, you are about to click around Mahara and test an area so say:
Feature: Creating a Portfolio page <- (the point of the test)
In order to have a portfolio page in Mahara <- (What you are wanting to do)
As a student <- (Who you are logging in as eg student, admin, institution admin)
So I can save my work on my Portfolio page <- (How you benefit from it)
Scenario:


You need a text editor installed to write your Behat tests on for example Vim, Gedit, Scite and Eclipse.
You need a text editor installed to write your Behat tests on for example Vim, Gedit, Scite and Eclipse.


You can follow the Behat documentation below on how to write a test:
You can follow the Behat documentation below on how to write a test:
  [http://docs.behat.org/en/v2.5/guides/1.gherkin.html]
  [http://docs.behat.org/en/v2.5/guides/1.gherkin.html]

Revision as of 09:09, 16 December 2014

How to write a Behat test

Behat tests are written in Gerkin language, which is English readable. To write the test start with the feature, you are about to click around Mahara and test an area so say:

Feature: Creating a Portfolio page <- (the point of the test) In order to have a portfolio page in Mahara <- (What you are wanting to do) As a student <- (Who you are logging in as eg student, admin, institution admin) So I can save my work on my Portfolio page <- (How you benefit from it)


Scenario:



You need a text editor installed to write your Behat tests on for example Vim, Gedit, Scite and Eclipse.


You can follow the Behat documentation below on how to write a test:

[1]