Actions

Testing Area/Behat Testing/Characteristics of a good test: Difference between revisions

From Mahara Wiki

< Testing Area‎ | Behat Testing
No edit summary
No edit summary
Line 4: Line 4:


<pre>
<pre>
  @javascript  
  @javascript @core
  Feature:  
  Feature:  
   In order to  
   In order to  
Line 20: Line 20:
</pre>  
</pre>  


Template for when you have multiple scenarios on one page.


<pre>
@javascript @core
Feature:
  In order to
  As an
  So I can
Background:
  Given
  And
  And
  And 
@core_
Scenario:
  Given
  And
  When
  And
  Then
@core_
Scenario:
  Given
  And
  When
  And
  Then
</pre>


<h2>Feature</h2>
<h2>Feature</h2>

Revision as of 11:35, 16 December 2014

How to write a good test

Template

 @javascript @core
 Feature: 
  In order to 
  As an
  So I can

 Scenario:
  Given
  And
  When
  And
  Then 


Template for when you have multiple scenarios on one page.

 @javascript @core 
 Feature: 
  In order to 
  As an
  So I can

 Background:
  Given
  And
  And
  And  

 @core_
 Scenario:
  Given
  And
  When
  And
  Then 

 @core_
 Scenario:
  Given
  And
  When
  And
  Then


Feature

Good features clearly explain what you are trying to do. If you are using a bug from Launchpad to write the test, use the title of the bug in the title of the feature.

Feature:
 In order to 
 As a
 So I can 


Tags

Always attach a @javascript tag

Scenario


Background


Steps


Comments