/** * @covers Mage_Selenium_Uimap_Page::getMainButtons */ public function testGetMainButtons() { $fileHelper = new Mage_Selenium_Helper_File($this->_config); $pageContainers = $fileHelper->loadYamlFile(SELENIUM_TESTS_BASEDIR . '\\fixture\\default\\core\\Mage\\UnitTest\\uimap\\frontend\\UnitTests.yml'); $uipage = new Mage_Selenium_Uimap_Page('pageId', $pageContainers['get_main_buttons']); $mainButtons = $uipage->getMainButtons(); $this->assertInstanceOf('Mage_Selenium_Uimap_ElementsCollection', $mainButtons); $pageContainers = array(); $uipage = new Mage_Selenium_Uimap_Page('pageId', $pageContainers); $mainButtons = $uipage->getMainButtons(); $this->assertNull($mainButtons); }
/** * @covers Mage_Selenium_Uimap_Tab::getFieldsetNames */ public function testGetFieldsetNames() { $fileHelper = new Mage_Selenium_Helper_File($this->_config); $dataArray = $fileHelper->loadYamlFile(SELENIUM_TESTS_BASEDIR . '\\fixture\\default\\core\\Mage\\UnitTest\\data\\UimapTests.yml'); $tabContainer = $dataArray['tab']; $instance = new Mage_Selenium_Uimap_Tab('tabId', $tabContainer); $elements = $instance->getFieldsetNames(); $this->assertInternalType('array', $elements); $this->assertContains('first_fieldset', $elements); $this->assertContains('second_fieldset', $elements); $tabContainer = array(); $instance = new Mage_Selenium_Uimap_Tab('tabId', $tabContainer); $elements = $instance->getFieldsetNames(); $this->assertInternalType('array', $elements); $this->assertEmpty($elements); }
/** * @covers Mage_Selenium_Uimap_Fieldset::getFieldsetElements */ public function testGetFieldsetElements() { $fileHelper = new Mage_Selenium_Helper_File($this->_config); $dataArray = $fileHelper->loadYamlFile(SELENIUM_TESTS_BASEDIR . '\\fixture\\default\\core\\Mage\\UnitTest\\data\\UimapTests.yml'); $fieldsetContainer = $dataArray['fieldset']; $instance = new Mage_Selenium_Uimap_Fieldset('fieldsetId', $fieldsetContainer); $elements = $instance->getFieldsetElements(); $this->assertInternalType('array', $elements); $this->assertArrayHasKey('button', $elements); $this->assertArrayHasKey('checkbox', $elements); $this->assertEquals($elements['checkbox']['first_checkbox'], "//div[@class='the-fieldset']//input[@id='the-first-checkbox']"); $fieldsetContainer = array(); $instance = new Mage_Selenium_Uimap_Fieldset('fieldsetId', $fieldsetContainer); $elements = $instance->getFieldsetElements(); $this->assertInternalType('array', $elements); $this->assertEmpty($elements); }
/** * @covers Mage_Selenium_Helper_File::loadYamlFile * @depends test__construct * * @expectedException InvalidArgumentException */ public function testLoadYamlFileException() { $fileHelper = new Mage_Selenium_Helper_File($this->_config); $this->assertFalse($fileHelper->loadYamlFile(SELENIUM_TESTS_BASEDIR . DIRECTORY_SEPARATOR . 'phpunit.xml')); }