Commit 1da9e692 authored by Rebecca Blundell's avatar Rebecca Blundell Committed by Robert Lyon

Bug 1752477: Behat test: image gallery block

-could be combined with nested_folders_images
-adding step to click a css selector without having to specify text
inside it
-also adding a properties step to call the above without passing
locators directly in feature files

Change-Id: I2b72e8c4d4506bbf24a37c64a4d3d27b0aad2aa4
(cherry picked from commit 173e04dc)
parent 67700a0c
......@@ -364,6 +364,21 @@ class BehatGeneral extends BehatBase {
* @Given I click on the :selector element
* @param string $selector - css selector
public function i_click_on_the($selector) {
$page = $this->getSession()->getPage();
$element = $page->find('css', $selector);
if (empty($element)) {
throw new Exception("No html element found for the selector ('$selector')");
* Click on the link or button which is located inside the second element.
......@@ -861,6 +876,15 @@ class BehatGeneral extends BehatBase {
* @Given I click on the :property property
* @param string $property
public function click_on_property($property) {
$property = get_property($property);
* @Then /^I should see "(?P<text_string>(?:[^"]|\\")*)" in the
* "(?P<property_string>(?:[^"]|\\")*)" property in "(?P<location_string>(?:[^"]|\\")*)"$/
......@@ -15,6 +15,7 @@ define ("LOCATOR_CONSTANTS", json_encode(array(
'Latest changes I can view' => array(".bt-newviews", "css_element"),
'Resume field block' => array(".bt-resumefield", "css_element"),
'Watched pages' => array(".bt-watchlist", "css_element"),
'Select' => array(".btn[title='Select']", "css_element"),
'Comment preview' => array(".commentreplyview", "css_element"),
'Comment text' => array(".comment-text", "css_element"),
'Extensions sub-menu' => array(".configextensions ul", "css_element"),
@javascript @core
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| UserA | Kupuh1pa! | | Angela | User | mahara | internal | member |
And the following "pages" exist:
| title | description | ownertype | ownername |
| Page UserA_01 | Page 01 | user | UserA |
Given I log in as "UserA" with password "Kupuh1pa!"
When I choose "Files" in "Content" from main menu
And I fill in "Folder1" for "files_filebrowser_createfolder_name"
And I press "Create folder"
And I follow "Folder1"
And I attach the file "Image1.jpg" to "File"
And I attach the file "Image2.png" to "File"
And I attach the file "Image3.png" to "File"
# Creating folder 1
Given 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 "Image gallery"
And I press "Add"
And I select the radio "Image selection: Display all images from a folder including images uploaded later"
And I click on the "Select" property
And I select the radio "Style: Thumbnails (square)"
And I press "Save"
And I display the page
Then I should see images within the block "Image gallery"
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