Hi there!
After initial problems with setting up Behat on my localhost Windows box I am now running behat tests for the Questionnaire plugin. I have even created my own behat tests, based on existing examples. All is fine except that I'm really getting too many timeouts.
Windows 11 64 bits; AMD Ryzen 7 2700X Eight-Core Processor 3.70 GHz; RAM memory 16,0 Go; WAMP localserver; Moodle 4.2.2 (Build: 20230814); Php: 8.1.13; mysqli: 8.0.27, OS: Windows NT 10.0 AMD64; Server OS "WINNT", Browser: "firefox"; Selenium installed and launched.
Use case #1: vendor\bin\behat --config C:\wamp64\www\moodledatatest_behat\behatrun\behat\behat.yml --tags=@mod_quiz
Results: 215 scenarios (210 passed, 5 failed)
4488 steps (4279 passed, 5 failed, 204 skipped)
84m25.46s (100.43Mb)
Not too bad, 5 scenarios failed and 210 passed, I find this acceptable.
Use case #2: vendor\bin\behat --config C:\wamp64\www\moodledatatest_behat\behatrun\behat\behat.yml --tags=questionaire
Results: 38 scenarios (31 passed, 7 failed)
1254 steps (1129 passed, 7 failed, 118 skipped)
34m27.95s (85.37Mb)
Not so good! I seem to notice that most timeouts happen on the questionnaire Questions add page, just before writing the question name in the ad hoc field.
Error messages; Javascript code and/or AJAX requests are not ready after 10 seconds. There is a Javascript error or the code is extremely slow (editor_tiny/editor:setupForTarget:editor_tiny/editor:setupForTarget). If you are using a slow machine, consider setting $CFG->behat_increasetimeout. (Exception)
OK, I have added in my moodle config: $CFG->behat_increasetimeout = 3; In scenarion #2 with the questionnaire tests I still get 8 failed scenarios due to timeout, and the testing time has gone up from 34m to 47m... quite disappointing!
I was not expecting to be told that I'm having a slow machine, even if I know that there are faster configurations and faster environments than Windows.
Any advice to avoid those nagging timeouts?