Minor - Disable send email in behat test

pull/3178/head
Julio Montoya 6 years ago
parent 8a226762ea
commit a60d6293b3
  1. 4
      main/admin/user_add.php
  2. 14
      tests/behat/features/bootstrap/FeatureContext.php
  3. 5
      tests/behat/features/createUser.feature

@ -274,8 +274,8 @@ $form->addSelectLanguage('language', get_lang('Language'), null);
// Send email
$group = [];
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1, ['id' => 'send_mail_yes']);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0, ['id' => 'send_mail_no']);
$form->addGroup($group, 'mail', get_lang('SendMailToNewUser'));
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);

@ -493,6 +493,20 @@ class FeatureContext extends MinkContext
return true;
}
/**
* @Given /^I check the "([^"]*)" radio button selector$/
*/
public function iCheckTheRadioButtonBasedInSelector($element)
{
$this->getSession()->executeScript("
$(function() {
$('$element').prop('checked', true);
});
");
return true;
}
/**
* @Then /^I should see an icon with title "([^"]*)"$/
*/

@ -23,8 +23,8 @@ Feature: Users management as admin
| email | smarshall@example.com |
| username | smarshall |
| password | smarshall |
And I check the "#send_mail_no" radio button selector
And I press "submit"
And wait for the page to be loaded
Then I should see "The user has been added"
Scenario: Search and delete a user
@ -45,6 +45,7 @@ Feature: Users management as admin
| email | hrm@example.com |
| username | hrm |
| password | hrm |
And I check the "#send_mail_no" radio button selector
And I fill in select bootstrap static input "#status_select" select "4"
And I press "submit"
Then I should see "The user has been added"
@ -59,6 +60,7 @@ Feature: Users management as admin
| username | teacher |
| password | teacher |
And I fill in select bootstrap static input "#status_select" select "1"
And I check the "#send_mail_no" radio button selector
And I press "submit"
Then I should see "The user has been added"
@ -72,6 +74,7 @@ Feature: Users management as admin
| username | student |
| password | student |
And I fill in select bootstrap static input "#status_select" select "5"
And I check the "#send_mail_no" radio button selector
And I press "submit"
Then I should see "The user has been added"

Loading…
Cancel
Save