draft_journal.feature 2.72 KB
Newer Older
1 2
@javascript @core @core_content @core_artefact
Feature: Creating a journal
3 4 5 6
In order write in my journal
As an admin
I need to have a journal

7 8 9
Background:
 Given the following "users" exist:
 | username | password | email | firstname | lastname | institution | authname | role |
10 11
 | UserA | Kupuhipa1 | UserA@example.org | Angela | User | mahara | internal | member |
 | UserB | Kupuhipa1 | UserB@example.org | Britta | Briggs | mahara | internal | member |
12 13

 And the following "pages" exist:
14 15
 | title | description | ownertype | ownername |
 | Page UserA_01 | Page 01 | user | UserA |
16 17

Scenario: Creating a Journal, publishing a draft, using tagged entry block
18
 # Create draft entry
19
 Given I log in as "UserA" with password "Kupuhipa1"
20
 When I choose "Journals" in "Content" from main menu
21
 And I follow "New entry"
22
 And I fill in the following:
23
 | Title * | My diary entry one |
24 25
 And I set the following fields to these values:
 | Entry * | I love my mum |
26 27
 | Draft | 1 |
 | Allow comments | 0 |
28
 And I scroll to the base of id "editpost_tags_container"
29
 And I fill in select2 input "editpost_tags" with "mildred" and select "mildred"
30 31 32 33 34 35 36 37
 And I press "Save entry"
 Then I should see "Journal entry saved"
 And I should see "Draft"

 # Make entry public
 Given I press "Publish"
 Then I should see "Published"

38
 # Add another entry
39
 And I follow "New entry"
40
 And I fill in the following:
41
 | Title * | My diary entry two |
42
 And I set the following fields to these values:
43 44
 | Entry | I love my dad |
 | Draft | 0 |
45
 | Allow comments | 0 |
46
 And I scroll to the base of id "editpost_tags_container"
47
 And I fill in select2 input "editpost_tags" with "george" and select "george"
48
 And I press "Save entry"
49

50 51
 # Remove tag from first journal and save
 Given I click on "Edit" in "My diary entry one" row
52
 And I clear value "mildred (1)" from select2 field "editpost_tags"
53 54 55 56
 And I press "Save entry"
 And I should not see "mildred"

 # Display tagged journals in block
57
 And I choose "Portfolio" from main menu
58 59
 And I click on "Page UserA_01" panel menu
 And I click on "Edit" in "Page UserA_01" panel menu
60 61
 And I expand "Journals" node in the "blocktype sidebar" property
 And I follow "Tagged journal entries" in the "blocktype sidebar" property
62 63 64 65
 And I press "Add"
 And I fill in select2 input "instconf_tagselect" with "george" and select "george"
 And I press "Save"
 Then I should see "My diary entry two"
66
 And I go to portfolio page "Page UserA_01"
67
 And I follow "Edit"
68
 And I follow "Share" in the "Toolbar buttons" property
69 70
 And I select "Public" from "accesslist[0][searchtype]"
 And I press "Save"
71
 And I log out
72 73
 And I log in as "UserB" with password "Kupuhipa1"
 And I go to portfolio page "Page UserA_01"
74 75
 Then I should see "My diary entry two"
 And I should not see "My diary entry one"