How Do I Switch Stores?

There is a simple mechanism for switching in between stores. It is called Magium\Magento\Navigators\Store\Switcher and it extends the InstructionNavigator.


use Magium\Magento\AbstractMagentoTestCase;
use Magium\Magento\Navigators\Store\Switcher;

class StoreSwitcherNavigationTest extends AbstractMagentoTestCase

    public function testStoreSwitcherNavigation()
        $element = $this->webdriver->byXpath('//body');


        // verifies that we've actually switched the page


Note that the method navigateTo() is available, but don’t use it. Use switchTo($store) instead.

Note, also, that you need to use the store code, not the label, for the switch.