Commit cc39442a authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Bug 1558864: Need to require artefact/lib.php"

parents 98d516d9 292dd15b
......@@ -1538,6 +1538,7 @@ function delete_user($userid) {
// @todo: test all artefact bulk_delete stuff, then replace the one-by-one
// artefact deletion below with ArtefactType::delete_by_artefacttype($artefactids);
if ($artefactids) {
require_once(get_config('docroot') . 'artefact/lib.php');
foreach ($artefactids as $artefactid) {
try {
$a = artefact_instance_from_id($artefactid, true);
......
......@@ -548,4 +548,20 @@ class BehatForms extends BehatBase {
$actionbutton->click();
}
/**
* Press a submit button with a confirm event attached
*
* @When /^I press and confirm "(?P<fieldlabel>(?:[^"]|\\")*)"$/
* @param string $button The submit element name
*/
public function i_press_and_confirm($fieldlabel) {
$textliteral = $this->escaper->escapeLiteral($fieldlabel);
$exception = new ElementNotFoundException($this->getSession(), 'field', null, $textliteral);
$xpath = "//button[@type='submit']" .
"//span[normalize-space(.)=" . $textliteral . "]";
$deletenode = $this->find('xpath', $xpath, $exception);
$this->ensure_node_is_visible($deletenode);
$deletenode->press();
$this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
}
}
......@@ -18,3 +18,13 @@ Scenario: Create users by csv (Bug 1426983)
And I press "Add users by CSV"
Then I should see "Your CSV file was processed successfully"
And I should see "New users added: 4."
# Check that we can delete a user after upload (Bug #1558864)
And I choose "User search" in "Users"
And I follow "kevin01"
And I follow "Suspend or delete this user"
And I scroll to the id "delete"
# Wait for the dialog to appear
And I wait "1" seconds
And I press and confirm "Delete user"
And I should see "User deleted successfully"
......@@ -62,7 +62,7 @@ Scenario: Turning switchboxes on and off in diff areas (Bug 1431569)
And I press "Add users by CSV"
# Navigating to the account index
And I follow "Logout"
Then I log in as "Bob" with password "Mahara1"
Then I log in as "bob01" with password "Mahara1"
And I go to "account/index.php"
# And I wait "1" seconds
And I should not see "Undefined index:"
......
username,password,email,firstname,lastname,studentid,preferredname
Kevin,Mahara1,kevin@griffin.com,Kevin,Griffin,kevingriffin,kevin
Jenny,Mahara1,jenny@gem.com,Jenny,Gem,Jennygem,Jen
Dow,Mahara1,dow@bridge.com,Dow,Bridge,Dowbridge,Downy
Bob,Mahara1,bob@bobbison.com,Bobby,Bobber,bobbybob,Bob
kevin01,Mahara1,kevin@griffin.com,Kevin,Griffin,Mr Griffin,kevin
jenny01,Mahara1,jenny@gem.com,Jenny,Gem,Jen Gem,Jen
dow01,Mahara1,dow@bridge.com,Dow,Bridge,'Draw' Bridge,Downy
bob01,Mahara1,bob@bobbison.com,Bobby,Bobber,Bob a job,Bob
Supports Markdown
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