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

7
8
9
10
11
12
13
14
15
16
17
Background:
 Given the following "users" exist:
 | username | password | email | firstname | lastname | institution | authname | role |
 | userA | Kupuhipa1 | test01@example.com | Andrea | Andrews | mahara | internal | member |
 | userB | Kupuhipa1 | test02@example.com | Britta | Briggs | mahara | internal | member |

 And the following "pages" exist:
 | title | description| ownertype | ownername |
 | Journal page | Page to contain the tagged journal block | user | userA |

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"
Rylee Foley's avatar
Rylee Foley committed
22
 And I set the following fields to these values:
23
24
25
26
 | Title * | My diary entry one |
 | Entry | I love my mum |
 | Draft | 1 |
 | Allow comments | 0 |
27
 And I scroll to the base of id "editpost_tags_container"
28
 And I fill in select2 input "editpost_tags" with "mildred" and select "mildred"
29
30
31
32
33
34
35
36
 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"

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

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

 # Display tagged journals in block
58
 And I click on "Show Menu"
59
 When I follow "Portfolio"
60
61
 And I click on "Journal page" panel menu
 And I click on "Edit" in "Journal page" panel menu
62
63
64
65
 And I expand "Journals" node in the "div#content-editor-foldable" "css_element"
 And I wait "1" seconds
 And I follow "Tagged journal entries" in the "div#blog" "css_element"
 And I press "Add"
66
 And I wait "1" seconds
67
68
69
70
71
72
73
74
 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"
 And I go to portfolio page "Journal page"
 And I follow "Edit this page"
 And I follow "Share page"
 And I select "Public" from "accesslist[0][searchtype]"
 And I press "Save"
75
 And I log out
76
77
78
79
 And I log in as "userB" with password "Kupuhipa1"
 And I go to portfolio page "Journal page"
 Then I should see "My diary entry two"
 And I should not see "My diary entry one"