Commit Graph

54 Commits

Author SHA1 Message Date
Rajesh Taneja
fba0ac63b8 MDL-54589 behat: Added hack for some OS/browsers 2016-06-20 16:03:36 +08:00
Rajesh Taneja
3aaf98f62c MDL-54589 behat: Trigger change event after selecting option
After selecting option, some browsers need
explicit change event
2016-06-20 09:43:08 +08:00
Rajesh Taneja
921faad9ad MDL-53571 behat: Use Escaper for escaping
xpathLiteral has been depreacted, use Escaper instead
2016-04-06 15:38:31 +08:00
Rajesh Taneja
225265b03d MDL-53623 behat: catch expection if failed to trigger event
Inline editing element might hide before
event is triggred, so don't trigger exception
if exception happens
2016-03-29 09:52:37 +08:00
Rajesh Taneja
42ad096fdb MDL-46891 Behat: Added support for behat 3 2016-03-11 10:51:15 +08:00
Rajesh Taneja
d2ee22e744 MDL-27628 behat: Added delay to ensure the value is set.
After user type there is a 400ms delay, then search
Adding 2 sec delay to ensure search is finished before
click event is triggred
2016-03-10 13:17:11 +01:00
Rajesh Taneja
f7a73e196e MDL-52970 behat: For single select only click event is enough 2016-02-19 15:21:52 +08:00
Rajesh Taneja
e8ef0e4f63 MDL-52970 behat: don't set select value if already set
In FF 44.0, it fails to click on submit button if
select value is set to the original value
2016-02-19 15:21:51 +08:00
Marina Glancy
cdc5f9785b MDL-51802 core: new template for quick editing a title
convert editing tag name to use new template
2016-02-13 11:07:42 +08:00
rajesh Taneja
0db240c1dd MDL-51918 behat: Key press should be down-press-up
As we simulate real user key press event, the
event should down followed by press and then up key
2015-11-05 09:15:41 +08:00
Damyon Wiese
60a1ea56d9 MDL-51247 forms: All new aria-pimped autocomplete mform element.
Supports static list of options - or options fetched via ajax.
Has options for single,multi and tags support.
2015-10-14 16:22:44 +01:00
Marina Glancy
0cf7252406 MDL-50919 behat: Step for keypress event in behat 2015-09-02 14:15:09 +08:00
sam marshall
002ccdcf49 MDL-44725 Add Behat support for setting grouping condition (14)
Makes it possible to add a grouping condition when creating an
activity, using the Behat field type API. You can set the field
using a syntax 'Grouping: NAME' (at present, only groupings are
supported, obviously we could potentially extend this to add
support for other conditions if needed).

Tested in Firefox and Chrome in JS mode, and in non-JS mode.
2014-09-02 13:03:35 +01:00
Rajesh Taneja
955118d831 MDL-43835 behat: Fixed matches for select form field 2014-06-25 12:54:52 +08:00
Damyon Wiese
e3adee555b MDL-44871 Atto: Move custom select text step to atto specific step definition. 2014-06-11 15:29:20 +08:00
Damyon Wiese
7d8f825bbf MDL-44871 Atto behat tests: Modified the tests to work around focus bugs with workspaces
The main changes here are that the "select the text in" step was modified to select only the
first text node in the editor field, and to focus on it's parent instead of the entire editable div.

Some tests had to be modified to match the new behaviour, and another "real" bug was found in the table plugin.
2014-06-11 14:34:48 +08:00
Damyon Wiese
457a9fa6c5 MDL-44871 Behat: Add tests for Atto functionalities (some of them) 2014-06-10 14:42:00 +08:00
David Monllao
af4830a257 MDL-44619 behat: Converting MDLQA-8
In a standard forum, students can start discussions
add replies and attach files to their posts.
2014-04-09 19:34:11 +07:00
David Monllao
9bc60e016b MDL-44619 behat: filemanager field manager
Enough to allow attachments use in multi-field steps.
2014-04-09 19:03:26 +07:00
Damyon Wiese
786ced9925 MDL-43883 Behat: Fix deprecation and move custom matches to the editor field only. 2014-03-27 12:36:37 +08:00
Rajesh Taneja
3e469992a1 MDL-44084 behat: Fixed setting value for form editor 2014-03-27 12:12:09 +08:00
Rajesh Taneja
b033c16390 MDL-44084 behat: Fixed behat set_value for atto editor 2014-03-26 15:56:21 +08:00
Damyon Wiese
b725a0eb19 MDL-43883 Atto behat: Make the set_field js handle atto or simple textarea 2014-03-26 10:01:49 +08:00
Damyon Wiese
5f3ea8cf66 MDL-43883 Atto behat: Rubrics are expecting magic tweaking in text from tinymce. 2014-03-26 10:01:49 +08:00
Damyon Wiese
9f07f05a48 MDL-43883 Behat: Make Atto the default text editor and adjust behat to use it. 2014-03-26 10:01:49 +08:00
David Monllao
8aff0eec9d 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.
2014-02-27 18:43:20 +08:00
David Monllao
a525414125 MDL-43738 behat: Updating steps definitions and deprecating methods 2014-02-27 18:22:05 +08:00
David Monllao
c3f1e9532d MDL-43738 behat: Normalization and major refactoring of getters and setters
Every single step that sets or gets a value from a field
has been updated to follow the same behaviour both when
using it through a single step or through generic steps
like "I fill the moodle form with:", to resume all the
changes:
- Created a behat_form_group to re-guess the field type
  and act appropriately setting and getting it's value
- Normalize all getters and setters to use behat_form_field
  children
- Complete behat_form_checkbox to trigger the appropiate JS
  event needed to perform some JS scripts that are listening
- Refactor MDL-43713 multi-select changes and remove
  the two new steps introduced there as that behaviour can
  be managed from the generic getter
- Added a new step definition to check a capability permission
  as we changed the way radio buttons gets it's value
2014-02-27 18:22:03 +08:00
Eloy Lafuente (stronk7)
5f66d46e22 MDL-43713 behat: improve multi-select support
This patch implements:

1) Normalization of options. Before the patch options
in a select were being returned as "op1 op2 op3" by selenium
and "op1 op2 op3" by goutte. With the patch, those lists
are always returned like "op1, op2, op3". If real commas are
needed when handling multiple selects they should
be escaped with backslash in feature files.

2) Support for selecting multiple options. Before the patch
only one option was selected and a new selection was cleaning the
previous one. With the patch it's possible to pass "op1, op2" in
these steps:
  - I fill the moodle form with (table)
  - I select "OPTION_STRING" from "SELECT_STRING"

3) Ability to match multiple options in this steps. Before the
patch matching of multiple was really random, now every every
passed option ("opt1, opt2") is individually verified. It applies
to these 2 steps:
  - the "ELEMENT" select box should contain "OPTIONS"
  - the "ELEMENT" select box should not contain "OPTIONS"

4) Two new steps able to verify if a form have some options selected or no:
  - the "ELEMENT" select box should contain "OPTIONS" selected
  - the "ELEMENT" select box should contain "OPTIONS" not selected

5) Change get_value from xpath search to Mink's getValue() that is immediate
(does not need form submission) and works for all browsers but Safari, that
fails because of the extra ->click() issued.

Note all the changes 1-4 only affect to multi-select fields. Single
selects should continue working 100% the same.

The change 5) causes Safari to fail. The problem has been traced down to
the extra ->click() present there. Anyway there are not test cases
requiring that "immediate" evaluation right now. Only the special feature
file attached verifies it.
2014-02-27 18:21:43 +08:00
David Monllao
405cdd0441 MDL-43951 behat: Fixing random failure
NodeElement->hasAttribute() (JS enabled) queries selenium
about whether it has any attribute or not, if due to an
AJAX request the field node changed selenium can not access
that node and throws an exception.
2014-02-03 13:59:12 +08:00
David Monllao
cca6f37389 MDL-43757 behat: Allowing the form field guesser to detect TinyMCE
It includes 2 more minor fixes:
- Escapes values sent to TinyMCE as it was breaking
  when values contained double quotes.
- Adding seconds to the screenshots directory to
  avoid using the same folder for multiple runs.
2014-01-24 15:06:12 +08:00
Dan Poltawski
267d4927b4 Merge branch 'MDL-43173_master' of git://github.com/dmonllao/moodle 2014-01-08 08:21:06 +08:00
David Monllao
afe9f42adb MDL-43173 behat: Thowing an exception if the JS is not ready 2014-01-03 11:27:54 +08:00
Aaron Barnes
832530e2eb MDL-43394 behat: Fix checkbox action 2013-12-23 15:40:06 +13:00
David Monllao
fff500c727 MDL-42625 behat: Wrapping select an option extra actions in a try & catch
To select an option is specially painful, every browser
behaves differently and phantomjs just joined the party
throwing "Element does not exist in cache" random
exceptions that we need to catch.
2013-12-12 12:16:45 +01:00
David Monllao
c1faf86bd1 MDL-42625 behat: Make behat pacient
* When looking for texts inside the page or inside
  other containers we should wait until the elements
  are visible.
* Same when expanding tree nodes.
* Normalizing loops to spin() function using
  behat_base::TIMEOUT and behat_base::EXTENDED_TIMEOUT,
  leaving TIMEOUT for DOM load processes and
  EXTENDED_TIMEOUT for long processes that involves JS
  too.
* Add page load waits between actions that involves
  reloading the page.
2013-12-09 11:08:42 +08:00
David Monllao
d1e55a47be MDL-42625 behat: Step definitions + related changes in features
In general aiming for compatibility with multiple browsers,
firefox, chrome and phantomjs to be more specific.

* Removing hardcoded waits
* Adding @_alert, @_switch_window and @_switch_frame tags,
  to label actions that different drivers have problems with.
* Adding missing @_files_upload and @_only_local tags to features that
  uploads files.
* Fixing a few wait for page ready what specified miliseconds.
* New methods to ensure elements (usual selectors), sections and editors
  are ready to interact with
* Changing the select an option implementation to deal with the different
  drivers implementations when listening to JS events.
2013-12-06 13:10:24 +08:00
David Monllao
3897608152 MDL-39635 behat: XPath cleanups
- Escaping steps arguments redirected to other steps
- Adding normalized-space() in all contains() assertions
- General xpaths review
- Convering provided xpath text strings to xpath literals
  to avoid problems with arguments containing both single
  quotes and double quotes
2013-07-19 10:02:36 +02:00
David Monllao
051e9663f0 MDL-39634 behat: Removing unused arguments
Also adding deprecated methods.
2013-06-14 16:14:04 +08:00
David Monllao
1fb9715721 MDL-39051 behat: Fixing extra interactions
When the elements to interact with are not
available anymore.
2013-05-09 17:21:19 +08:00
David Monllao
28abad1ab2 MDL-39348 behat: Compatibility with Safari and IE
Also changing from SeleniumDriver checking
to GoutteDriver as is less probably to change
goutte than to change selenium.
2013-05-03 10:43:06 +08:00
David Monllao
e541bc2182 MDL-38949 behat: Fix editor presence detection issue
Checking not only the presence of an editor
in the page, also an editor for the target
field.
2013-04-14 11:07:33 +08:00
David Monllao
ed6ca2d2f1 MDL-38949 behat: Form field for selectyesno
Silly extension of behat_form_select.
2013-04-14 10:58:20 +08:00
David Monllao
060bafefe3 MDL-38823 behat: New behat_form_radio
To deal with radio inputs after allowing
behat_form_field to delegate in specific
fields managers. It also fixes a BIG issue
when calling a no required class.
2013-04-03 13:55:42 +08:00
Eloy Lafuente (stronk7)
12879418e9 Merge branch 'MDL-38823_master' of git://github.com/dmonllao/moodle
Conflicts:
	mod/forum/tests/behat/behat_mod_forum.php
2013-04-02 01:47:40 +02:00
David Monllao
7bc7625e04 MDL-38823 behat: Make default form field manage different HTML elements 2013-04-01 17:51:54 +08:00
David Monllao
b918f9f7bf MDL-38499 behat: Steps definitions for section visibility management 2013-03-27 16:00:54 +08:00
David Monllao
5cde7298e3 MDL-38410 behat: Adding new form fields 2013-03-19 16:42:59 +08:00
David Monllao
a4534dceef MDL-38184 behat: Fields management externalized
Not only behat_forms needs to deal
with form fields
2013-03-08 09:42:28 +08:00
Eloy Lafuente (stronk7)
88906d068d Merge branch 'MDL-37958_master' of git://github.com/dmonllao/moodle 2013-03-05 19:28:14 +01:00