@webship-js/bbpress-steps 0.0.0-stage → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +515 -2
- package/package.json +67 -4
- package/tests/features/accessibility.feature +29 -0
- package/tests/features/administration.feature +126 -0
- package/tests/features/forum-index.feature +96 -0
- package/tests/features/forum-roles.feature +88 -0
- package/tests/features/moderation.feature +223 -0
- package/tests/features/notifications.feature +43 -0
- package/tests/features/profiles.feature +71 -0
- package/tests/features/search-and-tags.feature +72 -0
- package/tests/features/subscriptions-and-favorites.feature +67 -0
- package/tests/features/topics.feature +146 -0
- package/tests/step-definitions/README.md +44 -0
- package/tests/step-definitions/bbpress-admin.steps.js +414 -0
- package/tests/step-definitions/bbpress-content.steps.js +179 -0
- package/tests/step-definitions/bbpress-defaults.js +64 -0
- package/tests/step-definitions/bbpress-forums.steps.js +488 -0
- package/tests/step-definitions/bbpress-helpers.js +668 -0
- package/tests/step-definitions/bbpress-mail.steps.js +95 -0
- package/tests/step-definitions/bbpress-moderation.steps.js +413 -0
- package/tests/step-definitions/bbpress-profile.steps.js +402 -0
- package/tests/step-definitions/bbpress-search.steps.js +235 -0
- package/tests/step-definitions/bbpress-topics.steps.js +577 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@profiles
|
|
2
|
+
Feature: Forum profiles
|
|
3
|
+
As a member of the forums
|
|
4
|
+
I want a profile that shows what I wrote and the role I have
|
|
5
|
+
So that the others know who they talk to
|
|
6
|
+
|
|
7
|
+
Scenario: A visitor reads the forum profile of an account
|
|
8
|
+
Given I am an anonymous user
|
|
9
|
+
When I open the forum profile of "participant"
|
|
10
|
+
Then the forum profile should show "@participant"
|
|
11
|
+
And the forum profile should show "Forum Role: Participant"
|
|
12
|
+
And the forum profile should show "Topics Started: 12"
|
|
13
|
+
And the forum profile should show "Replies Created: 12"
|
|
14
|
+
And the forum profile should not show "Forum Role: Moderator"
|
|
15
|
+
And the forum profile should offer the page "Topics Started"
|
|
16
|
+
And the forum profile should offer the page "Replies Created"
|
|
17
|
+
And the forum profile should offer the page "Engagements"
|
|
18
|
+
And the forum profile should offer the page "Favorites"
|
|
19
|
+
But the forum profile should not offer the page "Subscriptions"
|
|
20
|
+
And the forum profile should not offer the page "Edit"
|
|
21
|
+
|
|
22
|
+
Scenario: The pages of a profile list the topics and the replies of the account
|
|
23
|
+
Given I am an anonymous user
|
|
24
|
+
When I open the forum profile of "moderator"
|
|
25
|
+
And I open "Topics Started" in the forum profile
|
|
26
|
+
Then the forum should list the topic "The spring meetup is over"
|
|
27
|
+
And the forum should list the topic "A long conversation"
|
|
28
|
+
And the forum should not list the topic "Staff only: the moderation notes"
|
|
29
|
+
When I open "Replies Created" in the forum profile
|
|
30
|
+
Then the forum profile should show "Welcome aboard. Ask in Help and support when you are stuck."
|
|
31
|
+
When I open "Profile" in the forum profile
|
|
32
|
+
Then the forum profile should show "Forum Role: Moderator"
|
|
33
|
+
|
|
34
|
+
Scenario Outline: The profile of each account states its forum role
|
|
35
|
+
Given I am an anonymous user
|
|
36
|
+
Then the forum role of "<account>" should be "<role>"
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
| account | role |
|
|
40
|
+
| admin | Keymaster |
|
|
41
|
+
| keymaster | Keymaster |
|
|
42
|
+
| moderator | Moderator |
|
|
43
|
+
| participant | Participant |
|
|
44
|
+
| spectator | Spectator |
|
|
45
|
+
| blocked | Blocked |
|
|
46
|
+
|
|
47
|
+
Scenario: An account has more pages on its own profile, and edits it
|
|
48
|
+
Given I am a logged in user with the "participant" user
|
|
49
|
+
When I open my forum profile
|
|
50
|
+
Then the forum profile should offer the page "Subscriptions"
|
|
51
|
+
And the forum profile should offer the page "Edit"
|
|
52
|
+
When I open "Edit" in the forum profile
|
|
53
|
+
And I fill in "Biographical Info" with "Webship test: I grow tomatoes."
|
|
54
|
+
And I save my forum profile
|
|
55
|
+
Then the forums should say "User updated."
|
|
56
|
+
When I open my forum profile
|
|
57
|
+
Then the forum profile should show "Webship test: I grow tomatoes."
|
|
58
|
+
When I open "Edit" in the forum profile
|
|
59
|
+
And I fill in "Biographical Info" with ""
|
|
60
|
+
And I save my forum profile
|
|
61
|
+
Then the forums should say "User updated."
|
|
62
|
+
When I open my forum profile
|
|
63
|
+
Then the forum profile should not show "Webship test: I grow tomatoes."
|
|
64
|
+
|
|
65
|
+
@js-off
|
|
66
|
+
Scenario: An account cannot edit the profile of another
|
|
67
|
+
Given I am a logged in user with the "participant" user
|
|
68
|
+
Then I should not be allowed to open "/forums/users/moderator/edit/"
|
|
69
|
+
When I open the forum profile of "moderator"
|
|
70
|
+
Then the forum profile should not offer the page "Edit"
|
|
71
|
+
And the forum profile should not offer the page "Subscriptions"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
@search
|
|
2
|
+
Feature: The forum search, topic tags and views
|
|
3
|
+
As a visitor of the forums
|
|
4
|
+
I want to search them and follow their tags
|
|
5
|
+
So that I find the topic that answers my question
|
|
6
|
+
|
|
7
|
+
Scenario: The search finds topics and replies, and opens one
|
|
8
|
+
Given I am an anonymous user
|
|
9
|
+
When I search the forums for "marigolds"
|
|
10
|
+
Then the search should find 2 matches
|
|
11
|
+
And the search results should show "A community garden in spring"
|
|
12
|
+
And the search results should show "Marigolds keep the aphids away from the tomatoes."
|
|
13
|
+
And the search results should show "We planted tomatoes, basil and marigolds this year."
|
|
14
|
+
And the search result "A community garden in spring" should be a topic in "General discussion"
|
|
15
|
+
And the search result "A community garden in spring" should be a reply
|
|
16
|
+
And the forum breadcrumbs should be "Home", "Forums", "Search" and "Search Results for 'marigolds'"
|
|
17
|
+
When I open the search result "A community garden in spring"
|
|
18
|
+
Then I should be reading the topic "A community garden in spring"
|
|
19
|
+
|
|
20
|
+
Scenario: A search with no match says so
|
|
21
|
+
Given I am an anonymous user
|
|
22
|
+
When I search the forums for "nothingmatchesthisword"
|
|
23
|
+
Then the search should find 0 matches
|
|
24
|
+
And the forums should say "Oh, bother! No search results were found here."
|
|
25
|
+
And the search results should not show "A community garden in spring"
|
|
26
|
+
|
|
27
|
+
Scenario: The search has pages
|
|
28
|
+
Given I am an anonymous user
|
|
29
|
+
When I search the forums for "long conversation"
|
|
30
|
+
Then the search should find 18 matches
|
|
31
|
+
And I should be on page 1
|
|
32
|
+
When I go to page 2
|
|
33
|
+
Then I should be on page 2
|
|
34
|
+
And the search should find 18 matches
|
|
35
|
+
|
|
36
|
+
Scenario: The search shows an account only what it may read
|
|
37
|
+
Given I am an anonymous user
|
|
38
|
+
When I search the forums for "meetup"
|
|
39
|
+
Then the search results should show "The spring meetup is over"
|
|
40
|
+
But the search results should not show "Members only: the next meetup"
|
|
41
|
+
Given I am a logged in user with the "participant" user
|
|
42
|
+
When I search the forums for "meetup"
|
|
43
|
+
Then the search results should show "Members only: the next meetup"
|
|
44
|
+
When I search the forums for "moderation notes"
|
|
45
|
+
Then the search should find 0 matches
|
|
46
|
+
Given I am a logged in user with the "moderator" user
|
|
47
|
+
When I search the forums for "moderation notes"
|
|
48
|
+
Then the search results should show "Staff only: the moderation notes"
|
|
49
|
+
|
|
50
|
+
Scenario: A topic tag has a page with its topics, from every forum
|
|
51
|
+
Given I am an anonymous user
|
|
52
|
+
When I open the topic "A community garden in spring" in "General discussion"
|
|
53
|
+
Then the topic should be tagged "spring"
|
|
54
|
+
When I open the topic tag "spring"
|
|
55
|
+
Then the forum breadcrumbs should be "Home", "Forums" and "Topic Tag: spring"
|
|
56
|
+
And the forum should have 2 topics
|
|
57
|
+
And the forum should list the topic "A community garden in spring"
|
|
58
|
+
And the forum should list the topic "The spring meetup is over"
|
|
59
|
+
When I open the topic tag "howto"
|
|
60
|
+
Then the forum should list the topic "How do I change my password?"
|
|
61
|
+
And the forum should list the topic "A long conversation"
|
|
62
|
+
And the forum should not list the topic "Forum rules"
|
|
63
|
+
|
|
64
|
+
Scenario: The views of the forums
|
|
65
|
+
Given I am an anonymous user
|
|
66
|
+
When I open the forum view "Most popular topics"
|
|
67
|
+
Then the first topic of the forum should be "A long conversation"
|
|
68
|
+
And the forum breadcrumbs should be "Home", "Forums" and "Most popular topics"
|
|
69
|
+
When I open the forum view "Topics with no replies"
|
|
70
|
+
Then the forum should list the topic "Showcase entry 16"
|
|
71
|
+
And the forum should not list the topic "Welcome to the forums"
|
|
72
|
+
And the forum should have 18 topics
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@engagement
|
|
2
|
+
Feature: Subscriptions and favorites
|
|
3
|
+
As a participant of the forums
|
|
4
|
+
I want to mark the topics I like and follow the ones I care about
|
|
5
|
+
So that I find them again and hear of their replies
|
|
6
|
+
|
|
7
|
+
Scenario: A participant marks a topic as a favorite and takes the mark away
|
|
8
|
+
Given I am a logged in user with the "participant" user
|
|
9
|
+
And I have no favorites
|
|
10
|
+
When I open the topic "A community garden in spring" in "General discussion"
|
|
11
|
+
Then the topic should not be a favorite
|
|
12
|
+
When I favorite the topic
|
|
13
|
+
Then the topic should be a favorite
|
|
14
|
+
And my favorites should list "A community garden in spring"
|
|
15
|
+
When I open the topic "A community garden in spring" in "General discussion"
|
|
16
|
+
Then the topic should be a favorite
|
|
17
|
+
When I unfavorite the topic
|
|
18
|
+
Then the topic should not be a favorite
|
|
19
|
+
And my favorites should not list "A community garden in spring"
|
|
20
|
+
|
|
21
|
+
Scenario: A participant subscribes to a topic and a forum, and removes both from the profile
|
|
22
|
+
Given I am a logged in user with the "participant" user
|
|
23
|
+
And I have no subscriptions
|
|
24
|
+
When I open the forum "Help and support"
|
|
25
|
+
Then the forum should not be subscribed to
|
|
26
|
+
When I subscribe to the forum
|
|
27
|
+
Then the forum should be subscribed to
|
|
28
|
+
When I open the topic "Where do the avatars come from?" in "Help and support"
|
|
29
|
+
Then the topic should not be subscribed to
|
|
30
|
+
When I subscribe to the topic
|
|
31
|
+
Then the topic should be subscribed to
|
|
32
|
+
And my subscribed forums should list "Help and support"
|
|
33
|
+
And my subscribed topics should list "Where do the avatars come from?"
|
|
34
|
+
When I remove "Where do the avatars come from?" from my subscribed topics
|
|
35
|
+
Then my subscribed topics should not list "Where do the avatars come from?"
|
|
36
|
+
When I remove "Help and support" from my subscribed forums
|
|
37
|
+
Then my subscribed forums should not list "Help and support"
|
|
38
|
+
When I open the forum "Help and support"
|
|
39
|
+
Then the forum should not be subscribed to
|
|
40
|
+
|
|
41
|
+
Scenario: A favorite is removed from the list of the profile
|
|
42
|
+
Given I am a logged in user with the "participant" user
|
|
43
|
+
And I have no favorites
|
|
44
|
+
When I open the topic "Forum rules" in "General discussion"
|
|
45
|
+
And I favorite the topic
|
|
46
|
+
Then my favorites should list "Forum rules"
|
|
47
|
+
When I remove "Forum rules" from my favorites
|
|
48
|
+
Then my favorites should not list "Forum rules"
|
|
49
|
+
When I open my forum profile
|
|
50
|
+
And I open "Favorites" in the forum profile
|
|
51
|
+
Then the forum profile should show "Oh, bother! No topics were found here."
|
|
52
|
+
|
|
53
|
+
Scenario: A spectator reads a topic but cannot reply; it may still mark a favorite
|
|
54
|
+
Given I am a logged in user with the "spectator" user
|
|
55
|
+
And I have no favorites
|
|
56
|
+
When I open the topic "Welcome to the forums" in "General discussion"
|
|
57
|
+
Then I should not be able to reply
|
|
58
|
+
When I favorite the topic
|
|
59
|
+
Then the topic should be a favorite
|
|
60
|
+
When I unfavorite the topic
|
|
61
|
+
Then the topic should not be a favorite
|
|
62
|
+
|
|
63
|
+
Scenario: The profile lists what the account started and where it wrote
|
|
64
|
+
Given I am a logged in user with the "participant" user
|
|
65
|
+
Then my topics started should list "A community garden in spring"
|
|
66
|
+
And my topics started should not list "Forum rules"
|
|
67
|
+
And my engagements should list "Welcome to the forums"
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
@topics
|
|
2
|
+
Feature: Topics and replies
|
|
3
|
+
As a participant of the forums
|
|
4
|
+
I want to read topics, start my own and reply to others
|
|
5
|
+
So that I can take part in the community
|
|
6
|
+
|
|
7
|
+
@critical
|
|
8
|
+
Scenario: A visitor reads a topic and its replies
|
|
9
|
+
Given I am an anonymous user
|
|
10
|
+
When I open the topic "Welcome to the forums" in "General discussion"
|
|
11
|
+
Then I should be reading the topic "Welcome to the forums"
|
|
12
|
+
And the forum breadcrumbs should be "Home", "Forums", "Community", "General discussion" and "Welcome to the forums"
|
|
13
|
+
And the forums should say "This topic has 2 replies, 3 voices"
|
|
14
|
+
And the topic should have 3 posts
|
|
15
|
+
And post 1 should be by "keymaster"
|
|
16
|
+
And post 1 should read "Say hello and tell us what you are working on."
|
|
17
|
+
And the author of post 1 should be a "Keymaster"
|
|
18
|
+
And post 2 should be by "participant"
|
|
19
|
+
And the author of post 2 should be a "Participant"
|
|
20
|
+
And the last post should be by "moderator"
|
|
21
|
+
And the last post should read "Welcome aboard."
|
|
22
|
+
And the author of the last post should be a "Moderator"
|
|
23
|
+
And the topic should be open
|
|
24
|
+
And the topic should be tagged "welcome"
|
|
25
|
+
And the topic should not be tagged "howto"
|
|
26
|
+
And I should not be able to reply
|
|
27
|
+
And the forums should say "You must be logged in to reply to this topic."
|
|
28
|
+
|
|
29
|
+
Scenario: A long topic has pages
|
|
30
|
+
Given I am an anonymous user
|
|
31
|
+
When I open the topic "A long conversation" in "Help and support"
|
|
32
|
+
Then the topic should have 18 posts
|
|
33
|
+
And I should be on page 1
|
|
34
|
+
And post 1 should read "This topic has more replies than one page shows."
|
|
35
|
+
And the last post should read "Reply number 14 of the long conversation."
|
|
36
|
+
When I go to page 2
|
|
37
|
+
Then I should be on page 2
|
|
38
|
+
And post 1 should read "Reply number 15 of the long conversation."
|
|
39
|
+
And the last post should read "Reply number 17 of the long conversation."
|
|
40
|
+
And the last post should be by "participant"
|
|
41
|
+
|
|
42
|
+
Scenario: A closed topic takes no replies from a participant
|
|
43
|
+
Given I am a logged in user with the "participant" user
|
|
44
|
+
When I open the topic "The spring meetup is over" in "General discussion"
|
|
45
|
+
Then the topic should be closed
|
|
46
|
+
And the topic should not be open
|
|
47
|
+
And I should not be able to reply
|
|
48
|
+
And the forums should say "The topic ‘The spring meetup is over’ is closed to new replies."
|
|
49
|
+
|
|
50
|
+
Scenario: A participant starts a topic with tags, and a moderator replies to it
|
|
51
|
+
Given there is no topic "Webship test topic"
|
|
52
|
+
And I am a logged in user with the "participant" user
|
|
53
|
+
When I start a new topic in "General discussion"
|
|
54
|
+
And I write the topic title "Webship test topic"
|
|
55
|
+
And I write "Webship test: the first post of the topic." in the editor
|
|
56
|
+
And I tag the topic with "webship, test"
|
|
57
|
+
And I submit the post
|
|
58
|
+
Then I should be reading the topic "Webship test topic"
|
|
59
|
+
And the topic should have 1 post
|
|
60
|
+
And post 1 should be by "participant"
|
|
61
|
+
And post 1 should read "Webship test: the first post of the topic."
|
|
62
|
+
And the topic should be tagged "webship"
|
|
63
|
+
And the topic should be tagged "test"
|
|
64
|
+
And post 1 should offer the link "Edit"
|
|
65
|
+
And post 1 should not offer the link "Trash"
|
|
66
|
+
When I open the forum "General discussion"
|
|
67
|
+
Then the forum should have 5 topics
|
|
68
|
+
And the topic "Webship test topic" should be by "participant" in the list
|
|
69
|
+
Given "moderator" replied to the topic "Webship test topic" with "Webship test reply of the moderator."
|
|
70
|
+
And I am a logged in user with the "participant" user
|
|
71
|
+
When I open the topic "Webship test topic" in "General discussion"
|
|
72
|
+
Then the topic should have 2 posts
|
|
73
|
+
And the last post should be by "moderator"
|
|
74
|
+
And the last post should read "Webship test reply of the moderator."
|
|
75
|
+
And the last post should not offer the link "Edit"
|
|
76
|
+
When I reply to the topic with "Webship test: thank you."
|
|
77
|
+
Then the topic should have 3 posts
|
|
78
|
+
And the last post should be by "participant"
|
|
79
|
+
And the last post should read "Webship test: thank you."
|
|
80
|
+
And there is no topic "Webship test topic"
|
|
81
|
+
|
|
82
|
+
Scenario: The forums refuse a topic without a title or a text
|
|
83
|
+
Given I am a logged in user with the "participant" user
|
|
84
|
+
When I start a new topic in "General discussion"
|
|
85
|
+
And I try to submit the post
|
|
86
|
+
Then the editor should show the error "Your topic needs a title."
|
|
87
|
+
And the editor should show the error "Your topic cannot be empty."
|
|
88
|
+
When I write the topic title "Webship test topic without a text"
|
|
89
|
+
And I try to submit the post
|
|
90
|
+
Then the editor should show the error "Your topic cannot be empty."
|
|
91
|
+
When I open the forum "General discussion"
|
|
92
|
+
Then the forum should not list the topic "Webship test topic without a text"
|
|
93
|
+
|
|
94
|
+
Scenario: The forums refuse an empty reply
|
|
95
|
+
Given I am a logged in user with the "participant" user
|
|
96
|
+
When I open the topic "A community garden in spring" in "General discussion"
|
|
97
|
+
Then I should be able to reply
|
|
98
|
+
When I write "" in the editor
|
|
99
|
+
And I try to submit the post
|
|
100
|
+
Then the editor should show the error "Your reply cannot be empty."
|
|
101
|
+
And the topic should have 2 posts
|
|
102
|
+
|
|
103
|
+
Scenario: The toolbar of the editor formats a post
|
|
104
|
+
Given there is a topic "Webship test topic" in "General discussion" by "participant"
|
|
105
|
+
And I am a logged in user with the "participant" user
|
|
106
|
+
When I open the topic "Webship test topic"
|
|
107
|
+
And I write "Webship test: " in the editor
|
|
108
|
+
And I add "bold words" to the editor with the "b" button
|
|
109
|
+
And I add " and " to the editor
|
|
110
|
+
And I add "important" to the editor with the "i" button
|
|
111
|
+
And I add "a quoted line" to the editor with the "b-quote" button
|
|
112
|
+
And I add "wp-config.php" to the editor with the "code" button
|
|
113
|
+
And I add "no longer true" to the editor with the "del" button
|
|
114
|
+
Then the editor should contain "<strong>bold words</strong>"
|
|
115
|
+
And the editor should contain "<blockquote>a quoted line</blockquote>"
|
|
116
|
+
When I submit the post
|
|
117
|
+
Then the topic should have 2 posts
|
|
118
|
+
And the last post should show "bold words" in bold
|
|
119
|
+
And the last post should show "important" in italics
|
|
120
|
+
And the last post should show "a quoted line" as a quote
|
|
121
|
+
And the last post should show "wp-config.php" as code
|
|
122
|
+
And the last post should show "no longer true" struck through
|
|
123
|
+
And the last post should read "Webship test: bold words and important"
|
|
124
|
+
And there is no topic "Webship test topic"
|
|
125
|
+
|
|
126
|
+
Scenario: An account edits its own post, with a reason the forums keep in the edit log
|
|
127
|
+
Given there is a topic "Webship test topic" in "General discussion" by "participant" with:
|
|
128
|
+
"""
|
|
129
|
+
Webship test: the text before the edit.
|
|
130
|
+
"""
|
|
131
|
+
And I am a logged in user with the "participant" user
|
|
132
|
+
When I open the topic "Webship test topic"
|
|
133
|
+
Then post 1 should read "Webship test: the text before the edit."
|
|
134
|
+
When I edit post 1
|
|
135
|
+
Then the editor should contain "Webship test: the text before the edit."
|
|
136
|
+
When I write the topic title "Webship test topic, renamed"
|
|
137
|
+
And I write "Webship test: the text after the edit, with a <a href='https://example.com/docs'>link to the documentation</a>." in the editor
|
|
138
|
+
And I give the edit reason "Clearer title"
|
|
139
|
+
And I submit the post
|
|
140
|
+
Then I should be reading the topic "Webship test topic, renamed"
|
|
141
|
+
And post 1 should read "Webship test: the text after the edit"
|
|
142
|
+
And post 1 should show "link to the documentation" as a link
|
|
143
|
+
And the edit log of post 1 should show "This topic was modified"
|
|
144
|
+
And the edit log of post 1 should show "by participant"
|
|
145
|
+
And the edit log of post 1 should show "Reason: Clearer title"
|
|
146
|
+
And there is no topic "Webship test topic, renamed"
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Step definitions
|
|
2
|
+
|
|
3
|
+
| File | Covers |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| `bbpress-forums.steps.js` | The forum index and a forum: the forums an account sees, their counters and marks, the topics of a forum, the pages of a list, the forums' breadcrumbs and notices, whether the account may start a topic or reply, a page the forums refuse. |
|
|
6
|
+
| `bbpress-topics.steps.js` | A topic and its posts (authors, forum roles, text, format, edit log, state, tags), and the forms: a new topic, a reply, an edit, the editor's toolbar, the errors, the links a post offers. |
|
|
7
|
+
| `bbpress-moderation.steps.js` | The moderation links of a topic and a reply, merge, split, move, what the forums hide from the members, the moderator tools. |
|
|
8
|
+
| `bbpress-profile.steps.js` | Subscriptions and favorites, the lists of the account's profile, the forum profile, the forum role of an account, the profile's edit form. |
|
|
9
|
+
| `bbpress-search.steps.js` | The forum search and its results, the page of a topic tag, the views of the forums. |
|
|
10
|
+
| `bbpress-admin.steps.js` | The forums in the administration: the lists and the actions of their rows, the features of the settings, the repair tools, the forum role on the users screen. |
|
|
11
|
+
| `bbpress-mail.steps.js` | The forums' notifications, read in the mail catcher of the test site. |
|
|
12
|
+
| `bbpress-content.steps.js` | Test content a scenario starts from: a topic by an account, a reply by an account, and their removal. |
|
|
13
|
+
| `bbpress-defaults.js` | Loads the WordPress pack's steps, adds the forums' screens to its named administration screens, and keeps per scenario the moment it began and the topics its Given steps made. It registers no step. |
|
|
14
|
+
| `bbpress-helpers.js` | Shared plumbing: the forums' root, what a page lists, the way to a forum and a topic, the links of a post, the session of another account, the mail catcher. It registers no step. |
|
|
15
|
+
|
|
16
|
+
## Rules for a new step
|
|
17
|
+
|
|
18
|
+
- Check `node_modules/webship-js/tests/step-definitions/` and the WordPress
|
|
19
|
+
pack's steps (`node_modules/@webship-js/wordpress-steps/tests/step-definitions/`)
|
|
20
|
+
first: a step that the generic vocabulary or the WordPress pack already covers
|
|
21
|
+
(text, clicks, fields, dialogs, the login, the administration's screens, menus,
|
|
22
|
+
notices and settings) is not added here.
|
|
23
|
+
- No step phrase names the platform. A name appears only as an argument a step
|
|
24
|
+
asserts.
|
|
25
|
+
- The regular expression starts with the pronoun group `(I |we )*` where a
|
|
26
|
+
person acts, and an assertion takes `should( not)*`, so one definition reads
|
|
27
|
+
both polarities.
|
|
28
|
+
- A JSDoc block above the step holds at least five `Example #N:` lines. Run
|
|
29
|
+
`npm run test:examples`: every example must match its own step and no step of
|
|
30
|
+
webship-js or of the WordPress pack.
|
|
31
|
+
- Find things the way a person does: the name of a forum, the title of a topic,
|
|
32
|
+
the number of a post on the page, the text of a link, a label. What the forums
|
|
33
|
+
print the same way on every theme is the fallback: the rows and classes inside
|
|
34
|
+
`#bbpress-forums`.
|
|
35
|
+
- Wait on the forums, never on a fixed time: on the page a form or a moderation
|
|
36
|
+
link leads to and the state the post has there, on the mark of a subscription
|
|
37
|
+
or a favorite, on the notice of an administration screen.
|
|
38
|
+
- Fail with `friendly({ message, hint })`: what was expected, what was found
|
|
39
|
+
and where to look.
|
|
40
|
+
- A step never creates or deletes a user: accounts are configuration, named in
|
|
41
|
+
the `users` registry of `cucumber.js` and created by the build of the site.
|
|
42
|
+
- Open the page in a real browser before writing or changing its step, and
|
|
43
|
+
write the step from what is there.
|
|
44
|
+
- Give every assertion a scenario in `tests/must-fail/` that makes it fail.
|