0

I have a website with 90 behat tests broken up into about 8,000 steps.

Previously, I was running my tests locally with standalone-chrome-debug. However, when I tried to use this image on GitHub Actions, I get random crashes and the test doesn't run for more than a few minutes. (To complete, it usually takes about two hours.)

So, I modified my behat config to use firefox instead of chrome and tried the standalone-firefox-debug image. This doesn't crash or timeout-- great! However, I have a different problem.

I have dozens of failures that fail like this:

And I press save                                                                                       # MyMinkContext::pressSave()
  (69, 1402) is out of bounds of viewport width (450) and height (582)
  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
  System info: host: '26b87286a5e5', ip: '172.18.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '5.11.0-1027-azure', java.version: '1.8.0_292'
  Driver info: driver.version: unknown

According to the answers to this question, the problem is that Firefox requires that the element first be scrolled into view before it can be interacted with.

So now I'm trying to find a solution to use firefox in my behat tests without having to go through the 8,000 lines of existing tests and add "scroll element into view" several hundred times.

Example (works with chrome):

  Scenario: Check that links work
    Given I am on "/abc"
    And I click "Title 2" in the "content" region
    And I click "Title 3"

Example (changes needed for firefox):

  Scenario: Check that links work
    Given I am on "/abc"
    And I scroll "Title 2" into view
    And I click "Title 2" in the "content" region
    And I scroll "Title 3" into view
    And I click "Title 3"

Is there some way to automatically force Firefox to scroll so that it works like Chrome?

Patrick Kenny
  • 2,170
  • 2
  • 26
  • 38

0 Answers0