Quantcast
Channel: General developer forum
Viewing all articles
Browse latest Browse all 37673

Re: Writing Behat tests with filepicker

$
0
0
by David Monllaó.  

Hi Yuliya,

At the moment the set of steps definitions is limited and there is no way to interact with the filepicker with the current ones, the same with other complex moodleform fields. We will be adding more steps definitions, don't hesitate to contribute if you have steps definitions that can be reused across Moodle or to open new issues.

About the filepicker and other complex fields, the design takes it into account but we should define a format for each of those complex form fields in order to continue using simple steps which makes tests writers life's easier, something like:

And I add a "Activityname" to section "3" and I fill the form with:

  | Name | basdasdasd |

  | Description | asdfasdf |

  | Attached file | URL Downloader ::  | (this was supposed to be an URL)

  | Another attached file | Upload a file :: blocks/tests/behat/fixtures/example.txt |

Considering also all the filepicker uses (single or multiple files..) dynamic parameters (it will all depend on the repository used) ... and the same with other moodleform fields as well; advanced, groups...

The quick alternative is to use XPath or CSS selectors step by step to interact with the filepicker HTML nodes, soon we will add some of those flexible steps definitions, which are not very BDD or human-friendly as they require CSS selectors or XPath, but can be used when there are no alternatives.


Viewing all articles
Browse latest Browse all 37673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>