Actions

Difference between revisions of "Testing Area/Behat Testing/Data set up"

From Mahara Wiki

< Testing Area‎ | Behat Testing
m
m
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Data set up==
 
==Data set up==
  
The behat test.feature is a template that can be used to pre-populate the database as below.  
+
The behat test.feature is a template that can be used to pre-populate the database as below.<br>
Full data specifications at <code>mahara/htdocs/testing/frameworks/behat/classes/BehatDataGenerators.php</code>
+
Note: full data specifications at <code>mahara/htdocs/testing/frameworks/behat/classes/BehatDataGenerators.php</code>
  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
Line 55: Line 55:
  
 
For example:
 
For example:
<code>And the following "blocks" exist:
+
<nowiki>
    # Available fields: title*, type*, data*, page*, retractable*
+
  And the following "blocks" exist:
    # Page One A
+
  # Available fields: title*, type*, data*, page*, retractable*
    | title               | type           | page         |retractable | data |
+
  # Page One A
    | Text                 | text           | Page One A    | yes        | textinput=This is some text;tags=texttag |
+
  |title       |type         |page   |retractable|data |
    | Image JPG           | image         | Page One A    | no        | attachment=Image1.jpg; width=100;tags=imagetag |
+
  |Text         |text         |Page 1 |yes        |textinput=This is some text;tags=texttag |
    | Image PNG           | image         | Page One A    | no        | attachment=Image2.png |
+
  |Image JPG   |image         |Page 1 |no        |attachment=Image1.jpg; width=100;tags=imagetag |
    | Files to download   | filedownload   | Page One A    | auto      | attachments=mahara_about.pdf |
+
  |Image PNG   |image         |Page 1 |no        |attachment=Image2.png |
    | Files to download   | filedownload   | Page One A    | no        | attachments=mahara_about.pdf,Image2.png |
+
  |Downloads   |filedownload |Page 1 |auto      |attachments=mahara_about.pdf |
    | External Feed - News | externalfeed   | Page One A    | No         | source=http://stuff.co.nz/rss;count=5 |
+
  |Downloads   |filedownload |Page 1 |no        |attachments=mahara_about.pdf,Image2.png |
    | External Feed - Food | externalfeed   | Page One A    | no        | source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
+
  |News         |externalfeed |Page 1 |no         |source=http://stuff.co.nz/rss;count=5 |
    | External Feed - Tech | externalfeed   | Page One A    | no        | source=feeds.feedburner.com/geekzone;count=3;tags=cat,a,lyst |
+
  |Food         |externalfeed |Page 1 |no        |source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
    | Social Media         | socialprofile | Page One A    | no        | sns=instagram,twitter,facebook,tumblr,pinterest,mysocialmedia |
+
  |Tech         |externalfeed |Page 1 |no        |source=feeds.feedburner.com/geekzone;count=3;tags=cat,a,lyst |
</code>
+
  |Social Media |socialprofile |Page 1 |no        |sns=instagram,twitter,facebook,tumblr,pinterest,mysocialmedia |
 +
</nowiki>

Latest revision as of 15:54, 10 July 2020

Data set up

The behat test.feature is a template that can be used to pre-populate the database as below.
Note: full data specifications at mahara/htdocs/testing/frameworks/behat/classes/BehatDataGenerators.php

Name Compulsory fields
institutions name, displayname
user username, password, email, firstname, lastname
groups name, owner
personalinformation username, password
goals and skills user, goaltype/skilltype, title
interests user, interest
coverletters user, content
educationhistory user, institution
employmenthistory user, startdate, employer, jobtitle
contactinformation user, email
achievements user, date, title
books and publications user, date, title, contribution
professionalmemberships user, startdate, title
forums title, description, group, creator
forumposts group, user, message
pages title, ownertype, ownername
collections title, ownertype, ownername
journals ownertype, owner, title
journalentries owner, ownertype, title, entry
plans owner, ownertype, title
tasks owner, ownertype, plan, title, completiondate, completed(boolean)
blocks title, type, page

For example:

  And the following "blocks" exist:
  # Available fields: title*, type*, data*, page*, retractable*
  # Page One A
  |title        |type          |page   |retractable|data |
  |Text         |text          |Page 1 |yes        |textinput=This is some text;tags=texttag |
  |Image JPG    |image         |Page 1 |no         |attachment=Image1.jpg; width=100;tags=imagetag |
  |Image PNG    |image         |Page 1 |no         |attachment=Image2.png |
  |Downloads    |filedownload  |Page 1 |auto       |attachments=mahara_about.pdf |
  |Downloads    |filedownload  |Page 1 |no         |attachments=mahara_about.pdf,Image2.png |
  |News         |externalfeed  |Page 1 |no         |source=http://stuff.co.nz/rss;count=5 |
  |Food         |externalfeed  |Page 1 |no         |source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
  |Tech         |externalfeed  |Page 1 |no         |source=feeds.feedburner.com/geekzone;count=3;tags=cat,a,lyst |
  |Social Media |socialprofile |Page 1 |no         |sns=instagram,twitter,facebook,tumblr,pinterest,mysocialmedia |