Commit 8305e480 authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Robert Lyon

Bug 1754239: Behat: adding embedded_media_block test

This replaces the existing add_video test
including test for mp3

Also adds a better step to access an extension -> plugin configuration page

Change-Id: I78f8592c9afde411a40f20c72f2ae2be6bc6ff70
(cherry picked from commit 658daadb)
parent 8477fafe
......@@ -1260,6 +1260,20 @@ class BehatGeneral extends BehatBase {
$this->visitPath("/group/view.php?id={$group->id}");
}
/**
* Visit a Mahara extension configuration page with the specified name
*
* @Given I go to the :plugin plugin :name configuration
* @Given I go to the :plugin plugin :name configuration :type type
*/
public function i_go_to_extension_configuration($plugin, $name, $type=null) {
$path = "/admin/extensions/pluginconfig.php?plugintype=" . $plugin . "&pluginname=" . $name;
if ($type) {
$path .= "&type=" . $type;
}
$this->visitPath($path);
}
/**
* Expand a collapsible section containing the specified text.
*
......
......@@ -32,6 +32,7 @@ define ("LOCATOR_CONSTANTS", json_encode(array(
'Web services sub-menu' => array(".webservices", "css_element"),
'H1 heading' => array("h1", "css_element"),
'Collections text-box' => array(".select2-selection__rendered", "css_element"),
'Videojs time remaining' => array(".vjs-remaining-time-display", "css_element"),
'Annotation' => array("#activate_blocktype_annotation", "css_element"),
'Smartevidence' => array("#activate_module_framework", "css_element"),
'Make comment public status' => array("#add_feedback_form_ispublic_container", "css_element"),
......
......@@ -13,8 +13,7 @@ Scenario Outline: When quota notification threshold is changed, send notificatio
# Log in as "Admin" user
Given I log in as "admin" with password "Kupuh1pa!"
# Modifying user quota quota to 2MB
And I choose "Extensions" from administration menu
And I go to "admin/extensions/pluginconfig.php?plugintype=artefact&pluginname=file&type=file"
And I go to the "artefact" plugin "file" configuration "file" type
And I follow "Default user quota"
# Clearning the tex box first to enter 2 MB
And I fill in "Default quota" with ""
......
......@@ -6,7 +6,7 @@ Feature: Missing language string when resizing images in plugin administration
Scenario: Checking the language string is visible (Bug 1446488)
Given I log in as "admin" with password "Kupuh1pa!"
When I go to "admin/extensions/pluginconfig.php?plugintype=artefact&pluginname=file&type=file"
And I go to the "artefact" plugin "file" configuration "file" type
And I follow "Resize images on upload"
Then I should see "Automatically resize large images on upload"
@javascript @core @core_artefact @play
Feature: Uploading videos
In order to upload a video
As an admin/user
So I can display videos on my pages
Scenario Outline: Uploading videos with a different file type (Bug 1445653)
Given I log in as "admin" with password "Kupuh1pa!"
When I choose "Files" in "Content" from main menu
And I attach the file "<videoname>" to "File"
Then I should see "<videolink>" in the "Filelist table" property
Examples:
| videoname | videolink |
| testvid1.3gp | testvid1.3gp |
| testvid2.mkv | testvid2.mkv |
| testvid3.mp4 | testvid3.mp4 |
@javascript @core
Feature: Embedded media block
As a user
I want to add an embedded media block to my page
So I can include audio and video content
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| UserA | Kupuh1pa! | UserA@example.org | Angela | User | mahara | internal | member |
And the following "pages" exist:
| title | description | ownertype | ownername |
| Page UserA_01 | Page 01 | user | UserA |
Scenario: Embed and play mp4
Given I log in as "UserA" with password "Kupuh1pa!"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "Edit" in "Page UserA_01" panel menu
And I expand "Media" node
And I follow "Embedded media"
And I press "Add"
And I follow "Media"
And I attach the file "testvid3.mp4" to "File"
And I press "Save"
And I display the page
And I press "Play Video"
# check remaining time is displayed
And I wait "3" seconds
And I should see "-0:00" in the "Videojs time remaining" property
Scenario: Embed and play mp3
Given I log in as "UserA" with password "Kupuh1pa!"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "Edit" in "Page UserA_01" panel menu
And I expand "Media" node
And I follow "Embedded media"
And I press "Add"
And I follow "Media"
And I attach the file "mahara.mp3" to "File"
And I press "Save"
And I display the page
And I should see "mahara.mp3"
And I press "Play Video"
# check pause and play buttons work
And I press "Pause"
And I press "Play"
Scenario: Change settings and embed 3gp
#change settings to allow 3gp
Given I log in as "admin" with password "Kupuh1pa!"
And I go to the "blocktype" plugin "file/internalmedia" configuration
And I enable the switch "3GPP media file"
And I press "Save"
And I log out
# Log in as user and check 3gp is uploadable
Given I log in as "UserA" with password "Kupuh1pa!"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "Edit" in "Page UserA_01" panel menu
And I expand "Media" node
And I follow "Embedded media"
And I press "Add"
And I follow "Media"
And I attach the file "testvid1.3gp" to "File"
And I press "Save"
And I display the page
# 3gp has no compatible add-ons to play in browser
And I should see "No compatible source was found for this video"
Scenario: Embed unsupported file type
Given I log in as "UserA" with password "Kupuh1pa!"
And I choose "Pages and collections" in "Portfolio" from main menu
And I click on "Edit" in "Page UserA_01" panel menu
And I expand "Media" node
And I follow "Embedded media"
And I press "Add"
And I follow "Media"
# mkv is not supported
And I attach the file "testvid2.mkv" to "File"
Then I should see "The file you uploaded was not the correct type for this block."
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment