Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behat tests in view_report.feature fail with Firefox #11

Open
leonstr opened this issue Jul 9, 2024 · 1 comment
Open

Behat tests in view_report.feature fail with Firefox #11

leonstr opened this issue Jul 9, 2024 · 1 comment

Comments

@leonstr
Copy link

leonstr commented Jul 9, 2024

For example with Moodle 4.3.5+ (Build: 20240705), report_allylti 2024060300 and firefox-115.12.0-1 on CentOS 9:

# vendor/bin/behat --config /var/www/beh_moodledata/behatrun/behat/behat.yml `pwd`/report/allylti/tests/behat/view_report.feature --profile=headlessfirefox
⋮
--- Failed steps:

001 Example: | classic |                                                           	# /var/www/moodle/report/allylti/tests/behat/view_report.feature:76
  	And I click on "Accessibility report" "link" in the "#settingsnav" "css_element" # /var/www/moodle/report/allylti/tests/behat/view_report.feature:65
    	Css matching locator "#settingsnav" not found. (Behat\Mink\Exception\ElementNotFoundException)

This test does pass with Chrome (tested with google-chrome-stable-126.0.6478.126-1).

@leonstr
Copy link
Author

leonstr commented Jul 9, 2024

I think this happens because line 64 of view_report.feature is:

    And I navigate to the course accessibility report

causes Accessibility report to be clicked which causes the report to open. But then the next line:

    And I click on "Accessibility report" "link" in the "#settingsnav" "css_element"

clicks Accessibility report a second time. Maybe in Chrome the report opens in a background tab so Accessibility report is in the active tab to click again, whereas in Firefox the focus moves to the new tab on the first click and so the Accessibility report isn't present to be clicked on again?

Two identical sequential requests when running this test with Chrome can be seen in the web server access log:

127.0.0.1 - - [09/Jul/2024:12:11:19 +0100] "GET /report/allylti/launch.php?reporttype=course&report=admin&course=194000 HTTP/1.1" 200 2340 "http://beh43.vm.ideapad/report/view.php?courseid=194000" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/126.0.0.0 Safari/537.36"
127.0.0.1 - - [09/Jul/2024:12:11:19 +0100] "POST /report/allylti/tests/fixtures/report.php HTTP/1.1" 200 117 "http://beh43.vm.ideapad/report/allylti/launch.php?reporttype=course&report=admin&course=194000" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/126.0.0.0 Safari/537.36"
127.0.0.1 - - [09/Jul/2024:12:11:19 +0100] "GET /report/allylti/launch.php?reporttype=course&report=admin&course=194000 HTTP/1.1" 200 2340 "http://beh43.vm.ideapad/report/view.php?courseid=194000" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/126.0.0.0 Safari/537.36"
127.0.0.1 - - [09/Jul/2024:12:11:19 +0100] "POST /report/allylti/tests/fixtures/report.php HTTP/1.1" 200 117 "http://beh43.vm.ideapad/report/allylti/launch.php?reporttype=course&report=admin&course=194000" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/126.0.0.0 Safari/537.36"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant