Giter Club home page Giter Club logo

Comments (3)

AlexSkrypnyk avatar AlexSkrypnyk commented on June 9, 2024

@timvol
Where does your headless browser runs: locally or in Docker container?

The DISPLAY variable is usually required by Selenium to run @javascript tests.

https://stackoverflow.com/questions/24653127/selenium-error-no-display-specified

The Docker image used to test this package already has everything setup https://github.com/drevops/behat-screenshot/blob/master/docker-compose.yml#L11 Maybe you can use it as-is.

from behat-screenshot.

timvol avatar timvol commented on June 9, 2024

@AlexSkrypnyk

I'm using geckodriver + Firefox, but I also tested it with chromedriver + Chrome and both are telling me the same message mentioned above. Currently the drivers and the browsers are both inside the container where my Behat test runs.

I'll try to "optimize" it so that I can run them in a separate container (you mentioned above). Maybe it solves the problem. I'll come back when I know more...

from behat-screenshot.

AlexSkrypnyk avatar AlexSkrypnyk commented on June 9, 2024

When this extension is enabled, it tries to start a browser session using one of the existing drivers. That driver would be communicating with the browser to get the session started. It is up to the browser's environment and installation to have all the tools required to be able to run it in a headless mode (like having Xvfb installed etc.).

Also, need to make sure that your Behat configuration uses the correct driver in the configuration.

For example, to test JS screenshots, this extension's own behat.yml uses selenium2 driver. This driver then talks to browser through Selenium.

The driver may actually talk to browser in the headless mode around selenium. You would have to find a suitable driver for this.

See this list of supported drivers https://github.com/FriendsOfBehat/MinkExtension/tree/master/src/Behat/MinkExtension/ServiceContainer/Driver

I'm going to close this issue as it is not related to this extension directly.

from behat-screenshot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.