/** * @When /^I navigate to "([^"]*)" page$/ * * @param $page */ public function navigateToPage($page) { $testCase = new Mage_Selenium_TestCase(); $testCase->prepareBrowserSession(); // $testCase->loginAdminUser(); $testCase->navigate($page); }
protected function assertPreConditions() { parent::assertPreConditions(); $this->addParameter('id', '0'); }
/** * Retrieves current Page's data from UIMap * * @return Mage_Selenium_Uimap_Page|null */ public function getCurrentLocationUimapPage() { $mca = Mage_Selenium_TestCase::_getMcaFromCurrentUrl($this->_applicationHelper->getBaseUrl(), $this->getLocation()); $page = $this->_uimapHelper->getUimapPageByMca($this->getArea(), $mca, $this->_paramsHelper); if (!$page) { $this->fail('Can\'t find page in area "' . $this->getArea() . '" for mca "' . $mca . '"'); } return $page; }
public function setUp() { parent::setUp(); $this->setUpBeforeEachTest(); self::$_lastXMessageId = $this->_getLatestXMessageId(); }
/** * Removes all added messages * * @param null|string $type */ public function clearMessages($type = null) { if ($type && array_key_exists($type, self::$_messages)) { unset(self::$_messages[$type]); } elseif ($type == null) { self::$_messages = null; } }
/** * Load config for browsers * @return Mage_Selenium_Helper_Config */ protected function _loadConfigBrowsers() { $config = $this->getConfigValue('browsers'); if (array_key_exists(self::DEFAULT_BROWSER, $config)) { if (is_array($config[self::DEFAULT_BROWSER])) { $this->_configBrowsers[self::DEFAULT_BROWSER] = $config[self::DEFAULT_BROWSER]; } else { unset($config[self::DEFAULT_BROWSER]); $this->_configBrowsers = $config; } } else { $this->_configBrowsers = $config; } Mage_Selenium_TestCase::$browsers = $this->_configBrowsers; return $this; }
/** * @covers Mage_Selenium_TestCase::setDefaultScreenshotPath * @covers Mage_Selenium_TestCase::getDefaultScreenshotPath */ public function testSetGetDefaultScreenshotPath() { $inst = new Mage_Selenium_TestCase(); $inst->setDefaultScreenshotPath('d:\\Temp'); $path = $inst->getDefaultScreenshotPath(); $this->assertEquals('d:\\Temp', $path); $this->assertInternalType('string', $path); $inst->setDefaultScreenshotPath('d:\\Temp\\'); $path = $inst->getDefaultScreenshotPath(); $this->assertEquals('d:\\Temp\\', $path); }
/** * @covers Mage_Selenium_TestCase::generate */ public function testGenerateModifierEmail() { $instance = new Mage_Selenium_TestCase(); $this->assertTrue((bool) filter_var($instance->generate('email', 20, 'valid'), FILTER_VALIDATE_EMAIL)); $this->assertFalse((bool) filter_var($instance->generate('email', 20, 'invalid'), FILTER_VALIDATE_EMAIL)); }