Actions

Testing Area/Behat Testing/Data set up: Difference between revisions

From Mahara Wiki

< Testing Area‎ | Behat Testing
mNo edit summary
mNo edit summary
Line 59: Line 59:
   # Available fields: title*, type*, data*, page*, retractable*
   # Available fields: title*, type*, data*, page*, retractable*
   # Page One A
   # Page One A
   | title                | type          | page       |retractable | data |
   |title                |type          |page   |retractable|data |
   | Text                | text          | Page One A | yes        | textinput=This is some text;tags=texttag |
   |Text                |text          |Page 1 |yes        |textinput=This is some text;tags=texttag |
   | Image JPG            | image        | Page One A | no        | attachment=Image1.jpg; width=100;tags=imagetag |
   |Image JPG            |image        |Page 1 |no        |attachment=Image1.jpg; width=100;tags=imagetag |
   | Image PNG            | image        | Page One A | no        | attachment=Image2.png |
   |Image PNG            |image        |Page 1 |no        |attachment=Image2.png |
   | Files to download    | filedownload  | Page One A | auto      | attachments=mahara_about.pdf |
   |Files to download    |filedownload  |Page 1 |auto      |attachments=mahara_about.pdf |
   | Files to download    | filedownload  | Page One A | no        | attachments=mahara_about.pdf,Image2.png |
   |Files to download    |filedownload  |Page 1 |no        |attachments=mahara_about.pdf,Image2.png |
   | External Feed - News | externalfeed  | Page One A | No         | source=http://stuff.co.nz/rss;count=5 |
   |External Feed - News |externalfeed  |Page 1 |no         |source=http://stuff.co.nz/rss;count=5 |
   | External Feed - Food | externalfeed  | Page One A | no        | source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
   |External Feed - Food |externalfeed  |Page 1 |no        |source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
   | External Feed - Tech | externalfeed  | Page One A | no        | source=feeds.feedburner.com/geekzone;count=3;tags=cat,a,lyst |
   |External Feed - Tech |externalfeed  |Page 1 |no        |source=feeds.feedburner.com/geekzone;count=3;tags=cat,a,lyst |
   | Social Media        | socialprofile | Page One A | no        | sns=instagram,twitter,facebook,tumblr,pinterest,mysocialmedia |
   |Social Media        |socialprofile |Page 1 |no        |sns=instagram,twitter,facebook,tumblr,pinterest,mysocialmedia |
</nowiki>
</nowiki>

Revision as of 15:50, 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 |
  |Files to download    |filedownload  |Page 1 |auto       |attachments=mahara_about.pdf |
  |Files to download    |filedownload  |Page 1 |no         |attachments=mahara_about.pdf,Image2.png |
  |External Feed - News |externalfeed  |Page 1 |no         |source=http://stuff.co.nz/rss;count=5 |
  |External Feed - Food |externalfeed  |Page 1 |no         |source=http://www.thekitchenmaid.com/feed;count=3;tags=cat,a,lyst |
  |External Feed - 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 |