Posts made by Joseph Rézeau

Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

@Renaat, at last the "rescue boat" has arrived.🤩

On my Windows 11 desktop, And I change window size to "large" sets the FF browser window to full screen, which hides the PowerShell command window. After some fiddling I found the best size for my own setting, which is:

And I change viewport size to "1400x1000"

This makes the Behat tests happy, I'm no longer getting the infamous "Element is not clickable..." error and I can just see my PowerShell command window. There is a slight difference between setting window size and viewport size, but never mind. Found this tracker issue MDL-54920 which relates to the topic of window size. By the way, where in the Behat documentation did you find that And I change window size to... command?

Many thanks, you saved my day (not to mention my behat-induced sleepless nights).

Average of ratings: Useful (2)
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

I am gradually getting acquainted with running Behat tests on my localhost (Windows)... and getting my share of usual problems, etc.

In the course of adapting the question/shortanswer behat tests to my own question/regexp question type I have come across a problem which has already been reported here.

When running this query:  vendor\bin\behat --config C:\wamp64\www\moodledatatest_behat\behatrun\behat\behat.yml  --profile=geckodriver C:\wamp64\www\htdocs\moodletest\question\type\regexp\tests\behat\edit.feature

I get this error message:

001 Scenario: Edit a Regexp question # C:\wamp64\www\htdocs\moodletest\question\type\regexp\tests\behat\edit.feature:25
      And I choose "Edit question" action for "Edited regularshortanswer-001" in the question bank # C:\wamp64\www\htdocs\moodletest\question\type\regexp\tests\behat\edit.feature:36
        Element <div id="action-menu-1-menubar" class="menubar d-flex "> is not clickable at point (575,674) because another element <div id="page" class="drawers show-drawer-left drag-container"> obscures it (Facebook\WebDriver\Exception\ElementClickInterceptedException)

I can trace the problem to the fact that the Acceptance Test Site Firefox browser window is not large enough (height is insufficient) to display the Edit question" action drop-down menu. I can fix this by dragging the bottom of that window while the Acceptance Test Site is running (of course before it reaches line 36 in the feature script). But it is still a nuisance!

I tried to run my query with the --profile=headlessgeckodriver profile, but to no avail; I still get the "not clickable" error message.

I've also tried to run it with Selenium, still no joy.

Questions:

  • Why at launch time does my Firefox browser window briefly displays full height, then reduced height?
  • Is there a setting where I can fix this height, which would fix the problem?
  • Or is there in my feature script a way to force it to either heighten the browser window, or enable a command to go fetch that invisible Edit question" action drop-down menu?

Yours puzzled,

Joseph

Average of ratings: Useful (2)
Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Tim,

It's good to hear that I'm not alone on the Behat+Windows boat.

Thanks for those tips, but either I'm set up as you way already or I can't use the other tips.

As a workaround I've found about the --rerun option (on the Behat for Moodle page). Of course it doesn't remove those nagging timeouts, but at least by re-running only the failed tests it gradully sorts things out. Well, sort of... Here's one example of workflow (without $CFG->behat_increasetimeout in the Moodle site config.php, as this only makes running the tests longer without removing any timeouts).

run 1 'normal run'
39 scenarios (34 passed, 5 failed)
1353 steps (1125 passed, 5 failed, 223 skipped)
32m22.96s (85.54Mb)
---
run 2 with --rerun param added
5 scenarios (4 passed, 1 failed)
287 steps (262 passed, 1 failed, 24 skipped)
6m5.02s (82.06Mb)
---
run 3 with --rerun param added
1 scenario (1 failed)
33 steps (26 passed, 1 failed, 6 skipped)
1m16.21s (81.50Mb)
---
run 4 with --rerun param added
1 scenario (1 passed)
33 steps (33 passed)
0m57.65s (81.19Mb)

I will now run all behat tests on the quiz mod and report...

Picture of Core developers Picture of Plugin developers Picture of Testers Picture of Translators

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?

Average of ratings: -