Commit f3443dc3 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge changes I22e45e8a,I0066c020 into 16.10_STABLE

* changes:
  Bug 1742600: update chromedriver for behat tests
  Bug #1694563 - add step to make breakpoint in testing
parents 3df230d9 8b235e61
......@@ -1099,6 +1099,25 @@ class BehatGeneral extends BehatBase {
$this->i_accept_confirm_popup();
$this->wait_until_the_page_is_ready();
}
/**
* Scroll to top of page
*
* @When I scroll to the top
*
*/
public function i_scroll_to_top() {
$function = <<<JS
(function(){
window.scrollTo(0,0);
})()
JS;
try {
$this->getSession()->executeScript($function);
}
catch(Exception $e) {
throw new \Exception("scrollToTop failed");
}
}
/**
* Scroll element into view and align top of element with the top of the visible area.
......@@ -1227,4 +1246,33 @@ JS;
);
}
/**
* Pauses the scenario until the user presses a key. Useful when debugging a scenario locally
* but not meant for automated runs.
*
* @Then /^(?:|I )insert breakpoint$/
*/
public function i_insert_breakpoint() {
fwrite(STDOUT, "\n\033[s \033[93m[Breakpoint] Press \033[1;93m[RETURN]\033[0;93m to continue...\033[0m\n");
while (fgets(STDIN, 1024) == '') {
}
fwrite(STDOUT, "\033[u");
return;
}
/**
* Echos a line to the console to indicate where the test has reached in a scenario.
* For debugging tests without using a breakpoint. Ok for automated runs.
*
* @Then /^(?:\I )echo the line "([^"]*)"$/
*/
public function i_echo_the_line($text){
fwrite(STDOUT, "\n\033[93m DEBUG: $text\033[0m\n\n");
}
}
......@@ -35,6 +35,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
# Verifying the settings saved
And I should see "Profile saved successfully"
# Updating Social media tab
And I scroll to the top
And I follow "Social media"
And I follow "New social media account"
And I fill in the following:
......@@ -42,6 +43,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
| Your URL or username | https://twitter.com/MaharaProject |
And I press "Save"
# Verifying the settings held, navitgating to dashboard page to check
And I scroll to the top
Then I follow "Dashboard"
And I should see "Test Admin"
# Resetting/Editing details
......@@ -56,6 +58,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
# Verifing settings saved
And I should see "Profile saved successfully"
# Editing contact information
And I scroll to the top
And I follow "Contact information"
And I press "Add email address"
And I fill in the following:
......@@ -72,6 +75,7 @@ Scenario: Editing admin profile page (Bug: 1426983)
And I press "Save profile"
And I should see "Profile saved successfully"
# Verifying changes has been made navigating to dashboard page to checked
And I scroll to the top
Then I follow "Dashboard"
And I should see "Admin User"
......
......@@ -27,6 +27,7 @@ Scenario: Creating an Institution assigning users and changing their passwords
| password | mahara1 |
And I select "Institution One" from "Institution"
And I enable the switch "Institution administrator"
And I scroll to the top
And I press "Create user"
# Creating user 2
And I follow "Users"
......@@ -38,6 +39,7 @@ Scenario: Creating an Institution assigning users and changing their passwords
| username | jen |
| password | mahara1 |
And I select "Institution One" from "Institution"
And I scroll to the top
And I press "Create user"
# Log out as user admin
And I follow "Logout"
......
......@@ -20,6 +20,7 @@ Scenario: Creating and deleting external links (Selenium 1426983)
And I should see "Item saved"
And I press "Save changes"
# Verifying the link as been added successfully
And I scroll to the top
And I follow "Return to site"
Then I should see "Test Menu Link"
And I follow "Administration"
......
......@@ -47,8 +47,7 @@ Scenario: Clicking randomly around Mahara (Bug: 1426983)
And I choose "Topics" in "Groups"
# Checking messages
# And I click on "Show User Menu" # problem with chrome driver clicking on user icon instead
# And I follow "mail"
And I choose "mail" from user menu by id
And I follow "mail"
And I follow "Inbox" in the ".arrow-bar" "css_element"
And I follow "Sent"
And I follow "Compose"
......
......@@ -133,6 +133,7 @@ Scenario: Newly created user can get a copy of the journal (Bug 1472467)
| Email * | test01@example.com |
| Username * | userA |
| Password * | KKJHH$$67686 |
And I scroll to the top
And I press "Create user"
# Logging in as new user
And I follow "Log in as this user"
......
......@@ -22,6 +22,7 @@ Scenario: Creating and accessing social media buttons (Bug 1448948)
| Social network * | Facebook URL |
| Your URL or username * | https://www.facebook.com/wellingtonphoenixfc |
And I press "Save"
And I scroll to the top
And I follow "Portfolio"
And I press "Create page"
And I set the following fields to these values:
......
......@@ -23,8 +23,8 @@ Scenario: Open badges block
And I wait "1" seconds
And I follow "Open Badges"
And I press "Add"
And I wait "5" seconds
And I wait "7" seconds
Then I should see "Your email test01@example.com is not found in the service"
And I press "Save"
And I wait "1" seconds
And I wait "7" seconds
Then I should see "No public badge collections / badges found."
......@@ -104,7 +104,7 @@ then
SELENIUM_FILENAME=selenium-server-standalone-$SELENIUM_VERSION_MAJOR.$SELENIUM_VERSION_MINOR.jar
SELENIUM_PATH=./test/behat/$SELENIUM_FILENAME
# @todo make this more flexible, cross-platform?
CHROMEDRIVER_PATH=./test/behat/chromedriver-2.26-linux64
CHROMEDRIVER_PATH=./test/behat/chromedriver-2.35-linux64
# If no Selenium installed, download it
if [ ! -f $SELENIUM_PATH ]; then
......
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