MDL-43738 behat: Refactoring the field type guesser

The previous behaviour delegates the responsability
of overwriting the 3 public methods to the child
classes, now the field type or moodleform field is
guessed earlier in the execution flow.

Other changes introduced here:
- Fix wrong moodleform detection when there is a form
  in the page but the field we are dealing with is
  not inside it.
- Updating the last week feature files to these new
  step definitions.
- Some coding style changes.
This commit is contained in:
David Monllao 2014-02-27 16:39:25 +08:00
parent decf1e14c8
commit 8aff0eec9d
13 changed files with 223 additions and 93 deletions

View file

@ -36,7 +36,7 @@ Feature: Add a quiz
And I press "Attempt quiz now"
Then I should see "Question 1"
And I should see "Answer the first question"
And I select "True" radio button
And I set the field "True" to "1"
And I press "Next"
And I should see "Answer saved"
And I press "Submit all and finish"

View file

@ -60,9 +60,9 @@ class behat_mod_quiz extends behat_base {
new Given("I follow \"$quizname\""),
new Given("I follow \"$editquiz\""),
new Given("I press \"$addaquestion\""),
new Given("I select \"$questiontype\" radio button"),
new Given("I set the field \"$questiontype\" to \"1\""),
new Given("I press \"$next\""),
new Given("I fill the moodle form with:", $table),
new Given("I set the following fields to these values:", $table),
new Given("I press \"$savechanges\"")
);
}