Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Screenshot only works on javascript scenarios? #47

Open
golddragon007 opened this issue Dec 20, 2018 · 5 comments
Open

Screenshot only works on javascript scenarios? #47

golddragon007 opened this issue Dec 20, 2018 · 5 comments
Labels

Comments

@golddragon007
Copy link

I have this settings:

  extensions:
    Behat\MinkExtension:
      browser_name: 'chrome'
      goutte: ~
      selenium2:
        wd_host: 'http://localhost:4444/wd/hub'
        browser: 'chrome'
        capabilities:
          browser: 'chrome'
          chrome:
            switches:
            - "--headless"
            - "--disable-gpu"
      javascript_session: 'selenium2'
      base-url: 'http://localhost:8080/my-site'
      files_path: '/home/user/environment/my-site'
    Drupal\DrupalExtension:
      api_driver: 'drupal'
      blackbox: ~
      drupal:
        drupal_root: '/home/user/environment/my-site'
      selectors:
        message_selector: '.messages'
        error_message_selector: '.messages.error'
        success_message_selector: '.messages.status'
      subcontexts:
        paths:
        - '/home/user/environment/my-site/sites/default'
      drush:
        alias: 'default'
        binary: '/home/user/environment/my-site/vendor/package/toolkit/bin/drush'
      region_map:
        header: "#layout-header"
        featured: ".region-featured-wrapper"
        content_top: ".content-top"
        content: "#content-wrapper"
        left sidebar: "#sidebar-left"
        right sidebar: "#sidebar-right"
        footer: "#layout-footer"
    Bex\Behat\ScreenshotExtension:
      screenshot_taking_mode: failed_scenarios
      image_drivers:
        local:
          screenshot_directory: '/home/user/environment/my-site/tests/screenshots'
          clear_screenshot_directory: true
  formatters:
    pretty: ~

And I noticed it only creates screenshots from the failed scenarios if the scenario is annotated as a javascript scenario. It's not possible to create screenshot if it's not annotated like that? And some why on the screenshot I can see only the text without css... But form the browser it works...

@leymannx
Copy link

leymannx commented Dec 20, 2018

Yup, only @javascript for now. See #44 and #45.

@golddragon007
Copy link
Author

Hmmm.. it strange, if I set browser_name: 'selenium2' and I delete goutte: ~ then it makes from the non JS scenarios too.

@leymannx
Copy link

Seems you made Selenium default, no?

@golddragon007
Copy link
Author

Probably yes, I don't know too much from these options.

@tkotosz
Copy link
Collaborator

tkotosz commented Dec 22, 2018

@golddragon007
Your default mink driver is goutte and that driver doesn't support screenshot taking... when you use the @javascript tag then the selenium2 is used which supports screenshot taking therefore you see screenshots.

One possible solution is to set selenium as default driver. See this comment for more detail: #38 (comment)

Also related: #22

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

No branches or pull requests

3 participants