first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
@core @core_blog @_file_upload @javascript
Feature: Blog entries can be added, modified and deleted
In order to modify or delete a blog entry
As a user
I need to be able to add a blog entry
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
And I am on the "testuser" "user > profile" page logged in as testuser
And I follow "Blog entries"
And I follow "Add a new entry"
And I should see "Blogs: Add a new entry"
And I set the following fields to these values:
| Entry title | Entry 1 |
| Blog entry body | Entry 1 content |
| Attachment | lib/tests/fixtures/gd-logo.png |
And I press "Save changes"
Scenario: Modify a blog entry
When I click on "Edit" "link"
And I set the following fields to these values:
| Entry title | Blog entry 1 |
And I press "Save changes"
Then I should see "Blog entry 1"
Scenario: Delete a blog entry
When I click on "Delete" "link"
And I press "Continue"
Then I should not see "Entry 1"
And I should see "Add a new entry"
+34
View File
@@ -0,0 +1,34 @@
@core @core_blog
Feature: Blogs can be set to be only visible by the author.
In order to make blogs personal only
As a user
I need to set the blog level to Users can only see their own blogs.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| testuser | C1 | student |
| testuser2 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I navigate to "Appearance > Blog" in site administration
And I set the following fields to these values:
| Blog visibility | Users can only see their own blog |
And I press "Save changes"
Scenario: A student can not see another student's blog entries.
Given I am on the "Course 1" course page logged in as testuser
And I navigate to course participants
When I follow "Test2 User2"
And I should see "Miscellaneous"
Then I should not see "Blog entries"
And I follow "Profile" in the user menu
And I follow "Blog entries"
And I should see "User blog: Test User"
+70
View File
@@ -0,0 +1,70 @@
@core @core_blog @javascript
Feature: Comment on a blog entry
In order to respond to a blog post
As a user
I need to be able to comment on a blog entry
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And the following "core_blog > entries" exist:
| subject | body | user |
| Blog post from user 1 | User 1 blog post content | testuser |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
Scenario: Commenting on my own blog entry
Given I log in as "testuser"
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Site blogs" "link" in the "Navigation" "block"
And I follow "Blog post from user 1"
And I should see "User 1 blog post content"
And I follow "Comments (0)"
When I set the field "content" to "$My own >nasty< \"string\"!"
And I follow "Save comment"
Then I should see "$My own >nasty< \"string\"!"
And I set the field "content" to "Another $Nasty <string?>"
And I follow "Save comment"
And I should see "Comments (2)" in the ".comment-link" "css_element"
Scenario: Deleting my own comment
Given I log in as "testuser"
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Site blogs" "link" in the "Navigation" "block"
And I follow "Blog post from user 1"
And I should see "User 1 blog post content"
And I follow "Comments (0)"
And I set the field "content" to "$My own >nasty< \"string\"!"
And I follow "Save comment"
When I click on ".comment-delete a" "css_element"
# Waiting for the animation to finish.
And I wait "4" seconds
Then I should not see "$My own >nasty< \"string\"!"
And I follow "Blog post from user 1"
And I click on ".comment-link" "css_element"
And I should not see "$My own >nasty< \"string\"!"
And I should see "Comments (0)" in the ".comment-link" "css_element"
Scenario: Commenting on someone's blog post
Given I am on site homepage
And I log in as "testuser2"
And I am on site homepage
And I click on "Site pages" "list_item" in the "Navigation" "block"
And I click on "Site blogs" "link" in the "Navigation" "block"
And I follow "Blog post from user 1"
When I follow "Comments (0)"
And I set the field "content" to "$My own >nasty< \"string\"!"
And I follow "Save comment"
Then I should see "$My own >nasty< \"string\"!"
+45
View File
@@ -0,0 +1,45 @@
@core @core_blog
Feature: Delete a blog entry
In order to manage my blog entries
As a user
I need to be able to delete entries I no longer wish to appear
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
And the following "core_blog > entries" exist:
| subject | body | user |
| Blog post one | User 1 blog post content | testuser |
| Blog post two | User 1 blog post content | testuser |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And the following config values are set as admin:
| unaddableblocks | | theme_boost|
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
And I log in as "testuser"
And I am on site homepage
And I click on "Site blogs" "link" in the "Navigation" "block"
Scenario: Delete blog post results in post deleted
Given I follow "Blog post one"
And I follow "Delete"
And I should see "Delete the blog entry 'Blog post one'?"
When I press "Continue"
Then I should not see "Blog post one"
And I should see "Blog post two"
Scenario: Delete confirmation screen works and allows cancel
Given I follow "Blog post one"
When I follow "Delete"
Then I should see "Delete the blog entry 'Blog post one'?"
And I press "Cancel"
And I should see "Blog post one"
And I should see "Blog post two"