Question

Whenever I run Sahi, it is using Firefox by default. What I am trying to do is have more control over the browser I use. I have followed instructions from http://mink.behat.org/#sahidriver

and my behat.yml is :

default:
  formatter:
    name: progress
  extensions:
    Behat\Symfony2Extension\Extension:
      mink_driver: true
      kernel:
        env: test
        debug: true
    Behat\MinkExtension\Extension:
      sahi: ~
      goutte: ~
      base_url: 'http://local.referral.com'
      default_session: sahi

My function is:

public function iAmOnHomepage()
    {

        $session = $this->getSession();
        $session->visit($this->locatePath('/'));

        $link = $session->getPage()->findLink('I am a Physician');

       if (null === $link) {
          throw new \LogicException("Home Page Not Loaded:\n");   
       }
    }

How do I specify additional instructions like browser etc? Is that in code or in yml file.

If so how do I do it?

Was it helpful?

Solution

# behat.yml
mink:
    browser_name: chrome

You could set up multiple profiles to run the same scenarios against different browsers.

source: https://github.com/Behat/MinkBundle/issues/15

See available parameters here: https://github.com/Behat/MinkBundle/blob/master/DependencyInjection/Configuration.php#L29

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top