diff --git a/dev/tests/functional/bootstrap.php b/dev/tests/functional/bootstrap.php deleted file mode 100644 index eb3d5b7f9a0..00000000000 --- a/dev/tests/functional/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ -=5.4.0", - "phpunit/phpunit": "4.1.0", - "phpunit/phpunit-selenium": ">=1.2", - "netwing/selenium-server-standalone": ">=2.35" - }, - "autoload": { - "psr-4": { - "Magento\\": ["lib/Magento/", "vendor/magento/mtf/Magento/", "testsuites/Magento/"], - "Mage\\": ["generated/Mage/", "tests/app/Mage/"], - "Test\\": "generated/Test/" - } - } -} diff --git a/dev/tests/functional/credentials.xml.dist b/dev/tests/functional/credentials.xml.dist deleted file mode 100644 index a35a21f5662..00000000000 --- a/dev/tests/functional/credentials.xml.dist +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/config.xml b/dev/tests/functional/etc/config.xml deleted file mode 100644 index 9553f8b3463..00000000000 --- a/dev/tests/functional/etc/config.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - testCase - admin - 123123q123123q - - - - 127.0.0.1 - root - 123123q - default - http://127.0.0.1/magento1/ - admin - - - dev/tests/mtf/isolation.php - before - none - none - - - - - ANY - - - - - - - - - diff --git a/dev/tests/functional/etc/config.xsd b/dev/tests/functional/etc/config.xsd deleted file mode 100644 index ffa714d8e47..00000000000 --- a/dev/tests/functional/etc/config.xsd +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/di.xml b/dev/tests/functional/etc/di.xml deleted file mode 100644 index 3850413a8b7..00000000000 --- a/dev/tests/functional/etc/di.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - etc/config.xsd - - - diff --git a/dev/tests/functional/etc/events.xml b/dev/tests/functional/etc/events.xml deleted file mode 100644 index 8c6f8842d61..00000000000 --- a/dev/tests/functional/etc/events.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/etc/events.xsd b/dev/tests/functional/etc/events.xsd deleted file mode 100644 index 3f4bb1fd469..00000000000 --- a/dev/tests/functional/etc/events.xsd +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - - - Observer class must be unique. - - - - - - - - - - - - Preset name must be unique. - - - - - - - - - - - - - - Tag name must be unique. - - - - - - - - - - - - - - - - Observer node with all attached tags for events inside - - - - - - - - - - - - Tag with name to look for - - - - - - diff --git a/dev/tests/functional/isolation.php b/dev/tests/functional/isolation.php deleted file mode 100644 index d3a21560f7a..00000000000 --- a/dev/tests/functional/isolation.php +++ /dev/null @@ -1,19 +0,0 @@ -configuration = $configuration; - $this->remoteDriverFactory = $remoteDriverFactory; - $this->eventManager = $eventManager; - $this->objectManager = $objectManager; - $this->pageLoader = $pageLoader; - - $this->init(); - } - - /** - * Destructor. - * - * @return void - */ - public function __destruct() - { - if ($this->driver->getSessionId()) { - $this->driver->stop(); - } - } - - /** - * Initial web driver. - * - * @return void - */ - protected function init() - { - $this->driver = $this->remoteDriverFactory->create(); - - $this->driver->setBrowserUrl('about:blank'); - $params = $this->configuration->get('server/0/item/selenium'); - $this->driver->setupSpecificBrowser($params); - $this->driver->prepareSession(); - $this->driver->currentWindow()->maximize(); - $this->driver->cookie()->clear(); - $this->driver->refresh(); - } - - /** - * Get native element by locator. - * - * @param Locator $locator - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $context - * @param bool $wait - * @return \PHPUnit_Extensions_Selenium2TestCase_Element - * @throws \Exception - */ - protected function findElement( - Locator $locator, - \PHPUnit_Extensions_Selenium2TestCase_Element $context = null, - $wait = true - ) { - $context = $context === null - ? $this->driver - : $context; - - $criteria = $this->getSearchCriteria($locator); - $this->pageLoader->setDriver($this->driver)->wait(); - if ($wait) { - return $this->waitUntil( - function () use ($context, $criteria) { - $element = $context->element($criteria); - return $element->displayed() ? $element : null; - } - ); - } - - $this->pageLoader->wait(); - - return $context->element($criteria); - } - - /** - * Get native element by Mtf Element. - * - * @param ElementInterface $element - * @param bool $wait - * @return null|\PHPUnit_Extensions_Selenium2TestCase_Element - * @throws \PHPUnit_Extensions_Selenium2TestCase_WebDriverException - */ - protected function getNativeElement(ElementInterface $element, $wait = true) - { - $chainElements = [$element]; - while ($element = $element->getContext()) { - $chainElements[] = $element; - } - - $contextElement = null; - /** @var ElementInterface $context */ - foreach (array_reverse($chainElements) as $chainElement) { - /** @var ElementInterface $chainElement */ - try { - // First call "getElement" with $resultElement equal "null" value - $contextElement = $this->findElement($chainElement->getLocator(), $contextElement, $wait); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - throw new \PHPUnit_Extensions_Selenium2TestCase_WebDriverException( - sprintf( - 'Error occurred on attempt to get element. Message: "%s". Locator: "%s" . Wait: "%s"', - $e->getMessage(), - $chainElement->getAbsoluteSelector(), - $wait - ) - ); - } - } - - return $contextElement; - } - - /** - * Get search criteria. - * - * @param Locator $locator - * @return \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria - */ - public function getSearchCriteria(Locator $locator) - { - $criteria = new \PHPUnit_Extensions_Selenium2TestCase_ElementCriteria($locator['using']); - $criteria->value($locator['value']); - - return $criteria; - } - - /** - * Inject Js Error collector. - * - * @return void - */ - public function injectJsErrorCollector() - { - $this->driver->execute( - [ - 'script' => 'window.onerror = function(msg, url, line) { - var errors = {}; - if (localStorage.getItem("errorsHistory")) { - errors = JSON.parse(localStorage.getItem("errorsHistory")); - } - if (!(window.location.href in errors)) { - errors[window.location.href] = []; - } - errors[window.location.href].push("error: \'" + msg + "\' " + "file: " + url + " " + "line: " + line); - localStorage.setItem("errorsHistory", JSON.stringify(errors)); - }', - 'args' => [] - ] - ); - } - - /** - * Get js errors. - * - * @return string[] - */ - public function getJsErrors() - { - return $this->driver->execute( - [ - 'script' => 'errors = JSON.parse(localStorage.getItem("errorsHistory")); - localStorage.removeItem("errorsHistory"); - return errors;', - 'args' => [] - ] - ); - } - - /** - * Click. - * - * @param ElementInterface $element - * @return void - */ - public function click(ElementInterface $element) - { - $absoluteSelector = $element->getAbsoluteSelector(); - $this->eventManager->dispatchEvent(['click_before'], [__METHOD__, $absoluteSelector]); - - $wrapperElement = $this->getNativeElement($element); - $this->driver->moveto($wrapperElement); - $wrapperElement->click(); - - $this->eventManager->dispatchEvent(['click_after'], [__METHOD__, $absoluteSelector]); - } - - /** - * Double click. - * - * @param ElementInterface $element - * @return void - */ - public function doubleClick(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['double_click_before'], [__METHOD__, $element->getAbsoluteSelector()]); - - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->doubleclick(); - } - - /** - * Right click. - * - * @param ElementInterface $element - * @return void - */ - public function rightClick(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['right_click_before'], [__METHOD__, $element->getAbsoluteSelector()]); - - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->click(\PHPUnit_Extensions_Selenium2TestCase_SessionCommand_Click::RIGHT); - } - - /** - * Check whether element is present in the DOM. - * - * @param ElementInterface $element - * @return bool - */ - public function isPresent(ElementInterface $element) - { - $isPresent = true; - $nativeElement = null; - try { - $this->eventManager->dispatchEvent(['is_present'], [__METHOD__, $element->getAbsoluteSelector()]); - $nativeElement = $this->getNativeElement($element, false); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isPresent = false; - } - return $nativeElement !== null && $isPresent; - } - - /** - * Check whether element is visible. - * - * @param ElementInterface $element - * @return bool - */ - public function isVisible(ElementInterface $element) - { - try { - $this->eventManager->dispatchEvent(['is_visible'], [__METHOD__, $element->getAbsoluteSelector()]); - $visible = $this->getNativeElement($element, false)->displayed(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $visible = false; - } - - return $visible; - } - - /** - * Check whether element is enabled. - * - * @param ElementInterface $element - * @return bool - */ - public function isDisabled(ElementInterface $element) - { - return !$this->getNativeElement($element)->enabled(); - } - - /** - * Check whether element is selected. - * - * @param ElementInterface $element - * @return bool - */ - public function isSelected(ElementInterface $element) - { - return $this->getNativeElement($element)->selected(); - } - - /** - * Set the value. - * - * @param ElementInterface $element - * @param string|array $value - * @return void - */ - public function setValue(ElementInterface $element, $value) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $element->getAbsoluteSelector()]); - - $wrappedElement = $this->getNativeElement($element); - $this->driver->moveto($wrappedElement); - $wrappedElement->clear(); - $this->focus($element); - - $wrappedElement->value($value); - $this->triggerChangeEvent($element); - } - - /** - * Get the value. - * - * @param ElementInterface $element - * @return null|string - */ - public function getValue(ElementInterface $element) - { - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $element->getAbsoluteSelector()]); - return $this->getNativeElement($element)->value(); - } - - /** - * Get content. - * - * @param ElementInterface $element - * @return string - */ - public function getText(ElementInterface $element) - { - return $this->getNativeElement($element)->text(); - } - - /** - * Find element on the page. - * - * @param string $selector - * @param string $strategy - * @param string $type = select|multiselect|checkbox|null OR custom class with full namespace - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - public function find( - $selector, - $strategy = Locator::SELECTOR_CSS, - $type = null, - ElementInterface $context = null - ) { - $locator = new Locator($selector, $strategy); - - $this->eventManager->dispatchEvent(['find'], [__METHOD__, $locator]); - - $className = 'Magento\Mtf\Client\ElementInterface'; - if (null !== $type) { - if (strpos($type, '\\') === false) { - $type = ucfirst(strtolower($type)); - if (class_exists('Magento\Mtf\Client\Element\\' . $type . 'Element')) { - $className = 'Magento\Mtf\Client\Element\\' . $type . 'Element'; - } - } else { - if (!class_exists($type) && !interface_exists($type)) { - throw new \Exception( - sprintf('Requested interface or class "%s" does not exists!', $type) - ); - } - $className = $type; - } - } - - return $this->objectManager->create( - $className, - [ - 'driver' => $this, - 'locator' => $locator, - 'context' => $context - ] - ); - } - - /** - * Drag and drop element to(between) another element(s). - * - * @param ElementInterface $element - * @param ElementInterface $target - * @return void - */ - public function dragAndDrop(ElementInterface $element, ElementInterface $target) - { - $this->driver->moveto($this->getNativeElement($element)); - $this->driver->buttondown(); - - $this->driver->moveto($this->getNativeElement($target)); - $this->driver->buttonup(); - } - - /** - * Hover mouse over an element. - * - * @param ElementInterface $element - * @return void - */ - public function hover(ElementInterface $element) - { - $this->driver->moveto($this->getNativeElement($element)); - } - - /** - * Send a sequence of key strokes to the active element. - * - * @param ElementInterface $element - * @param array $keys - * @return void - */ - public function keys(ElementInterface $element, array $keys) - { - $wrappedElement = $this->getNativeElement($element); - $wrappedElement->clear(); - $this->focus($element); - foreach ($keys as $key) { - $this->driver->keys($key); - } - } - - /** - * Wait until callback isn't null or timeout occurs. - * - * @param callable $callback - * @return mixed - * @throws \Exception - */ - public function waitUntil($callback) - { - return $this->driver->waitUntil($callback); - } - - /** - * Get all elements by locator. - * - * @param ElementInterface $context - * @param string $selector - * @param string $strategy - * @param null|string $type - * @param bool $wait - * @return ElementInterface[] - * @throws \Exception - */ - public function getElements( - ElementInterface $context, - $selector, - $strategy = Locator::SELECTOR_CSS, - $type = null, - $wait = true - ) { - $locator = new Locator($selector, $strategy); - $criteria = $this->getSearchCriteria($locator); - $nativeContext = $this->getNativeElement($context); - $resultElements = []; - if ($wait) { - try { - $nativeElements = $this->waitUntil( - function () use ($nativeContext, $criteria) { - return $nativeContext->elements($criteria); - } - ); - } catch (\Exception $e) { - throw new \Exception( - sprintf( - 'Error occurred during waiting for an elements. Message: "%s". Locator: "%s"', - $e->getMessage(), - $context->getAbsoluteSelector() . ' -> ' . $locator - ) - ); - } - } else { - $nativeElements = $nativeContext->elements($criteria); - } - - foreach ($nativeElements as $key => $element) { - $resultElements[] = $this->find( - $this->getRelativeXpath($element, $nativeContext), - Locator::SELECTOR_XPATH, - $type, - $context - ); - } - - return $resultElements; - } - - /** - * Retrieve relative xpath from context to element. - * - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $element - * @param \PHPUnit_Extensions_Selenium2TestCase_Element $context - * @param string $path - * @param bool $includeLastIndex - * @return null - */ - protected function getRelativeXpath( - \PHPUnit_Extensions_Selenium2TestCase_Element $element, - \PHPUnit_Extensions_Selenium2TestCase_Element $context, - $path = '', - $includeLastIndex = true - ) { - if ($element->equals($context)) { - return '.' . $path; - } - - $parentLocator = new Locator('..', Locator::SELECTOR_XPATH); - $parentElement = $element->element($this->getSearchCriteria($parentLocator)); - - $childrenLocator = new Locator('*', Locator::SELECTOR_XPATH); - - $index = 1; - $tag = $element->name(); - if (!$includeLastIndex) { - return $this->getRelativeXpath($parentElement, $context, '/' . $tag); - } - foreach ($parentElement->elements($this->getSearchCriteria($childrenLocator)) as $child) { - if ($child->equals($element)) { - return $this->getRelativeXpath($parentElement, $context, '/' . $tag . '[' . $index . ']' . $path); - } - if ($child->name() == $tag) { - ++$index; - } - } - return null; - } - - /** - * Get the value of a the given attribute of the element. - * - * @param ElementInterface $element - * @param string $name - * @return string - */ - public function getAttribute(ElementInterface $element, $name) - { - return $this->getNativeElement($element)->attribute($name); - } - - /** - * Open page. - * - * @param string $url - * @return void - */ - public function open($url) - { - $this->eventManager->dispatchEvent(['open_before'], [__METHOD__, $url]); - $this->driver->url($url); - $this->eventManager->dispatchEvent(['open_after'], [__METHOD__, $url]); - } - - /** - * Back to previous page. - * - * @return void - */ - public function back() - { - $this->driver->back(); - $this->eventManager->dispatchEvent(['back'], [__METHOD__]); - } - - /** - * Forward page. - * - * @return void - */ - public function forward() - { - $this->driver->forward(); - $this->eventManager->dispatchEvent(['forward'], [__METHOD__]); - } - - /** - * Refresh page. - * - * @return void - */ - public function refresh() - { - $this->driver->refresh(); - } - - /** - * Reopen browser. - * - * @return void - */ - public function reopen() - { - $this->eventManager->dispatchEvent(['reopen'], [__METHOD__]); - if ($this->driver->getSessionId()) { - $this->driver->stop(); - } - if ($sessionStrategy = $this->configuration->get('server/0/item/selenium/sessionStrategy')) { - $this->driver->setSessionStrategy($sessionStrategy); - } else { - $this->driver->setSessionStrategy('isolated'); - } - $this->init(); - } - - /** - * Change the focus to a frame in the page by locator. - * - * @param Locator|null $locator - * @return void - * @throws \Exception - */ - public function switchToFrame(Locator $locator = null) - { - if ($locator) { - $this->eventManager->dispatchEvent(['switch_to_frame'], [(string)$locator]); - try { - $element = $this->findElement($locator); - } catch (\Exception $e) { - throw new \Exception( - sprintf( - 'Error occurred during switch to frame! Message: "%s". Locator: "%s".', - $e->getMessage(), - $locator - ) - ); - } - } else { - $this->eventManager->dispatchEvent(['switch_to_frame'], ['Switch to main window']); - $element = null; - } - - $this->driver->frame($element); - } - - /** - * Close the current window. - * - * @return void - */ - public function closeWindow() - { - $windowHandles = $this->driver->windowHandles(); - if (count($windowHandles) > 1) { - $this->driver->window(end($windowHandles)); - $this->driver->closeWindow(); - $this->driver->window(reset($windowHandles)); - } else { - $this->driver->closeWindow(); - } - } - - /** - * Select window by its name. - * - * @return void - */ - public function selectWindow() - { - $windowHandles = $this->driver->windowHandles(); - $this->driver->window(end($windowHandles)); - } - - /** - * Get page title text. - * - * @return string - */ - public function getTitle() - { - return $this->driver->title(); - } - - /** - * Press OK on an alert or confirm a dialog. - * - * @return void - */ - public function acceptAlert() - { - //$this->_driver->acceptAlert(); Temporary fix for selenium issue 3544 - $this->waitForOperationSuccess('acceptAlert'); - $this->eventManager->dispatchEvent(['accept_alert_after'], [__METHOD__]); - } - - /** - * Press Cancel on alert or does not confirm a dialog. - * - * @return void - */ - public function dismissAlert() - { - //$this->_driver->dismissAlert(); Temporary fix for selenium issue 3544 - $this->waitForOperationSuccess('dismissAlert'); - $this->eventManager->dispatchEvent(['dismiss_alert_after'], [__METHOD__]); - } - - /** - * @todo Temporary fix for selenium issue 3544 - * https://code.google.com/p/selenium/issues/detail?id=3544 - * - * @param string $operation - */ - protected function waitForOperationSuccess($operation) - { - $driver = $this->driver; - $this->waitUntil( - function () use ($driver, $operation) { - try { - $driver->$operation(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $exception) { - return null; - } - return true; - } - ); - } - - /** - * Get the alert dialog text. - * - * @return string - */ - public function getAlertText() - { - return $this->driver->alertText(); - } - - /** - * Set the text to a prompt popup. - * - * @param string $text - * @return void - */ - public function setAlertText($text) - { - $this->driver->alertText($text); - } - - /** - * Get current page url. - * - * @return string - */ - public function getUrl() - { - try { - if ($this->driver->alertText()) { - return null; - } - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $exception) { - return $this->driver->url(); - } - - return $this->driver->url(); - } - - /** - * Get Html page source. - * - * @return string - */ - public function getHtmlSource() - { - return $this->driver->source(); - } - - /** - * Get binary string of image. - * - * @return string - */ - public function getScreenshotData() - { - return $this->driver->currentScreenshot(); - } - - /** - * Set focus on element. - * - * @param ElementInterface $element - * @return void - */ - public function focus(ElementInterface $element) - { - $elementId = $element->getAttribute('id'); - if ($elementId) { - $js = "if (window.jQuery != undefined) jQuery('[id=\"$elementId\"]').focus(); "; - $js .= "var element = document.getElementById('$elementId'); if (element != undefined) element.focus();"; - $this->driver->execute(['script' => $js, 'args' => []]); - } else { - $element->click(); - } - } - - /** - * Trigger change on event. - * - * @param ElementInterface $element - * @return void - */ - protected function triggerChangeEvent(ElementInterface $element) - { - $elementId = $element->getAttribute('id'); - if ($elementId) { - $js = "if (window.jQuery != undefined)"; - $js .= "{jQuery('[id=\"$elementId\"]').change(); jQuery('[id=\"$elementId\"]').keyup();}"; - $js .= "var element = document.getElementById('$elementId'); if (element != undefined) element.focus();"; - $this->driver->execute(['script' => $js, 'args' => []]); - } - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php deleted file mode 100644 index f4a4b481750..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/ConditionsElement.php +++ /dev/null @@ -1,507 +0,0 @@ - '{', - '\}' => '}', - '\[' => '&lbracket;', - '\]' => '&rbracket;', - '\:' => ':', - ]; - - /** - * Map decode special chars. - * - * @var array - */ - protected $decodeChars = [ - '{' => '{', - '}' => '}', - '&lbracket;' => '[', - '&rbracket;' => ']', - ':' => ':', - ]; - - /** - * Rule param wait locator. - * - * @var string - */ - protected $ruleParamWait = './/*[@class="rule-param-wait"]'; - - /** - * Chooser grid locator. - * - * @var string - */ - protected $chooserGridLocator = 'div[id*=chooser]'; - - /** - * Rule param input selector. - * - * @var string - */ - protected $ruleParamInput = '.element [name^="rule"]'; - - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Set value to conditions. - * - * @param string $value - * @return void - */ - public function setValue($value) - { - $conditions = $this->decodeValue($value); - $context = $this->find($this->mainCondition, Locator::SELECTOR_XPATH); - $this->clear(); - $this->addMultipleCondition($conditions, $context); - } - - /** - * Add condition combination. - * - * @param string $condition - * @param ElementInterface $context - * @return ElementInterface - */ - protected function addConditionsCombination($condition, ElementInterface $context) - { - $condition = $this->parseCondition($condition); - $this->addCondition($condition['type'], $context); - $createdCondition = $context->find($this->created, Locator::SELECTOR_XPATH); - if (!empty($condition['rules'])) { - $this->fillCondition($condition['rules'], $createdCondition); - } - return $createdCondition; - } - - /** - * Add condition. - * - * @param string $type - * @param ElementInterface $context - * @throws \Exception - * @throws \PHPUnit_Extensions_Selenium2TestCase_WebDriverException - */ - protected function addCondition($type, ElementInterface $context) - { - $newCondition = $context->find($this->newCondition, Locator::SELECTOR_XPATH); - $count = 0; - - do { - $newCondition->find($this->addNew, Locator::SELECTOR_XPATH)->click(); - - try { - $newCondition->find($this->typeNew, Locator::SELECTOR_XPATH, 'select')->setValue($type); - $this->getTemplateBlock()->waitLoader(); - $this->waitForCondition(); - $isSetType = true; - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isSetType = false; - $this->exception = $e; - $this->eventManager->dispatchEvent(['exception'], [__METHOD__, $this->getAbsoluteSelector()]); - } - $count++; - } while (!$isSetType && $count < self::TRY_COUNT); - - if (!$isSetType) { - $exception = $this->exception ? $this->exception : (new \Exception("Can not add condition: {$type}")); - throw $exception; - } - } - - /** - * Add conditions. - * - * @param array $conditions - * @param ElementInterface $context - * @return void - */ - protected function addMultipleCondition(array $conditions, ElementInterface $context) - { - foreach ($conditions as $key => $condition) { - $elementContext = is_numeric($key) ? $context : $this->addConditionsCombination($key, $context); - if (is_string($condition)) { - $this->addSingleCondition($condition, $elementContext); - } else { - $this->addMultipleCondition($condition, $elementContext); - } - } - } - - /** - * Add single Condition. - * - * @param string $condition - * @param ElementInterface $context - * @return void - */ - protected function addSingleCondition($condition, ElementInterface $context) - { - $condition = $this->parseCondition($condition); - $this->addCondition($condition['type'], $context); - $createdCondition = $context->find($this->created, Locator::SELECTOR_XPATH); - $this->fillCondition($condition['rules'], $createdCondition); - } - - /** - * Fill single condition. - * - * @param array $rules - * @param ElementInterface $element - * @return void - * @throws \Exception - */ - protected function fillCondition(array $rules, ElementInterface $element) - { - $this->resetKeyParam(); - foreach ($rules as $rule) { - /** @var ElementInterface $param */ - $param = $this->findNextParam($element); - $isSet = false; - $count = 0; - - do { - try { - $openParamLink = $param->find('a'); - if ($openParamLink->isVisible()) { - $openParamLink->click(); - } - if (preg_match('`%(.*?)%`', $rule, $chooserGrid)) { - $chooserConfig = explode('#', $chooserGrid[1]); - $param->find($this->chooserLocator)->click(); - $rule = preg_replace('`%(.*?)%`', '', $rule); - $grid = ObjectManager::getInstance()->create( - str_replace('/', '\\', $chooserConfig[0]), - [ - 'element' => $this->find($this->chooserGridLocator) - ] - ); - $grid->searchAndSelect([$chooserConfig[1] => $rule]); - $isSet = true; - continue; - } - $input = $this->ruleParamInput; - $param->waitUntil( - function () use ($param, $input) { - $element = $param->find($input); - return $element->isVisible() ? true : null; - } - ); - $value = $param->find('select', Locator::SELECTOR_TAG_NAME, 'select'); - if ($value->isVisible()) { - $value->setValue($rule); - $isSet = true; - continue; - } - $value = $param->find('input', Locator::SELECTOR_TAG_NAME); - if ($value->isVisible()) { - $value->setValue($rule); - $apply = $param->find('.//*[@class="rule-param-apply"]', Locator::SELECTOR_XPATH); - if ($apply->isVisible()) { - $apply->click(); - } - $isSet = true; - continue; - } - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - $isSet = false; - $this->exception = $e; - $this->eventManager->dispatchEvent(['exception'], [__METHOD__, $this->getAbsoluteSelector()]); - } - $count++; - } while (!$isSet && $count < self::TRY_COUNT); - - if (!$isSet) { - $exception = $this->exception ? $this->exception : (new \Exception('Can not set value: ' . $rule)); - throw $exception; - } - } - } - - /** - * Decode value. - * - * @param string $value - * @return array - * @throws \Exception - */ - protected function decodeValue($value) - { - $value = str_replace(array_keys($this->encodeChars), $this->encodeChars, $value); - $value = preg_replace('/(\]|})({|\[)/', '$1,$2', $value); - $value = preg_replace('/{([^:]+):/', '{"$1":', $value); - $value = preg_replace('/\[([^\[{])/', '"$1', $value); - $value = preg_replace('/([^\]}])\]/', '$1"', $value); - $value = str_replace(array_keys($this->decodeChars), $this->decodeChars, $value); - - $value = "[{$value}]"; - $value = json_decode($value, true); - if (null === $value) { - throw new \Exception('Bad format value.'); - } - return $value; - } - - /** - * Parse condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - protected function parseCondition($condition) - { - if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) { - throw new \Exception('Bad format condition'); - } - foreach ($match[1] as $key => $value) { - $match[1][$key] = rtrim($value, '|'); - } - - return [ - 'type' => array_shift($match[1]), - 'rules' => array_values($match[1]), - ]; - } - - /** - * Find next param of condition for fill. - * - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function findNextParam(ElementInterface $context) - { - do { - if (!isset($this->mapParams[$this->findKeyParam])) { - throw new \Exception("Empty map of params"); - } - $param = $this->mapParams[$this->findKeyParam]; - $element = $context->find(sprintf($this->param, strlen($param), $param), Locator::SELECTOR_XPATH); - $this->findKeyParam += 1; - } while (!$element->isVisible()); - - return $element; - } - - /** - * Reset key of last find param. - * - * @return void - */ - protected function resetKeyParam() - { - $this->findKeyParam = 0; - } - - /** - * Param wait loader. - * - * @return void - */ - protected function waitForCondition() - { - $browser = $this; - $selector = $this->created; - $this->waitUntil( - function () use ($browser, $selector) { - if (!$browser->find($selector, Locator::SELECTOR_XPATH)->isVisible()) { - return null; - } - return true; - } - ); - } - - /** - * Clear conditions. - * - * @return void - */ - protected function clear() - { - $remote = $this->find($this->remove, Locator::SELECTOR_XPATH); - while ($remote->isVisible()) { - $remote->click(); - $remote = $this->find($this->remove, Locator::SELECTOR_XPATH); - } - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return ObjectManager::getInstance()->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->driver->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get value from conditions. - * - * @return null - */ - public function getValue() - { - return null; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php deleted file mode 100644 index 0aa56c08882..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectgrouplistElement.php +++ /dev/null @@ -1,320 +0,0 @@ -deselectAll(); - $values = is_array($values) ? $values : [$values]; - foreach ($values as $value) { - $this->selectOption($value); - } - } - - /** - * Select option. - * - * @param string $option - * @return void - * @throws \Exception - */ - protected function selectOption($option) - { - $isOptgroup = false; - $optgroupIndent = ''; - $values = explode('/', $option); - $context = $this; - - foreach ($values as $value) { - $optionIndent = $isOptgroup ? $this->indent : ''; - $optionElement = $context->find(sprintf($this->option, $optionIndent . $value), Locator::SELECTOR_XPATH); - if ($optionElement->isVisible()) { - if (!$optionElement->isSelected()) { - $optionElement->click(); - } - return; - } - - $value = $optgroupIndent . $value; - $optgroupIndent .= $this->indent; - if ($isOptgroup) { - $context = $this->getChildOptgroup($value, $context); - } else { - $context = $this->getOptgroup($value, $context); - $isOptgroup = true; - } - } - throw new \Exception("Can't find option \"{$option}\"."); - } - - /** - * Get optgroup. - * - * @param string $value - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function getOptgroup($value, ElementInterface $context) - { - $optgroup = $context->find(sprintf($this->optgroupByLabel, $value), Locator::SELECTOR_XPATH); - if (!$optgroup->isVisible()) { - throw new \Exception("Can't find group \"{$value}\"."); - } - - return $optgroup; - } - - /** - * Get child optgroup. - * - * @param string $value - * @param ElementInterface $context - * @return ElementInterface - * @throws \Exception - */ - protected function getChildOptgroup($value, ElementInterface $context) - { - $childOptgroup = null; - $count = 1; - while (!$childOptgroup) { - $optgroup = $context->find(sprintf($this->nextOptgroup, $count), Locator::SELECTOR_XPATH); - if (!$optgroup->isVisible()) { - throw new \Exception("Can't find child group \"{$value}\""); - } - - $childOptgroup = $context->find( - sprintf($this->childOptgroup, $count, $value), - Locator::SELECTOR_XPATH - ); - if (!$childOptgroup->isVisible()) { - $childOptgroup = null; - } - ++$count; - } - - return $childOptgroup; - } - - /** - * Get value. - * - * @return array - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function getValue() - { - $values = []; - $indentOption = str_repeat(' ', self::INDENT_LENGTH); - - foreach ($this->getSelectedOptions() as $option) { - $value = []; - - /** @var ElementInterface $option */ - $optionText = $option->getText(); - $optionValue = trim($optionText, $this->trim); - $value[] = $optionValue; - if (0 !== strpos($optionText, $indentOption)) { - $values[] = implode('/', $value); - continue; - } - - $pathOptgroup = sprintf($this->parentOptgroup, $this->indent . $optionValue); - $optgroup = $this->find($pathOptgroup, Locator::SELECTOR_XPATH); - $optgroupText = $optgroup->getAttribute('label'); - $optgroupValue = trim($optgroupText, $this->trim); - $amountIndent = strlen($optgroupText) - strlen($optgroupValue); - $amountIndent = $amountIndent ? ($amountIndent / strlen($this->indent)) : 0; - $value[] = $optgroupValue; - if (0 == $amountIndent) { - $values[] = implode('/', $value); - continue; - } - - --$amountIndent; - $indent = $amountIndent ? str_repeat($this->indent, $amountIndent) : ''; - $pathOptgroup .= sprintf($this->precedingOptgroup, $amountIndent * self::INDENT_LENGTH, $indent); - while (0 <= $amountIndent && $this->find($pathOptgroup, Locator::SELECTOR_XPATH)->isVisible()) { - $optgroup = $this->find($pathOptgroup, Locator::SELECTOR_XPATH); - $optgroupText = $optgroup->getAttribute('label'); - $optgroupValue = trim($optgroupText, $this->trim); - $value[] = $optgroupValue; - - --$amountIndent; - $indent = (0 < $amountIndent) ? str_repeat($this->indent, $amountIndent) : ''; - $pathOptgroup .= sprintf($this->precedingOptgroup, $amountIndent * self::INDENT_LENGTH, $indent); - } - - $values[] = implode('/', array_reverse($value)); - } - - return $values; - } - - /** - * Get options. - * - * @return ElementInterface[] - */ - protected function getOptions() - { - $options = []; - - $countOption = 1; - $option = $this->find(sprintf($this->optionByNumber, $countOption), Locator::SELECTOR_XPATH); - while ($option->isVisible()) { - $options[] = $option; - ++$countOption; - $option = $this->find(sprintf($this->optionByNumber, $countOption), Locator::SELECTOR_XPATH); - } - - $countOptgroup = 1; - $optgroup = $this->find(sprintf($this->optgroupByNumber, $countOptgroup), Locator::SELECTOR_XPATH); - while ($optgroup->isVisible()) { - $countOption = 1; - $option = $this->find( - sprintf($this->childOptionByNumber, $countOptgroup, $countOption), - Locator::SELECTOR_XPATH - ); - while ($option->isVisible()) { - $options[] = $option; - ++$countOption; - $option = $this->find( - sprintf($this->childOptionByNumber, $countOptgroup, $countOption), - Locator::SELECTOR_XPATH - ); - } - - ++$countOptgroup; - $optgroup = $this->find(sprintf($this->optgroupByNumber, $countOptgroup), Locator::SELECTOR_XPATH); - } - - return $options; - } - - /** - * Get selected options. - * - * @return array - */ - protected function getSelectedOptions() - { - $options = []; - foreach ($this->getOptions() as $option) { - if ($option->isSelected()) { - $options[] = $option; - } - } - - return $options; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php deleted file mode 100644 index 37a6df2239b..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/MultiselectlistElement.php +++ /dev/null @@ -1,62 +0,0 @@ -getElements($this->optionElement); - - foreach ($options as $option) { - /** @var \Magento\Mtf\Client\ElementInterface $option */ - $optionsValue[] = $option->getText(); - } - - return $optionsValue; - } - - /** - * Check whether value is visible in the list. - * - * @param string $value - * @return bool - */ - public function isValueVisible($value) - { - $option = $this->find(sprintf($this->optionByValue, $this->escapeQuotes($value)), Locator::SELECTOR_XPATH); - return $option->isVisible(); - } - -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php deleted file mode 100644 index 99cd8dae76a..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/OptgroupselectElement.php +++ /dev/null @@ -1,98 +0,0 @@ -eventManager->dispatchEvent(['get_value'], [(string)$this->getAbsoluteSelector()]); - - $selectedLabel = ''; - $labels = $this->getElements($this->optionByIndex, Locator::SELECTOR_XPATH); - foreach ($labels as $label) { - if ($label->isSelected()) { - $selectedLabel = $label->getText(); - break; - } - } - if ($selectedLabel == '') { - throw new \Exception('Selected value has not been found in optgroup select.'); - } - - $element = $this->find(sprintf($this->optGroup, $selectedLabel), Locator::SELECTOR_XPATH); - $value = trim($element->getAttribute('label'), chr(0xC2) . chr(0xA0)); - $value .= '/' . $selectedLabel; - - return $value; - } - - /** - * Select value in dropdown which has option groups. - * - * @param string $value - * @return void - */ - public function setValue($value) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - list($group, $option) = explode('/', $value); - $xpath = (($option != 'Time') - ? (sprintf($this->optionGroupValue, $group, $option)) - : (sprintf($this->optionGroupExactValue, $group, $option))); - $option = $this->find($xpath, Locator::SELECTOR_XPATH); - $option->click(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php deleted file mode 100644 index 022ce0a94aa..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SelectstoreElement.php +++ /dev/null @@ -1,81 +0,0 @@ -find(sprintf($this->website, $selectedLabel), Locator::SELECTOR_XPATH); - $value = trim($element->getAttribute('label')); - $element = $this->find(sprintf($this->storeGroup, $selectedLabel), Locator::SELECTOR_XPATH); - $value .= '/' . trim($element->getAttribute('label'), chr(0xC2) . chr(0xA0)); - $value .= '/' . $selectedLabel; - return $value; - } - - /** - * Select value in dropdown which has option groups. - * - * @param string $value - * @throws \Exception - * @return void - */ - public function setValue($value) - { - $pieces = explode('/', $value); - - if (1 == count($pieces)) { - $optionLocator = './/option[contains(text(),"' . $pieces[0] . '")]'; - } else { - $optionLocator = './/optgroup[contains(@label,"' - . $pieces[0] . '")]/following-sibling::optgroup[contains(@label,"' - . $pieces[1] . '")]/option[contains(text(), "' - . $pieces[2] . '")]'; - } - - $option = $this->context->find($optionLocator, Locator::SELECTOR_XPATH); - if (!$option->isVisible()) { - throw new \Exception('[' . implode('/', $pieces) . '] option is not visible in store switcher.'); - } - $option->click(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php deleted file mode 100644 index ca99c07df58..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/SimpleElement.php +++ /dev/null @@ -1,297 +0,0 @@ -driver = $driver; - $this->eventManager = $eventManager; - $this->locator = $locator; - $this->context = $context; - } - - /** - * Drag and drop element to(between) another element(s) - * - * @param ElementInterface $target - * @return void - */ - public function dragAndDrop(ElementInterface $target) - { - $this->driver->dragAndDrop($this, $target); - } - - /** - * Check whether element is visible - * - * @return bool - */ - public function isVisible() - { - return $this->driver->isVisible($this); - } - - /** - * Get content - * - * @return string - */ - public function getText() - { - return $this->driver->getText($this); - } - - /** - * Find element by locator in context of current element - * - * @param string $selector - * @param string $strategy [optional] - * @param null|string $type [optional] - * @return ElementInterface - */ - public function find($selector, $strategy = Locator::SELECTOR_CSS, $type = null) - { - return $this->driver->find($selector, $strategy, $type, $this); - } - - /** - * Get all elements by locator - * - * @param string $selector - * @param string $strategy - * @param null|string $type - * @return ElementInterface[] - */ - public function getElements($selector, $strategy = Locator::SELECTOR_CSS, $type = null) - { - return $this->driver->getElements($this, $selector, $strategy, $type); - } - - /** - * Wait until callback isn't null or timeout occurs - * - * @param callable $callback - * @return mixed - */ - public function waitUntil($callback) - { - return $this->driver->waitUntil($callback); - } - - /** - * Click - * - * @return void - */ - public function click() - { - $this->driver->click($this); - } - - /** - * Send keys - * - * @param array $keys - * @return void - */ - public function keys(array $keys) - { - $this->driver->keys($this, $keys); - } - - /** - * Check whether element is enabled - * - * @return bool - */ - public function isDisabled() - { - return $this->driver->isDisabled($this); - } - - /** - * Check whether element is present in the DOM. - * - * @return bool - */ - public function isPresent() - { - return $this->driver->isPresent($this); - } - - /** - * Check whether element is selected - * - * @return bool - */ - public function isSelected() - { - return $this->driver->isSelected($this); - } - - /** - * Set the value - * - * @param string|array $value - * @return void - */ - public function setValue($value) - { - $this->driver->setValue($this, $value); - } - - /** - * Get the value - * - * @return string|array - */ - public function getValue() - { - return $this->driver->getValue($this); - } - - /** - * Get the value of a the given attribute of the element - * - * @param string $name - * @return string - */ - public function getAttribute($name) - { - return $this->driver->getAttribute($this, $name); - } - - /** - * Double click - * - * @return void - */ - public function doubleClick() - { - $this->driver->doubleClick($this); - } - - /** - * Right click - * - * @return void - */ - public function rightClick() - { - $this->driver->rightClick($this); - } - - /** - * Get absolute selector (for DBG) - * - * @return string - */ - public function getAbsoluteSelector() - { - $selectors = []; - $selectors[] = $this->getLocator(); - $element = $this; - while($element = $element->getContext()) { - $selectors[] = $element->getLocator(); - } - - return implode(' -> ', array_reverse($selectors)); - } - - /** - * Get element locator - * - * @return Locator - */ - public function getLocator() - { - return $this->locator; - } - - /** - * Get context element - * - * @return ElementInterface|null - */ - public function getContext() - { - return $this->context; - } - - /** - * Hover mouse over an element. - * - * @return void - */ - public function hover() - { - $this->driver->hover($this); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php deleted file mode 100644 index 9fdbcbeb456..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/TreeElement.php +++ /dev/null @@ -1,245 +0,0 @@ -getElements($this->selectedCheckboxes, Locator::SELECTOR_XPATH, 'checkbox'); - foreach ($checkboxes as $checkbox) { - $checkbox->setValue('No'); - } - } - - /** - * Get the value. - * - * @return array - */ - public function getValue() - { - $this->eventManager->dispatchEvent(['get_value'], [(string)$this->getAbsoluteSelector()]); - $checkboxes = $this->getElements($this->selectedLabels, Locator::SELECTOR_XPATH); - $values = []; - foreach ($checkboxes as $checkbox) { - $fullPath = $this->getFullPath($checkbox); - $values[] = implode('/', array_reverse($fullPath)); - } - - return $values; - } - - /** - * Get full path for element. - * - * @param ElementInterface $element - * @return string[] - */ - protected function getFullPath(ElementInterface $element) - { - $fullPath[] = $this->getElementLabel($element); - $parentElement = $element->find($this->parentElement, Locator::SELECTOR_XPATH); - if ($parentElement->isVisible()) { - $fullPath = array_merge($fullPath, $this->getFullPath($parentElement)); - } - - return $fullPath; - } - - /** - * Get element label. - * - * @param ElementInterface $element - * @return string - */ - protected function getElementLabel(ElementInterface $element) - { - $value = $element->getText(); - preg_match('`(.+) \(.*`', $value, $matches); - - return $matches[1]; - } - - /** - * Click a tree element by its path (Node names) in tree. - * - * @param string $path - * @return void - */ - public function setValue($path) - { - $this->eventManager->dispatchEvent(['set_value'], [(string)$this->getAbsoluteSelector()]); - $this->clear(); - $elementSelector = $this->prepareElementSelector($path); - $elements = $this->getElements($elementSelector . $this->input, Locator::SELECTOR_XPATH); - foreach ($elements as $element) { - $element->click(); - } - } - - /** - * Prepare element selector. - * - * @param string $path - * @return string - */ - protected function prepareElementSelector($path) - { - $pathArray = explode('/', $path); - $elementSelector = ''; - foreach ($pathArray as $itemElement) { - $this->displayChildren($itemElement); - $elementSelector .= sprintf($this->pattern, $itemElement); - } - - return $elementSelector; - } - - /** - * Check visible element. - * - * @param string $path - * @return bool - */ - public function isElementVisible($path) - { - $elementSelector = $this->prepareElementSelector($path); - return $this->find($elementSelector, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Display children. - * - * @param $element - * @return void - */ - protected function displayChildren($element) - { - $element = $this->find(sprintf($this->pattern, $element), Locator::SELECTOR_XPATH); - $plusButton = $element->find($this->imagePlus, Locator::SELECTOR_XPATH); - if ($plusButton->isVisible()) { - $plusButton->click(); - $this->waitLoadChildren($element); - } - } - - /** - * Waiter for load children. - * - * @param ElementInterface $element - * @return void - */ - protected function waitLoadChildren(ElementInterface $element) - { - $selector = $this->childLoader; - $this->waitUntil( - function () use ($element, $selector) { - return $element->find($selector)->isVisible() ? true : null; - } - ); - } - - /** - * keys method is not accessible in this class. - * Throws exception if used. - * - * @param array $keys - * @throws \BadMethodCallException - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function keys(array $keys) - { - throw new \BadMethodCallException('Not applicable for this class of elements (TreeElement)'); - } - - /** - * Drag'n'drop method is not accessible in this class. - * Throws exception if used. - * - * @param ElementInterface $target - * @throws \BadMethodCallException - * @return void - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function dragAndDrop(ElementInterface $target) - { - throw new \BadMethodCallException('Not applicable for this class of elements (TreeElement)'); - } - -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php b/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php deleted file mode 100644 index 795c431cfea..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Constraint/AbstractAssertForm.php +++ /dev/null @@ -1,257 +0,0 @@ - $value) { - if (in_array($key, $this->skippedFields)) { - continue; - } - $formValue = isset($formData[$key]) ? $formData[$key] : null; - if (is_numeric($formValue)) { - $formValue = floatval($formValue); - } - - if (null === $formValue) { - $errors[] = '- field "' . $key . '" is absent in form'; - } elseif (is_array($value) && is_array($formValue)) { - $valueErrors = $this->verifyData($value, $formValue, $isStrict, $isPrepareError); - if (!empty($valueErrors)) { - $errors[$key] = $valueErrors; - } - } elseif ($value != $formValue) { - if (is_array($value)) { - $value = $this->arrayToString($value); - } - if (is_array($formValue)) { - $formValue = $this->arrayToString($formValue); - } - $errors[] = sprintf('- %s: "%s" instead of "%s"', $key, $formValue, $value); - } - } - - if ($isStrict) { - $diffData = array_diff(array_keys($formData), array_keys($fixtureData)); - if ($diffData) { - $errors[] = '- fields ' . implode(', ', $diffData) . ' is absent in fixture'; - } - } - - if ($isPrepareError) { - return $this->prepareErrors($errors); - } - return $errors; - } - - /** - * Sort array by value. - * - * @param array $data - * @return array - */ - protected function sortData(array $data) - { - $scalarValues = []; - $arrayValues = []; - - foreach ($data as $key => $value) { - if (is_array($value)) { - $arrayValues[$key] = $this->sortData($value); - } else { - $scalarValues[$key] = $value; - } - } - asort($scalarValues); - foreach (array_keys($arrayValues) as $key) { - if (!is_numeric($key)) { - ksort($arrayValues); - break; - } - } - - return $scalarValues + $arrayValues; - } - - /** - * Sort multidimensional array by paths. - * Pattern path: key/subKey::sorkKey. - * Exapmle: - * $data = [ - * 'custom_options' => [ - * 'options' => [ - * 0 => [ - * 'title' => 'title_2', - * ], - * 1 => [ - * 'title' => 'title_1' - * ] - * ] - * ] - * ]; - * $paths = ['custom_options/options::title']; - * - * Result: - * $data = [ - * 'custom_options' => [ - * 'options' => [ - * title_1 => [ - * 'title' => 'title_1', - * ], - * title_2 => [ - * 'title' => 'title_2' - * ] - * ] - * ] - * ]; - * - * @param array $data - * @param string $path - * @return array - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function sortDataByPath(array $data, $path) - { - $steps = explode('/', $path); - $key = array_shift($steps); - $order = null; - $nextPath = empty($steps) ? null : implode('/', $steps); - - if (false !== strpos($key, '::')) { - list($key, $order) = explode('::', $key); - } - if ($key && !isset($data[$key])) { - return $data; - } - - if ($key) { - $data[$key] = $order ? $this->sortMultidimensionalArray($data[$key], $order) : $data[$key]; - $data[$key] = $nextPath ? $this->sortDataByPath($data[$key], $nextPath) : $data[$key]; - } else { - $data = $this->sortMultidimensionalArray($data, $order); - $data = $nextPath ? $this->sortDataByPath($data, $nextPath) : $data; - } - - return $data; - } - - /** - * Sort multidimensional array by key. - * - * @param array $data - * @param string $orderKey - * @return array - */ - protected function sortMultidimensionalArray(array $data, $orderKey) - { - $result = []; - foreach ($data as $key => $value) { - if (isset($value[$orderKey])) { - $orderValue = is_numeric($value[$orderKey]) ? floatval($value[$orderKey]) : $value[$orderKey]; - $result[$orderValue] = $value; - } else { - $result[$key] = $value; - } - } - - ksort($result); - return $result; - } - - /** - * Convert array to string. - * - * @param array $array - * @return string - */ - protected function arrayToString(array $array) - { - $result = []; - foreach ($array as $key => $value) { - $value = is_array($value) ? $this->arrayToString($value) : $value; - $result[] = "{$key} => {$value}"; - } - - return '[' . implode(', ', $result) . ']'; - } - - /** - * Prepare errors to string. - * - * @param array $errors - * @param string|null $notice - * @param string $indent [optional] - * @return string - */ - protected function prepareErrors(array $errors, $notice = null, $indent = '') - { - if (empty($errors)) { - return ''; - } - - $result = []; - foreach ($errors as $key => $error) { - $result[] = is_array($error) - ? $this->prepareErrors($error, "{$indent}{$key}:\n", $indent . "\t") - : ($indent . $error); - } - - if (null === $notice) { - $notice = $this->notice; - } - return $notice . implode("\n", $result); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php b/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php deleted file mode 100644 index 17a86951ac2..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Page/BackendPage.php +++ /dev/null @@ -1,95 +0,0 @@ -url = $_ENV['app_backend_url'] . static::MCA; - } - - /** - * Open backend page and log in if needed. - * - * @param array $params - * @return $this - */ - public function open(array $params = []) - { - $systemConfig = ObjectManager::getInstance()->create('Magento\Mtf\Config\DataInterface'); - $admin = [ - 'username' => [ - 'value' => $systemConfig->get('application/0/backendLogin/0/value') - ], - 'password' => [ - 'value' => $systemConfig->get('application/0/backendPassword/0/value') - ] - ]; - $this->adminAuthLogin = ObjectManager::getInstance()->create('Mage\Adminhtml\Test\Page\AdminAuthLogin'); - $this->dashboard = ObjectManager::getInstance()->create('Mage\Adminhtml\Test\Page\Adminhtml\Dashboard'); - - if (!$this->dashboard->getAdminPanelHeader()->isVisible()) { - $this->loginSuperAdmin($admin); - } - return parent::open($params); - } - - /** - * Log in on backend for super admin. - * - * @param array $admin - * @return void - */ - protected function loginSuperAdmin(array $admin) - { - $this->adminAuthLogin->open(); - $loginBlock = $this->adminAuthLogin->getLoginBlock(); - if ($loginBlock->isVisible()) { - $loginBlock->loginToAdminPanel($admin); - } - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php deleted file mode 100644 index 749d261936d..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Fixture/FieldsProvider.php +++ /dev/null @@ -1,187 +0,0 @@ -initMage(); - } - - /** - * Collect fields for the entity based on its type. - * - * @param array $fixture - * @return array - */ - public function getFields(array $fixture) - { - $method = $fixture['type'] . 'CollectFields'; - if (!method_exists($this, $method)) { - return []; - } - - return $this->$method($fixture); - } - - /** - * Collect fields for the entity with eav type. - * - * @param array $fixture - * @return array - */ - protected function eavCollectFields(array $fixture) - { - $entity = $fixture['entity_type']; - $collection = \Mage::getSingleton('eav/config')->getEntityType($entity)->getAttributeCollection(); - $attributes = []; - foreach ($collection as $attribute) { - if (isset($fixture['product_type'])) { - $applyTo = $attribute->getApplyTo(); - if (!empty($applyTo) && !in_array($fixture['product_type'], $applyTo)) { - continue; - } - } - - /** @var \Mage_Eav_Model_Attribute $attribute */ - $code = $attribute->getAttributeCode(); - $attributes[$code] = array( - 'attribute_code' => $code, - 'backend_type' => $attribute->getBackendType(), - 'is_required' => $attribute->getIsRequired(), - 'default_value' => $attribute->getDefaultValue(), - 'input' => $attribute->getFrontendInput() - ); - } - - return $attributes; - } - - /** - * Collect fields for the entity with table type. - * - * @param array $fixture - * @return array - */ - protected function tableCollectFields(array $fixture) - { - return $this->flatCollectFields($fixture); - } - - /** - * Collect fields for the entity with flat type. - * - * @param array $fixture - * @return array - */ - protected function flatCollectFields(array $fixture) - { - $entityType = $fixture['entity_type']; - $fields = $this->getConnection()->describeTable($this->retrieveTableName($entityType)); - - $attributes = []; - foreach ($fields as $code => $field) { - $attributes[$code] = array( - 'attribute_code' => $code, - 'backend_type' => $field['DATA_TYPE'], - 'is_required' => ($field['PRIMARY'] || $field['IDENTITY']), - 'default_value' => $field['DEFAULT'], - 'input' => '' - ); - } - - return $attributes; - } - - /** - * Collect fields for the entity with composite type. - * - * @param array $fixture - * @return array - */ - protected function compositeCollectFields(array $fixture) - { - $entityTypes = $fixture['entities']; - - $connection = $this->getConnection(); - $fields = []; - foreach ($entityTypes as $entityType) { - $fields = array_merge($fields, $connection->describeTable($this->retrieveTableName($entityType))); - } - - $attributes = []; - foreach ($fields as $code => $field) { - $attributes[$code] = [ - 'attribute_code' => $code, - 'backend_type' => $field['DATA_TYPE'], - 'is_required' => ($field['PRIMARY'] || $field['IDENTITY']), - 'default_value' => $field['DEFAULT'], - 'input' => '' - ]; - } - - return $attributes; - } - - /** - * Mage init. - * - * @return void - */ - protected function initMage() - { - require_once realpath(__DIR__ . "/../../../../../../../../../app/Mage.php"); - \Mage::app('default'); - } - - /** - * Get DB connection. - * - * @return \Magento_Db_Adapter_Pdo_Mysql - */ - protected function getConnection() - { - return \Mage::getSingleton('core/resource')->getConnection('core_write'); - } - - /** - * Get DB table name with prefix. - * - * @param string $entity - * @return string - */ - protected function retrieveTableName($entity) - { - return \Mage::getSingleton('core/resource')->getTableName($entity); - } - - /** - * Check connection to DB. - * - * @return bool - */ - public function checkConnection() - { - return $this->getConnection(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php b/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php deleted file mode 100644 index 80da947321d..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Generate/Page.php +++ /dev/null @@ -1,193 +0,0 @@ -cnt = 0; - - foreach ($this->configData->get('page') as $name => $data) { - $this->generateClass($name, $data); - } - - \Magento\Mtf\Util\Generate\GenerateResult::addResult('Page Classes', $this->cnt); - } - - /** - * Generate single page class. - * - * @param string $className - * @return string|bool - * @throws \InvalidArgumentException - */ - public function generate($className) - { - $classNameParts = explode('\\', $className); - $classDataKey = 'page/' . end($classNameParts); - - if (!$this->configData->get($classDataKey)) { - throw new \InvalidArgumentException('Invalid class name: ' . $className); - } - - return $this->generateClass( - end($classNameParts), - $this->configData->get($classDataKey) - ); - } - - /** - * Generate page class from XML source. - * - * @param string $name - * @param array $data - * @return string|bool - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function generateClass($name, array $data) - { - $className = ucfirst($name); - $module = str_replace('_', '/', $data['module']); - $area = empty($data['area']) ? null : $data['area']; - $folderPath = $module . '/Test/Page' . (($area === null) ? '' : ('/' . $area)); - $realFolderPath = MTF_BP . '/generated/' . $folderPath; - $namespace = str_replace('/', '\\', $folderPath); - $mca = isset($data['mca']) ? $data['mca'] : ''; - $areaMtfPage = $this->getParentPage($folderPath, $mca, $area); - $blocks = isset($data['block']) ? $data['block'] : []; - - $content = "getFilePhpDoc(); - $content .= "namespace {$namespace};\n\n"; - $content .= "use Magento\\Mtf\\Page\\{$areaMtfPage};\n\n"; - $content .= "/**\n"; - $content .= " * Class {$className}\n"; - $content .= " */\n"; - $content .= "class {$className} extends {$areaMtfPage}\n"; - $content .= "{\n"; - $content .= " const MCA = '{$mca}';\n\n"; - - $content .= " /**\n"; - $content .= " * Blocks' config\n"; - $content .= " *\n"; - $content .= " * @var array\n"; - $content .= " */\n"; - $content .= " protected \$blocks = [\n"; - foreach ($blocks as $blockName => $block) { - $content .= $this->generatePageClassBlock($blockName, $block, ' '); - } - $content .= " ];\n"; - - foreach ($blocks as $blockName => $block) { - $content .= "\n /**\n"; - $content .= " * @return \\{$block['class']}\n"; - $content .= " */\n"; - $content .= ' public function get' . ucfirst($blockName) . '()' . "\n"; - $content .= " {\n"; - $content .= " return \$this->getBlockInstance('{$blockName}');\n"; - $content .= " }\n"; - } - - $content .= "}\n"; - - $newFilename = $className . '.php'; - - if (file_exists($realFolderPath . '/' . $newFilename)) { - unlink($realFolderPath . '/' . $newFilename); - } - - if (!is_dir($realFolderPath)) { - mkdir($realFolderPath, 0777, true); - } - - $result = @file_put_contents($realFolderPath . '/' . $newFilename, $content); - - if ($result === false) { - $error = error_get_last(); - $this->addError(sprintf('Unable to generate %s class. Error: %s', $className, $error['message'])); - return false; - } - - $this->cnt++; - - return $realFolderPath . '/' . $newFilename; - } - - /** - * Generate block for page class. - * - * @param string $blockName - * @param array $params - * @param string $indent - * @return string - */ - protected function generatePageClassBlock($blockName, array $params, $indent = '') - { - $content = $indent . "'{$blockName}' => [\n"; - foreach ($params as $key => $value) { - if (is_array($value)) { - $content .= $this->generatePageClassBlock($key, $value, $indent . ' '); - } else { - $escaped = str_replace('\'', '"', $value); - $content .= $indent . " '{$key}' => '{$escaped}',\n"; - } - } - $content .= $indent . "],\n"; - - return $content; - } - - /** - * Determine parent page class. - * - * @param string $folderPath - * @param string $mca - * @param string|null $area - * @return string - */ - protected function getParentPage($folderPath, $mca, $area) - { - if (str_contains($folderPath, 'Adminhtml') && $area === 'Adminhtml') { - $areaMtfPage = 'BackendPage'; - } else { - if (!str_contains($mca, 'http')) { - $areaMtfPage = 'FrontendPage'; - } else { - $areaMtfPage = 'ExternalPage'; - } - } - - return $areaMtfPage; - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php deleted file mode 100644 index 30a466dfdc8..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php +++ /dev/null @@ -1,176 +0,0 @@ -transport = $transport; - $this->configuration = $configuration; - $this->authorize(); - } - - /** - * Authorize customer on backend. - * - * @throws \Exception - * @return void - */ - protected function authorize() - { - // Perform GET to backend url so form_key is set - $url = $_ENV['app_backend_url']; - $this->transport->write($url, [], CurlInterface::GET); - $this->read(); - - $data = [ - 'login[username]' => $this->configuration->get('application/0/backendLogin/0/value'), - 'login[password]' => $this->configuration->get('application/0/backendPassword/0/value'), - 'form_key' => $this->formKey, - ]; - $this->transport->write($url, $data, CurlInterface::POST, []); - $response = $this->read(); - - if (!strpos($response, 'link-logout')) { - throw new \Exception( - "Admin user cannot be logged in by curl handler!" - ); - } - } - - /** - * Init Form Key from response. - * - * @return void - */ - protected function initFormKey() - { - preg_match('!var FORM_KEY = \'(\w+)\';!', $this->response, $matches); - - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } else { - preg_match('!input name="form_key" type="hidden" value="(\w+)"!', $this->response, $matches); - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } - } - } - - /** - * Send request to the remote server. - * - * @param string $url - * @param mixed $params - * @param string $method - * @param mixed $headers - * @return void - * @throws \Exception - */ - public function write($url, $params = [], $method = CurlInterface::POST, $headers = []) - { - if ($this->formKey) { - $params['form_key'] = $this->formKey; - } else { - throw new \Exception(sprintf('Form key is absent! Url: "%s" Response: "%s"', $url, $this->response)); - } - $this->transport->write($url, http_build_query($params), $method, $headers); - } - - /** - * Read response from server. - * - * @return string - */ - public function read() - { - $this->response = $this->transport->read(); - $this->initFormKey(); - return $this->response; - } - - /** - * Add additional option to cURL. - * - * @param int $option the CURLOPT_* constants - * @param mixed $value - * @return void - */ - public function addOption($option, $value) - { - $this->transport->addOption($option, $value); - } - - /** - * Close the connection to the server. - * - * @return void - */ - public function close() - { - $this->transport->close(); - } -} diff --git a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php b/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php deleted file mode 100644 index 0b4470f8729..00000000000 --- a/dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/FrontendDecorator.php +++ /dev/null @@ -1,169 +0,0 @@ -transport = $transport; - $this->authorize($customer); - } - - /** - * Authorize customer on frontend. - * - * @param Customer $customer - * @throws \Exception - * @return void - */ - protected function authorize(Customer $customer) - { - $url = $_ENV['app_frontend_url'] . 'customer/account/login/'; - $this->transport->write($url); - $this->read(); - $url = $_ENV['app_frontend_url'] . 'customer/account/loginPost/'; - $data = [ - 'login[username]' => $customer->getEmail(), - 'login[password]' => $customer->getPassword(), - 'form_key' => $this->formKey, - ]; - $this->transport->write($url, $data, CurlInterface::POST, ['Set-Cookie:' . $this->cookies]); - $response = $this->read(); - if (strpos($response, 'customer/account/login')) { - throw new \Exception($customer->getFirstname() . ', cannot be logged in by curl handler!'); - } - } - - /** - * Init Form Key from response. - * - * @return void - */ - protected function initFormKey() - { - $str = substr($this->response, strpos($this->response, 'form_key')); - preg_match('/value="(.*)" \/>/', $str, $matches); - if (!empty($matches[1])) { - $this->formKey = $matches[1]; - } - } - - /** - * Init Cookies from response. - * - * @return void - */ - protected function initCookies() - { - preg_match_all('|Set-Cookie: (.*);|U', $this->response, $matches); - if (!empty($matches[1])) { - $this->cookies = implode('; ', $matches[1]); - } - } - - /** - * Send request to the remote server. - * - * @param string $url - * @param array $params - * @param string $method - * @param array $headers - * @throws \Exception - */ - public function write($url, $params = [], $method = CurlInterface::POST, $headers = []) - { - if ($this->formKey) { - $params['form_key'] = $this->formKey; - } - $this->transport->write($url, http_build_query($params), $method, ['Set-Cookie:' . $this->cookies]); - } - - /** - * Read response from server. - * - * @return string - */ - public function read() - { - $this->response = $this->transport->read(); - $this->initCookies(); - $this->initFormKey(); - return $this->response; - } - - /** - * Add additional option to cURL. - * - * @param int $option the CURLOPT_* constants - * @param mixed $value - * @return void - */ - public function addOption($option, $value) - { - $this->transport->addOption($option, $value); - } - - /** - * Close the connection to the server. - * - * @return void - */ - public function close() - { - $this->transport->close(); - } -} diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist deleted file mode 100644 index 56dd56f9082..00000000000 --- a/dev/tests/functional/phpunit.xml.dist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php deleted file mode 100644 index 2f929ce4c14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ - $role->getRoleName()]; - $rolePage->open(); - \PHPUnit_Framework_Assert::assertTrue( - $rolePage->getRoleGrid()->isRowVisible($filter), - 'Role with name \'' . $filter['rolename'] . '\' is absent in Roles grid.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Role is present in Roles grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php deleted file mode 100644 index 2a1ae7aa411..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertRoleSuccessSaveMessage.php +++ /dev/null @@ -1,55 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Success message on roles page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php deleted file mode 100644 index 3c4fcd42ca6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserAccessDeniedMessage.php +++ /dev/null @@ -1,29 +0,0 @@ -getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals( - self::ERROR_MESSAGE, - $failedMessage, - 'Wrong error message is displayed.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Error message on creation user page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php deleted file mode 100644 index afeec788362..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInGrid.php +++ /dev/null @@ -1,65 +0,0 @@ -hasData('password') || $user->hasData('username')) ? $user : $customAdmin; - $filter = ['username' => $adminUser->getUsername()]; - $userIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $userIndex->getUserGrid()->isRowVisible($filter), - 'User with name \'' . $adminUser->getUsername() . '\' is absent in User grid.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User is present in Users grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php deleted file mode 100644 index 3c2932cdafd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserInvalidEmailMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getEmail()); - $actualMessage = $userEdit->getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals($expectedMessage, $actualMessage, 'Wrong error message is displayed.'); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Error message about invalid email on creation user page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php deleted file mode 100644 index b5e5065952c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserIsLockedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Admin user account is locked.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php deleted file mode 100644 index f3aa6ecbce8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogOut.php +++ /dev/null @@ -1,59 +0,0 @@ -getAdminPanelHeader()->logOut(); - $isLoginBlockVisible = $adminAuth->getLoginBlock()->isVisible(); - \PHPUnit_Framework_Assert::assertTrue($isLoginBlockVisible, 'Admin user was not logged out.'); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User had successfully logged out.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php deleted file mode 100644 index bc42e6f62b6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessLogin.php +++ /dev/null @@ -1,91 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - if (!$adminAuth->getLoginBlock()->isVisible()) { - $this->checkForInstallData($browser, $install); - } - $adminAuth->getLoginBlock()->loginToAdminPanel($adminUser->getData()); - - \PHPUnit_Framework_Assert::assertTrue($adminPanelHeader->isVisible(), 'Admin user was not logged in.'); - } - - /** - * Determines if assert is called after magento installation and performs assert precondition. - * - * @param Browser $browser - * @param array $install - * @return void - */ - protected function checkForInstallData(Browser $browser, array $install) - { - isset($install['admin_frontname']) - ? $browser->open($_ENV['app_frontend_url'] . $install['admin_frontname']) - : $browser->open($_ENV['app_backend_url']); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Admin user is logged in.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php deleted file mode 100644 index dec8dae3d80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserSuccessSaveMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success save message is displayed.' - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Success message on User Index page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php deleted file mode 100644 index aa1aeee1273..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithCustomRole.php +++ /dev/null @@ -1,103 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - $adminAuth->getLoginBlock()->loginToAdminPanel($adminUser->getData()); - - $role = $user->getDataFieldConfig('role_id')['source']->getRole(); - $menuItems = $this->getMenuItems($role); - foreach ($menuItems as $item) { - \PHPUnit_Framework_Assert::assertTrue( - $adminPanelHeader->checkMenu(ucfirst($item)), - "Menu $item is absent on top menu." - ); - } - - // Check access denied message on category page. - $categoryIndex->open(); - \PHPUnit_Framework_Assert::assertTrue($categoryIndex->getContentBlock()->checkAccessDeniedMessage()); - } - - /** - * Get menu items. - * - * @param Role $role - * @return array - */ - protected function getMenuItems(Role $role) - { - $resources = $role->getRolesResources(); - $rootMenu = []; - foreach ($resources as $resource) { - $elements = explode('/', $resource); - if (!in_array($elements[0], $rootMenu)) { - $rootMenu[] = $elements[0]; - } - } - return $rootMenu; - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'User have custom role.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php deleted file mode 100644 index 6508e90033c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWithRestrictedResources.php +++ /dev/null @@ -1,85 +0,0 @@ -getAdminPanelHeader(); - if ($adminPanelHeader->isVisible()) { - $adminPanelHeader->logOut(); - } - $adminAuthLogin->getLoginBlock()->loginToAdminPanel($user->getData()); - $menuItems = $adminPanelHeader->getMenuFirstLevelItems(); - - \PHPUnit_Framework_Assert::assertTrue( - count($menuItems) == 1 && in_array('Sales', $menuItems), - 'Sales menu item is not visible or count of menu items is greater than 1.' - ); - - $browser->open($_ENV['app_backend_url'] . $this->manageProductsUrl); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($dashboard->getMainBlock()->getMainBlockText(), self::ACCESS_DENIED), - self::ACCESS_DENIED . " text is not visible on dashboard page."); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "Not allowed resources are not available on menu level." - . " In case if type it via URL - 'Access Denied' page appeared."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php deleted file mode 100644 index c402a38f0bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Constraint/AssertUserWrongCredentialsMessage.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $adminAuth->getLoginBlock()->loginToAdminPanel($user->getData()); - - \PHPUnit_Framework_Assert::assertEquals( - static::INVALID_CREDENTIALS_MESSAGE, - $adminAuth->getMessagesBlock()->getErrorMessages(), - 'Message "' . static::INVALID_CREDENTIALS_MESSAGE . '" is not visible.' - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Invalid credentials message was displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml deleted file mode 100644 index 46fd77265b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php deleted file mode 100644 index ea621d700bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/GwsStoreGroups.php +++ /dev/null @@ -1,112 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var StoreGroup $storeGroup */ - $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataset' => trim($dataset)]); - $storeGroup->persist(); - $this->data[] = $storeGroup->getGroupId(); - $this->storeGroups[] = $storeGroup; - } - } - } - - /** - * Persist source. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get store groups. - * - * @return StoreGroup[] - */ - public function getStoreGroups() - { - return $this->storeGroups; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php deleted file mode 100644 index 209d83058b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/InRoleUsers.php +++ /dev/null @@ -1,116 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $datasets = explode(',', $data['dataset']); - foreach ($datasets as $dataset) { - $adminUser = $fixtureFactory->createByCode('user', ['dataset' => trim($dataset)]); - if (!$adminUser->hasData('user_id')) { - $adminUser->persist(); - } - $this->adminUsers[] = $adminUser; - $this->data[] = $adminUser->getUsername(); - } - } - } - - /** - * Persist user role. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return array with user names. - * - * @param string $key [optional] - * @return array|null - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return array with admin user fixtures. - * - * @return array - */ - public function getAdminUsers() - { - return $this->adminUsers; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php deleted file mode 100644 index 5796ed7b4bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/Role/RolesResources.php +++ /dev/null @@ -1,151 +0,0 @@ -params = $params; - if (isset($data['preset'])) { - $this->data = $this->getPreset($data['preset']); - } elseif (isset($data['value'])) { - $this->data = $data['value']; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Preset for Attribute manage options. - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'sales' => [ - 'sales', - 'sales/archive', - 'sales/archive/creditmemos', - 'sales/archive/shipments', - 'sales/archive/invoices', - 'sales/archive/orders', - 'sales/archive/orders/remove', - 'sales/archive/orders/add', - 'sales/order', - 'sales/order/actions', - 'sales/order/actions/hold', - 'sales/order/actions/creditmemo', - 'sales/order/actions/unhold', - 'sales/order/actions/ship', - 'sales/order/actions/emails', - 'sales/order/actions/comment', - 'sales/order/actions/invoice', - 'sales/order/actions/capture', - 'sales/order/actions/email', - 'sales/order/actions/view', - 'sales/order/actions/reorder', - 'sales/order/actions/edit', - 'sales/order/actions/review_payment', - 'sales/order/actions/cancel', - 'sales/order/actions/create', - 'sales/order/actions/create/reward_spend', - 'sales/invoice', - 'sales/shipment', - 'sales/creditmemo', - 'sales/checkoutagreement', - 'sales/transactions', - 'sales/transactions/fetch', - 'sales/recurring_profile', - 'sales/billing_agreement', - 'sales/billing_agreement/actions', - 'sales/billing_agreement/actions/view', - 'sales/billing_agreement/actions/manage', - 'sales/billing_agreement/actions/use', - 'sales/tax', - 'sales/tax/classes_customer', - 'sales/tax/classes_product', - 'sales/tax/import_export', - 'sales/tax/rates', - 'sales/tax/rules' - ] - ]; - - if (!isset($presets[$name])) { - return null; - } - - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml deleted file mode 100644 index 67143e0eacc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php deleted file mode 100644 index fb80b864f90..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Fixture/User/RoleId.php +++ /dev/null @@ -1,110 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->role = $fixtureFactory->createByCode('role', ['dataset' => $data['dataset']]); - if (!$this->role->hasData('role_id')) { - $this->role->persist(); - } - $this->data = $this->role->getRoleName(); - } - if (isset($data['role']) && $data['role'] instanceof Role) { - $this->role = $data['role']; - $this->data = $data['role']->getRoleName(); - } - } - - /** - * Persist user role. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return string|null - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return role fixture. - * - * @return Role - */ - public function getRole() - { - return $this->role; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php deleted file mode 100644 index 9d6c505b65c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/Curl.php +++ /dev/null @@ -1,117 +0,0 @@ - [ - 'Custom' => 0, - 'All' => 1 - ], - 'resource_access' => [ - 'Custom' => 0, - 'All' => 1 - ] - ]; - - /** - * Curl creation of User Role. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'permissions_role/saverole/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Role entity creating by curl handler was not successful! Response: $response"); - } - - return ['role_id' => $this->getRoleId($response)]; - } - - /** - * Prepare data. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture){ - /** @var Role $fixture */ - $data = $this->replaceMappingData($fixture->getData()); - if (isset($data['roles_resources'])) { - $data['resource'] = $this->prepareRolesResources($data['roles_resources']); - unset($data['roles_resources']); - } - - return $data; - } - - /** - * Prepare roles resources. - * - * @param array $resources - * @return string - */ - protected function prepareRolesResources(array $resources) - { - $data = '__root__,'; - $data .= implode(',', $resources); - $result = str_replace(',', ',admin/', $data); - - return $result; - } - - /** - * Get role id. - * - * @param string $response - * @return int - * @throws \Exception - */ - protected function getRoleId($response) - { - preg_match_all('~title="http[^\s]*\/rid\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find user role id'); - } - - return max($matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php deleted file mode 100644 index 51c1b3f29dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/Role/RoleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Active' => 1 - ] - ]; - - /** - * Curl creation of Admin User. - * - * @param FixtureInterface $fixture - * @return array|mixed - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var \Mage\Admin\Test\Fixture\User $fixture */ - $data = $this->replaceMappingData($fixture->getData()); - if ($fixture->hasData('role_id')) { - $data['roles[]'] = $fixture->getDataFieldConfig('role_id')['source']->getRole()->getRoleId(); - } - $url = $_ENV['app_backend_url'] . 'permissions_user/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Admin user entity creating by curl handler was not successful! Response: $response"); - } - - return ['user_id' => $this->getId()]; - } - - /** - * Get created user id. - * - * @return string - */ - protected function getId() - { - $url = $_ENV['app_backend_url'] . 'permissions_user/roleGrid/sort/user_id/dir/desc/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('@edit/user_id/(\d+)/@siu', $response, $matches); - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php b/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php deleted file mode 100644 index ee6398478f7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Handler/User/UserInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml deleted file mode 100644 index 3ee4db2cb3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml deleted file mode 100644 index 4345ea0ab0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleEditRole.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml deleted file mode 100644 index 3f520b77fb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Page/Adminhtml/UserRoleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml deleted file mode 100644 index 03f894bad6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/Role.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Administrators - All - 1 - - - - Custom%isolation% - All - 123123q123123q - Custom - - sales - - - - - Custom%isolation% - Custom - 123123q123123q - Custom - - sales - - - custom - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml deleted file mode 100644 index efdb1b21fa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/Repository/User.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - 123123q123123q - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - 123123q123123q - Active - - administrators - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - 123123q123123q - Active - - - AdminUserInstall%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - - - admin - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php deleted file mode 100644 index bbb206924ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.php +++ /dev/null @@ -1,144 +0,0 @@ -fixtureFactory = $fixtureFactory; - $adminUser = $fixtureFactory->createByCode('user'); - $adminUser->persist(); - - return ['adminUser' => $adminUser]; - } - - /** - * Injection data. - * - * @param UserIndex $userIndex - * @param UserEdit $userEdit - * @return void - */ - public function __inject(UserIndex $userIndex, UserEdit $userEdit) - { - $this->userIndexPage = $userIndex; - $this->userEditPage = $userEdit; - } - - /** - * Run Create Admin User Entity Test. - * - * @param User $user - * @param User $adminUser - * @param null|string $duplicatedParam - * @param bool $isCustomRole [optional] - * @return void - */ - public function test(User $user, User $adminUser, $duplicatedParam = null, $isCustomRole = false) - { - // Prepare data - $user = $this->prepareUser($user, $adminUser, $duplicatedParam, $isCustomRole); - - // Steps: - $this->userIndexPage->open(); - $this->userIndexPage->getPageActionsBlock()->addNew(); - $this->userEditPage->getUserForm()->fill($user); - $this->userEditPage->getFormPageActions()->save(); - } - - /** - * Prepare User fixture. - * - * @param User $user - * @param User $adminUser - * @param null|string $duplicatedParam - * @param bool $isCustomRole - * @return User - */ - protected function prepareUser(User $user, User $adminUser, $duplicatedParam, $isCustomRole) - { - if (!empty($duplicatedParam)) { - $data = $user->getData(); - $data[$duplicatedParam] = $adminUser->getData($duplicatedParam); - $user = $this->prepareUserFixture($user, $data); - } elseif ($isCustomRole) { - $data = $user->getData(); - $user = $this->prepareUserFixture($user, $data); - } - - return $user; - } - - /** - * Prepare user fixture. - * - * @param User $user - * @param array $data - * @return FixtureInterface - */ - protected function prepareUserFixture(User $user, array $data) - { - $data['role_id'] = ['role' => $user->getDataFieldConfig('role_id')['source']->getRole()]; - return $this->fixtureFactory->createByCode('user', ['data' => $data]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml deleted file mode 100644 index cb89a82e3dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserEntityTest.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - administrators - 123123q123123q - - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Inactive - administrators - 123123q123123q - - - - - - - - - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - administrators - username - 123123q123123q - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - - - 123123q123123q - 123123q123123q - Active - administrators - email - 123123q123123q - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - - - 123123q123123q - - - - - - - AdminUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.cim - 123123q123123q - 123123q123123q - Active - - - 123123q123123q - - - - CustomUser%isolation% - FirstName%isolation% - LastName%isolation% - email%isolation%@example.com - 123123q123123q - 123123q123123q - Active - custom - true - 123123q123123q - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php deleted file mode 100644 index 57b0bc0b720..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Permissions -> Roles. - * 3. Press "Add new role" button to start create New Role. - * 4. Fill in all data according to data set. - * 5. Save role. - * 6. Perform assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-7318 - */ -class CreateAdminUserRoleEntityTest extends Injectable -{ - /** - * User role index page. - * - * @var UserRoleIndex - */ - protected $userRoleIndex; - - /** - * User role edit page. - * - * @var UserRoleEditRole - */ - protected $userRoleEditRole; - - /** - * Injection data. - * - * @param UserRoleIndex $userRoleIndex - * @param UserRoleEditRole $userRoleEditRole - * @return void - */ - public function __inject(UserRoleIndex $userRoleIndex, UserRoleEditRole $userRoleEditRole) - { - $this->userRoleIndex = $userRoleIndex; - $this->userRoleEditRole = $userRoleEditRole; - } - - /** - * Run Create Admin User Role Entity test. - * - * @param Role $role - * @return void - */ - public function test(Role $role) - { - //Steps - $this->userRoleIndex->open(); - $this->userRoleIndex->getRoleActions()->addNew(); - $this->userRoleEditRole->getRoleFormTabs()->fill($role); - $this->userRoleEditRole->getPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml deleted file mode 100644 index bea74aeadb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/CreateAdminUserRoleEntityTest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - AdminRole%isolation% - 123123q123123q - Custom - sales - - - - - AdminRole%isolation% - 123123q123123q - All - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php deleted file mode 100644 index 0da0003a169..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.php +++ /dev/null @@ -1,129 +0,0 @@ - Permissions -> Users. Find user and open to edit it. - * 3. Go to User Role tab and assign user role from preconditions. Save changes. - * 4. Perform assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-7602 - */ -class UseAclRoleWithRestrictedGwsScopeTest extends Injectable -{ - /** - * User index page. - * - * @var UserIndex - */ - protected $userIndexPage; - - /** - * User edit page. - * - * @var UserEdit - */ - protected $userEditPage; - - /** - * Factory of fixtures. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Preconditions for test. - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - /** @var Role $role */ - $role = $fixtureFactory->createByCode('role', ['dataset' => 'custom_with_gws_scope']); - $role->persist(); - $user = $fixtureFactory->createByCode('user', ['dataset' => 'admin_without_role']); - $user->persist(); - - $this->fixtureFactory = $fixtureFactory; - - return ['user' => $user, 'role' => $role]; - } - - /** - * Injection data. - * - * @param UserIndex $userIndex - * @param UserEdit $userEdit - * @return void - */ - public function __inject(UserIndex $userIndex, UserEdit $userEdit) - { - $this->userIndexPage = $userIndex; - $this->userEditPage = $userEdit; - } - - /** - * Run Use ACL Role with Restricted GWS Scope test. - * - * @param User $user - * @param Role $role - * @return array - */ - public function test(User $user, Role $role) - { - // Steps: - $this->userIndexPage->open(); - $this->userIndexPage->getUserGrid()->searchAndOpen(['email' => $user->getEmail()]); - $this->userEditPage->getUserForm()->fill($this->prepareUser($user, $role)); - $this->userEditPage->getFormPageActions()->save(); - - } - - /** - * Prepare user for test. - * - * @param User $user - * @param Role $role - * @return User - */ - protected function prepareUser(User $user, Role $role) - { - $userData = $user->getData(); - $userData['role_id'] = ['role' => $role]; - unset($userData['user_id'], $userData['password'], $userData['password_confirmation']); - - return $this->fixtureFactory->createByCode('user', ['data' => $userData]); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml deleted file mode 100644 index bf46bcc7986..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/TestCase/UseAclRoleWithRestrictedGwsScopeTest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml deleted file mode 100644 index ea5c80fd923..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/curl/di.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml deleted file mode 100644 index 261d7afb54e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Admin/Test/etc/fixture.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - flat - admin_user - Mage\Admin\Model\Resource\User\Collection - - - flat - admin_role - Mage\Admin\Model\Resource\Role\Collection - - - all - virtual - - - roles_resources - virtual - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php deleted file mode 100644 index e3bd21b1cbf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.php +++ /dev/null @@ -1,94 +0,0 @@ -dashboard = $dashboard; - } - - /** - * Submit login form. - * - * @return void - */ - protected function submit() - { - $this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click(); - } - - /** - * Log in to admin panel. - * - * @param array $admin - * @return void - */ - public function loginToAdminPanel(array $admin) - { - $data = $this->dataMapping($admin); - $this->_fill($data); - $this->submit(); - if (!$this->_rootElement->isVisible()) { - $this->dashboard->getAdminPanelHeader()->waitVisible(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml deleted file mode 100644 index f7404328eeb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Admin/Login.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - login - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php deleted file mode 100644 index 0ad95dabb65..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role.php +++ /dev/null @@ -1,51 +0,0 @@ -getRoleGrid()->searchAndSelect(['rolename' => $fields['role_id']['value']]); - } - - /** - * Returns role grid. - * - * @return Grid; - */ - public function getRoleGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Api\User\Tab\Role\Grid', - ['element' => $this->_rootElement->find('#permissionsUserRolesGrid')] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php deleted file mode 100644 index 220054f95b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/Tab/Role/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'selector' => '#permissionsUserRolesGrid_filter_role_name' - ] - ]; - - /** - * Radio button input selector. - * - * @var string - */ - protected $selectItem = '.a-center [type="radio"]'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php deleted file mode 100644 index 0d06c3cbc05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Api/User/UserForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #page_tabs_main_section - css selector - - - - - - - #user_password - - - #user_confirmation - - - - select - - - - - \Mage\Adminhtml\Test\Block\Api\User\Tab\Role - #page_tabs_roles_section - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php deleted file mode 100644 index f5bd81a3a24..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cache/PageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -_rootElement->find($this->flushCacheStorageButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php deleted file mode 100644 index 2a730773837..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Content.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->accessDenied)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php deleted file mode 100644 index bf27e04af41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.php +++ /dev/null @@ -1,64 +0,0 @@ -hasData() ? parent::getData($category) : parent::getData(); - } - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $this->browser->find('#global_search')->click(); - $tab->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml deleted file mode 100644 index 7b33db2d2de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/CategoryForm.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[1]/a - xpath - general - - - select - - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[2]/a - xpath - general - - - select - - - select - - - #use_config_group_5available_sort_by - checkbox - - - #group_5available_sort_by - multiselect - - - #use_config_group_5default_sort_by - checkbox - - - select - - - select - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - .//ul[contains(@id, "category_info_tabs")]/li[3]/a - xpath - general - - - \Mage\Adminhtml\Test\Block\Catalog\Category\Edit\Tab\Product - #category_info_tabs_products - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php deleted file mode 100644 index 3f5c3a9a98a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product.php +++ /dev/null @@ -1,105 +0,0 @@ -getProducts(); - $this->getProductGrid()->clear(); - foreach ($products as $product) { - $this->getProductGrid()->searchAndSelect(['sku' => $product->getSku()]); - } - - return $this; - } - - /** - * Returns product grid. - * - * @return Grid - */ - public function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Category\Edit\Tab\Product\Grid', - ['element' => $this->_rootElement->find($this->productGrid)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return ['category_products' => $this->getProducts($fields['category_products']['source']->getProducts())]; - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - if ($productGrid->isSelect(['sku' => $product->getSku()])) { - $result[$key] = $product->getSku(); - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php deleted file mode 100644 index e38b0aafc1a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Edit/Tab/Product/Grid.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'selector' => '#catalog_category_products_filter_sku' - ] - ]; - - /** - * Clear grid. - * - * @return void - */ - public function clear() - { - $this->_rootElement->find($this->selectAll, Locator::SELECTOR_CSS, 'checkbox')->setValue('No'); - } - - /** - * Search for item product and select it. - * - * @param array $filter - * @return void - * @throws \Exception - */ - public function searchAndSelect(array $filter) - { - $this->search($filter); - $selectItem = $this->_rootElement->find($this->selectItem, Locator::SELECTOR_CSS, 'checkbox'); - if ($selectItem->isVisible()) { - $selectItem->setValue('No'); - $selectItem->setValue('Yes'); - } else { - throw new \Exception('Searched item product was not found.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php deleted file mode 100644 index 7e12eba2aac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Category/Tree.php +++ /dev/null @@ -1,162 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Press 'Add Subcategory' button. - * - * @return void - */ - public function addSubcategory() - { - $this->_rootElement->find($this->addSubcategory, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Press 'Add Root Category' button. - * - * @return void - */ - public function addRootCategory() - { - $this->_rootElement->find($this->addRootCategory, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Select category. - * - * @param CatalogCategory $category - * @param bool $fullPath - * @return void - */ - public function selectCategory(CatalogCategory $category, $fullPath = true) - { - $parentPath = $this->prepareFullCategoryPath($category); - if (!$fullPath) { - array_pop($parentPath); - } - if (empty($parentPath)) { - return; - } - $path = implode('/', $parentPath); - $this->expandAllCategories(); - $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->setValue($path); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - if ($category->hasData('parent_id')) { - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Expand all categories tree. - * - * @return void - */ - protected function expandAllCategories() - { - $this->browser->find($this->addRootCategory)->hover(); - $this->_rootElement->find($this->expandAll)->click(); - } - - /** - * Check category in category tree. - * - * @param CatalogCategory $category - * @return bool - */ - public function isCategoryVisible(CatalogCategory $category) - { - $categoryPath = $this->prepareFullCategoryPath($category); - $categoryPath = implode('/', $categoryPath); - return $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree') - ->isElementVisible($categoryPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php deleted file mode 100644 index 9a4db9ce7f6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/CustomAttribute.php +++ /dev/null @@ -1,175 +0,0 @@ - null, - 'textarea' => null, - 'hasDatepicker' => 'datepicker', - 'select' => 'select', - 'multiselect' => 'multiselect', - ]; - - /** - * @constructor - * @param DriverInterface $driver - * @param EventManagerInterface $eventManager - * @param Locator $locator - * @param ElementInterface $context - */ - public function __construct( - DriverInterface $driver, - EventManagerInterface $eventManager, - Locator $locator, - ElementInterface $context = null - ) { - parent:: __construct($driver, $eventManager, $locator, $context); - - $this->attributeLabel = $this->getAttributeLabelFromPage(); - } - - /** - * Get attribute label. - * - * @return mixed - */ - protected function getAttributeLabelFromPage() - { - $label = $this->find($this->attributeLabel, Locator::SELECTOR_XPATH)->getText(); - return str_replace(' *', '', $label); - } - - /** - * Set attribute value. - * - * @param array|string $data - * @return void - */ - public function setValue($data) - { - $this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $element = $this->getElementByClass($this->getElementClass()); - $value = is_array($data) ? $data['value'] : $data; - $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $element) - ->setValue($value); - } - - /** - * Get custom attribute value. - * - * @return string|array - */ - public function getValue() - { - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $inputType = $this->getElementByClass($this->getElementClass()); - return $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $inputType) - ->getValue(); - } - - /** - * Get custom attribute values. - * - * @return array - */ - public function getValues() - { - $result = []; - $this->eventManager->dispatchEvent(['get_value'], [__METHOD__, $this->getAbsoluteSelector()]); - $inputType = $this->getElementByClass($this->getElementClass()); - $element = $this->find(sprintf($this->inputSelector, $this->attributeLabel), Locator::SELECTOR_CSS, $inputType); - $values = $element->getElements('option'); - foreach ($values as $value) { - $result[] = $value->getText(); - } - - return array_reverse($this->prepareResult($inputType, $result)); - } - - /** - * Prepare result. - * - * @param string $inputType - * @param array $result - * @return array - */ - protected function prepareResult($inputType, array $result) - { - if ($inputType == 'multiselect') { - return $result; - } else { - array_shift($result); - return $result; - } - } - - /** - * Get element type by class. - * - * @param string $class - * @return string - */ - protected function getElementByClass($class) - { - $element = null; - foreach ($this->classReference as $key => $reference) { - if (str_contains($class, $key)) { - $element = $reference; - } - } - return $element; - } - - /** - * Get element class. - * - * @return string - */ - protected function getElementClass() - { - return $this->find(sprintf($this->inputSelector, $this->attributeLabel))->getAttribute('class'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php deleted file mode 100644 index 9683e4322cd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php +++ /dev/null @@ -1,105 +0,0 @@ -tabs as $tabName => $tab) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); - } - } else { - $tabsFields = $this->getFieldsByTabs($fixture); - foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields); - $data = array_merge($data, $tabData); - } - } - return $data; - } - - /** - * Fill form with tabs. - * - * @param FixtureInterface $fixture - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $fixture, Element $element = null) - { - $tabs = $this->getFieldsByTabs($fixture); - - $this->openTab('attribute-properties'); - $tabElement = $this->getTabElement('attribute-properties'); - $tabElement->fillFormTab($tabs['attribute-properties'], $element); - unset($tabs['attribute-properties']); - - return $this->fillTabs($tabs, $element); - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - $this->openTab('manage-options'); - return $this->getTabElement('manage-options')->getOptionsIds(); - } - - /** - * Get attribute id. - * - * @return int - */ - public function getAttributeId() - { - $attributeId = $this->_rootElement->find($this->deleteButton)->getAttribute('onclick'); - preg_match('`attribute_id/(\d+)`', $attributeId, $matches); - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml deleted file mode 100644 index f97f4ced507..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_main - css selector - - - - - select - - - select - - - select - - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_main - css selector - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_attribute_tabs_labels - css selector - - - [name="frontend_label[0]"] - - - [name="frontend_label[1]"] - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\Edit\Tab\Options - #product_attribute_tabs_labels - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php deleted file mode 100644 index b8f259cb22c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options.php +++ /dev/null @@ -1,127 +0,0 @@ -_rootElement->find($this->addOption)->click(); - $this->getOptionsBlock()->fillOption($field); - } - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $options = []; - foreach ($fields['options']['value'] as $key => $field) { - $options[] = $this->getOptionsBlock($key)->getOption($field); - } - $result['options'] = array_reverse($options); - - return $result; - } - - /** - * Get options block. - * - * @param int|null $key - * @return Option - */ - protected function getOptionsBlock($key = null) - { - $row = ''; - if ($key !== null) { - $row = sprintf($this->optionsRow, $key + 2); - } - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\Edit\Tab\Options\Option', - ['element' => $this->_rootElement->find($this->optionsBlock . $row, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - $result = []; - $selector = $this->optionsBlock . $this->optionsSelector; - $options = $this->_rootElement->getElements($selector, Locator::SELECTOR_XPATH); - foreach ($options as $option) { - $elementName = $option->getAttribute('name'); - preg_match('`option\[value\]\[(\d+)\]\[0\]`', $elementName, $matches); - $result[$option->getValue()] = $matches[1]; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php deleted file mode 100644 index f0033224065..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.php +++ /dev/null @@ -1,50 +0,0 @@ -dataMapping($fields); - $this->_fill($data); - } - - /** - * Get attribute option. - * - * @param array $value - * @return array - */ - public function getOption(array $value) - { - $mapping = $this->dataMapping($value); - $options = $this->_getData($mapping); - - return $options; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml deleted file mode 100644 index 45939ac22ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/Tab/Options/Option.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - [name="default[]"] - checkbox - - - [name$="[0]"] - - - [name$="[1]"] - - - [name^="option[order]"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php deleted file mode 100644 index 704a0351831..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Grid.php +++ /dev/null @@ -1,71 +0,0 @@ - [ - 'selector' => 'input[name="attribute_code"]' - ], - 'frontend_label' => [ - 'selector' => 'input[name="frontend_label"]' - ], - 'is_required' => [ - 'selector' => 'select[name="is_required"]', - 'input' => 'select' - ], - 'is_user_defined' => [ - 'selector' => 'select[name="is_user_defined"]', - 'input' => 'select' - ], - 'is_visible' => [ - 'selector' => 'select[name="is_visible"]', - 'input' => 'select' - ], - 'is_global' => [ - 'selector' => 'select[name="is_global"]', - 'input' => 'select' - ], - 'is_searchable' => [ - 'selector' => 'select[name="is_searchable"]', - 'input' => 'select' - ], - 'is_filterable' => [ - 'selector' => 'select[name="is_filterable"]', - 'input' => 'select' - ], - 'is_comparable' => [ - 'selector' => 'select[name="is_comparable"]', - 'input' => 'select' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php deleted file mode 100644 index 4d33865d010..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ - [ - 'selector' => 'input[name="set_name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php deleted file mode 100644 index cc25d2d4264..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main.php +++ /dev/null @@ -1,138 +0,0 @@ -_rootElement->find(sprintf($this->attribute, 'color'), Locator::SELECTOR_XPATH)->click(); - $attributeLocator = sprintf($this->attribute, $attribute); - $attribute = $this->_rootElement->find($attributeLocator, Locator::SELECTOR_XPATH); - $attribute->click(); - $target = $this->_rootElement->find(sprintf($this->groups, $attributeGroup), Locator::SELECTOR_XPATH); - $this->browser->refresh(); - $attribute->dragAndDrop($target); - } - - /** - * Get AttributeSet name from product_set edit page. - * - * @return string - */ - public function getAttributeSetName() - { - return $this->_rootElement->find($this->attributeSetName, Locator::SELECTOR_CSS)->getValue(); - } - - /** - * Checks present Product Attribute on product_set Groups. - * - * @param string $attributeLabel - * @return bool - */ - public function checkProductAttribute($attributeLabel) - { - $attributeLabelLocator = sprintf($this->attributeLocator, $attributeLabel); - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Checks present Unassigned Product Attribute. - * - * @param string $attributeLabel - * @return bool - */ - public function checkUnassignedProductAttribute($attributeLabel) - { - $attributeLabelLocator = sprintf($this->attributeLabel, $attributeLabel); - - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Add attribute set group to Attribute Set. - * - * @param string $groupName - * @return void - */ - public function addAttributeSetGroup($groupName) - { - $this->_rootElement->find($this->addGroupButton)->click(); - $this->browser->setAlertText($groupName); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php deleted file mode 100644 index a2eca905f97..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/AttributeSetForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php deleted file mode 100644 index 0a52dfcadee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Set/Main/EditForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php deleted file mode 100644 index fda248bf524..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenant.php +++ /dev/null @@ -1,82 +0,0 @@ -type]['value'])) { - $context = $element ? $element : $this->_rootElement; - $relatedBlock = $this->getGrid($context); - - foreach ($data[$this->type]['value'] as $product) { - $relatedBlock->searchAndSelect(['sku' => $product['sku']]); - } - } - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $relatedBlock = $this->getGrid($element); - $columns = [ - 'entity_id' => '.="ID"', - 'name' => '.="Name"', - 'sku' => '.="SKU"', - ]; - $relatedProducts = $relatedBlock->getRowsData($columns); - - return [$this->type => $relatedProducts]; - } - - /** - * Return related products grid. - * - * @param Element $element - * @return Grid - */ - abstract protected function getGrid(Element $element = null); -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php deleted file mode 100644 index 17e85c547e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractAppurtenantProductsGrid.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'selector' => 'input[name="name"]', - ], - 'sku' => [ - 'selector' => 'input[name="sku"]', - ], - 'type' => [ - 'selector' => 'select[name="type"]', - 'input' => 'select', - ], - ]; - - /** - * Column selectors map. - * - * @var array - */ - protected $columnFilters = [ - 'entity_id' => '.="ID"', - 'name' => '.="Name"', - 'sku' => '.="SKU"', - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php deleted file mode 100644 index 193d58426bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractOptions.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($fields); - $this->_fill($mapping, $element); - return $this; - } - - /** - * Getting options data form on the product form. - * - * @param array $fields [optional] - * @param Element $element [optional] - * @return $this - */ - public function getOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php deleted file mode 100644 index 6576bd3001d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AbstractSelectOptions.php +++ /dev/null @@ -1,94 +0,0 @@ -_rootElement; - foreach ($fields as $key => $value) { - $this->clickAddNewOptionsButton(); - $element = $context->find(sprintf($this->itemOption, ++$key), Locator::SELECTOR_XPATH); - parent::fillOptions($value, $element); - } - - return $this; - } - - /** - * Click on add new options button. - * - * @return void - */ - protected function clickAddNewOptionsButton() - { - $this->_rootElement->find($this->addButton)->click(); - } - - /** - * Getting options data form on the product form. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getOptions(array $fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - $items = $context->getElements($this->itemOptions, Locator::SELECTOR_XPATH); - foreach ($items as $key => $value) { - $result[$key] = parent::getOptions($fields[$key], $value); - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php deleted file mode 100644 index 558888f650c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts.php +++ /dev/null @@ -1,107 +0,0 @@ -getSearchGridBlock(); - foreach ($fields['associated']['value'] as $key => $groupedProduct) { - $gridBlock->searchAndSelect(['name' => $groupedProduct['name'], 'id' => $groupedProduct['id']]); - $this->getProductBlock()->fillOptions($groupedProduct); - } - } - return $this; - } - - /** - * Get associated products grid. - * - * @return Grid - */ - protected function getSearchGridBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts\Grid', - ['element' => $this->_rootElement->find($this->productSearchGrid)] - ); - } - - /** - * Get product row block. - * - * @param int $key [optional] - * @return Product - */ - protected function getProductBlock($key = 1) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts\Product', - ['element' => $this->_rootElement->find(sprintf($this->productRow, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $options = []; - foreach ($fields['associated']['value'] as $key => $field) { - $options[$key] = $this->getProductBlock($key + 1)->getOptions($field); - } - $result['associated'] = array_reverse($options); - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php deleted file mode 100644 index 6c6af597b67..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Grid.php +++ /dev/null @@ -1,41 +0,0 @@ - [ - 'selector' => '#super_product_grid_filter_name', - ], - 'id' => [ - 'selector' => '#super_product_grid_filter_entity_id', - ], - 'sku' => [ - 'selector' => '#super_product_grid_filter_sku', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php deleted file mode 100644 index a0e6b860a55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.php +++ /dev/null @@ -1,86 +0,0 @@ -dataMapping($value); - $this->_fill($mapping); - } - - /** - * Get product options. - * - * @param array $value - * @return array - */ - public function getOptions(array $value) - { - $mapping = $this->dataMapping($value); - $options = $this->_getData($mapping); - $options['id'] = $this->getProductId(); - $options['name'] = $this->getProductName(); - return $options; - } - - /** - * Get product name. - * - * @return string - */ - protected function getProductName() - { - return $this->_rootElement->find($this->productName, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get product id. - * - * @return string - */ - protected function getProductId() - { - return $this->_rootElement->find($this->productId, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml deleted file mode 100644 index 0e3cc62887c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/AssociatedProducts/Product.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php deleted file mode 100644 index 82c652832f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Categories.php +++ /dev/null @@ -1,112 +0,0 @@ -selectCategory($category); - } - - return $this; - } - - /** - * Get value. - * - * @param null $fields - * @param Element $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return [ - 'category_ids' => $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->getValue() - ]; - } - - /** - * Select category. - * - * @param CatalogCategory $category - * @param bool $fullPath - * @return void - */ - public function selectCategory(CatalogCategory $category, $fullPath = true) - { - $parentPath = $this->prepareFullCategoryPath($category); - if (!$fullPath) { - array_pop($parentPath); - } - $path = implode('/', $parentPath); - - $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree')->setValue($path); - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Check category in category tree. - * - * @param CatalogCategory $category - * @return bool - */ - public function isCategoryVisible(CatalogCategory $category) - { - $categoryPath = $this->prepareFullCategoryPath($category); - return $this->_rootElement->find($this->treeElement, Locator::SELECTOR_CSS, 'tree') - ->isCategoryVisible($categoryPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php deleted file mode 100644 index 3fef4c9c769..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable.php +++ /dev/null @@ -1,237 +0,0 @@ -selectProducts($fields['configurable_options']['value']['products']); - $this->fillAttributes($fields['configurable_options']['value']['attributes_data']); - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return [ - 'configurable_options' => [ - 'products' => $this->getProducts($fields['configurable_options']['value']['products']), - 'attributes_data' => $this->getAttributes($fields['configurable_options']['value']['attributes_data']) - ] - ]; - } - - /** - * Fill attributes. - * - * @param array $attributes - * @return void - */ - public function fillAttributes(array $attributes) - { - foreach ($attributes as $attribute) { - $this->getItemAttributeForm($attribute['attribute_code'])->fillAttribute($attribute); - } - } - - /** - * Get attributes. - * - * @param array $attributes - * @return array - */ - protected function getAttributes(array $attributes) - { - $result = []; - foreach ($attributes as $key => $attribute) { - $result[$key] = $this->getItemAttributeForm($attribute['attribute_code'])->getAttribute($attribute); - } - - return $result; - } - - /** - * Select products. - * - * @param array $products - * @return void - */ - public function selectProducts(array $products) - { - $productGrid = $this->getProductGrid(); - foreach ($products as $product) { - $productGrid->searchAndSelect(['sku' => $product]); - } - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - if ($productGrid->isSelect(['sku' => $product])) { - $result[$key] = $product; - } - } - - return $result; - } - - /** - * Get product grid. - * - * @return Grid - */ - protected function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Grid', - ['element' => $this->_rootElement->find($this->grid)] - ); - } - - /** - * Get item attribute form. - * - * @param string $key - * @return Attribute - */ - protected function getItemAttributeForm($key) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Attribute', - ['element' => $this->_rootElement->find(sprintf($this->itemAttribute, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Unselect all products. - * - * @return void - */ - public function unselectAllProducts() - { - $this->getProductGrid()->unselectAllProducts(); - } - - /** - * Get quick creation block. - * - * @return QuickCreation - */ - public function getQuickCreationBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation', - ['element' => $this->_rootElement->find($this->simpleForm)] - ); - } - - /** - * Get new product popup. - * - * @return NewProductPopup - */ - public function getNewProductPopup() - { - $this->browser->selectWindow(); - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\NewProductPopup', - ['element' => $this->browser->find($this->newProductPopup)] - ); - } - - /** - * Get simple associated product block. - * - * @return SimpleAssociatedProduct - */ - public function getSimpleAssociatedProductBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\SimpleAssociatedProduct', - ['element' => $this->_rootElement->find($this->simpleAssociatedProduct)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php deleted file mode 100644 index f3703ce6001..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.php +++ /dev/null @@ -1,129 +0,0 @@ -dataMapping($attributeMapping); - $this->_fill($mapping); - $this->fillOptions($options); - } - - /** - * Get item attribute. - * - * @param array $attribute - * @return array - */ - public function getAttribute(array $attribute) - { - $attributeMapping = []; - $attributeMapping['frontend_label'] = $attribute['frontend_label']; - $options = $attribute['options']; -// unset($attribute['options']); - $mapping = $this->dataMapping($attributeMapping); - - return array_merge($this->_getData($mapping), ['options' => $this->getOptions($options)]); - } - - /** - * Fill attribute options. - * - * @param array $options - * @return void - */ - protected function fillOptions(array $options) - { - $optionFields = [ - 'price', - 'price_type', - 'admin' - ]; - foreach ($options as $option) { - $option = array_intersect_key($option, array_flip($optionFields)); - $optionName = $option['admin']; - unset($option['admin']); - $this->getItemOption($optionName)->fillOption($option); - } - } - - /** - * Get attribute options. - * - * @param array $options - * @return array - */ - protected function getOptions(array $options) - { - $result = []; - $optionFields = [ - 'price', - 'price_type', - 'admin' - ]; - foreach ($options as $key => $option) { - $option = array_intersect_key($option, array_flip($optionFields)); - $optionName = $option['admin']; - unset($option['admin']); - $result[$key] = array_merge( - $this->getItemOption($optionName)->getOption($option), - ['admin' => $optionName] - ); - } - - return $result; - } - - /** - * Get item option form. - * - * @param string $key - * @return Option - */ - protected function getItemOption($key) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\Attribute\Option', - ['element' => $this->_rootElement->find(sprintf($this->itemOption, $key), Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml deleted file mode 100644 index e30b5509d15..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [id$="_label"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php deleted file mode 100644 index c579761420d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($option); - $this->_fill($mapping); - } - - /** - * Get option. - * - * @param array $option - * @return array - */ - public function getOption(array $option) - { - $mapping = $this->dataMapping($option); - return $this->_getData($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml deleted file mode 100644 index b9dbd85dd6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Attribute/Option.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - [id$="_pricing"] - - - [id$="_price_type"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php deleted file mode 100644 index c6c586edebd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/Grid.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'selector' => '#super_product_links_filter_sku' - ] - ]; - - /** - * Unselect all products. - * - * @return void - */ - public function unselectAllProducts() - { - $this->_rootElement->find($this->selectAll, Locator::SELECTOR_CSS, 'checkbox')->setValue('No'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php deleted file mode 100644 index 9be1c2aca92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.php +++ /dev/null @@ -1,64 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Catalog\Product\FormPageActions', - ['element' => $this->_rootElement->find($this->formPageActions)] - ); - } - - /** - * Close popup. - * - * @return void - */ - public function close() - { - $this->waitForElementVisible($this->saveMessage); - $this->browser->closeWindow(); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml deleted file mode 100644 index a433375bc2e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/NewProductPopup.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - - - - - - select - - - - select - - - Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation\AttributesElement - .form-list - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - - select - - - - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_inventory - product - - - - [name="product[stock_data][qty]"] - - - [name="product[stock_data][is_in_stock]"] - select - - - [name="product[stock_data][use_config_manage_stock]"] - checkbox - - - [name="product[stock_data][manage_stock]"] - select - - - [name='product[stock_data][use_config_min_qty]'] - checkbox - - - [name='product[stock_data][min_qty]'] - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Categories - #product_info_tabs_categories - product - - - #product-categories - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\CustomOptions - #product_info_tabs_customer_options - css selector - - - <selector>input[id$='_title']</selector> - <strategy>css selector</strategy> - - - select[id$='_is_require'] - css selector - select - - - select[id$='_type'] - css selector - optgroupselect - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related - #product_info_tabs_related - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell - #product_info_tabs_crosssell - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell - #product_info_tabs_upsell - css selector - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_group_17 - css selector - product - - - checkbox - - - select - - - select - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Websites - #product_info_tabs_websites - css selector - - - //*[@class="website-name" and .//label[text()="%s"]]/input - checkbox - xpath - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php deleted file mode 100644 index be0fc0dc02d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.php +++ /dev/null @@ -1,95 +0,0 @@ -fillDefaultField($product); - $mapping = $this->dataMapping($product->getData()); - unset($mapping['isPersist']); - $this->_fill($mapping); - $this->_rootElement->find($this->create)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Fill default fields. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillDefaultField(InjectableFixture $product) - { - $data = []; - foreach ($this->defaultFields as $field) { - if ($product->hasData($field)) { - $data[$field . '_autogenerate'] = 'No'; - } - } - $mapping = $this->dataMapping($data); - $this->_fill($mapping); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml deleted file mode 100644 index c94a34fbe74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - simple_product - - - checkbox - - - - checkbox - - - - - select - - - select - - - Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable\QuickCreation\AttributesElement - .form-list - - - - [name="simple_product[stock_data][qty]"] - - - [name="simple_product[stock_data][is_in_stock]"] - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php deleted file mode 100644 index a189d0225bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/QuickCreation/AttributesElement.php +++ /dev/null @@ -1,58 +0,0 @@ - $itemValue) { - $selector = sprintf($this->attributeInput, $attributeCode, $this->escapeQuotes($itemValue)); - $option = $this->find($selector, Locator::SELECTOR_XPATH); - $option->click(); - } - } - - /** - * Skip this method. - * - * @return void - */ - public function getValue() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php deleted file mode 100644 index 2b5f100ccff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Configurable/SimpleAssociatedProduct.php +++ /dev/null @@ -1,60 +0,0 @@ -browser->find(".//h4[text()='Create Simple Associated Product']", Locator::SELECTOR_XPATH)->hover(); - $this->_rootElement->find($this->createEmpty)->click(); - } - - /** - * Click on 'Copy From Configurable' button. - * - * @return void - */ - public function clickCopyFromConfigurable() - { - $this->_rootElement->find($this->copyFromConfigurable)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php deleted file mode 100644 index 8e1d8e46023..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell\Grid', - ['element' => $element->find($this->crossSellGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php deleted file mode 100644 index fc5f6dc32c5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Crosssell/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - foreach ($fields['custom_options']['value'] as $field) { - $context->find($this->addOptions)->click(); - $element = $this->getOptionsBlock(1, $context); - $options = array_pop($field); - $data = $this->dataMapping($field); - $this->_fill($data, $element); - $field['type'] = explode('/', $field['type'])[1]; - $this->fillSubOptions([$field['type'] => $options], $element); - } - - return $this; - } - - /** - * Fill price options. - * - * @param array $options - * @param Element $element - * @return void - */ - protected function fillSubOptions(array $options, Element $element) - { - $optionType = key($options); - $this->getSubOptionsBlock($optionType, $element)->fillOptions($options[$optionType]); - } - - /** - * Get option name. - * - * @param string $optionType - * @return string - */ - protected function getOptionName($optionType) - { - $optionName = str_replace([' ', '&'], "", $optionType); - $end = strpos($optionType, '-'); - if ($end !== false) { - $optionName = substr($optionName, 0, $end) . ucfirst(substr($optionName, ($end + 1))); - } - return $optionName; - } - - /** - * Get sub options block. - * - * @param string $optionType - * @param Element $context - * @return AbstractOptions - */ - protected function getSubOptionsBlock($optionType, Element $context) - { - return $this->blockFactory->create( - __NAMESPACE__ . '\\CustomOptions\\' . $this->getOptionName($optionType), - ['element' => $context->find($this->subOptions)] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - foreach ($fields['custom_options']['value'] as $key => $field) { - $element = $this->getOptionsBlock(($key + 1), $context); - $data = $this->dataMapping($field); - unset($data['options']); - $result['custom_options'][$key] = $this->_getData($data, $element); - $result['custom_options'][$key]['options'] = $this->getSubOptions($element); - } - - return $result; - } - - /** - * Get sub options. - * - * @param Element $element - * @return array - */ - protected function getSubOptions(Element $element) - { - $optionType = $element->find($this->checkedOptionType)->getText(); - $optionType = str_replace([' ', '&', '-'], '', $optionType); - return $this->getSubOptionsBlock($optionType, $element)->getOptions(); - } - - /** - * Get sub options. - * - * @param Element $element - * @param int $key - * @return Element - */ - protected function getOptionsBlock($key, Element $element) - { - $element = $element ? $element : $this->_rootElement; - return $element->find(sprintf($this->itemCustomOptions, $key), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php deleted file mode 100644 index 2fc9fe3de85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Area.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - [name$='[max_characters]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php deleted file mode 100644 index 17b82f14306..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Checkbox.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php deleted file mode 100644 index 997627afdff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Date.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php deleted file mode 100644 index 5acbfc5d346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DateTime.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php deleted file mode 100644 index cf93d81e1ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/DropDown.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php deleted file mode 100644 index 7252af44bfe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Field.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - [name$='[max_characters]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php deleted file mode 100644 index fa088e73661..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/File.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name$='[price]'] - - - [name$='[price_type]'] - select - - - [name$='[sku]'] - - - [name$='[file_extension]'] - - - [name$='[image_size_x]'] - - - [name$='[image_size_y]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php deleted file mode 100644 index a8606df5949..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/MultipleSelect.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php deleted file mode 100644 index 56f787bdd1f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/RadioButtons.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - <selector>[id$="_title"]</selector> - - - [id$="_price"] - - - [id$="_price_type"] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php deleted file mode 100644 index 264818d4bd0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/CustomOptions/Time.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$='_price'] - - - [id$='_price_type'] - select - - - [name$='[sku]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php deleted file mode 100644 index 3346dcc17a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php +++ /dev/null @@ -1,133 +0,0 @@ - [ - 'selector' => 'group_prices' - ], - 'tier_price' => [ - 'selector' => 'tiers' - ] - ]; - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - $context = $element ? $element : $this->_rootElement; - foreach ($this->childrenForm as $key => $value) { - if (isset($fields[$key])) { - $this->fillOptionsPrices([$key => $fields[$key]], $context); - unset($fields[$key]); - } - } - - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } - - /** - * Fill price options. - * - * @param array $options - * @param Element $context - * @return void - */ - protected function fillOptionsPrices(array $options, Element $context) - { - $priceType = key($options); - $this->getOptionBlock($priceType, $context)->fillOptions($options[$priceType]['value']); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $result = []; - $context = $element ? $element : $this->_rootElement; - foreach ($this->childrenForm as $key => $value) { - if (isset($fields[$key])) { - $result[$key] = $this->getOptionsPrices([$key => $fields[$key]], $context); - unset($fields[$key]); - } - } - $data = $this->dataMapping($fields); - $result += $this->_getData($data, $element); - - return $result; - } - - /** - * Get price options. - * - * @param array $options - * @param Element $context - * @return array - */ - protected function getOptionsPrices(array $options, Element $context) - { - $priceType = key($options); - return $this->getOptionBlock($priceType, $context)->getOptions($options[$priceType]['value']); - } - - /** - * Get price options block. - * - * @param string $priceType - * @param Element $context - * @return AbstractSelectOptions - */ - protected function getOptionBlock($priceType, Element $context) - { - return $this->blockFactory->create( - __NAMESPACE__ . '\\Prices\\Option' . ucfirst(str_replace('_price', '', $priceType)), - ['element' => $context->find(sprintf($this->priceType, $this->childrenForm[$priceType]['selector']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php deleted file mode 100644 index 43f1797b346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionGroup.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$="_price"] - - - [id$="_cust_group"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php deleted file mode 100644 index 0638a50463a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices/OptionTier.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id$="_price"] - - - [id$="_cust_group"] - select - - - [id$="_qty"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php deleted file mode 100644 index d80197d055c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/ProductSettings.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($fields); - $this->_fill($data, $element); - $this->_rootElement->find($this->continue)->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php deleted file mode 100644 index 8deed3e139f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related\Grid', - ['element' => $element->find($this->relatedGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php deleted file mode 100644 index a6fb086e42a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Related/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - $data = []; - $mapping = $this->dataMapping(['attribute' => '']); - $formatSelector = $mapping['attribute']['selector']; - foreach($fields['attribute']['value'] as $attribute) { - $mapping['attribute']['selector'] = sprintf($formatSelector, $attribute->getFrontendLabel()); - $mapping['attribute']['value'] = 'Yes'; - $data[] = $mapping['attribute']; - } - - $this->_fill($data, $context); - $context->find($this->continue)->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php deleted file mode 100644 index 4124305d295..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - '\Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell\Grid', - ['element' => $element->find($this->upsellGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php deleted file mode 100644 index c645a916f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Upsell/Grid.php +++ /dev/null @@ -1,31 +0,0 @@ -_rootElement; - $mapping = $this->dataMapping(['website' => 'Yes']); - $data = []; - foreach ($fields as $key => $website) { - $data[$key] = $mapping['website']; - $data[$key]['selector'] = sprintf($mapping['website']['selector'], $website); - } - $this->_fill($data, $context); - - return $this; - } - - /** - * Get data of the form. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $result = []; - $checkedWebsites = $this->_rootElement->getElements($this->checkedWebsites, Locator::SELECTOR_CSS, 'checkbox'); - foreach ($checkedWebsites as $item) { - if($item->getValue() == 'Yes') { - $result[] = $item->find($this->websiteLabel, Locator::SELECTOR_XPATH)->getText(); - } - } - - return $result; - } - - /** - * Check if the tab is visible or not. - * - * @return bool - */ - public function isVisible() - { - return $this->_rootElement->find($this->tabSelector)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php deleted file mode 100644 index bbbd7e21731..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/FormPageActions.php +++ /dev/null @@ -1,80 +0,0 @@ -buttonClick('save'); - } - - /** - * Click on "Save and Continue Edit" button. - * - * @return void - */ - public function saveAndContinue() - { - $this->buttonClick('saveAndContinue'); - } - - /** - * Click on "Duplicate" button. - * - * @return void - */ - public function duplicate() - { - $this->buttonClick('duplicate'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php deleted file mode 100644 index 7e729321628..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Grid.php +++ /dev/null @@ -1,78 +0,0 @@ - [ - 'selector' => '#productGrid_product_filter_name' - ], - 'sku' => [ - 'selector' => '#productGrid_product_filter_sku' - ], - 'type' => [ - 'selector' => '#productGrid_product_filter_type', - 'input' => 'select' - ], - 'price_from' => [ - 'selector' => '#productGrid_product_filter_price_from' - ], - 'price_to' => [ - 'selector' => '#productGrid_product_filter_price_to' - ], - 'qty_from' => [ - 'selector' => '#productGrid_product_filter_qty_from' - ], - 'qty_to' => [ - 'selector' => '#productGrid_product_filter_qty_to' - ], - 'visibility' => [ - 'selector' => '#productGrid_product_filter_visibility', - 'input' => 'select' - ], - 'status' => [ - 'selector' => '#productGrid_product_filter_status', - 'input' => 'select' - ], - 'set_name' => [ - 'selector' => '#productGrid_product_filter_set_name', - 'input' => 'select' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php deleted file mode 100644 index 584a8f25fbc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php +++ /dev/null @@ -1,369 +0,0 @@ -getProductType($product); - - // Fill product type - $this->fillSettingsTabs($product); - - if ($this->hasRender($typeId)) { - $renderArguments = [ - 'product' => $product, - 'element' => $element, - 'category' => $category, - ]; - $this->callRender($typeId, 'fill', $renderArguments); - } else { - $this->fillDefaultFields($product, $element, $category); - } - - return $this; - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $product - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $product = null, Element $element = null) - { - $data = parent::getData($product, $element); - if ($this->isWebsiteTabVisible() && !isset($data['website_ids'])) { - $data['website_ids'] = $this->getWebsiteTabData(); - } - - return $data; - } - - /** - * Get data from website tab. - * - * @return array - */ - protected function getWebsiteTabData() - { - $this->openTab('websites'); - return $this->getTabElement('websites')->getData(); - } - - /** - * Fill default fields. - * - * @param FixtureInterface $product - * @param Element|null $element [optional] - * @param CatalogCategory|null $category [optional] - * @return void - */ - protected function fillDefaultFields( - FixtureInterface $product, - Element $element = null, - CatalogCategory $category = null - ) { - $tabs = $this->prepareTabs($product, $category); - $this->fillTabs($tabs, $element); - $this->fillWebsitesTab($product); - } - - /** - * Prepare tabs. - * - * @param FixtureInterface $product - * @param CatalogCategory|null $category - * @return array - */ - protected function prepareTabs(FixtureInterface $product, CatalogCategory $category = null) - { - $tabs = $this->getFieldsByTabs($product); - $categories = $this->prepareCategories($product, $category); - if (!empty($categories)) { - $tabs['categories'] = $categories; - } - return $tabs; - } - - /** - * Fill websites tab. - * - * @param FixtureInterface $product - * @return void - */ - protected function fillWebsitesTab(FixtureInterface $product) - { - if (!$this->isWebsiteTabVisible()) { - return; - } - $data = $product->hasData('website_ids') ? $product->getWebsiteIds() : ['Main Website']; - $this->openTab('websites'); - $this->getTabElement('websites')->fillFormTab($data); - } - - /** - * Check website tab visible. - * - * @return bool - */ - protected function isWebsiteTabVisible() - { - return $this->_rootElement->find($this->websitesTab)->isVisible(); - } - - /** - * Prepare categories for fill. - * - * @param FixtureInterface $product - * @param CatalogCategory|null $category - * @return array - */ - protected function prepareCategories(FixtureInterface $product, CatalogCategory $category = null) - { - return $category - ? [$category] - : ($product->hasData('category_ids') - ? $product->getDataFieldConfig('category_ids')['source']->getCategories() - : []); - } - - /** - * Get product type. - * - * @param FixtureInterface $product - * @return string|null - */ - protected function getProductType(FixtureInterface $product) - { - $dataConfig = $product->getDataConfig(); - return isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - } - - /** - * Fill product's settings. - * - * @param FixtureInterface $product - * @return void - */ - protected function fillSettingsTabs(FixtureInterface $product) - { - if ($this->_rootElement->find($this->settingsTab)->isVisible()) { - $tabs = $this->prepareSettingsData($product); - foreach ($tabs as $tabName => $tabFields) { - $tabElement = $this->getTabElement($tabName); - $tabElement->fillFormTab($tabFields); - } - } - } - - /** - * Prepare data for settings tabs. - * - * @param FixtureInterface $product - * @return array - */ - protected function prepareSettingsData(FixtureInterface $product) - { - $typeId = $this->getProductType($product); - $attributeSet = null; - $tabs['settings']['product_type']['value'] = $this->hasRender($typeId) - ? $this->callRender($typeId, 'convertProductType') - : ucfirst($typeId) . ' Product'; - if ($product->hasData('attribute_set_id')) { - $attributeSet = $product->getDataFieldConfig('attribute_set_id')['source']->getAttributeSet(); - } elseif ($product instanceof ConfigurableProduct && !$product->hasData('attribute_set_id')) { - $attributeSet = $product->getDataFieldConfig('configurable_options')['source']->getAttributeSet(); - } - if ($attributeSet) { - $tabs['settings']['attribute_set_id']['value'] = $attributeSet->getAttributeSetName(); - if ($attributeSet->hasData('assigned_attributes')) { - $attributes = $attributeSet->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - $tabs['super-settings']['attribute']['value'] = $attributes; - } - } - - return $tabs; - } - - /** - * Open product tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $this->_rootElement->find($this->productInfo)->click(); - parent::openTab($tabName); - $this->getTemplateBlock()->waitLoader(); - - return $this; - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Check visibility of the attribute on the product page. - * - * @param mixed $productAttribute - * @return bool - */ - public function checkAttributeLabel($productAttribute) - { - $frontendLabel = (is_array($productAttribute)) - ? $productAttribute['frontend_label'] - : $productAttribute->getFrontendLabel(); - $attributeLabelLocator = sprintf($this->attribute, $frontendLabel); - - return $this->_rootElement->find($attributeLabelLocator, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Check attribute set name. - * - * @param string $name - * @return bool - */ - public function checkAttributeSet($name) - { - $attributeSetLabel = $this->_rootElement->find(sprintf($this->attributeSet, $name), Locator::SELECTOR_XPATH); - $attributeSetLabel->click(); - return $attributeSetLabel->isVisible(); - } - - /** - * Get require notice attributes. - * - * @param FixtureInterface $product - * @return array - */ - public function getRequireNoticeAttributes(FixtureInterface $product) - { - $data = []; - $tabs = $this->getFieldsByTabs($product); - foreach ($tabs as $tabName => $fields) { - $tab = $this->getTabElement($tabName); - $this->openTab($tabName); - $errors = $tab->getRequireNoticeMessages(); - if (!empty($errors)) { - $data[$tabName] = $errors; - } - } - return $data; - } - - /** - * Get attribute element. - * - * @param CatalogProductAttribute $attribute - * @return CustomAttribute - */ - public function getAttributeElement(CatalogProductAttribute $attribute) - { - return $this->_rootElement->find( - sprintf($this->attributeBlock, $attribute->getFrontendLabel()), - Locator::SELECTOR_XPATH, - 'Mage\Adminhtml\Test\Block\Catalog\Product\Attribute\CustomAttribute' - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml deleted file mode 100644 index 74402b3228c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\ProductSettings - #product_info_tabs_set - - - #attribute_set_id - select - - - [name="type"] - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - - - - - - select - - - - select - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - - select - - - - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_inventory - product - - - - [name="product[stock_data][qty]"] - - - [name="product[stock_data][is_in_stock]"] - select - - - [name="product[stock_data][use_config_manage_stock]"] - checkbox - - - [name="product[stock_data][manage_stock]"] - select - - - [name='product[stock_data][use_config_min_qty]'] - checkbox - - - [name='product[stock_data][min_qty]'] - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Categories - #product_info_tabs_categories - product - - - #product-categories - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\CustomOptions - #product_info_tabs_customer_options - css selector - - - <selector>input[id$='_title']</selector> - <strategy>css selector</strategy> - - - select[id$='_is_require'] - css selector - select - - - select[id$='_type'] - css selector - optgroupselect - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\SuperSettings - #product_info_tabs_super_settings - css selector - - - //tr[td[@class="label" and label[text()="%s"]]]//td[@class="value"]/input - checkbox - xpath - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Configurable - #product_info_tabs_configurable - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Related - #product_info_tabs_related - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Crosssell - #product_info_tabs_crosssell - css selector - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Upsell - #product_info_tabs_upsell - css selector - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #product_info_tabs_group_17 - css selector - product - - - checkbox - - - select - - - select - - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Websites - #product_info_tabs_websites - css selector - - - //*[@class="website-name" and .//label[text()="%s"]]/input - checkbox - xpath - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\AssociatedProducts - #product_info_tabs_super - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php deleted file mode 100644 index 8c696536667..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/FormPageActions.php +++ /dev/null @@ -1,57 +0,0 @@ -_rootElement->find($this->saveAndApplyButton)->click(); - } - - /** - * Click "Delete" button. - * - * @return void - */ - public function delete() - { - $this->_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php deleted file mode 100644 index 04ceab84090..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog.php +++ /dev/null @@ -1,59 +0,0 @@ - [ - 'selector' => '#promo_catalog_grid_filter_rule_id', - ], - 'name' => [ - 'selector' => '#promo_catalog_grid_filter_name', - ], - 'from_date' => [ - 'selector' => '[name="from_date[from]"]', - ], - 'to_date' => [ - 'selector' => '[name="from_date[to]"]', - ], - 'is_active' => [ - 'selector' => '#promo_catalog_grid_filter_is_active', - 'input' => 'select', - ], - 'rule_website' => [ - 'selector' => '#promo_catalog_grid_filter_rule_website', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php deleted file mode 100644 index 6eb4ee8d0ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.php +++ /dev/null @@ -1,91 +0,0 @@ -getFieldsByTabs($catalogPriceRule); - if ($replace) { - $tabs = $this->prepareData($tabs, $replace); - } - $this->fillWebsites($catalogPriceRule); - $this->fillTabs($tabs, $element); - } - - /** - * Fill website. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - protected function fillWebsites(CatalogRule $catalogPriceRule) - { - $websiteField = $this->_rootElement->find($this->website, Locator::SELECTOR_CSS, 'multiselectlist'); - if ($websiteField->isVisible() && !$catalogPriceRule->hasData('website_ids')) { - $websiteField->setValue('Main Website'); - } - } - - /** - * Replace placeholders in each values of data. - * - * @param array $tabs - * @param array $replace - * @return array - */ - protected function prepareData(array $tabs, array $replace) - { - foreach ($replace as $tabName => $fields) { - foreach ($fields as $key => $pairs) { - if (isset($tabs[$tabName][$key])) { - $tabs[$tabName][$key]['value'] = str_replace( - array_keys($pairs), - array_values($pairs), - $tabs[$tabName][$key]['value'] - ); - } - } - } - - return $tabs; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml deleted file mode 100644 index 4a0f7cb5136..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/Form.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_main_section - css selector - - - - - select - - - [name='website_ids[]'] - multiselect - - - [name='customer_group_ids[]'] - multiselect - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_conditions_section - css selector - - - #rule_conditions_fieldset - conditions - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_actions_section - css selector - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php deleted file mode 100644 index 02f7cd26799..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.php +++ /dev/null @@ -1,67 +0,0 @@ -getFieldsByTabs($fixture); - if ($replace) { - $tabs = $this->prepareData($tabs, $replace); - } - $this->fillTabs($tabs, $element); - } - - /** - * Replace placeholders in each values of data. - * - * @param array $tabs - * @param array $replace - * @return array - */ - protected function prepareData(array $tabs, array $replace) - { - foreach ($replace as $tabName => $fields) { - foreach ($fields as $key => $pairs) { - if (isset($tabs[$tabName][$key])) { - $tabs[$tabName][$key]['value'] = str_replace( - array_keys($pairs), - array_values($pairs), - $tabs[$tabName][$key]['value'] - ); - } - } - } - - return $tabs; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml deleted file mode 100644 index 4a0f7cb5136..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/Catalog/Edit/PromoForm.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_main_section - css selector - - - - - select - - - [name='website_ids[]'] - multiselect - - - [name='customer_group_ids[]'] - multiselect - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_conditions_section - css selector - - - #rule_conditions_fieldset - conditions - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #promo_catalog_edit_tabs_actions_section - css selector - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php deleted file mode 100644 index b5d9512ce78..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogRule/Promo/GridPageActions.php +++ /dev/null @@ -1,37 +0,0 @@ -_rootElement->find($this->applyRules)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php deleted file mode 100644 index 6b10e546884..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Edit/SearchTermForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - selectstore - - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php deleted file mode 100644 index 3bfa859d011..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/CatalogSearch/Grid.php +++ /dev/null @@ -1,53 +0,0 @@ - [ - 'selector' => 'input[name="search_query"]', - ], - 'store_id' => [ - 'selector' => 'select[name="store_id"]', - 'input' => 'selectstore', - ], - 'results_from' => [ - 'selector' => 'input[name="num_results[from]"]', - ], - 'popularity_from' => [ - 'selector' => 'input[name="popularity[from]"]', - ], - 'synonym_for' => [ - 'selector' => 'input[name="synonym_for"]', - ], - 'redirect' => [ - 'selector' => 'input[name="redirect"]', - ], - 'display_in_terms' => [ - 'selector' => 'select[name="display_in_terms"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php deleted file mode 100644 index 7c38c07e436..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.php +++ /dev/null @@ -1,61 +0,0 @@ -fillWebsite(); - - return $this; - } - - /** - * Fill website field. - * - * @return void - */ - protected function fillWebsite() - { - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if ($storeViewField->isVisible() && !$storeViewField->getValue()) { - $storeViewField->setValue('All Store Views'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml deleted file mode 100644 index 907c0c60b35..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Edit/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - select - - - select - - - [name="stores[]"] - multiselectgrouplist - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php deleted file mode 100644 index 77baa20af22..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Checkout/Agreement/Grid.php +++ /dev/null @@ -1,47 +0,0 @@ - [ - 'selector' => 'input[name="name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php deleted file mode 100644 index ccf7fb901ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/CmsGrid.php +++ /dev/null @@ -1,50 +0,0 @@ - [ - 'selector' => '#cmsBlockGrid_filter_title', - ], - 'identifier' => [ - 'selector' => '#cmsBlockGrid_filter_identifier', - ], - 'is_active' => [ - 'selector' => '#cmsBlockGrid_filter_is_active', - 'input' => 'select', - ] - ]; - - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php deleted file mode 100644 index 55685d84b5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.php +++ /dev/null @@ -1,69 +0,0 @@ -_rootElement->find($this->contentForm, Locator::SELECTOR_CSS); - $toggleButton = $this->_rootElement->find($this->toggleButton, Locator::SELECTOR_CSS); - if (!$content->isVisible()) { - $toggleButton->click(); - } - } - - /** - * Fill form. - * - * @param FixtureInterface $fixture - * @param SimpleElement|null $element - * @return void - */ - public function fill(FixtureInterface $fixture, SimpleElement $element = null) - { - $this->toggleEditor(); - parent::fill($fixture, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml deleted file mode 100644 index 10e38f5a5a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/BlockForm.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - <identifier /> - <is_active> - <input>select</input> - </is_active> - <content /> - <stores> - <selector>[name="stores[]"]</selector> - <input>multiselectgrouplist</input> - </stores> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php deleted file mode 100644 index b509c715af6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Block/Edit/FormPageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Block\Edit; - -/** - * Form page actions block for cms page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * Get Cms Block id. - * - * @return int - * @throws \Exception - */ - public function getBlockId() - { - $attribute = $this->_rootElement->find($this->deleteButton)->getAttribute('onclick'); - - preg_match('~http[^\s]*\/block_id\/(\d+)~', $attribute, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Block id'); - } - - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php deleted file mode 100644 index 4503fb42ec2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit; - -/** - * Form page actions block for cms page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * 'Preview' button selector. - * - * @var string - */ - protected $previewButton = '.scalable.preview'; - - /** - * Click "Preview" button. - * - * @return void - */ - public function preview() - { - $this->_rootElement->find($this->previewButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php deleted file mode 100644 index fa2978c73e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Mage\Cms\Test\Fixture\CmsPage; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Backend Cms Page edit page. - */ -class PageForm extends FormTabs -{ - /** - * Selector for store view field. - * - * @var string - */ - protected $storeView = '#page_store_id'; - - /** - * Fill form with tabs. - * - * @param FixtureInterface $cms - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $cms, Element $element = null) - { - $this->fillStoreView($cms); - return parent::fill($cms, $element); - } - - /** - * Fill store view. - * - * @param CmsPage $cms - * @return void - */ - protected function fillStoreView(CmsPage $cms) - { - $this->openTab('page_information'); - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if($storeViewField->isVisible() && !$cms->hasData('store_id')) { - $storeViewField->setValue('All Store Views'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml deleted file mode 100644 index 1f460822e2f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/PageForm.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <page_information> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#page_tabs_main_section</selector> - <strategy>css selector</strategy> - <fields> - <title /> - <identifier /> - <store_id> - <selector>[name='stores[]']</selector> - <input>multiselectgrouplist</input> - </store_id> - <is_active> - <input>select</input> - </is_active> - <under_version_control> - <input>select</input> - </under_version_control> - </fields> - </page_information> - <content> - <class>\Mage\Adminhtml\Test\Block\Cms\Page\Edit\Tab\Content</class> - <selector>#page_tabs_content_section</selector> - <strategy>css selector</strategy> - <fields> - <content_heading /> - <content /> - </fields> - </content> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php deleted file mode 100644 index 28049e5eb6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Edit/Tab/Content.php +++ /dev/null @@ -1,166 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Cms\Wysiwyg\Config; -use Mage\Widget\Test\Block\Adminhtml\WidgetForm; - -/** - * Backend cms page content tab. - */ -class Content extends Tab -{ - /** - * Page content toolbar selector. - * - * @var string - */ - protected $contentToolBar = "#page_content_toolbargroup"; - - /** - * Hide button selector. - * - * @var string - */ - protected $hideButton = "#togglepage_content"; - - /** - * Insert Variable button selector. - * - * @var string - */ - protected $addVariableButton = ".add-variable"; - - /** - * Insert Widget button selector. - * - * @var string - */ - protected $addWidgetButton = '.add-widget'; - - /** - * System Variable block selector. - * - * @var string - */ - protected $systemVariableBlock = ".//ancestor::body/div[@id='variables-chooser']"; - - /** - * Widget block selector. - * - * @var string - */ - protected $widgetBlock = ".//ancestor::body/div[@id='widget_window']"; - - /** - * Hide editor. - * - * @return void - */ - protected function hideEditor() - { - if ($this->_rootElement->find($this->contentToolBar)->isVisible()) { - $this->_rootElement->find($this->hideButton)->click(); - } - } - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - $this->hideEditor(); - $content = $fields['content']['value']; - $fields['content']['value'] = $content['content']; - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - if (isset($content['variable'])) { - $this->clickInsertVariable(); - $config = $this->getWysiwygConfig(); - $config->selectVariable($content['variable']); - } - if (isset($content['widget'])) { - foreach ($content['widget']['preset'] as $widget) { - $this->clickInsertWidget(); - $this->getWidgetBlock()->addWidget($widget); - } - } - - return $this; - } - - /** - * Click 'Insert Variable' button. - * - * @return void - */ - public function clickInsertVariable() - { - $this->_rootElement->find($this->addVariableButton)->click(); - } - - /** - * Click 'Insert Widget' button. - * - * @return void - */ - public function clickInsertWidget() - { - $this->_rootElement->find($this->addWidgetButton)->click(); - } - - /** - * Get for wysiwyg config block. - * - * @return Config - */ - public function getWysiwygConfig() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Cms\Wysiwyg\Config', - ['element' => $this->_rootElement->find($this->systemVariableBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get widget block. - * - * @return WidgetForm - */ - public function getWidgetBlock() - { - return $this->blockFactory->create( - 'Mage\Widget\Test\Block\Adminhtml\WidgetForm', - ['element' => $this->_rootElement->find($this->widgetBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * {@inheritdoc} - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $this->hideEditor(); - return parent::getDataFormTab($fields, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php deleted file mode 100644 index d3f4a70c254..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Grid.php +++ /dev/null @@ -1,83 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page; - -/** - * Backend Cms Page grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'title' => [ - 'selector' => '#cmsPageGrid_filter_title' - ], - 'identifier' => [ - 'selector' => '#cmsPageGrid_filter_identifier' - ], - 'is_active' => [ - 'selector' => '#cmsPageGrid_filter_is_active', - 'input' => 'select' - ] - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; - - /** - * Selector for review link. - * - * @var string - */ - protected $reviewLink = 'a'; - - /** - * The number of attempts for click. - */ - const COUNT = 3; - - /** - * Search and review. - * - * @param $filter - * @throws \Exception - * @return void - */ - public function searchAndReview($filter) - { - $this->search($filter); - $rowItem = $this->_rootElement->find($this->rowItem); - if ($rowItem->isVisible()) { - $count = 0; - $link = $rowItem->find($this->reviewLink); - do { - $link->click(); - $this->browser->selectWindow(); - $count++; - } while ($link->isVisible() && $count < self::COUNT); - } else { - throw new \Exception('Searched item was not found.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php deleted file mode 100644 index 862e07c58b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Page/Widget/Chooser.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Page\Widget; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Backend select page, block grid. - */ -class Chooser extends Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'chooser_identifier' => [ - 'selector' => 'input[name="chooser_identifier"]', - ], - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php deleted file mode 100644 index ee8bd8cf219..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Cms/Wysiwyg/Config.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Cms\Wysiwyg; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * System variable management block. - */ -class Config extends Block -{ - /** - * Variable link selector. - * - * @var string - */ - protected $variableSelector = '//a[contains(text(),"%s")]'; - - /** - * Select variable by name. - * - * @param string $variableName - * @return void - */ - public function selectVariable($variableName) - { - $this->_rootElement->find(sprintf($this->variableSelector, $variableName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php deleted file mode 100644 index 36634030c5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/CustomerGrid.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Backend customer grid - */ -class CustomerGrid extends Grid -{ - /** - * Selector for action option select. - * - * @var string - */ - protected $option = '[name="group"]'; - - /** - * The first row in grid. For this moment we suggest that we should strictly define what we are going to search. - * - * @var string - */ - protected $rowItem = 'div.grid tbody tr'; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td[class*=last] a'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'name' => [ - 'selector' => '#customerGrid_filter_name', - ], - 'email' => [ - 'selector' => '#customerGrid_filter_email', - ], - 'group' => [ - 'selector' => '#customerGrid_filter_group', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php deleted file mode 100644 index 8ed1f319792..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Fixture\Address; - -/** - * Form for creation of the customer. - */ -class CustomerForm extends FormTabs -{ - /** - * Customer groups selector. - * - * @var string - */ - protected $customerGroupsSelector = "[name='account[group_id]']"; - - /** - * Fill Customer forms on tabs by customer, addresses data. - * - * @param Customer $customer - * @param Address|Address[]|null $address - * @return $this - */ - public function fillCustomer(Customer $customer, $address = null) - { - if ($customer->hasData()) { - parent::fill($customer); - } - if (null !== $address) { - $this->openTab('addresses'); - $this->getTabElement('addresses')->fillAddresses($address); - } - - return $this; - } - - /** - * Get data of Customer information, addresses on tabs. - * - * @param Customer $customer - * @param Address|Address[]|null $address - * @return array - */ - public function getDataCustomer(Customer $customer, $address = null) - { - $data = ['customer' => $customer->hasData() ? parent::getData($customer) : parent::getData()]; - - if (null !== $address) { - $this->openTab('addresses'); - $data['addresses'] = $this->getTabElement('addresses')->getDataAddresses($address); - } - - return $data; - } - - /** - * Get customer groups. - * - * @return array - */ - public function getCustomerGroups() - { - return explode("\n", $this->_rootElement->find($this->customerGroupsSelector)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml deleted file mode 100644 index e98610c0d64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/CustomerForm.xml +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <account_information> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#customer_info_tabs_account</selector> - <strategy>css selector</strategy> - <wrapper>account</wrapper> - <fields> - <website_id> - <input>select</input> - </website_id> - <group_id> - <input>select</input> - </group_id> - <prefix /> - <firstname /> - <middlename /> - <lastname /> - <suffix /> - <email /> - <dob> - <input>datepicker</input> - </dob> - <taxvat /> - <gender> - <input>select</input> - </gender> - <password /> - </fields> - </account_information> - <addresses> - <class>\Mage\Adminhtml\Test\Block\Customer\Edit\Tab\Addresses</class> - <selector>#customer_info_tabs_addresses</selector> - <strategy>css selector</strategy> - </addresses> - <wishlist> - <class>\Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist</class> - <selector>#customer_info_tabs_wishlist</selector> - <strategy>css selector</strategy> - </wishlist> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php deleted file mode 100644 index 131f0a1fbff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit; - -/** - * Form page actions block for customer page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * 'Create Order' button selector. - * - * @var string - */ - protected $createOrderButton = '.scalable.add'; - - /** - * Click "Create Order" button. - * - * @return void - */ - public function createOrder() - { - $this->_rootElement->find($this->createOrderButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php deleted file mode 100644 index c9664ef6cf2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Edit\Tab; - -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; -use Mage\Customer\Test\Fixture\Address; -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Customer addresses edit block. - */ -class Addresses extends Tab -{ - /** - * "Add New Customer" button. - * - * @var string - */ - protected $addNewAddress = '#add_address_button'; - - /** - * Open customer address. - * - * @var string - */ - protected $customerAddress = '//*[@id="address_list"]/li[%d]/a'; - - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill customer addresses. - * - * @param Address|Address[] $address - * @return $this - */ - public function fillAddresses($address) - { - $addresses = is_array($address) ? $address : [$address]; - foreach ($addresses as $address) { - $this->addNewAddress(); - - /* Fix switch between region_id and region */ - /** @var Address $address */ - $countryId = $address->getCountryId(); - if ($countryId && $this->mapping['country_id']) { - $this->_fill($this->dataMapping(['country_id' => $countryId])); - $this->getTemplateBlock()->waitLoader(); - } - - $this->fillFormTab($address->getData(), $this->_rootElement); - } - - return $this; - } - - /** - * Update customer addresses. - * - * @param Address|Address[] $address - * @return $this - * @throws \Exception - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - public function updateAddresses($address) - { - $addresses = is_array($address) ? $address : [1 => $address]; - foreach ($addresses as $addressNumber => $address) { - /* Throw exception if isn't exist previous customer address. */ - if (1 < $addressNumber && !$this->isVisibleCustomerAddress($addressNumber - 1)) { - throw new \Exception("Invalid argument: can't update customer address #{$addressNumber}"); - } - - if (!$this->isVisibleCustomerAddress($addressNumber)) { - $this->addNewAddress(); - } - $this->openCustomerAddress($addressNumber); - - /* Fix switch between region_id and region */ - /** @var Address $address */ - $countryId = $address->getCountryId(); - if ($countryId && $this->mapping['country_id']) { - $this->_fill($this->dataMapping(['country_id' => $countryId])); - $this->getTemplateBlock()->waitLoader(); - } - $defaultAddress = ['default_billing' => 'No', 'default_shipping' => 'No']; - $addressData = $address->getData(); - foreach ($defaultAddress as $key => $value) { - if (isset($addressData[$key])) { - $defaultAddress[$key] = $value; - } - } - $this->_fill($this->dataMapping($defaultAddress)); - - $this->fillFormTab(array_diff($addressData, $defaultAddress), $this->_rootElement); - } - - return $this; - } - - /** - * Get data of Customer addresses. - * - * @param Address|Address[]|null $address - * @return array - * @throws \Exception - */ - public function getDataAddresses($address = null) - { - $data = []; - $addresses = is_array($address) ? $address : [1 => $address]; - - foreach ($addresses as $addressNumber => $address) { - $isHasData = (null === $address) || $address->hasData(); - $isVisibleCustomerAddress = $this->isVisibleCustomerAddress($addressNumber); - - if ($isHasData && !$isVisibleCustomerAddress) { - throw new \Exception("Invalid argument: can't get data from customer address #{$addressNumber}"); - } - - if (!$isHasData && !$isVisibleCustomerAddress) { - $data[$addressNumber] = []; - } else { - $this->openCustomerAddress($addressNumber); - $data[$addressNumber] = $this->getData($address, $this->_rootElement); - } - } - - return $data; - } - - /** - * Get data to fields on tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getDataFormTab($fields = null, Element $element = null) - { - /* Skip get data for standard method. Use getDataAddresses. */ - return []; - } - - /** - * Click "Add New Address" button. - * - * @return void - */ - protected function addNewAddress() - { - $this->_rootElement->find($this->addNewAddress)->click(); - } - - /** - * Open customer address. - * - * @param int $addressNumber - * @throws \Exception - * @return void - */ - protected function openCustomerAddress($addressNumber) - { - $addressTab = $this->_rootElement->find( - sprintf($this->customerAddress, $addressNumber), - Locator::SELECTOR_XPATH - ); - - if (!$addressTab->isVisible()) { - throw new \Exception("Can't open customer address #{$addressNumber}"); - } - $addressTab->click(); - } - - /** - * Check is visible customer address. - * - * @param int $addressNumber - * @return bool - */ - protected function isVisibleCustomerAddress($addressNumber) - { - $addressTab = $this->_rootElement->find( - sprintf($this->customerAddress, $addressNumber), - Locator::SELECTOR_XPATH - ); - return $addressTab->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml deleted file mode 100644 index 83194c08118..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Edit/Tab/Addresses.xml +++ /dev/null @@ -1,90 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <prefix> - <selector>#address_form_container [name^="address"][name$="[prefix]"]</selector> - <strategy>css selector</strategy> - </prefix> - <firstname> - <selector>#address_form_container [name^="address"][name$="[firstname]"]</selector> - <strategy>css selector</strategy> - </firstname> - <middlename> - <selector>#address_form_container [name^="address"][name$="[middlename]"]</selector> - <strategy>css selector</strategy> - </middlename> - <lastname> - <selector>#address_form_container [name^="address"][name$="[lastname]"]</selector> - <strategy>css selector</strategy> - </lastname> - <suffix> - <selector>#address_form_container [name^="address"][name$="[suffix]"]</selector> - <strategy>css selector</strategy> - </suffix> - <company> - <selector>#address_form_container [name^="address"][name$="[company]"]</selector> - <strategy>css selector</strategy> - </company> - <street> - <selector>#address_form_container [name^="address"][name$="[street][0]"]</selector> - <strategy>css selector</strategy> - </street> - <city> - <selector>#address_form_container [name^="address"][name$="[city]"]</selector> - <strategy>css selector</strategy> - </city> - <country_id> - <input>select</input> - <selector>#address_form_container [name^="address"][name$="[country_id]"]</selector> - <strategy>css selector</strategy> - </country_id> - <region_id> - <input>select</input> - <selector>#address_form_container [name^="address"][name$="[region_id]"]</selector> - <strategy>css selector</strategy> - </region_id> - <region> - <selector>#address_form_container [name^="address"][name$="[region]"]</selector> - <strategy>css selector</strategy> - </region> - <postcode> - <selector>#address_form_container [name^="address"][name$="[postcode]"]</selector> - <strategy>css selector</strategy> - </postcode> - <telephone> - <selector>#address_form_container [name^="address"][name$="[telephone]"]</selector> - <strategy>css selector</strategy> - </telephone> - <fax> - <selector>#address_form_container [name^="address"][name$="[fax]"]</selector> - <strategy>css selector</strategy> - </fax> - <vat_id> - <selector>#address_form_container [name^="address"][name$="[vat_id]"]</selector> - <strategy>css selector</strategy> - </vat_id> - <default_billing> - <selector>#address_list [name^="account"][name$="[default_billing]"]</selector> - <input>checkbox</input> - </default_billing> - <default_shipping> - <selector>#address_list [name^="account"][name$="[default_shipping]"]</selector> - <input>checkbox</input> - </default_shipping> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php deleted file mode 100644 index 58b15d62a58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Group\Edit; - -/** - * Customer group edit form. - */ -class Form extends \Magento\Mtf\Block\Form -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml deleted file mode 100644 index 3d3ee75ccf8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Edit/Form.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <code /> - <tax_class_id> - <selector>#tax_class_id</selector> - <input>select</input> - </tax_class_id> - <customer_group_code> - <selector>#customer_group_code</selector> - </customer_group_code> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php deleted file mode 100644 index 35c39a06587..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Customer/Group/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Customer\Group; - -/** - * Customer group grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array $filters - */ - protected $filters = [ - 'code' => [ - 'selector' => '#customerGroupGrid_filter_type', - ], - ]; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php deleted file mode 100644 index 409d388961a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/FormPageActions.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -/** - * Form page actions block. - */ -class FormPageActions extends PageActions -{ - /** - * 'Save' button selector. - * - * @var string - */ - protected $saveButton = '.scalable.save'; - - /** - * "Save and Continue Edit" button. - * - * @var string - */ - protected $saveAndContinueButton = '[onclick*="saveAndContinueEdit"]'; - - /** - * Header floating css selector. - * - * @var string - */ - protected $headerFloating = '.content-header-floating'; - - /** - * 'Delete' button selector. - * - * @var string - */ - protected $deleteButton = '.scalable.delete'; - - /** - * Selector for top page. - * - * @var string - */ - protected $topPage = '#global_search'; - - /** - * Click "Save" button. - * - * @return void - */ - public function save() - { - $this->buttonClick('save'); - } - - /** - * Click on "Save and Continue Edit" button. - * - * @return void - */ - public function saveAndContinue() - { - $this->buttonClick('saveAndContinue'); - } - - /** - * Click "Delete" button. - * - * @return void - */ - public function delete() - { - $this->browser->find($this->topPage)->hover(); - $this->_rootElement->find($this->deleteButton)->click(); - } - - /** - * Click "Delete" button and accept alert. - * - * @return void - */ - public function deleteAndAcceptAlert() - { - $this->delete(); - $this->browser->acceptAlert(); - } - - /** - * Click on button. - * - * @param string $buttonName - * @return void - */ - protected function buttonClick($buttonName) - { - $this->clickOnTopPage(); - $button = $this->_rootElement->find($this->{$buttonName . 'Button'}); - if ($button->isVisible()) { - $button->click(); - } else { - $this->browser->find($this->headerFloating . ' ' . $this->{$buttonName . 'Button'})->click(); - } - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Click on top page. - * - * @return void - */ - protected function clickOnTopPage() - { - $topPage = $this->browser->find($this->topPage); - if ($topPage->isVisible()) { - $topPage->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php deleted file mode 100644 index 299aae9dc81..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/GridPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -/** - * Grid page actions block. - */ -class GridPageActions extends PageActions -{ - /** - * "Add New" button. - * - * @var string - */ - protected $addNewButton = '.scalable.add'; - - /** - * Click on "Add New" button. - * - * @return void - */ - public function addNew() - { - $this->_rootElement->find($this->addNewButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php deleted file mode 100644 index ccdcb8b8422..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Newsletter/Grid.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Newsletter; - -/** - * Newsletter subscribers grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'email' => [ - 'selector' => '#subscriberGrid_filter_email', - ], - 'firstname' => [ - 'selector' => '#subscriberGrid_filter_firstname' - ], - 'lastname' => [ - 'selector' => '#subscriberGrid_filter_lastname' - ], - 'status' => [ - 'selector' => '#subscriberGrid_filter_status', - 'input' => 'select' - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php deleted file mode 100644 index ea1bb1fa8b6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Footer.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2020-2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Header block. - */ -class Footer extends Block -{ - /** - * @var string - */ - protected $versionPath = '//div[@class="footer" and contains(.,"OpenMage ver. '; - - /** - * @param $currentVersion - * @return string - */ - protected function getVersionLocator($currentVersion) - { - return $this->versionPath . $currentVersion . '")]'; - } - - /** - * - */ - public function findVersion($currentVersion) - { - return $this->_rootElement->find($this->getVersionLocator($currentVersion), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php deleted file mode 100644 index 958ec941a55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Header.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Header block. - */ -class Header extends Block -{ - /** - * Logout link selector. - * - * @var string - */ - protected $logOut = '.link-logout'; - - /** - * Top menu item selector. - * - * @var string - */ - protected $topMenuItem = './/div[@class = "nav-bar"]/ul/li/a[contains(., "%s")]'; - - /** - * Log out Admin User. - * - * @return void - */ - public function logOut() - { - $this->_rootElement->find($this->logOut)->click(); - $this->waitForElementNotVisible($this->logOut); - } - - /** - * First level menu items selector. - * - * @var string - */ - protected $firstLevelMenuItem = 'li.parent.level0'; - - /** - * Check navigation menu. - * - * @param string $name - * @return bool - */ - public function checkMenu($name) - { - return $this->_rootElement->find(sprintf($this->topMenuItem, $name), Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Wait header block is visible. - * - * @return bool - */ - public function waitVisible() - { - try { - $browser = $this->_rootElement; - return $browser->waitUntil( - function () use ($browser) { - return $browser->isVisible() ? true : null; - } - ); - } catch (\Exception $e) { - return false; - } - } - - /** - * Get first-level menu elements. - * - * @return array - */ - public function getMenuFirstLevelItems() - { - $elements = $this->_rootElement->getElements($this->firstLevelMenuItem); - $items = []; - foreach ($elements as $element) { - $items[] = $element->getText(); - } - return $items; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php deleted file mode 100644 index c995bd006bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Page/Main.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Page; - -use Magento\Mtf\Block\Block; - -/** - * Main dashboard block. - */ -class Main extends Block -{ - /** - * Selector for Revenue prices. - * - * @var string - */ - protected $revenuePriceBlock = '#dashboard_diagram_totals td:first-child'; - - /** - * Get Revenue price. - * - * @return string - */ - public function getRevenuePrice() - { - return $this->_rootElement->find($this->revenuePriceBlock)->getText(); - } - - /** - * Get Main Block text. - * - * @return string - */ - public function getMainBlockText() - { - return $this->_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php deleted file mode 100644 index 8324a93dc7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/PageActions.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Page actions block for Form page & Grid page action blocks to extend. - */ -class PageActions extends Block -{ - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php deleted file mode 100644 index 38a646e5854..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Edit/Tab/RoleResources.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role\Edit\Tab; - -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Mage\Adminhtml\Test\Block\Widget\Tab; - -/** - * Role resources Tab. - */ -class RoleResources extends Tab -{ - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['roles_resources'])) { - $fields['roles_resources']['value'] = ucfirst($fields['roles_resources']['value'][0]); - } - $data = $this->dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php deleted file mode 100644 index 1fde3b3e717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/Grid/RoleGrid.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role\Grid; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Role grid on role index page. - */ -class RoleGrid extends Grid -{ - /** - * Grid filters' selectors. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => '#roleGrid_filter_role_id', - ], - 'rolename' => [ - 'selector' => '#roleGrid_filter_role_name', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php deleted file mode 100644 index 3c096d859af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\Role; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; - -/** - * Role edit form page. - */ -class RoleForm extends FormTabs -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml deleted file mode 100644 index 1f50d55e154..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/Role/RoleForm.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <role-info> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#role_info_tabs_info</selector> - <strategy>css selector</strategy> - <fields> - <role_name> - <selector>[name='rolename']</selector> - <strategy>css selector</strategy> - </role_name> - </fields> - </role-info> - <role-resources> - <class>\Mage\Adminhtml\Test\Block\Permissions\Role\Edit\Tab\RoleResources</class> - <selector>#role_info_tabs_account</selector> - <strategy>css selector</strategy> - <fields> - <resource_access> - <selector>[name="all"]</selector> - <strategy>css selector</strategy> - <input>select</input> - </resource_access> - <roles_resources> - <selector>#resource-tree</selector> - <strategy>css selector</strategy> - <input>tree</input> - </roles_resources> - </fields> - </role-resources> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php deleted file mode 100644 index bb3c6c787e7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Permissions/User/Grid.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Permissions\User; - -/** - * User grid on User index page. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Grid filters' selectors. - * - * @var array - */ - protected $filters = [ - 'username' => [ - 'selector' => '#permissionsUserGrid_filter_username' - ], - 'email' => [ - 'selector' => '#permissionsUserGrid_filter_email' - ] - ]; - - /** - * Locator value of td with username. - * - * @var string - */ - protected $editLink = 'td.last'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php deleted file mode 100644 index 172653b105e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo; - -/** - * Shopping Cart Price Rules grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'name' => [ - 'selector' => 'input[name="name"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php deleted file mode 100644 index 5f9ebda3b06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/FormPageActions.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit; - -/** - * Form page actions block for cart price rule page. - */ -class FormPageActions extends \Mage\Adminhtml\Test\Block\FormPageActions -{ - /** - * Click "Delete" button and accept alert. - * - * @return void - */ - public function delete() - { - $this->_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php deleted file mode 100644 index 380615921ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; - -/** - * PromoQuote form. - */ -class PromoQuoteForm extends FormTabs -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml deleted file mode 100644 index 351ad746509..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/PromoQuoteForm.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <rule_information> - <class>\Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab\RuleInformation</class> - <selector>#promo_catalog_edit_tabs_main_section</selector> - <strategy>css selector</strategy> - <fields> - <name /> - <description /> - <is_active> - <input>select</input> - </is_active> - <website_ids> - <selector>#rule_website_ids</selector> - <input>multiselect</input> - </website_ids> - <customer_group_ids> - <selector>[name="customer_group_ids[]"]</selector> - <input>multiselect</input> - </customer_group_ids> - <coupon_type> - <input>select</input> - </coupon_type> - <coupon_code /> - <uses_per_coupon /> - <uses_per_customer /> - <from_date /> - <to_date /> - <sort_order /> - <is_rss> - <input>select</input> - </is_rss> - </fields> - </rule_information> - <conditions> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#promo_catalog_edit_tabs_conditions_section</selector> - <strategy>css selector</strategy> - <fields> - <conditions_serialized> - <selector>#rule_conditions_fieldset</selector> - <input>conditions</input> - </conditions_serialized> - </fields> - </conditions> - <actions> - <class>\Mage\Adminhtml\Test\Block\Widget\Tab</class> - <selector>#promo_catalog_edit_tabs_actions_section</selector> - <strategy>css selector</strategy> - <fields> - <simple_action> - <input>select</input> - </simple_action> - <discount_amount /> - <discount_qty /> - <discount_step /> - <apply_to_shipping> - <input>select</input> - </apply_to_shipping> - <simple_free_shipping> - <input>select</input> - </simple_free_shipping> - <stop_rules_processing> - <input>select</input> - </stop_rules_processing> - <reward_points_delta /> - <actions_serialized> - <selector>#rule_actions_fieldset</selector> - <input>conditions</input> - </actions_serialized> - </fields> - </actions> - <labels> - <class>\Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab\Labels</class> - <selector>#promo_catalog_edit_tabs_labels_section</selector> - <strategy>css selector</strategy> - </labels> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php deleted file mode 100644 index abc8b66d155..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/Labels.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; - -/** - * Backend sales rule label tab. - */ -class Labels extends Tab -{ - /** - * Store label field name. - */ - const STORE_LABEL_NAME = '[name="store_labels[%s]"]'; - - /** - * Fill data to labels fields on labels tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['store_labels'])) { - $count = 0; - foreach ($fields['store_labels']['value'] as $storeLabel) { - $element->find(sprintf(self::STORE_LABEL_NAME, $count))->setValue($storeLabel); - ++$count; - } - } - - return $this; - } - - /** - * Get data of labels tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $storeLabels = []; - $count = 0; - $field = $this->_rootElement->find(sprintf(self::STORE_LABEL_NAME, $count)); - while ($field->isVisible()) { - $fieldValue = $field->getValue(); - if ($fieldValue != '') { - $storeLabels[$count] = $fieldValue; - } - ++$count; - $field = $this->_rootElement->find(sprintf(self::STORE_LABEL_NAME, $count)); - } - - return ['store_labels' => $storeLabels]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php deleted file mode 100644 index 5cd95be7a87..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Promo/Quote/Edit/Tab/RuleInformation.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Promo\Quote\Edit\Tab; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; -use Magento\Mtf\Client\Locator; - -/** - * Backend sales rule information tab. - */ -class RuleInformation extends Tab -{ - /** - * Web site field. - * - * @var string - */ - protected $websiteField = '#rule_website_ids'; - - /** - * Fill data to labels fields on labels tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - parent::fillFormTab($fields, $element); - $webSiteField = $this->_rootElement->find($this->websiteField, Locator::SELECTOR_CSS, 'multiselect'); - if ($webSiteField->isVisible()) { - $webSiteFieldValue = $webSiteField->getValue(); - if (empty($webSiteFieldValue)) { - $webSiteField->setValue('Main Website'); - } - } - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php deleted file mode 100644 index d6babbda07b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Rating/Grid.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Rating; - -/** - * Grid on rating index page. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php deleted file mode 100644 index b254a3be91a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review\Edit; - -use Mage\Adminhtml\Test\Block\Widget\Tab; -use Magento\Mtf\Client\Element\SimpleElement as Element; - -/** - * Review details tab. - */ -class ReviewDetails extends Tab -{ - /** - * Selector for customer. - * - * @var string - */ - protected $customer = '#customer'; - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - return array_merge(parent::getDataFormTab($fields, $element), ['customer' => $this->getCustomer()]); - } - - /** - * Get customer. - * - * @return string - */ - protected function getCustomer() - { - return $this->_rootElement->find($this->customer)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php deleted file mode 100644 index 52a060a0d45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Edit/ReviewDetails/RatingElement.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails; - -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\Element\SimpleElement; - -/** - * Rating typified element. - */ -class RatingElement extends SimpleElement -{ - /** - * Selector for label of checked rating. - * - * @var string - */ - protected $checkedRating = 'input:checked'; - - /** - * Selector for rating title. - * - * @var string - */ - protected $ratingTitle = '//*[@id="product-review-table"]/tbody/tr/td[1]'; - - /** - * Get ratings list. - * - * @return array - */ - public function getValue() - { - $result = []; - $ratings = $this->getElements($this->checkedRating, Locator::SELECTOR_CSS, 'checkbox'); - $titles = $this->getElements($this->ratingTitle, Locator::SELECTOR_XPATH); - foreach ($ratings as $key => $rating) { - $ratingTitle = $titles[$key]->getText(); - $result[] = [ - 'title' => $ratingTitle, - 'rating' => $this->prepareFormatValue($rating->getAttribute('id'), $ratingTitle) - ]; - } - - return $result; - } - - /** - * Prepare format for rating value. - * - * @param string $value - * @param string $replace - * @return string - */ - protected function prepareFormatValue($value, $replace) - { - return str_replace($replace . '_', '', $value); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php deleted file mode 100644 index 469d2e8dae9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/Grid.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review; - -/** - * Reviews grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'review_id' => [ - 'selector' => 'input[name="review_id"]', - ], - 'title' => [ - 'selector' => 'input[name="title"]', - ], - 'status_id' => [ - 'selector' => '#reviwGrid_filter_status', - 'input' => 'select', - ], - 'nickname' => [ - 'selector' => 'input[name="nickname"]', - ], - 'detail' => [ - 'selector' => 'input[name="detail"]', - ], - 'type' => [ - 'selector' => 'select[name="type"]', - 'input' => 'select', - ], - 'name' => [ - 'selector' => 'input[name="name"]', - ], - 'sku' => [ - 'selector' => 'input[name="sku"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php deleted file mode 100644 index 24fbe58ff88..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Review; - -use Mage\Adminhtml\Test\Block\Widget\FormTabs; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Widget\Tab; - -/** - * Review form on backend review page. - */ -class ReviewForm extends FormTabs -{ - /** - * Rating status - * - * @var string - */ - protected $status = '[name=status_id]'; - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - return $this; - } - - /** - * Set approve review. - * - * @return void - */ - public function setApproveReview() - { - $this->_rootElement->find($this->status, Locator::SELECTOR_CSS, 'select')->setValue('Approved'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml deleted file mode 100644 index 7a9fd16e626..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Review/ReviewForm.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<tabs> - <review-details> - <class>\Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails</class> - <selector>.fieldset-legend</selector> - <fields> - <status_id> - <input>select</input> - </status_id> - <title /> - <nickname /> - <detail> - <input>textarea</input> - </detail> - <ratings> - <selector>#detailed_rating</selector> - <class>Mage\Adminhtml\Test\Block\Review\Edit\ReviewDetails\RatingElement</class> - </ratings> - </fields> - </review-details> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php deleted file mode 100644 index 00c23acac37..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/AbstractGrid.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales; - -use Mage\Adminhtml\Test\Block\Widget\Grid; - -/** - * Sales abstract grid. - */ -abstract class AbstractGrid extends Grid -{ - /** - * Locator value for link on action column. - * - * @var string - */ - protected $editLink = 'td:nth-child(2)'; - - /** - * Name for id column. - * - * @var array - */ - protected $idColumnName; - - /** - * Get invoice ids - * - * @return array - */ - public function getIds() - { - $result = []; - $dataIds = $this->getRowsData(['id' => $this->idColumnName]); - foreach ($dataIds as $key => $dataId) { - $result[$key] = $dataId['id']; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php deleted file mode 100644 index 923d7a50cb0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/Grid.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos; - -use Mage\Adminhtml\Test\Block\Sales\AbstractGrid; - -/** - * Sales credit memos grid. - */ -class Grid extends AbstractGrid -{ - /** - * Products table identifier. - * - * @var string - */ - protected $tableIdentifier = '@id="order_creditmemos_table"'; - - /** - * Selector for title id column. - * - * @var array - */ - protected $idColumnName = '.="Credit Memo #"'; - - /** - * Base part of row locator template for getRow() method. - * - * @var string - */ - protected $location = './/div[@class="grid"]//tr['; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'from' => [ - 'selector' => 'input[name*="grand_total[from]"]', - ], - 'to' => [ - 'selector' => 'input[name*="grand_total[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php deleted file mode 100644 index ef881ff7ea5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos\View; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -/** - * Credit memo Items block on Credit memo view page. - */ -class Items extends AbstractItems -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass ='Mage\Adminhtml\Test\Block\Sales\CreditMemos\View\Items\Item'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php deleted file mode 100644 index 44fa28bcadc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/CreditMemos/View/Items/Item.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\CreditMemos\View\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Credit memo Items block on Credit memo view page. - */ -class Item extends AbstractItem -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = [ - 'product' => ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_price' => ['col_name' => 'Price'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_tax' => ['col_name' => 'Tax Amount'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php deleted file mode 100644 index c2f17cdbaa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Actions.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices; - -use Magento\Mtf\Block\Block; - -/** - * Order actions block. - */ -class Actions extends Block -{ - /** - * 'Credit Memo' button on the order page. - * - * @var string - */ - protected $orderCreditMemoButton = '[onclick*="sales_order_creditmemo"]'; - - /** - * Order credit memo. - * - * @return void - */ - public function creditMemo() - { - $this->_rootElement->find($this->orderCreditMemoButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php deleted file mode 100644 index fbcf5c6621c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/Grid.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices; - -use Mage\Adminhtml\Test\Block\Sales\AbstractGrid; - -/** - * Sales invoices grid. - */ -class Grid extends AbstractGrid -{ - /** - * Products table identifier. - * - * @var string - */ - protected $tableIdentifier = '@id="order_invoices_table"'; - - /** - * Name for id column. - * - * @var array - */ - protected $idColumnName = '.="Invoice #"'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'from' => [ - 'selector' => 'input[name*="grand_total[from]"]', - ], - 'to' => [ - 'selector' => 'input[name*="grand_total[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php deleted file mode 100644 index 15c06fa84e3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices\View; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -/** - * Invoice Items block on Invoice view page. - */ -class Items extends AbstractItems -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass ='Mage\Adminhtml\Test\Block\Sales\Invoices\View\Items\Item'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php deleted file mode 100644 index 06260caa165..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Invoices/View/Items/Item.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Invoices\View\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Invoice Items block on Invoice view page. - */ -class Item extends AbstractItem -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = [ - 'product' => ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_price' => ['col_name' => 'Price'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_tax' => ['col_name' => 'Tax Amount'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php deleted file mode 100644 index 3b33d58367c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm.php +++ /dev/null @@ -1,148 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Form; -use Mage\Adminhtml\Test\Block\Template; -use Magento\Mtf\Client\Locator; - -/** - * Abstract Form block. - */ -abstract class AbstractForm extends Form -{ - /** - * Backend abstract block selector. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Send button css selector. - * - * @var string - */ - protected $send = '.submit-button'; - - /** - * Disabled flag. - * - * @var string - */ - protected $disabledFlag = '.disabled'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass; - - /** - * Items block css selector. - * - * @var string - */ - protected $items; - - /** - * Fill form data. - * - * @param array $data - * @param array|null $products - * @return void - */ - public function fillData(array $data, $products = null) - { - if (isset($data['form_data'])) { - $data['form_data'] = $this->dataMapping($data['form_data']); - $this->_fill($data['form_data']); - } - if (isset($data['items_data']) && $products !== null) { - $this->fillItemsData($data['items_data'], $products); - } - } - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - foreach ($products as $key => $product) { - $this->getItemsBlock()->getItemProductBlock($product)->fillProduct($data[$key]); - } - } - - /** - * Click update qty's button. - * - * @return void - */ - public function updateQty() - { - $this->getItemsBlock()->clickUpdateQty(); - } - - /** - * Get items block. - * - * @return AbstractItemsNewBlock - */ - public function getItemsBlock() - { - return $this->blockFactory->create( - $this->itemBlockClass, - ['element' => $this->_rootElement->find($this->items)] - ); - } - - /** - * Submit order. - * - * @return void - */ - public function submit() - { - $this->getTemplateBlock()->waitLoader(); - $browser = $this->browser; - $selector = $this->send . $this->disabledFlag; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - $this->_rootElement->find($this->send)->click(); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php deleted file mode 100644 index 4cb7cf9830d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/Product.php +++ /dev/null @@ -1,82 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -use Mage\Checkout\Test\Block\AbstractItem; -use Magento\Mtf\Client\Locator; - -/** - * Item product form on items block. - */ -abstract class Product extends AbstractItem -{ - /** - * Items tax type. - * - * @var array - */ - protected $pricesType = [ - 'cart_item_price_excl_tax' => [ - 'selector' => '//span[@class="price-excl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '//span[@class="price-incl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//span[@class="price-excl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//span[@class="price-incl-tax"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ], - 'cart_item_price' => [ - 'selector' => '//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Price' - ], - 'cart_item_subtotal' => [ - 'selector' => '//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH, - 'column' => 'Subtotal' - ] - ]; - - /** - * Field selector. - * - * @var string - */ - protected $fieldSelector = '//td[count(//th[contains(text(),"%s")]/preceding-sibling::th)+1]'; - - /** - * Prepare selector for field. - * - * @param string $field - * @return string - */ - protected function prepareSelector($field) - { - $fieldMapping = $this->pricesType[$field]; - return sprintf($this->fieldSelector, $fieldMapping['column']) . $fieldMapping['selector']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php deleted file mode 100644 index 2700bcd6062..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractForm/ProductForm.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Item product form on items block. - */ -abstract class ProductForm extends Product -{ - /** - * Fill item product data. - * - * @param array $data - * @return void - */ - public function fillProduct(array $data) - { - $data = $this->dataMapping($data); - $this->_fill($data); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php deleted file mode 100644 index 0ca4c41396c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems\AbstractItem; - -/** - * Base Items block on Credit Memo, Invoice, Shipment view page. - */ -class AbstractItems extends Block -{ - /** - * Item class. - * - * @var string - */ - protected $itemClass; - - /** - * Locator for row item. - * - * @var string - */ - protected $rowItem = '.data.order-tables>tbody>tr'; - - /** - * Get items data. - * - * @return array - */ - public function getData() - { - $result = []; - foreach ($this->getItems() as $item) { - /** @var AbstractItem $item */ - $result[] = $item->getFieldsData(); - } - - return $result; - } - - /** - * Get items blocks. - * - * @return AbstractItem[] - */ - protected function getItems() - { - $items = $this->_rootElement->getElements($this->rowItem); - foreach ($items as $key => $item) { - $items[$key] = $this->blockFactory->create($this->itemClass, ['element' => $item]); - } - - return $items; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php deleted file mode 100644 index 1c5cd424c5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItems/AbstractItem.php +++ /dev/null @@ -1,152 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\AbstractItems; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\Product; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Client\ElementInterface; - -/** - * Abstract item block on sales type view page. - */ -abstract class AbstractItem extends Product -{ - /** - * Columns in grid. - * - * @var array - */ - protected $columns = ['product' => ['col_name' => 'Product']]; - - /** - * Field selector. - * - * @var string - */ - protected $fieldSelector = './/td[count(//th[contains(.,"%s")]/preceding-sibling::th)+1]'; - - /** - * Mapping for products fields. - * - * @var array - */ - protected $productFields = [ - 'name' => [ - 'selector' => '.title' - ], - 'sku' => [ - 'selector' => './/*[*[contains(text(),"SKU")]]', - 'strategy' => Locator::SELECTOR_XPATH, - 'replace' => 'SKU:' - ], - 'options' => [ - 'selector' => '.item-options' - ] - ]; - - /** - * Option title selector. - * - * @var string - */ - protected $optionTitleSelector = 'dt'; - - /** - * Get data from item row. - * - * @param array $filter [optional] - * @return array - */ - public function getFieldsData(array $filter = []) - { - $result = []; - $fields = empty($filter) ? $this->columns : $filter; - foreach ($fields as $field => $fieldData) { - $methodName = 'get' . ucfirst($field); - if (method_exists($this, $methodName)) { - $result[$field] = $this->$methodName($fieldData['col_name']); - } else { - $column = $this->getColumn($fieldData['col_name']); - if ($column !== null) { - $result[$field] = $this->getColumnValue($column, $fieldData); - } - } - } - - return $result; - } - - /** - * Get data from product column. - * - * @param string $fieldName - * @return array - */ - protected function getProduct($fieldName) - { - $result = []; - $dataColumn = $this->getColumn($fieldName); - foreach ($this->productFields as $key => $mapping) { - $strategy = isset($mapping['strategy']) ? $mapping['strategy'] : Locator::SELECTOR_CSS; - $field = $dataColumn->find($mapping['selector'], $strategy); - if ($field->isVisible()) { - if ($key == 'options') { - $result[$key] = $this->getOptions($dataColumn); - } else { - $result[$key] = $this->getColumnValue($field, $mapping); - } - } - } - - return $result; - } - - /** - * Get column value. - * - * @param ElementInterface $element - * @param array $attributes - * @return string - */ - protected function getColumnValue(ElementInterface $element, array $attributes = []) - { - $search = isset($attributes['replace']) ? $attributes['replace'] : ['$', '%']; - return trim(str_replace($search, '', $element->getText())); - } - - /** - * Get column. - * - * @param string $fieldName - * @return ElementInterface|null - */ - protected function getColumn($fieldName) - { - $column = $this->_rootElement->find($this->getColumnSelector($fieldName), Locator::SELECTOR_XPATH); - return $column->isVisible() ? $column : null; - } - - /** - * Get column selector. - * - * @param string $fieldName - * @return string - */ - protected function getColumnSelector($fieldName) - { - return sprintf($this->fieldSelector, $fieldName); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php deleted file mode 100644 index c376e6985e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/AbstractItemsNewBlock.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\Product; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Fixture\InjectableFixture; -use Magento\Mtf\Client\Locator; - -/** - * Items block on Credit Memo, Invoice, Shipment new pages. - */ -abstract class AbstractItemsNewBlock extends Block -{ - /** - * Item product row selector. - * - * @var string - */ - protected $productItem = '//tr[.//*[contains(text(),"%s")]]'; - - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock; - - /** - * 'Update Qty's' button css selector. - * - * @var string - */ - protected $updateQty = '.update-button'; - - /** - * Get item product block. - * - * @param InjectableFixture $product - * @return Product - */ - public function getItemProductBlock(InjectableFixture $product) - { - $element = $this->_rootElement->find(sprintf($this->productItem, $product->getName()), Locator::SELECTOR_XPATH); - return $this->blockFactory->create($this->classItemBlock, ['element' => $element]); - } - - /** - * Click update qty button. - * - * @return void - */ - public function clickUpdateQty() - { - $this->_rootElement->find($this->updateQty)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php deleted file mode 100644 index cd7f9c415a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Actions.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order actions block. - */ -class Actions extends Block -{ - /** - * General button selector. - * - * @var string - */ - protected $button = 'button[title="%s"]'; - - /** - * 'Invoice' button. - * - * @var string - */ - protected $orderInvoiceButton = '[onclick*="sales_order_invoice"]'; - - /** - * 'Ship' button. - * - * @var string - */ - protected $orderShipButton = '[onclick*="sales_order_shipment"]'; - - /** - * 'Credit Memo' button on the order page. - * - * @var string - */ - protected $orderCreditMemoButton = '[onclick*="sales_order_creditmemo"]'; - - /** - * Cancel button on the order page. - * - * @var string - */ - protected $orderCancelButton = '[onclick*="sales_order/cancel"]'; - - /** - * Reorder button on the order page. - * - * @var string - */ - protected $reorderButton = '[onclick*="sales_order_create/reorder/order_id"]'; - - /** - * Check if action button is visible. - * - * @param string $buttonName - * @return bool - */ - public function isActionButtonVisible($buttonName) - { - return $this->_rootElement->find(sprintf($this->button, $buttonName))->isVisible(); - } - - /** - * Invoice order. - * - * @return void - */ - public function invoice() - { - $this->_rootElement->find($this->orderInvoiceButton)->click(); - } - - /** - * Ship order. - * - * @return void - */ - public function shipment() - { - $this->_rootElement->find($this->orderShipButton)->click(); - } - - /** - * Order credit memo. - * - * @return void - */ - public function refund() - { - $this->_rootElement->find($this->orderCreditMemoButton)->click(); - } - - /** - * Cancel order. - * - * @return void - */ - public function cancel() - { - $this->_rootElement->find($this->orderCancelButton)->click(); - $this->browser->acceptAlert(); - } - - /** - * Reorder order. - * - * @return void - */ - public function reorder() - { - $this->_rootElement->find($this->reorderButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php deleted file mode 100644 index 4908cd39c9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Address.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order address block. - */ -class Address extends Block -{ - /** - * Address selector. - * - * @var string - */ - protected $address = 'address'; - - /** - * Get address. - * - * @return string - */ - public function getAddress() - { - return $this->_rootElement->find($this->address)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php deleted file mode 100644 index 2daef31db06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Comments.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Magento\Mtf\Block\Block; - -/** - * Order comments block. - */ -class Comments extends Block -{ - /** - * Comment selector. - * - * @var string - */ - protected $comment = '.note-list li'; - - /** - * Comments form selector. - * - * @var string - */ - protected $commentsForm = '#history_form'; - - /** - * Get all comments elements. - * - * @return array - */ - protected function getCommentsElements() - { - $this->waitForElementVisible($this->commentsForm); - return $this->_rootElement->getElements($this->comment); - } - - /** - * Check if comment with specific text is present. - * - * @param string $commentText - * @return bool - */ - public function isCommentPresent($commentText) - { - $comments = $this->getCommentsElements(); - foreach ($comments as $comment) { - if (str_contains($comment->getText(), $commentText)) { - return true; - } - } - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php deleted file mode 100644 index 4ba121cc304..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create.php +++ /dev/null @@ -1,190 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Coupons; -use Mage\Adminhtml\Test\Block\Template; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Items; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Search; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Payment; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Shipping; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing\Address; -use Magento\Mtf\Fixture\InjectableFixture; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Block\Block; - -/** - * Adminhtml sales order create block. - */ -class Create extends Block -{ - /** - * Items block selector. - * - * @var string - */ - protected $itemsBlock = '#order-items'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Products grid selector. - * - * @var string - */ - protected $searchGrid = '#order-search'; - - /** - * Billing address block selector. - * - * @var string - */ - protected $billingAddress = '#order-billing_address'; - - /** - * Payment block selector. - * - * @var string - */ - protected $payment = '#order-billing_method'; - - /** - * Shipping block selector. - * - * @var string - */ - protected $shipping = '#order-shipping_method'; - - /** - * 'Submit Order' button. - * - * @var string - */ - protected $submitOrder = '.order-totals-bottom button'; - - /** - * Coupons block selector. - * - * @var string - */ - protected $coupons = '#order-coupons'; - - /** - * Getter for order selected products grid. - * - * @return Items - */ - public function getItemsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Items', - ['element' => $this->_rootElement->find($this->itemsBlock)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get products search block. - * - * @return Search - */ - public function getSearchBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Search', - ['element' => $this->_rootElement->find($this->searchGrid)] - ); - } - - /** - * Get Billing address block. - * - * @return Address - */ - public function getBillingAddressForm() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing\Address', - ['element' => $this->_rootElement->find($this->billingAddress)] - ); - } - - /** - * Get payment block. - * - * @return Payment - */ - public function getPaymentBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Payment', - ['element' => $this->_rootElement->find($this->payment)] - ); - } - - /** - * Get shipping block. - * - * @return Shipping - */ - public function getShippingBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Shipping', - ['element' => $this->_rootElement->find($this->shipping)] - ); - } - - /** - * Click 'Submit Order' button. - * - * @return void - */ - public function submitOrder() - { - $this->_rootElement->find($this->submitOrder)->click(); - } - - /** - * Get coupons block. - * - * @return Coupons - */ - public function getCouponsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Coupons', - ['element' => $this->_rootElement->find($this->coupons)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php deleted file mode 100644 index a6260230089..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Billing; - -use Magento\Mtf\Block\Form; - -/** - * Adminhtml sales order billing address form. - */ -class Address extends Form -{ - /** - * Existed addresses selector. - * - * @var string - */ - protected $existedAddresses = '#order-billing_address_customer_address_id'; - - /** - * Get existing addresses. - * - * @return string - */ - public function getExistingAddresses() - { - return explode("\n", $this->_rootElement->find($this->existedAddresses)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml deleted file mode 100644 index b2d80c29df0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Billing/Address.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>order[billing_address]</wrapper> - <fields> - <firstname /> - <lastname /> - <company /> - <street> - <selector>[name='order[billing_address][street][0]']</selector> - </street> - <city /> - <country_id> - <input>select</input> - </country_id> - <region_id> - <input>select</input> - </region_id> - <postcode /> - <telephone /> - <save_in_address_book> - <input>checkbox</input> - </save_in_address_book> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php deleted file mode 100644 index 05d3ae16cbc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\SalesRule\Test\Fixture\SalesRule; -use Magento\Mtf\Block\Form; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order coupons block. - */ -class Coupons extends Form -{ - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Click apply button selector. - * - * @var string - */ - protected $applyButton = '//*[@id="coupons:code"]/following-sibling::button'; - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Apply Sales rule coupon. - * - * @param SalesRule $salesRule - * @return void - */ - public function applyCouponsCode(SalesRule $salesRule) - { - parent::fill($salesRule); - $this->_rootElement->find($this->applyButton, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml deleted file mode 100644 index 5328af1fac8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Coupons.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="1"> - <fields> - <coupon_code> - <selector>input[name="coupon_code"]</selector> - </coupon_code> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php deleted file mode 100644 index 7a1ed95a6ff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities.php +++ /dev/null @@ -1,85 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Block\Template; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar\ShoppingCartItems; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Customer's Activities block - */ -class CustomerActivities extends Block -{ - /** - * 'Update Changes' button. - * - * @var string - */ - protected $updateChanges = '[onclick^="order.sidebarApplyChanges"]'; - - /** - * Shopping cart sidebar selector. - * - * @var string - */ - protected $shoppingCartSidebar = '#order-sidebar_cart'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Get shopping Cart items block. - * - * @return ShoppingCartItems - */ - public function getShoppingCartItemsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar\ShoppingCartItems', - ['element' => $this->_rootElement->find($this->shoppingCartSidebar)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Click 'Update Changes' button. - * - * @return void - */ - public function updateChanges() - { - $this->_rootElement->find($this->updateChanges)->click(); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php deleted file mode 100644 index cce81937b58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Sidebar block. - */ -abstract class Sidebar extends Block -{ - /** - * 'Add to order' checkbox. - * - * @var string - */ - protected $addToOrder = '//tr[td[.="%s"]]//input[contains(@name,"add")]'; - - /** - * Add product to order. - * - * @param array $products - * @return void - */ - public function addToOrder(array $products) - { - foreach ($products as $product) { - $this->_rootElement - ->find(sprintf($this->addToOrder, $product->getName()), Locator::SELECTOR_XPATH, 'checkbox') - ->setValue('Yes'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php deleted file mode 100644 index 1a0a3199bfd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerActivities/Sidebar/ShoppingCartItems.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar; - -use Mage\Adminhtml\Test\Block\Sales\Order\Create\CustomerActivities\Sidebar; - -/** - * Shopping cart items block. - */ -class ShoppingCartItems extends Sidebar -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php deleted file mode 100644 index 4336dde756d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/CustomerGrid.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Block\Widget\Grid; -use Mage\Customer\Test\Fixture\Customer; - -/** - * Customer selection grid. - */ -class CustomerGrid extends Grid -{ - /** - * Selector for 'Create New Customer' button. - * - * @var string - */ - protected $createNewCustomer = '.add'; - - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'email' => [ - 'selector' => '#sales_order_create_customer_grid_filter_email', - ], - ]; - - /** - * Select customer if it is specified or click create new customer button. - * - * @param Customer $customer - * @return void - */ - public function selectCustomer(Customer $customer) - { - if ($customer === null) { - $this->_rootElement->find($this->createNewCustomer)->click(); - } else { - $this->searchAndOpen(['email' => $customer->getEmail()]); - } - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php deleted file mode 100644 index 56037046a5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items.php +++ /dev/null @@ -1,167 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Items\ItemProduct; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order create items block. - */ -class Items extends Block -{ - /** - * Item block selector. - * - * @var string - */ - protected $itemProduct = '//tbody/tr[td[contains(.,"%s")]]'; - - /** - * 'Add Products' button. - * - * @var string - */ - protected $addProducts = "//button[span='Add Products']"; - - /** - * 'Add Products By Sku' button. - * - * @var string - */ - protected $addProductsBySku = "//button[span='Add Products By SKU']"; - - /** - * 'Update Item's and Qty' button selector. - * - * @var string - */ - protected $updateProducts = '[onclick="order.itemsUpdate()"]'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Product names. - * - * @var string - */ - protected $productNames = 'tbody tr td.first span'; - - /** - * Empty block selector. - * - * @var string - */ - protected $emptyBlock = '.empty-text'; - - /** - * Click 'Add Products' button. - * - * @return void - */ - public function clickAddProducts() - { - $this->_rootElement->find($this->addProducts, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Update product data in sales. - * - * @param array $products - * @return void - */ - public function updateProductsData(array $products) - { - foreach ($products as $product) { - $this->getItemProduct($product->getName())->fillProductOptions($product->getCheckoutData()); - } - $this->_rootElement->find($this->updateProducts)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get products data by fields from items ordered grid. - * - * @param array $fields - * @return array - */ - public function getProductsDataByFields($fields) - { - $this->getTemplateBlock()->waitLoader(); - $productsNames = $this->_rootElement->getElements($this->productNames); - $pageData = []; - foreach ($productsNames as $productName) { - $pageData[] = $this->getItemProduct($productName->getText())->getCheckoutData($fields); - } - - return $pageData; - } - - /** - * Get item product block. - * - * @param string $productName - * @return ItemProduct - */ - public function getItemProduct($productName) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Items\ItemProduct', - ['element' => $this->_rootElement->find(sprintf($this->itemProduct, $productName), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Check that empty block is visible. - * - * @return bool - */ - public function isEmptyBlockVisible() - { - return $this->_rootElement->find($this->emptyBlock)->isVisible(); - } - - /** - * Click 'Add Products By SKU' button. - * - * @return void - */ - public function clickAddProductsBySku() - { - $this->_rootElement->find($this->addProductsBySku, Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php deleted file mode 100644 index 1dfd2ea67ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.php +++ /dev/null @@ -1,113 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Items; - -use Magento\Mtf\Block\Form; - -/** - * Item product block. - */ -class ItemProduct extends Form -{ - /** - * Actions for fields. - * - * @var array - */ - protected $actions = [ - 'name' => 'getText', - 'price' => 'getText', - 'qty' => 'getValue', - 'checkout_data' => 'getValue', - ]; - - /** - * Error message selector. - * - * @var string - */ - protected $errorMessage = ".error"; - - /** - * Notice message selector. - * - * @var string - */ - protected $noticeMessage = ".notice"; - - /** - * Fill product options. - * - * @param array $options - */ - public function fillProductOptions(array $options) - { - if (isset($options['cartItem'])) { - unset($options['cartItem']); - } - if (isset($options['options'])) { - unset($options['options']); - } - - $mapping = $this->dataMapping($options); - $this->_fill($mapping); - } - - /** - * Get data item products. - * - * @param array $fields - * @param string $currency [optional] - * @return array - */ - public function getCheckoutData(array $fields, $currency = '$') - { - $result = []; - $data = $this->dataMapping($fields); - foreach ($data as $key => $item) { - if (!isset($item['value'])) { - $result[$key] = $this->getCheckoutData($item); - continue; - } - $value = $this->_rootElement->find($item['selector'], $item['strategy'], $item['input']) - ->{$this->actions[$key]}(); - - $result[$key] = str_replace($currency, '', trim($value)); - } - - return $result; - } - - /** - * Get error message. - * - * @return string - */ - public function getErrorMessage() - { - return $this->_rootElement->find($this->errorMessage)->getText(); - } - - /** - * Get notice message. - * - * @return string - */ - public function getNoticeMessage() - { - return $this->_rootElement->find($this->noticeMessage)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml deleted file mode 100644 index 159beb61b1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Items/ItemProduct.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <name> - <selector>h5.title span</selector> - </name> - <price> - <selector>//td[@class="price"][1]/span</selector> - <strategy>xpath</strategy> - </price> - <qty> - <selector>.item-qty</selector> - </qty> - <checkout_data composite="1"> - <custom_price> - <selector>//td[@class="price"][1]/input</selector> - <strategy>xpath</strategy> - </custom_price> - <use_custom_price> - <selector>//td[@class="price"][1]/div/input[@type="checkbox"]</selector> - <strategy>xpath</strategy> - <input>checkbox</input> - </use_custom_price> - </checkout_data> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php deleted file mode 100644 index d191ea6b60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Payment.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Template; -use Magento\Mtf\Client\Locator; - -/** - * Adminhtml sales order payment block. - */ -class Payment extends Block -{ - /** - * Payment method. - * - * @var string - */ - protected $paymentMethod = '#p_method_%s'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Select payment method. - * - * @param array $paymentCode - * @throws \Exception - */ - public function selectPaymentMethod(array $paymentCode) - { - $paymentInput = $this->_rootElement->find(sprintf($this->paymentMethod, $paymentCode['method'])); - if ($paymentInput->isPresent()) { - if ($paymentInput->isVisible()) { - $paymentInput->click(); - } - $this->getTemplateBlock()->waitLoader(); - } else { - throw new \Exception("{$paymentCode['method']} method is not visible."); - } - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php deleted file mode 100644 index e067f03714c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search.php +++ /dev/null @@ -1,62 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Mage\Adminhtml\Test\Block\Sales\Order\Create\Search\Grid; - -/** - * Adminhtml sales order create search items block. - */ -class Search extends Block -{ - /** - * Search products grid selector. - * - * @var string - */ - protected $gridSelector = '#sales_order_create_search_grid'; - - /** - * 'Add Selected Product(s) to Order' button. - * - * @var string - */ - protected $addSelectedProducts = 'button[onclick="order.productGridAddSelected()"]'; - - /** - * Click "Add Selected Product(s) to Order" button. - * - * @return void - */ - public function addSelectedProductsToOrder() - { - $this->_rootElement->find($this->addSelectedProducts)->click(); - } - - /** - * Get search products grid. - * - * @return Grid - */ - public function getSearchGrid() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Create\Search\Grid', - ['element' => $this->_rootElement->find($this->gridSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php deleted file mode 100644 index 603d58927ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Search/Grid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create\Search; - -/** - * Adminhtml sales order create search items grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * An element locator which allows to select entities in grid. - * - * @var string - */ - protected $selectItem = '#sales_order_create_search_grid_table tbody tr'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'sku' => [ - 'selector' => '#sales_order_create_search_grid_filter_sku', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php deleted file mode 100644 index 003bbd741c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Shipping.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order shipping block. - */ -class Shipping extends Block -{ - /** - * 'Get shipping methods and rates' link. - * - * @var string - */ - protected $shippingMethodsLink = '#order-shipping-method-summary a'; - - /** - * Shipping method selector. - * - * @var string - */ - protected $shippingMethod = '//dt[contains(.,"%s")]/following-sibling::*//*[contains(text(), "%s")]'; - - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Select shipping method. - * - * @param array $method - * @return void - */ - public function selectShippingMethod(array $method) - { - $this->_rootElement->find($this->shippingMethodsLink)->click(); - $selector = sprintf($this->shippingMethod, $method['shipping_service'], $method['shipping_method']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php deleted file mode 100644 index a15812ae788..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Create/Store.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Create; - -use Mage\Adminhtml\Test\Fixture\Store as StoreFixture; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Adminhtml sales order create select store block. - */ -class Store extends Block -{ - /** - * Backend abstract block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Selector for store label. - * - * @var string - */ - protected $storeLabel = '//label[text()="%s"]/preceding-sibling::*'; - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Select store view for order based on Order fixture. - * - * @param StoreFixture|null $store - * @return void - */ - public function selectStoreView(StoreFixture $store = null) - { - if (!$this->isVisible()) { - return; - } - $storeName = $store == null ? 'Default Store View' : $store->getName(); - $selector = sprintf($this->storeLabel, $storeName); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); - $this->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php deleted file mode 100644 index 6b9429fae96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.php +++ /dev/null @@ -1,107 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Credit memo create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#creditmemo_item_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items'; - - /** - * Online refund button. - * - * @var string - */ - protected $onlineRefund = '[onclick*="submitCreditMemo()"]'; - - /** - * Offline refund button. - * - * @var string - */ - protected $offlineRefund = '[onclick*="submitCreditMemoOffline()"]'; - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - parent::fillItemsData($data, $products); - $this->updateQty(); - } - - /** - * Online refund. - * - * @return void - */ - public function onlineRefund() - { - $this->waitUntilRefundButtonVisible('online'); - $this->_rootElement->find($this->onlineRefund)->click(); - } - - /** - * Offline refund. - * - * @return void - */ - public function offlineRefund() - { - $this->waitUntilRefundButtonVisible('offline'); - $this->_rootElement->find($this->offlineRefund)->click(); - } - - /** - * Wait until refund button is visible. - * - * @param string $refundType - * @return void - */ - protected function waitUntilRefundButtonVisible($refundType) - { - $this->getTemplateBlock()->waitLoader(); - $browser = $this->browser; - $button = $refundType . "Refund"; - $selector = $this->$button . $this->disabledFlag; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml deleted file mode 100644 index 20f445f32f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>creditmemo</wrapper> - <fields> - <comment_text /> - <shipping_amount /> - <adjustment_positive /> - <adjustment_negative /> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - <send_email> - <input>checkbox</input> - </send_email> - <refund_customerbalance_return_enable> - <selector>#creditmemo_customerbalance_return_enable</selector> - <input>checkbox</input> - </refund_customerbalance_return_enable> - <refund_customerbalance_return /> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php deleted file mode 100644 index 5d991a8ee16..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Credit Memo Items block on Credit Memo new page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php deleted file mode 100644 index 14e65f0c7d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product form on credit memo items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml deleted file mode 100644 index b62d39f0730..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Form/Items/Product.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>[name$="[qty]"]</selector> - </qty> - <back_to_stock> - <selector>[name$="[back_to_stock]"]</selector> - <input>checkbox</input> - </back_to_stock> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php deleted file mode 100644 index 8065cedea28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Creditmemo/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Creditmemo; - -/** - * Invoice totals block. - */ -class Totals extends \Mage\Adminhtml\Test\Block\Sales\Order\Totals -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php deleted file mode 100644 index e45762dcc31..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Grid.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order; - -/** - * Sales order grid. - */ -class Grid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Order Id td selector. - * - * @var string - */ - protected $editLink = 'a[data-column="action"]'; - - /** - * First row selector. - * - * @var string - */ - protected $firstRowSelector = '//tr[./td[contains(@class,"last")]][1]//a'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'id' => [ - 'selector' => 'input[name="real_order_id"]', - ], - 'status' => [ - 'selector' => 'select[name="status"]', - 'input' => 'select', - ], - 'purchased_from' => [ - 'selector' => 'select[name="store_id"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php deleted file mode 100644 index 01f4550f8ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; - -/** - * Invoice create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#invoice_item_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items'; - - /** - * Fill items data. - * - * @param array $data - * @param array $products - * @return void - */ - protected function fillItemsData(array $data, array $products) - { - parent::fillItemsData($data, $products); - $this->updateQty(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml deleted file mode 100644 index 0066348f830..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>invoice</wrapper> - <fields> - <comment_text /> - <do_shipment> - <input>checkbox</input> - </do_shipment> - <capture_case> - <input>select</input> - </capture_case> - <send_email> - <input>checkbox</input> - </send_email> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php deleted file mode 100644 index 6b8fd84f8bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Block for items to invoice on new invoice page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php deleted file mode 100644 index e5959b16999..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product block on invoice items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml deleted file mode 100644 index 1ca6c2a1c55..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Form/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>input.qty-input</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php deleted file mode 100644 index 2e2a06b0708..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Invoice/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Invoice; - -/** - * Invoice totals block. - */ -class Totals extends \Mage\Adminhtml\Test\Block\Sales\Order\Totals -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php deleted file mode 100644 index 51ce9c7931e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm; -use Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking; - -/** - * Shipment create form. - */ -class Form extends AbstractForm -{ - /** - * Items block css selector. - * - * @var string - */ - protected $items = '#ship_items_container'; - - /** - * Item block class. - * - * @var string - */ - protected $itemBlockClass = 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items'; - - /** - * Tracking block css selector. - * - * @var string - */ - protected $tracking = '#tracking_numbers_table'; - - /** - * Get tracking block. - * - * @return Tracking - */ - protected function getTrackingBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking', - ['element' => $this->_rootElement->find($this->tracking)] - ); - } - - /** - * Fill form data. - * - * @param array $data - * @param array|null $products - * @return void - */ - public function fillData(array $data, $products = null) - { - if (isset($data['form_data']['tracking'])) { - $this->getTrackingBlock()->fill($data['form_data']['tracking']); - unset($data['form_data']['tracking']); - } - parent::fillData($data, $products); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml deleted file mode 100644 index b7e8f952ad8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>shipment</wrapper> - <fields> - <comment_text /> - <comment_customer_notify> - <input>checkbox</input> - </comment_customer_notify> - <send_email> - <input>checkbox</input> - </send_email> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php deleted file mode 100644 index 7dd07b0945f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractItemsNewBlock; - -/** - * Block for items to shipment on new shipment page. - */ -class Items extends AbstractItemsNewBlock -{ - /** - * Item block class. - * - * @var string - */ - protected $classItemBlock = 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items\Product'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php deleted file mode 100644 index 022d5c355d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Items; - -use Mage\Adminhtml\Test\Block\Sales\Order\AbstractForm\ProductForm; - -/** - * Item product block on invoice items block. - */ -class Product extends ProductForm -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml deleted file mode 100644 index f6a93d47f18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>input.qty-item</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php deleted file mode 100644 index f2cde88ea43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form; - -use Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking\Item; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Tracking to ship block. - */ -class Tracking extends Block -{ - /** - * Add tracking button. - * - * @var string - */ - protected $addTracking = '[onclick*="trackingControl.add"]'; - - /** - * Item tracking block. - * - * @var string - */ - protected $itemTracking = './/tbody/tr[not(contains(@class,"no-display"))][%d]'; - - /** - * Get tracking block. - * - * @param int $index - * @return Item - */ - protected function getItemTrackingBlock($index) - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking\Item', - ['element' => $this->_rootElement->find(sprintf($this->itemTracking, $index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill tracking. - * - * @param array $data - * @return void - */ - public function fill(array $data) - { - foreach ($data as $key => $value) { - if (!$this->getItemTrackingBlock(++$key)->isVisible()) { - $this->_rootElement->find($this->addTracking)->click(); - } - $this->getItemTrackingBlock($key)->fillRow($value); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php deleted file mode 100644 index 66702ec6da0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Adminhtml\Test\Block\Sales\Order\Shipment\Form\Tracking; - -use Magento\Mtf\Block\Form; - -/** - * Item tracking to ship block. - */ -class Item extends Form -{ - /** - * Fill item tracking. - * - * @param array $fields - * @return void - */ - public function fillRow(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml deleted file mode 100644 index 277305aa669..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Shipment/Form/Tracking/Item.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <carrier_code> - <selector>[name$='[carrier_code]']</selector> - <input>select</input> - </carrier_code> - <title> - <selector>[name$='[title]']</selector> - - - [name$='[number]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php deleted file mode 100644 index a8094831819..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Title.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->title)->getText(), $matches); - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php deleted file mode 100644 index 732093fa1b7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/Totals.php +++ /dev/null @@ -1,45 +0,0 @@ -fieldType[$type]['selector']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php deleted file mode 100644 index 52fb0c4fdf6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/AbstractGridTab.php +++ /dev/null @@ -1,52 +0,0 @@ -blockFactory->create( - $this->gridClass, - ['element' => $this->_rootElement->find($this->gridSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php deleted file mode 100644 index 8725e4b3f2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Form.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Info - #sales_order_view_tabs_order_info - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Invoices - #sales_order_view_tabs_order_invoices - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Shipments - #sales_order_view_tabs_order_shipments - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Transactions - #sales_order_view_tabs_order_transactions - css selector - - - Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\CreditMemos - #sales_order_view_tabs_order_creditmemos - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php deleted file mode 100644 index a7292e01621..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items.php +++ /dev/null @@ -1,71 +0,0 @@ -getName(); - - if ($product instanceof ConfigurableProduct) { - // Find the price for the specific configurable product that was purchased - $configurableAttributes = $product->getConfigurableAttributes(); - $productOptions = $product->getCheckoutData()['options']['configurable_options']; - $checkoutOption = reset($productOptions); - $attributeKey = $checkoutOption['title']; - $optionKey = $checkoutOption['value']; - $attributeValue = $configurableAttributes[$attributeKey]['label']['value']; - $optionValue = $configurableAttributes[$attributeKey][$optionKey]['option_label']['value']; - - $productDisplay = $productName . ' SKU: ' . $product->getVariationSku($checkoutOption); - $productDisplay .= ' ' . $attributeValue . ' ' . $optionValue; - } else { - $productDisplay = $productName . ' SKU: ' . $product->getSku(); - } - $selector = '//tr[normalize-space(td)="' . $productDisplay . '"]' . $this->priceSelector; - - return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php deleted file mode 100644 index 424eda78893..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Items/Product.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name$="[qty]"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php deleted file mode 100644 index 9b32ce46e14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/CreditMemos.php +++ /dev/null @@ -1,38 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\View\Tab\Info', - ['element' => $this->_rootElement->find($this->orderInfoBlock)] - ); - } - - /** - * Get order totals block. - * - * @return Totals - */ - public function getOrderTotalsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Totals', - ['element' => $this->_rootElement->find($this->orderTotalsBlock)] - ); - } - - /** - * Get order status from info block. - * - * @return string - */ - public function getOrderStatus() - { - return $this->_rootElement->find($this->orderStatus)->getText(); - } - - /** - * Get comments block. - * - * @return Comments - */ - public function getCommentsBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Comments', - ['element' => $this->_rootElement->find($this->commentsBlock)] - ); - } - - /** - * Get billing address block. - * - * @return Address - */ - public function getBillingAddressBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Address', - ['element' => $this->_rootElement->find($this->billingAddressBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get shipping address block. - * - * @return Address - */ - public function getShippingAddressBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Sales\Order\Address', - ['element' => $this->_rootElement->find($this->shippingAddressBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php deleted file mode 100644 index 58af3be9a10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Order/View/Tab/Invoices.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]' - ], - 'total_qty_from' => [ - 'selector' => 'input[name="total_qty[from]"]' - ], - 'total_qty_to' => [ - 'selector' => 'input[name="total_qty[to]"]' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php deleted file mode 100644 index e7f1871b04d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sales/Transactions/Grid.php +++ /dev/null @@ -1,39 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]', - ], - 'transaction_type' => [ - 'selector' => 'select[name="txn_type"]', - 'input' => 'select', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php deleted file mode 100644 index d60649424d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/Grid.php +++ /dev/null @@ -1,42 +0,0 @@ - [ - 'selector' => 'input[name="increment_id"]', - ], - 'order_id' => [ - 'selector' => 'input[name="order_increment_id"]', - ], - 'total_qty_from' => [ - 'selector' => 'input[name="total_qty[from]"]', - ], - 'total_qty_to' => [ - 'selector' => 'input[name="total_qty[to]"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php deleted file mode 100644 index c1cec7a9659..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Shipping/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ - ['col_name' => 'Product'], - 'item_qty' => ['col_name' => 'Qty'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php deleted file mode 100644 index f2af877dcda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/Form.php +++ /dev/null @@ -1,61 +0,0 @@ -fillStoreView($sitemap); - return parent::fill($sitemap, $element); - } - - /** - * Fill store view field. - * - * @param Sitemap $sitemap - * @return void - */ - protected function fillStoreView(Sitemap $sitemap) - { - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'selectstore'); - if ($storeViewField->isVisible() && !$sitemap->hasData('store_id')) { - $storeViewField->setValue('Main Website/Main Website Store/Default Store View'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php deleted file mode 100644 index 4f1fa1695b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Edit/FormPageActions.php +++ /dev/null @@ -1,39 +0,0 @@ -_rootElement->find($this->saveAndGenerateButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php deleted file mode 100644 index 21ba6d3399b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Sitemap/Grid.php +++ /dev/null @@ -1,58 +0,0 @@ - [ - 'selector' => '#sitemapGrid_filter_sitemap_filename', - ], - 'sitemap_path' => [ - 'selector' => '#sitemapGrid_filter_sitemap_path', - ], - 'sitemap_id' => [ - 'selector' => '#sitemapGrid_filter_sitemap_id', - ], - ]; - - /** - * Locator link for Google in grid. - * - * @var string - */ - protected $linkForGoogle = ".//td/a[contains(.,'.xml')]"; - - /** - * Get link for Google. - * - * @return string - */ - public function getLinkForGoogle() - { - return $this->_rootElement->find($this->linkForGoogle, Locator::SELECTOR_XPATH)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php deleted file mode 100644 index 018b426665a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Config/Switcher.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->storeViewSelector, $store->getCode()))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php deleted file mode 100644 index 33aecd533a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/CurrencyGrid.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->gbpRate, Locator::SELECTOR_XPATH)->setValue('0.7'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php deleted file mode 100644 index d828aa07930..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Currency/GridPageActions.php +++ /dev/null @@ -1,93 +0,0 @@ -_rootElement->find($this->importButton)->click(); - - //Wait message - $browser = $this->browser; - $selector = $this->message; - $browser->waitUntil( - function () use ($browser, $selector) { - $message = $browser->find($selector); - return $message->isVisible() ? true : null; - } - ); - if ($this->getMessageBlock()->isVisibleMessage('warning')) { - throw new \Exception($this->getMessageBlock()->getWarningMessages()); - } - } - - /** - * Get message block. - * - * @return Messages - */ - protected function getMessageBlock() - { - return $this->blockFactory->create( - 'Mage\Core\Test\Block\Messages', - ['element' => $this->_rootElement->find($this->message)] - ); - } - - /** - * Save Currency Rates. - * - * @return void - */ - public function saveCurrentRate() - { - $this->_rootElement->find($this->saveCurrentRate)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php deleted file mode 100644 index f3149fb3a77..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find(sprintf($this->currencyRow, $fixture->getCode()), Locator::SELECTOR_XPATH); - $data = $fixture->getData(); - unset($data['code']); - $mapping = $this->dataMapping($data); - $this->_fill($mapping, $element); - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml deleted file mode 100644 index 7315ed107cc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/CurrencySymbolForm.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - variable - - - [id^=custom_currency_symbol_inherit] - css selector - checkbox - - - [id^=custom_currency_symbol] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php deleted file mode 100644 index b19c50d49af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/FormPageActions.php +++ /dev/null @@ -1,44 +0,0 @@ -_rootElement->find($this->saveButton); - if ($saveButton->isVisible()) { - $saveButton->click(); - } else { - $this->browser->find($this->headerFloating . ' ' . $this->saveButton)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php deleted file mode 100644 index a440f02a45d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Process/Grid.php +++ /dev/null @@ -1,37 +0,0 @@ -_rootElement->find($this->selectAll)->click(); - $this->_rootElement->find($this->massactionSelect, Locator::SELECTOR_CSS, 'select')->setValue($actionType); - $this->massActionSubmit(false); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php deleted file mode 100644 index c71809f7193..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/GroupForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php deleted file mode 100644 index 3f2f1abca7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Form/StoreForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php deleted file mode 100644 index a4247d01cd5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.php +++ /dev/null @@ -1,60 +0,0 @@ -dataMapping(['create_backup' => 'No']); - $this->_fill($mapping); - $this->_rootElement->find($this->delete)->click(); - } - - /** - * Check whether element is visible - * - * @return bool - */ - public function isVisible() - { - return $this->_rootElement->find($this->buttonContainer)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml deleted file mode 100644 index 649c7e2acaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Delete/Website.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php deleted file mode 100644 index 56f48d5040a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->website, $websiteName), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml deleted file mode 100644 index 29145e36618..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/GroupForm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - group - - - select - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php deleted file mode 100644 index 22ba91f4ef0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->store, $name), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml deleted file mode 100644 index 23d65dd3f64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/StoreForm.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - store - - - optgroupselect - - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php deleted file mode 100644 index e753fe9d8c3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/Edit/Form/WebsiteForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - website - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php deleted file mode 100644 index bb827561fa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/GridPageActions.php +++ /dev/null @@ -1,73 +0,0 @@ -_rootElement->find($this->addStoreViewButton)->click(); - } - - /** - * Click on "Create Store" button. - * - * @return void - */ - public function createStoreGroup() - { - $this->_rootElement->find($this->createStoreButton)->click(); - } - - /** - * Click on "Create Website" button. - * - * @return void - */ - public function createWebsite() - { - $this->_rootElement->find($this->createWebsiteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php deleted file mode 100644 index d7647d47f6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/System/Store/StoreGrid.php +++ /dev/null @@ -1,146 +0,0 @@ -_rootElement->find(sprintf($this->titleFormat, $title), Locator::SELECTOR_XPATH); - return $element->isVisible(); - } - - /** - * Check if store group exists. - * - * @param string $title - * @return bool - */ - public function isStoreGroupExists($title) - { - return $this->_rootElement->find(sprintf($this->storeGroupName, $title), Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Open Store View. - * - * @param Store $store - * @return void - */ - public function openStore(Store $store) - { - $this->_rootElement->find(sprintf($this->storeName, $store->getName()), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open Store Group. - * - * @param string $title - * @return void - */ - public function openStoreGroup($title) - { - $this->_rootElement->find(sprintf($this->storeGroupName, $title), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open website by name. - * - * @param string $title - * @return void - */ - public function openWebsite($title) - { - $this->_rootElement->find(sprintf($this->websiteName, $title), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Open Store Group by name. - * - * @param string $storeGroupName - * @return void - */ - public function openStoreGroupByName($storeGroupName) - { - $this->_rootElement->find(sprintf($this->storeGroupName, $storeGroupName), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get link url. - * - * @param string $link - * @throws \Exception - * @return string - */ - public function getLinkUrl($link) - { - $link = $this->_rootElement->find(sprintf($this->link, $link), Locator::SELECTOR_XPATH); - if ($link->isVisible()) { - return $link->getAttribute('href'); - } else { - throw new \Exception("Link should be visible to take it's href"); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php deleted file mode 100644 index 50325ae0aa0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.php +++ /dev/null @@ -1,39 +0,0 @@ -_rootElement->find($this->rate)->getValue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml deleted file mode 100644 index d4e1d87e5f7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/Edit/Form.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - select - - - select - - - select - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php deleted file mode 100644 index 3e150181043..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rate/RatesGrid.php +++ /dev/null @@ -1,47 +0,0 @@ - [ - 'selector' => 'input[name="code"]', - ], - 'tax_country_id' => [ - 'selector' => 'select[name="tax_country_id"]', - 'input' => 'select', - ], - 'tax_postcode' => [ - 'selector' => 'input[name="tax_postcode"]', - ], - ]; - - /** - * Locator value of td with tax rate. - * - * @var string - */ - protected $editLink = 'td'; -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php deleted file mode 100644 index d2d9d6a91be..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement->find($this->taxRate, Locator::SELECTOR_CSS, 'multiselectlist')->getAllValues(); - } - - /** - * Check whether tax rate is visible in the list. - * - * @param string $value - * @return bool - */ - public function isTaxRateAvailable($value) - { - return $this->_rootElement->find($this->taxRate, Locator::SELECTOR_CSS, 'multiselectlist') - ->isValueVisible($value); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml deleted file mode 100644 index 00c36825e7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Edit/Form.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - [name^="tax_customer_class"] - multiselect - - - [name^="tax_product_class"] - multiselect - - - [name^="tax_rate"] - multiselect - - - - checkbox - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php deleted file mode 100644 index fe2f412bb66..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/FormPageActions.php +++ /dev/null @@ -1,40 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php deleted file mode 100644 index 469cf3944de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Tax/Rule/Grid.php +++ /dev/null @@ -1,90 +0,0 @@ - [ - 'selector' => '#taxRuleGrid_filter_code', - ], - 'tax_customer_class' => [ - 'selector' => '#taxRuleGrid_filter_customer_tax_classes', - 'input' => 'select', - ], - 'tax_product_class' => [ - 'selector' => '#taxRuleGrid_filter_product_tax_classes', - 'input' => 'select', - ], - 'tax_rate' => [ - 'selector' => '#taxRuleGrid_filter_tax_rates', - 'input' => 'select', - ], - ]; - - /** - * Check if specific row exists in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return bool - */ - public function isRowVisible(array $filter, $isSearchable = false, $isStrict = true) - { - $this->search(['code' => $filter['code']]); - return parent::isRowVisible($filter, $isSearchable); - } - - /** - * Press 'Reset' button. - * - * @return void - */ - public function resetFilter() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Search item via grid filter. - * - * @param array $filter - */ - public function search(array $filter) - { - $this->resetFilter(); - $this->prepareForSearch($filter); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php deleted file mode 100644 index 1b2ba78d1b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Template.php +++ /dev/null @@ -1,42 +0,0 @@ -waitForElementNotVisible($this->loadingMask); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php deleted file mode 100644 index 8d9596cda76..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php +++ /dev/null @@ -1,281 +0,0 @@ -tabs = $this->getFormMapping(); - } - - /** - * Get path for form *.xml file with mapping - * - * @return string - */ - protected function getFormMapping() - { - $result = []; - $paths = $this->getPaths(); - foreach ($paths as $path) { - $content = $this->mapper->read($path); - if (is_array($content)) { - $result = array_replace_recursive($result, $content); - } - } - - return $result; - } - - /** - * Get xml files paths for merge. - * - * @return array - */ - protected function getPaths() - { - $realPath = str_replace('\\', '/', get_class($this)) . '.xml'; - $paths = glob(MTF_TESTS_PATH . preg_replace('/Mage\/\w+/', '*/*', $realPath)); - if (str_contains($realPath, 'Adminhtml')) { - $paths = array_merge( - $paths, - glob(MTF_TESTS_PATH . preg_replace('/Mage\/(\w+)(\/.*Block\/)/', '*/*$2$1/', $realPath)), - glob(MTF_TESTS_PATH . preg_replace('@.*Adminhtml/(.*)@', '*/Adminhtml/Test/Block/$1', $realPath)), - glob(MTF_TESTS_PATH . preg_replace('/.*Adminhtml\/(.*)/', '*/*/Test/Block/*/$1', $realPath)) - ); - } - return array_reverse($paths); - } - - /** - * Fill form with tabs. - * - * @param FixtureInterface $fixture - * @param Element|null $element - * @return FormTabs - */ - public function fill(FixtureInterface $fixture, Element $element = null) - { - $tabs = $this->getFieldsByTabs($fixture); - return $this->fillTabs($tabs, $element); - } - - /** - * Fill specified form with tabs. - * - * @param array $tabs - * @param Element|null $element - * @return FormTabs - */ - protected function fillTabs(array $tabs, Element $element = null) - { - $context = ($element === null) ? $this->_rootElement : $element; - foreach ($tabs as $tabName => $tabFields) { - $tabElement = $this->getTabElement($tabName); - $this->openTab($tabName); - $tabElement->fillFormTab($tabFields, $context); - } - if (!empty($this->unassignedFields)) { - $this->fillMissedFields(); - } - - return $this; - } - - /** - * Fill fields which weren't found on filled tabs. - * - * @throws \Exception - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function fillMissedFields() - { - foreach ($this->tabs as $tabName => $tabData) { - $tabElement = $this->getTabElement($tabName); - if ($this->openTab($tabName)) { - $mapping = $tabElement->dataMapping($this->unassignedFields); - foreach ($mapping as $fieldName => $data) { - $element = $tabElement->_rootElement->find($data['selector'], $data['strategy'], $data['input']); - if ($element->isVisible()) { - $element->setValue($data['value']); - unset($this->unassignedFields[$fieldName]); - } - } - if (empty($this->unassignedFields)) { - break; - } - } - } - - if (!empty($this->unassignedFields)) { - throw new \Exception( - 'Could not find all elements on the tabs: ' . implode(', ', array_keys($this->unassignedFields)) - ); - } - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $data = []; - - if (null === $fixture) { - foreach ($this->tabs as $tabName => $tab) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab(); - $data = array_merge($data, $tabData); - } - } else { - $tabsFields = $fixture->hasData() ? $this->getFieldsByTabs($fixture) : []; - foreach ($tabsFields as $tabName => $fields) { - $this->openTab($tabName); - $tabData = $this->getTabElement($tabName)->getDataFormTab($fields, $this->_rootElement); - $data = array_merge($data, $tabData); - } - } - - return $data; - } - - /** - * Update form with tabs. - * - * @param FixtureInterface $fixture - * @return FormTabs - */ - public function update(FixtureInterface $fixture) - { - $tabs = $this->getFieldsByTabs($fixture); - foreach ($tabs as $tab => $tabFields) { - $this->openTab($tab)->updateFormTab($tabFields, $this->_rootElement); - } - return $this; - } - - /** - * Create data array for filling tabs. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function getFieldsByTabs(FixtureInterface $fixture) - { - return $this->getFixtureFieldsByTabs($fixture); - } - - /** - * Create data array for filling tabs (new fixture specification). - * - * @param FixtureInterface $fixture - * @return array - */ - private function getFixtureFieldsByTabs(FixtureInterface $fixture) - { - $tabs = []; - - $data = $fixture->getData(); - foreach ($data as $field => $value) { - $attributes = $fixture->getDataFieldConfig($field); - $attributes['value'] = $value; - if (array_key_exists('group', $attributes) && $attributes['group'] != 'null') { - $tabs[$attributes['group']][$field] = $attributes; - } elseif (!array_key_exists('group', $attributes) && ($field != 'attribute_id')) { - $this->unassignedFields[$field] = $attributes; - } - } - return $tabs; - } - - /** - * Get tab element. - * - * @param string $tabName - * @return Tab - * @throws \Exception - */ - public function getTabElement($tabName) - { - $tabClass = $this->tabs[$tabName]['class']; - /** @var Tab $tabElement */ - $tabElement = $this->blockFactory->create($tabClass, ['element' => $this->_rootElement]); - if (!$tabElement instanceof Tab) { - throw new \Exception('Wrong Tab Class.'); - } - $tabElement->setWrapper(isset($this->tabs[$tabName]['wrapper']) ? $this->tabs[$tabName]['wrapper'] : ''); - $tabElement->setMapping(isset($this->tabs[$tabName]['fields']) ? (array)$this->tabs[$tabName]['fields'] : []); - - return $tabElement; - } - - /** - * Open tab. - * - * @param string $tabName - * @return Tab - */ - public function openTab($tabName) - { - $selector = $this->tabs[$tabName]['selector']; - $strategy = isset($this->tabs[$tabName]['strategy']) - ? $this->tabs[$tabName]['strategy'] - : Locator::SELECTOR_CSS; - $tab = $this->_rootElement->find($selector, $strategy); - $tab->click(); - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php deleted file mode 100644 index d1401e08a1c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Grid.php +++ /dev/null @@ -1,528 +0,0 @@ - $selector) { - $columnElements = $this->_rootElement - ->getElements($this->prepareColumnSelector($selector), Locator::SELECTOR_XPATH); - /** @var Element $columnElement */ - foreach ($columnElements as $columnElement) { - $data[$columnName][] = $columnElement->getText(); - } - } - return $data; - } - - /** - * Prepare column xpath selector. - * - * @param $selector - * @return string - */ - protected function prepareColumnSelector($selector) - { - $tableIdentifier = isset($this->tableIdentifier) ? $this->tableIdentifier : '@*'; - return sprintf($this->columnSelector, $tableIdentifier, $tableIdentifier, $selector); - } - - /** - * Convert column data in accordance with rows in grid. - * Example: - * Columns data - * 'id' => ['1', '2'] - * 'name' => ['Simple1', 'Simple2'] - * - * converts to - * 0 => ['id' = 1, 'name' => 'Simple1']; - * 1 => ['id' = 2, 'name' => 'Simple2']; - * - * @param array $columnData - * @return array - */ - protected function rowsDataConverter(array $columnData) - { - $rowData = []; - foreach ($columnData as $key => $dataValues) { - foreach($dataValues as $index => $value){ - $rowData[$index][$key] = $value; - } - } - - return $rowData; - } - - /** - * Prepare data to perform search, fill in search filter. - * - * @param array $filters - * @throws \Exception - */ - protected function prepareForSearch(array $filters) - { - foreach ($filters as $key => $value) { - if (isset($this->filters[$key])) { - $selector = $this->filters[$key]['selector']; - $strategy = isset($this->filters[$key]['strategy']) - ? $this->filters[$key]['strategy'] - : Locator::SELECTOR_CSS; - $typifiedElement = isset($this->filters[$key]['input']) - ? $this->filters[$key]['input'] - : null; - $this->_rootElement->find($selector, $strategy, $typifiedElement)->setValue($value); - } else { - throw new \Exception('Such column is absent in the grid or not described yet.'); - } - } - } - - /** - * Search item via grid filter. - * - * @param array $filter - */ - public function search(array $filter) - { - $this->resetFilter(); - $this->prepareForSearch($filter); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Search item and open it. - * - * @param array $filter - * @throws \Exception - */ - public function searchAndOpen(array $filter) - { - $this->search($filter); - $rowItem = $this->_rootElement->find($this->rowItem, Locator::SELECTOR_CSS); - if ($rowItem->isVisible()) { - $rowItem->find($this->editLink, Locator::SELECTOR_CSS)->click(); - } else { - throw new \Exception('Searched item was not found.'); - } - } - - /** - * Search for item and select it. - * - * @param array $filter - * @throws \Exception - */ - public function searchAndSelect(array $filter) - { - $this->search($filter); - $selectItem = $this->_rootElement->find($this->selectItem); - if ($selectItem->isVisible()) { - $selectItem->click(); - } else { - throw new \Exception('Searched item was not found.'); - } - } - - /** - * Press 'Reset' button. - */ - public function resetFilter() - { - $this->_rootElement->find($this->resetButton, Locator::SELECTOR_CSS)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Perform selected massaction over checked items. - * - * @param array $items - * @param array|string $action [array -> key = value from first select; value => value from subselect] - * @param bool $acceptAlert [optional] - * @param string $massActionSelection [optional] - * @return void - */ - public function massaction(array $items, $action, $acceptAlert = false, $massActionSelection = '') - { - if (!is_array($action)) { - $action = [$action => '-']; - } - foreach ($items as $item) { - $this->searchAndSelect($item); - } - if ($massActionSelection) { - $this->_rootElement->find($this->massactionAction, Locator::SELECTOR_CSS, 'select') - ->setValue($massActionSelection); - } - $actionType = key($action); - $this->_rootElement->find($this->massactionSelect, Locator::SELECTOR_CSS, 'select')->setValue($actionType); - if (isset($action[$actionType]) && $action[$actionType] != '-') { - $this->_rootElement->find($this->option, Locator::SELECTOR_CSS, 'select')->setValue($action[$actionType]); - } - $this->massActionSubmit($acceptAlert); - } - - /** - * Submit mass actions. - * - * @param bool $acceptAlert - * @return void - */ - protected function massActionSubmit($acceptAlert) - { - $this->_rootElement->find($this->massactionSubmit, Locator::SELECTOR_CSS)->click(); - if ($acceptAlert) { - $this->browser->acceptAlert(); - } - } - - /** - * Obtain specific row in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return Element - */ - protected function getRow(array $filter, $isSearchable = true, $isStrict = true) - { - if ($isSearchable) { - $this->search($filter); - } - $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - if ($isStrict) { - $rowTemplate = 'td[text()[normalize-space()="%s"]]'; - } - $rows = []; - foreach ($filter as $value) { - $rows[] = sprintf($rowTemplate, $value); - } - $location = $this->location . implode(' and ', $rows) . ']'; - return $this->_rootElement->find($location, Locator::SELECTOR_XPATH); - } - - /** - * Get rows data. - * - * @param array $columns - * @return array - */ - public function getRowsData(array $columns) - { - $columnData = $this->getColumnData($columns); - - return $this->rowsDataConverter($columnData); - } - - /** - * Check if specific row exists in grid. - * - * @param array $filter - * @param bool $isSearchable - * @param bool $isStrict - * @return bool - */ - public function isRowVisible(array $filter, $isSearchable = true, $isStrict = true) - { - return $this->getRow($filter, $isSearchable, $isStrict)->isVisible(); - } - - /** - * Sort grid by field. - * - * @param $field - * @param string $sort - */ - public function sortGridByField($field, $sort = "desc") - { - $sortBlock = $this->_rootElement->find(sprintf($this->sortLink, $field, $sort)); - if ($sortBlock->isVisible()) { - $sortBlock->click(); - $this->getTemplateBlock()->waitLoader(); - } - } - - /** - * Click to next page action link. - * - * @return bool - */ - protected function nextPage() - { - if ($this->_rootElement->find($this->actionNextPageDisabled)->isVisible()) { - return false; - } - $this->_rootElement->find($this->actionNextPage)->click(); - $this->getTemplateBlock()->waitLoader(); - return true; - } - - /** - * Check whether first row is visible. - * - * @return bool - */ - public function isFirstRowVisible() - { - return $this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->isVisible(); - } - - /** - * Open first item in grid. - * - * @return void - */ - public function openFirstRow() - { - $this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Check select entity. - * - * @param array $filter - * @throws \Exception - * @return bool - */ - public function isSelect(array $filter) - { - try { - $this->search($filter); - $checkValue = $this->_rootElement->find($this->selectedItem, Locator::SELECTOR_CSS, 'checkbox')->getValue(); - if ($checkValue == 'Yes') { - return true; - } - return false; - } catch (\Exception $e) { - throw new \Exception("Searched item was not found. \n $e"); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php deleted file mode 100644 index a0b72019c20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/Tab.php +++ /dev/null @@ -1,154 +0,0 @@ -dataMapping($fields); - $this->_fill($data, $element); - - return $this; - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $data = $this->dataMapping($fields); - return $this->_getData($data, $element); - } - - /** - * Update data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return void - */ - public function updateFormTab(array $fields, Element $element = null) - { - $this->fillFormTab($fields, $element); - } - - /** - * Get array of label => js error text. - * - * @return array - */ - public function getJsErrors() - { - $data = []; - $elements = $this->_rootElement->getElements($this->mageErrorField, Locator::SELECTOR_XPATH); - foreach ($elements as $element) { - $error = $element->find($this->mageErrorText, Locator::SELECTOR_XPATH); - if ($error->isVisible()) { - $label = $element->find($this->mageErrorLabel, Locator::SELECTOR_XPATH)->getText(); - $data[$label] = $error->getText(); - } - } - return $data; - } - - /** - * Get require notice messages. - * - * @return array - */ - public function getRequireNoticeMessages() - { - $messages = []; - $elements = $this->_rootElement->getElements($this->noticeMassage); - foreach ($elements as $element) { - $error = $element->find($this->noticeLabel, Locator::SELECTOR_XPATH); - if ($error->isVisible()) { - $label = $this->getNoticeLabel($element); - $messages[$label] = $element->getText(); - } - } - - return $messages; - } - - /** - * Get label for notice message. - * - * @param Element $element - * @return string - */ - protected function getNoticeLabel(Element $element) - { - $noticeLabel = str_replace(' ', '', strtolower($element->find($this->noticeLabel, Locator::SELECTOR_XPATH)->getText())); - return str_replace('*', '', $noticeLabel); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php deleted file mode 100644 index adb910b9953..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist.php +++ /dev/null @@ -1,45 +0,0 @@ -blockFactory->create( - 'Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist\Grid', - ['element' => $this->_rootElement->find($this->wishlistGrid)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php deleted file mode 100644 index e7b5a788339..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Wishlist/Customer/Edit/Tab/Wishlist/Grid.php +++ /dev/null @@ -1,132 +0,0 @@ - [ - 'selector' => 'input[name="product_name"]', - ], - 'qty_from' => [ - 'selector' => 'input[name="qty[from]"]', - ], - 'qty_to' => [ - 'selector' => 'input[name="qty[to]"]', - ], - 'options' => [ - 'selector' => 'td//*[dt[contains(.,"%option_name%")]/following-sibling::dd[contains(.,"%value%")]]', - 'strategy' => 'xpath', - ], - ]; - - /** - * Delete link selector. - * - * @var string - */ - protected $deleteLink = 'a[onclick*="removeItem"]'; - - /** - * Configure link selector. - * - * @var string - */ - protected $configureLink = 'a[onclick*="configureItem"]'; - - /** - * Delete product. - * - * @return void - */ - protected function delete() - { - $this->_rootElement->find($this->rowItem . ' ' . $this->deleteLink)->click(); - $this->browser->acceptAlert(); - } - - /** - * Configure product. - * - * @return void - */ - protected function configure() - { - $this->_rootElement->find($this->rowItem . ' ' . $this->configureLink)->click(); - } - - /** - * Search item product and action it. - * - * @param array $filter - * @param string $action - * @return void - */ - public function searchAndAction(array $filter, $action) - { - $this->search($filter); - $this->{ucfirst($action)}(); - $this->waitLoader(); - } - - /** - * Obtain specific row in grid. - * - * @param array $filter - * @param bool $isSearchable [optional] - * @param bool $isStrict [optional] - * @return Element - */ - protected function getRow(array $filter, $isSearchable = true, $isStrict = true) - { - $options = []; - if (isset($filter['options'])) { - $options = $filter['options']; - unset($filter['options']); - } - if ($isSearchable) { - $this->search($filter); - } - $location = '//div[@class="grid"]//tr['; - $rowTemplate = 'td[contains(.,normalize-space("%s"))]'; - $rows = []; - foreach ($filter as $value) { - $rows[] = sprintf($rowTemplate, $value); - } - if (!empty($options) && is_array($options)) { - foreach ($options as $value) { - $rows[] = str_replace( - '%value%', - $value['value'], - str_replace('%option_name%', $value['option_name'], $this->filters['options']['selector']) - ); - } - } - $location = $location . implode(' and ', $rows) . ']'; - return $this->_rootElement->find($location, Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php deleted file mode 100644 index 1cc8a29cad6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertProductIsPresentOnCustomWebsite.php +++ /dev/null @@ -1,196 +0,0 @@ -getDataFieldConfig('group_id')['source']->getStoreGroup(); - $this->website = $store->getDataFieldConfig('website_id')['source']->getWebsite(); - $this->setupPaths(); - $this->createWebsiteFolder(); - $this->placeFiles(); - $this->enableWebsiteConfiguration($fixtureFactory); - - $product = $fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataset' => 'default', 'data' => ['website_ids' => ['websites' => [$this->website]]]] - ); - $product->persist(); - - $code = $this->website->getCode(); - $productUrl = $_ENV['app_frontend_url'] . "websites/$code/" . $product->getUrlKey() . ".html"; - $browser->open(str_replace("index.php/", "", $productUrl)); - - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getViewBlock()->isVisible(), - "Searched product is not visible." - ); - } - - /** - * Setup paths for assert. - * - * @throws \Exception - * @return void - */ - protected function setupPaths() - { - $code = $this->website->getCode(); - $this->magentoRoot = $this->resolveMagentoRoot(); - $this->websiteFolder = $this->magentoRoot . DIRECTORY_SEPARATOR . "websites" . DIRECTORY_SEPARATOR . $code; - } - - /** - * Resolve magento root path. - * - * @return string - */ - protected function resolveMagentoRoot() - { - $realPath = realpath(MTF_BP . '/../../../'); - preg_match('@instance-\d@', $_ENV['app_frontend_url'], $matches); - return isset($matches[0]) ? preg_replace('@instance-\d@', $matches[0], $realPath) : $realPath; - } - - /** - * Create Website folder in magento root. - * - * @return void - */ - protected function createWebsiteFolder() - { - $oldMask = umask(0); - if (!is_dir($this->magentoRoot . DIRECTORY_SEPARATOR . 'websites')) { - - mkdir($this->magentoRoot . DIRECTORY_SEPARATOR . 'websites', 0777); - } - mkdir($this->websiteFolder, 0777); - umask($oldMask); - } - - /** - * Place files in created folder in magento root dir. - * - * @return void - */ - protected function placeFiles() - { - $htaccessFile = file_get_contents($this->magentoRoot . DIRECTORY_SEPARATOR . '.htaccess'); - file_put_contents($this->websiteFolder . DIRECTORY_SEPARATOR . ".htaccess", $htaccessFile); - $indexPhpFile = file_get_contents($this->magentoRoot . DIRECTORY_SEPARATOR . 'index.php'); - - $replace = ["getcwd()", "(\$mageRunCode, \$mageRunType)"]; - $replacement = ["'{$this->magentoRoot}'", "('{$this->website->getCode()}', 'website')"]; - $indexPhpFile = str_replace($replace, $replacement, $indexPhpFile); - - file_put_contents($this->websiteFolder . DIRECTORY_SEPARATOR . "index.php", $indexPhpFile); - } - - /** - * Enable website configuration. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - protected function enableWebsiteConfiguration(FixtureFactory $fixtureFactory) - { - $code = $this->website->getCode(); - $scope = "web/website/$code/"; - $data = [ - $scope . 'secure/base_link_url' => [ - 'scope' => $scope, - 'value' => "{{secure_base_url}}websites/$code/" - ], - $scope . 'unsecure/base_link_url' => [ - 'scope' => $scope, - 'value' => "{{unsecure_base_url}}websites/$code/" - ] - ]; - - $fixture = $fixtureFactory->createByCode('customConfigData', ['data' => $data]); - $fixture->persist(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is present on custom website."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php deleted file mode 100644 index d3812ca9e29..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreBackend.php +++ /dev/null @@ -1,59 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $systemConfig->getStoresSwitcher()->isStoreVisible($store), - "Store " . $store->getName() . " is not visible in dropdown on config page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View is available in backend configuration.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php deleted file mode 100644 index f528996c3f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreForm.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getStoreGrid()->openStore($store); - $errors = $this->verifyData($store->getData(), $storeNew->getStoreForm()->getData()); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php deleted file mode 100644 index 56616e70c5f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreFrontend.php +++ /dev/null @@ -1,72 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $cmsIndex->open(); - $footerBlock = $cmsIndex->getFooterBlock(); - $headerBlock = $cmsIndex->getHeaderBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - - $isStoreViewVisible = $headerBlock->isStoreViewDropdownVisible() - ? $headerBlock->isStoreViewVisible($store) - : true; // if only one store view is assigned to store group - - \PHPUnit_Framework_Assert::assertTrue( - $isStoreViewVisible, - "Store view '{$store->getName()}' is not visible in dropdown on CmsIndex page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store view is visible in dropdown on CmsIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php deleted file mode 100644 index c1e06ad8d6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupForm.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $storeIndex->getStoreGrid()->openStoreGroup($storeGroup->getName()); - $formData = $editGroup->getEditFormStoreGroup()->getData(); - $fixtureData = $storeGroup->getData(); - - $errors = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php deleted file mode 100644 index 2ebb1e768c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $storeGroupName = $storeGroup->getName(); - \PHPUnit_Framework_Assert::assertTrue( - $storeIndex->getStoreGrid()->isStoreGroupExists($storeGroupName), - "Store group '$storeGroupName' is not present in grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php deleted file mode 100644 index 0f0ef5e3a9a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupInPurchasePointDropdown.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - foreach ($storeGroups as $storeGroup) { - /** @var StoreGroup $storeGroup */ - $storeGroupName = $storeGroup->getName(); - \PHPUnit_Framework_Assert::assertTrue( - $salesOrderIndex->getSalesOrderGrid()->isRowVisible(['purchased_from' => $storeGroupName]), - "Store group '$storeGroupName' is not present in grid filter." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group can be found in "Purchase Point" dropdown on SalesOrderIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php deleted file mode 100644 index 29e48fc7f69..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupOnStoreViewForm.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $storeGroupName = $storeGroup->getName(); - $storeIndex->getGridPageActions()->addStoreView(); - \PHPUnit_Framework_Assert::assertTrue( - $storeNew->getStoreForm()->isStoreVisible($storeGroupName), - "Store Group '$storeGroupName' is not present on StoreView Form in Store dropdown." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group is visible on StoreView Form in Store dropdown.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php deleted file mode 100644 index 6f879a07e70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreGroupSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store Group success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php deleted file mode 100644 index 211b9a74fc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -getName(); - $storeIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $storeIndex->getStoreGrid()->isStoreExists($storeName), - "Store $storeName is not present in grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php deleted file mode 100644 index 44e75c34f80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreLocalized.php +++ /dev/null @@ -1,123 +0,0 @@ -open(); - $adminCache->getPageActions()->flushCacheStorage(); - $adminCache->getMessagesBlock()->waitSuccessMessage(); - - $this->cmsIndexPage = $cmsIndex; - $this->setConfig($store, $fixtureFactory, $config); - $cmsIndex->open(); - $this->selectStore($store); - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cmsIndex->getTopLinksBlock()->getAccountLabelText()), - self::EXPECTED_TEXT - ); - } - - /** - * Set config. - * - * @param Store $store - * @param FixtureFactory $fixtureFactory - * @param ConfigData $config - * @return void - */ - protected function setConfig(Store $store, FixtureFactory $fixtureFactory, ConfigData $config) - { - $configData = $config->getData(); - $configData['section']['general/locale/code']['scope'] .= '/' . $store->getCode(); - $fixtureFactory->createByCode('configData', ['data' => $configData['section']])->persist(); - } - - /** - * Select store. - * - * @param Store $store - * @return void - */ - protected function selectStore(Store $store) - { - $headerBlock = $this->cmsIndexPage->getHeaderBlock(); - $footerBlock = $this->cmsIndexPage->getFooterBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - if ($headerBlock->isStoreViewDropdownVisible()) { - $headerBlock->selectStore($store->getName()); - }; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created store view can be localized.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php deleted file mode 100644 index 7b4ec697af4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreNotOnFrontend.php +++ /dev/null @@ -1,69 +0,0 @@ -open(); - $footerBlock = $cmsIndex->getFooterBlock(); - $headerBlock = $cmsIndex->getHeaderBlock(); - if ($footerBlock->isStoreGroupSwitcherVisible() && $footerBlock->isStoreGroupVisible($store)) { - $footerBlock->selectStoreGroup($store); - } - - $isStoreViewVisible = $headerBlock->isStoreViewDropdownVisible() - ? $headerBlock->isStoreViewVisible($store) - : false; // if only one store view is assigned to store group - - \PHPUnit_Framework_Assert::assertFalse( - $isStoreViewVisible, - "Store view '{$store->getName()}' is visible in dropdown on CmsIndex page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store view is not visible in dropdown on CmsIndex page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php deleted file mode 100644 index b2a1d98a96c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertStoreSuccessSaveMessage.php +++ /dev/null @@ -1,64 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Store View success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php deleted file mode 100644 index 38056de44a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Constraint/AssertVersionCorrect.php +++ /dev/null @@ -1,52 +0,0 @@ -get('Magento\Mtf\Config\GlobalConfig'); - $newVersion = $config->get('version/0/value'); - $dashboard->open(); - \PHPUnit_Framework_Assert::assertTrue( - $dashboard->getFooter()->findVersion($newVersion)->isVisible() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Magento has benn upgraded successfully'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml deleted file mode 100644 index 7ba1b4f3c7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/CustomConfigData.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml deleted file mode 100644 index fc0485d06ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php deleted file mode 100644 index 1fd75cd4b94..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Store/GroupId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['store_group'])) { - $this->storeGroup = $data['store_group']; - $this->data = $data['store_group']->getWebsiteId() . "/" . $data['store_group']->getName(); - } elseif (isset($data['dataset'])) { - $storeGroup = $fixtureFactory->createByCode('storeGroup', ['dataset' => $data['dataset']]); - /** @var StoreGroup $storeGroup */ - if (!$storeGroup->getGroupId()) { - $storeGroup->persist(); - } - $this->storeGroup = $storeGroup; - $this->data = $storeGroup->getWebsiteId() . "/" . $storeGroup->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return StoreGroup fixture. - * - * @return StoreGroup - */ - public function getStoreGroup() - { - return $this->storeGroup; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml deleted file mode 100644 index 71e486d3f05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php deleted file mode 100644 index 76289447240..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/CategoryId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['category'])) { - $this->category = $data['category']; - $this->data = $data['category']->getName(); - } elseif (isset($data['dataset'])) { - $category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $data['dataset']]); - /** @var CatalogCategory $category */ - if (!$category->getId()) { - $category->persist(); - } - $this->category = $category; - $this->data = $category->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return CatalogCategory fixture. - * - * @return CatalogCategory - */ - public function getCategory() - { - return $this->category; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php deleted file mode 100644 index 1f9ab7f33d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/StoreGroup/WebsiteId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['website'])) { - $this->website = $data['website']; - $this->data = $data['website']->getName(); - } elseif (isset($data['dataset'])) { - $website = $fixtureFactory->createByCode('website', ['dataset' => $data['dataset']]); - /** @var Website $website */ - if (!$website->getWebsiteId()) { - $website->persist(); - } - $this->website = $website; - $this->data = $website->getName(); - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Website fixture. - * - * @return Website - */ - public function getWebsite() - { - return $this->website; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml deleted file mode 100644 index 6b4d28baaa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Fixture/Website.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php deleted file mode 100644 index 378b63eeaa8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Conditions.php +++ /dev/null @@ -1,267 +0,0 @@ - [ - 'is' => '==', - 'is not' => '!=', - 'equal to' => '==', - 'matches' => '==', - ], - 'value_type' => [ - 'same_as' => 'the Same as Matched Product Categories', - ], - 'value' => [ - 'California' => '12', - 'United States' => 'US', - '[flatrate] Fixed' => 'flatrate_flatrate', - ], - 'aggregator' => [ - 'ALL' => 'all', - ], - ]; - - /** - * Map encode special chars. - * - * @var array - */ - protected $encodeChars = [ - '\{' => '{', - '\}' => '}', - '\[' => '&lbracket;', - '\]' => '&rbracket;', - '\:' => ':', - ]; - - /** - * Map decode special chars. - * - * @var array - */ - protected $decodeChars = [ - '{' => '{', - '}' => '}', - '&lbracket;' => '[', - '&rbracket;' => ']', - ':' => ':', - ]; - - /** - * Prepare conditions to array for send by post request. - * - * @param string $conditions - * @return array - */ - protected function prepareCondition($conditions) - { - $decodeConditions = empty($conditions) - ? $this->decodeValue("[Conditions combination]") - : $this->decodeValue("{Conditions combination:[{$conditions}]}"); - return $this->convertMultipleCondition($decodeConditions); - } - - /** - * Convert condition combination. - * - * @param string $combination - * @param array|string $conditions - * @param int $nesting - * @return array - */ - private function convertConditionsCombination($combination, $conditions, $nesting) - { - $combination = [$nesting => $this->convertSingleCondition($combination)]; - $conditions = $this->convertMultipleCondition($conditions, $nesting, 1); - return $combination + $conditions; - } - - /** - * Convert multiple condition. - * - * @param array $conditions - * @param int $nesting - * @param int $count - * @return array - */ - private function convertMultipleCondition(array $conditions, $nesting = 1, $count = 0) - { - $result = []; - foreach ($conditions as $key => $condition) { - $curNesting = $nesting . ($count ? ('--' . $count) : ''); - - if (!is_numeric($key)) { - $result += $this->convertConditionsCombination($key, $condition, $curNesting); - } elseif (is_string($condition)) { - $result[$curNesting] = $this->convertSingleCondition($condition); - } else { - $result += $this->convertMultipleCondition($condition, $nesting, $count); - } - $count++; - } - return $result; - } - - /** - * Convert single condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - private function convertSingleCondition($condition) - { - $condition = $this->parseCondition($condition); - extract($condition); - - $typeParam = $this->getTypeParam($type); - if (empty($typeParam)) { - throw new \Exception("Can't find type param \"{$type}\"."); - } - - $ruleParam = []; - foreach ($rules as $value) { - $param = $this->getRuleParam($value); - if (empty($param)) { - $ruleParam['value'] = $value; - break; - } - $ruleParam += $param; - } - if (count($ruleParam) != count($rules)) { - throw new \Exception( - "Can't find all params. " - . "\nSearch: " . implode(', ', $rules) . " " - . "\nFind: " . implode(', ', $ruleParam) - ); - } - - return $typeParam + $ruleParam; - } - - /** - * Get type param by name. - * - * @param string $name - * @return array - */ - private function getTypeParam($name) - { - return isset($this->mapTypeParams[$name]) ? $this->mapTypeParams[$name] : []; - } - - /** - * Get rule param by name. - * - * @param string $name - * @return array - */ - private function getRuleParam($name) - { - foreach ($this->mapRuleParams as $typeParam => &$params) { - if (isset($params[$name])) { - return [$typeParam => $params[$name]]; - } - } - return []; - } - - /** - * Decode value. - * - * @param string $value - * @return array - * @throws \Exception - */ - private function decodeValue($value) - { - $value = str_replace(array_keys($this->encodeChars), $this->encodeChars, $value); - $value = preg_replace('/(\]|})({|\[)/', '$1,$2', $value); - $value = preg_replace('/{([^:]+):/', '{"$1":', $value); - $value = preg_replace('/\[([^\[{])/', '"$1', $value); - $value = preg_replace('/([^\]}])\]/', '$1"', $value); - $value = str_replace(array_keys($this->decodeChars), $this->decodeChars, $value); - - $value = "[{$value}]"; - $value = json_decode($value, true); - if (null === $value) { - throw new \Exception('Bad format value.'); - } - return $value; - } - - /** - * Parse condition. - * - * @param string $condition - * @return array - * @throws \Exception - */ - private function parseCondition($condition) - { - if (!preg_match_all('/([^|]+\|?)/', $condition, $match)) { - throw new \Exception('Bad format condition'); - } - foreach ($match[1] as $key => $value) { - $match[1][$key] = rtrim($value, '|'); - } - - return [ - 'type' => array_shift($match[1]), - 'rules' => array_values($match[1]), - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php deleted file mode 100644 index a731371a733..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/Curl.php +++ /dev/null @@ -1,57 +0,0 @@ - $subPath) { - if ($position === 0) { - $resultArray .= $subPath; - continue; - } elseif ($position === (count($path) - 1)) { - $resultArray .= '[fields]'; - } else { - $resultArray .= '[groups]'; - } - $resultArray .= '[' . $subPath . ']'; - } - $resultArray .= '[value]'; - if (is_array($InputValue)) { - $values = []; - foreach ($InputValue as $key => $value) { - $values[] = $resultArray . "[$key]=$value"; - } - $resultArray = implode('&', $values); - } elseif(!empty($InputValue)) { - $resultArray .= '=' . $InputValue; - } - return $resultArray; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php deleted file mode 100644 index 751e43977ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/CustomConfigData/CustomConfigDataInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -url = $url; - $this->regExpPattern = $regExpPattern; - $this->isAll = $isAll; - } - - /** - * Retrieves data from cURL response - * - * @throws \Exception - * @return array - */ - public function getData() - { - /** @var \Magento\Mtf\Config\DataInterface $config */ - $config = \Magento\Mtf\ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); - $url = $_ENV['app_backend_url'] . $this->url; - $curl = new BackendDecorator(new CurlTransport(), $config); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - if ($this->isAll) { - preg_match_all($this->regExpPattern, $response, $matches); - } else { - preg_match($this->regExpPattern, $response, $matches); - } - - $countMatches = $this->isAll ? count($matches[1]) : count($matches); - if ($countMatches == 0) { - throw new \Exception('Matches array can\'t be empty.'); - } - return $matches; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php deleted file mode 100644 index 3acd3b71417..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/Curl.php +++ /dev/null @@ -1,114 +0,0 @@ - [ - 'Main Website Store' => 1, - ], - 'is_active' => [ - 'Enabled' => 1, - 'Disabled' => 0, - ], - ]; - - /** - * POST request for creating store. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . $this->saveUrl; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Store View entity creating by curl handler was not successful! Response: $response"); - } - - return ['store_id' => $this->getStoreId($fixture->getName())]; - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = [ - 'store' => $this->replaceMappingData($fixture->getData()), - 'store_action' => 'add', - 'store_type' => 'store', - ]; - $data['store']['group_id'] = $fixture->getDataFieldConfig('group_id')['source']->getStoreGroup()->getGroupId(); - $data['store']['store_id'] = isset($data['store']['store_id']) ? $data['store']['store_id'] : ''; - - return $data; - } - - /** - * Get Store id by name after creating Store. - * - * @param string $name - * @return int|null - * @throws \Exception - */ - protected function getStoreId($name) - { - //Set pager limit to 2000 in order to find created store view by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/store_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - preg_match('@.*store_id/(\d+).*' . $name . '@siu', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find store id'); - } - - return empty($matches[1]) ? null : $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php deleted file mode 100644 index 8126ddcc4aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Store/StoreInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * POST request for creating store group. - * - * @param FixtureInterface $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var StoreGroup $fixture */ - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'system_store/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'success-msg')) { - throw new \Exception("Store group entity creating by curl handler was not successful! Response: $response"); - } - $groupId = $this->getStoreGroupIdByGroupName($fixture->getName()); - - if ($fixture->hasData('default_store_id')) { - $this->createStoreView($fixture, $groupId); - } - - return ['group_id' => $groupId]; - } - - /** - * Create store view. - * - * @param StoreGroup $storeGroup - * @param int $groupId - * @return void - */ - protected function createStoreView(StoreGroup $storeGroup, $groupId) - { - $storeId = $storeGroup->getDefaultStoreId(); - $storeGroup = $this->prepareStoreGroup($storeGroup, $groupId); - $store = $this->fixtureFactory->createByCode( - 'store', - ['dataset' => $storeId['dataset'], 'data' => ['group_id' => ['store_group' => $storeGroup]]] - ); - $store->persist(); - } - - /** - * Prepare store group fixture. - * - * @param StoreGroup $storeGroup - * @param int $groupId - * @return StoreGroup - */ - protected function prepareStoreGroup(StoreGroup $storeGroup, $groupId) - { - $category = $storeGroup->getDataFieldConfig('root_category_id')['source']->getCategory(); - $website = $storeGroup->getDataFieldConfig('website_id')['source']->getWebsite(); - $storeGroupData = array_replace_recursive( - $storeGroup->getData(), - [ - 'root_category_id' => ['category' => $category], - 'website_id' => ['website' => $website], - 'group_id' => $groupId - ] - ); - $storeGroup = $this->fixtureFactory->createByCode('storeGroup', ['data' => $storeGroupData]); - - return $storeGroup; - } - - /** - * Get store id by store name. - * - * @param string $storeName - * @return int - * @throws \Exception - */ - protected function getStoreGroupIdByGroupName($storeName) - { - //Set pager limit to 2000 in order to find created store group by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/group_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - preg_match('@.*group_id/(\d+).*' . $storeName . '@siu', $response, $matches); - - if (empty($matches)) { - throw new \Exception('Cannot find store group id'); - } - - return intval($matches[1]); - } - - /** - * Prepare data from text to values. - * - * @param StoreGroup $fixture - * @return array - */ - protected function prepareData(StoreGroup $fixture) - { - $categoryId = $fixture->getDataFieldConfig('root_category_id')['source']->getCategory()->getId(); - $websiteId = $fixture->getDataFieldConfig('website_id')['source']->getWebsite()->getWebsiteId(); - $data = [ - 'group' => [ - 'name' => $fixture->getName(), - 'root_category_id' => $categoryId, - 'website_id' => $websiteId, - 'group_id' => $fixture->hasData('group_id') ? $fixture->getGroupId() : '' - ], - 'store_action' => 'add', - 'store_type' => 'group' - ]; - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php deleted file mode 100644 index 92b2d43e19d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/StoreGroup/StoreGroupInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -adminAuthLogin = $adminAuthLogin; - $this->dashboard = $dashboard; - } - - /** - * Login admin user. - * - * @param FixtureInterface $fixture [optional] - * @return mixed|string - */ - public function persist(FixtureInterface $fixture = null) - { - $this->adminAuthLogin->open(); - $loginBlock = $this->adminAuthLogin->getLoginBlock(); - if ($loginBlock->isVisible()) { - $loginBlock->fill($fixture); - $loginBlock->submit(); - $this->dashboard->getAdminPanelHeader()->waitVisible(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php deleted file mode 100644 index 57f0f491b54..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/Curl.php +++ /dev/null @@ -1,162 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * POST request for creating Website. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var Website $fixture $data */ - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'system_store/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'success-msg"')) { - throw new \Exception("Website entity creating by curl handler was not successful! Response: $response"); - } - $websiteId = $this->getWebSiteId($fixture); - - if ($fixture->hasData('default_group_id')) { - $this->createStoreGroup($fixture, $websiteId); - } - - return ['website_id' => $websiteId]; - } - - /** - * Create store group. - * - * @param Website $website - * @param int $websiteId - * @return void - */ - protected function createStoreGroup(Website $website, $websiteId) - { - $groupId = $website->getDefaultGroupId(); - $website = $this->prepareWebsite($website, $websiteId); - $storeGroup = $this->fixtureFactory->createByCode( - 'storeGroup', - ['dataset' => $groupId['dataset'], 'data' => ['website_id' => ['website' => $website]]] - ); - $storeGroup->persist(); - } - - /** - * Prepare website fixture. - * - * @param Website $website - * @param int $websiteId - * @return Website - */ - protected function prepareWebsite(Website $website, $websiteId) - { - $websiteData = $website->getData(); - $websiteData['website_id'] = $websiteId; - $website = $this->fixtureFactory->createByCode('website', ['data' => $websiteData]); - - return $website; - } - - /** - * Get website id. - * - * @param Website $website - * @return int - * @throws \Exception - */ - protected function getWebSiteId(Website $website) - { - //Set pager limit to 2000 in order to find created website by name - $url = $_ENV['app_backend_url'] . 'system_store/index/sort/group_title/dir/asc/limit/2000'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - - $expectedUrl = '/admin/system_store/editWebsite/website_id/'; - preg_match('@.*' . $expectedUrl . '(\d+).*?' . $website->getName() . '@siu', $response, $matches); - - if (empty($matches)) { - throw new \Exception('Cannot find website id.'); - } - - return intval($matches[1]); - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = [ - 'website' => $fixture->getData(), - 'store_action' => 'add', - 'store_type' => 'website', - ]; - $data['website']['website_id'] = isset($data['website']['website_id']) ? $data['website']['website_id'] : ''; - $data['website']['is_default'] = isset($data['website']['is_default']) ? $data['website']['is_default'] : ''; - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php deleted file mode 100644 index 15fa92a0690..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Handler/Website/WebsiteInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml deleted file mode 100644 index a79ad8ec887..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/AdminLogout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml deleted file mode 100644 index f8b309dd663..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Cache.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml deleted file mode 100644 index ffc061600a0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/Dashboard.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml deleted file mode 100644 index cabaa5758df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml deleted file mode 100644 index 602504fa94f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteStore.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml deleted file mode 100644 index 69e6c915152..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/DeleteWebsite.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml deleted file mode 100644 index 4deced001b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml deleted file mode 100644 index ac97d7a8d51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditStore.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml deleted file mode 100644 index a61090af612..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/EditWebsite.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml deleted file mode 100644 index 7ccb0d8f033..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewStoreGroup.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml deleted file mode 100644 index 830b85e98e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/NewWebsite.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml deleted file mode 100644 index de01aeffc10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/ProcessList.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml deleted file mode 100644 index 55a46910b07..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml deleted file mode 100644 index ec5e3345195..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/StoreNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml deleted file mode 100644 index 65cecf0181a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Page/Adminhtml/SystemConfig.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml deleted file mode 100644 index 0074fd91d94..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - general/website/base/store - 1 - German (Germany) - de_DE - - - - - general/website/base/store - 1 - English (United States) - en_US - - - - - general/website/base/store - 1 - English (United States) - en_US - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml deleted file mode 100644 index 54337f9f2e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Store.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - default - - Default Store View - base - Enabled - 1 - - - - default - - Custom_Store_%isolation% - code_%isolation% - Enabled - - - - custom_with_custom_web_site - - Custom_Store_%isolation% - code_%isolation% - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml deleted file mode 100644 index 9dfc294df1d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/StoreGroup.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - main_website - - Main Website Store - 1 - - default_category - - - - - main_website - - store_name_%isolation% - - default_category - - - - - custom_website - - store_name_%isolation% - - default_category - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml deleted file mode 100644 index c788a35d773..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/Repository/Website.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Main Website - base - 1 - - - - Main Website - base - 0 - 1 - - - - Web_Site_%isolation% - code_%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php deleted file mode 100644 index 7dfbb9642e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.php +++ /dev/null @@ -1,181 +0,0 @@ - Manage Stores - * 3. Click "Create Store View" button - * 4. Fill data according to dataset - * 5. Perform all assertions - * - * @group Store_Management_(MX) - * @ZephyrId MPERF-6650 - */ -class CreateStoreEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Page StoreNew. - * - * @var StoreNew - */ - protected $storeNew; - - /** - * Current Store View. - * - * @var Store - */ - protected $store; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Page EditGroup. - * - * @var EditGroup - */ - protected $editGroup; - - /** - * Page DeleteGroup. - * - * @var DeleteGroup - */ - protected $deleteGroup; - - /** - * Admin logout page. - * - * @var AdminLogout - */ - protected $adminLogout; - - /** - * Preparing pages for test. - * - * @param StoreIndex $storeIndex - * @param StoreNew $storeNew - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param EditGroup $editGroup - * @param DeleteGroup $deleteGroup - * @param AdminLogout $adminLogout - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - StoreNew $storeNew, - EditStore $editStore, - DeleteStore $deleteStore, - EditGroup $editGroup, - DeleteGroup $deleteGroup, - AdminLogout $adminLogout - ) { - $this->storeIndex = $storeIndex; - $this->storeNew = $storeNew; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->editGroup = $editGroup; - $this->deleteGroup = $deleteGroup; - $this->adminLogout = $adminLogout; - } - - /** - * Run CreateStoreEntity test. - * - * @param Store $store - * @param ConfigData $config - * @return void - */ - public function test(Store $store, ConfigData $config) - { - // Preconditions - $this->store = $store; - $config->persist(); - $this->adminLogout->open(); - - // Steps - $this->storeIndex->open(); - $this->storeIndex->getGridPageActions()->addStoreView(); - $this->storeNew->getStoreForm()->fill($store); - $this->storeNew->getFormPageActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'store_view_local', 'rollback' => true] - )->run(); - $this->storeIndex->open(); - if ($this->store->getGroupId() === 'Main Website/Main Website Store') { - $this->storeIndex->getStoreGrid()->openStore($this->store); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } else { - $this->storeIndex->getStoreGrid()->openStoreGroup(explode('/', $this->store->getGroupId())[1]); - $this->editGroup->getFormPageActions()->delete(); - $deleteGroupFormPageActions = $this->deleteGroup->getFormPageActions(); - if ($deleteGroupFormPageActions->isVisible()) { - $this->deleteGroup->getForm()->fillForm(); - $deleteGroupFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml deleted file mode 100644 index 850cb0524fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreEntityTest.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - default - store_name_%isolation% - storecode_%isolation% - Enabled - store_view_local_us - The store view has been saved - main:ce - - - - - - - - default - store_name_%isolation% - storecode_%isolation% - Disabled - - - - - - - - - - custom - store_name_%isolation% - storecode_%isolation% - Enabled - store_view_local_us - The store view has been saved - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php deleted file mode 100644 index a286c21a1e7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.php +++ /dev/null @@ -1,160 +0,0 @@ - Manage Stores. - * 3. Click "Create Store" button. - * 4. Fill data according to dataset. - * 5. Click "Save Store" button. - * 6. Perform all assertions. - * - * @group Store_Management_(PS) - * @ZephyrId MPERF-6816 - */ -class CreateStoreGroupEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * NewGroupIndex page. - * - * @var NewStoreGroup - */ - protected $newStoreGroup; - - /** - * Page EditGroup. - * - * @var EditGroup - */ - protected $editGroup; - - /** - * Page DeleteGroup. - * - * @var DeleteGroup - */ - protected $deleteGroup; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Store group fixture. - * - * @var StoreGroup - */ - protected $storeGroup; - - /** - * Injection pages. - * - * @param StoreIndex $storeIndex - * @param NewStoreGroup $newStoreGroup - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param EditGroup $editGroup - * @param DeleteGroup $deleteGroup - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - NewStoreGroup $newStoreGroup, - EditGroup $editGroup, - DeleteGroup $deleteGroup, - EditStore $editStore, - DeleteStore $deleteStore - ) - { - $this->storeIndex = $storeIndex; - $this->newStoreGroup = $newStoreGroup; - $this->editGroup = $editGroup; - $this->deleteGroup = $deleteGroup; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - } - - /** - * Create new StoreGroup. - * - * @param StoreGroup $storeGroup - * @return void - */ - public function test(StoreGroup $storeGroup) - { - $this->storeGroup = $storeGroup; - //Steps - $this->storeIndex->open(); - $this->storeIndex->getGridPageActions()->createStoreGroup(); - $this->newStoreGroup->getEditFormStoreGroup()->fill($storeGroup); - $this->newStoreGroup->getFormPageActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - $this->storeIndex->open(); - if ($this->storeGroup->getWebsiteId() !== 'Main Website') { - $this->storeIndex->getStoreGrid()->openWebsite($this->storeGroup->getWebsiteId()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } else { - $this->storeIndex->getStoreGrid()->openStoreGroupByName($this->storeGroup->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml deleted file mode 100644 index 1ec681ccb10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateStoreGroupEntityTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - main_website - store_name_%isolation% - default_category - - - - - - - custom_website - store_name_%isolation% - root_category - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php deleted file mode 100644 index ae013cd478c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.php +++ /dev/null @@ -1,222 +0,0 @@ - Manage Stores. - * 3. Click "Create Website" button. - * 4. Fill data according to dataset. - * 5. Create Store with created Website. - * 6. Create StoreView with created Store. - * 7. Create folder with appropriate files for created Website. - * 8. Configure configuration settings for created Website. - * 9. Perform all assertions - * - * @group Store_Management_(MX) - * @ZephyrId MPERF-7232 - */ -class CreateWebsiteEntityTest extends Injectable -{ - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Website Fixture. - * - * @var Website - */ - protected $website; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Page NewWebsite. - * - * @var NewWebsite - */ - protected $newWebsite; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare fixture factory for test. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Preparing pages for test. - * - * @param StoreIndex $storeIndex - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @param NewWebsite $newWebsite - * @return void - */ - public function __inject( - StoreIndex $storeIndex, - EditStore $editStore, - DeleteStore $deleteStore, - NewWebsite $newWebsite - ) { - $this->storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->newWebsite = $newWebsite; - } - - /** - * Run Create Website Entity test. - * - * @param Website $website - * @param StoreGroup $store - * @param Store $storeView - * @return array - */ - public function test(Website $website, StoreGroup $store, Store $storeView) - { - // Steps - $this->storeIndex->open(); - $this->website = $this->createWebsite($website); - - // Persisting Store and StoreView with created website - $store = $this->persistStore($store); - $storeView = $this->persistStoreView($storeView, $store); - - return ['storeView' => $storeView]; - } - - /** - * Create website from admin panel. - * - * @param Website $website - * @return Website - */ - protected function createWebsite(Website $website) - { - $this->storeIndex->getGridPageActions()->createWebsite(); - $this->newWebsite->getWebsiteForm()->fill($website); - $this->newWebsite->getFormPageActions()->save(); - - return $this->prepareWebsite($website); - } - - /** - * Persist store with created website. - * - * @param StoreGroup $store - * @return StoreGroup - */ - protected function persistStore(StoreGroup $store) - { - $category = $store->getDataFieldConfig('root_category_id')['source']->getCategory(); - $data = ['website_id' => ['website' => $this->website], 'root_category_id' => ['category' => $category]]; - $store = $this->fixtureFactory->createByCode('storeGroup', ['data' => array_merge($store->getData(), $data)]); - $store->persist(); - - return $store; - } - - /** - * Persist store view with created store. - * - * @param Store $storeView - * @param StoreGroup $store - * @return Store - */ - protected function persistStoreView(Store $storeView, StoreGroup $store) - { - $data = ['data' => array_merge($storeView->getData(), ['group_id' => ['store_group' => $store]])]; - $storeView = $this->fixtureFactory->createByCode('store', $data); - $storeView->persist(); - - return $storeView; - } - - /** - * Prepare website for test. - * - * @param Website $website - * @return Website - */ - protected function prepareWebsite(Website $website) - { - $id = preg_replace("@.*/(\d+)/@", "$1", $this->storeIndex->getStoreGrid()->getLinkUrl($website->getName())); - $data = array_merge($website->getData(), ['website_id' => $id]); - - return $this->fixtureFactory->createByCode('website', ['data' => $data]); - } - - /** - * Delete Website after test variation. - * - * @return void - */ - public function tearDown() - { - // Delete Website - if ($this->website->hasData('website_id')) { - $this->storeIndex->open(); - $storeGrid = $this->storeIndex->getStoreGrid(); - $storeGrid->openWebsite($this->website->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml deleted file mode 100644 index 9dfc84f99da..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestCase/CreateWebsiteEntityTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - custom_website - custom - custom - main:ce - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php deleted file mode 100644 index ada33bfc2f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteStoreGroupsStep.php +++ /dev/null @@ -1,94 +0,0 @@ -storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - $this->storeGroups = $storeGroups; - } - - /** - * Delete store groups. - * - * @return void - */ - public function run() - { - foreach ($this->storeGroups as $storeGroup) { - /** @var StoreGroup $storeGroup */ - $this->storeIndex->getStoreGrid()->openStoreGroupByName($storeGroup->getName()); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php deleted file mode 100644 index 79cbbd35f3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/TestStep/DeleteWebsiteStep.php +++ /dev/null @@ -1,92 +0,0 @@ -websitesNames = $websitesNames; - $this->storeIndex = $storeIndex; - $this->editWebsite = $editWebsite; - $this->deleteWebsite = $deleteWebsite; - } - - /** - * Delete websites. - * - * @return void - */ - public function run() - { - foreach ($this->websitesNames as $websiteName) { - $this->storeIndex->open(); - $this->storeIndex->getStoreGrid()->openWebsite($websiteName); - $this->editWebsite->getFormPageActions()->delete(); - $deleteWebsiteForm = $this->deleteWebsite->getForm(); - if ($deleteWebsiteForm->isVisible()) { - $deleteWebsiteForm->delete(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml deleted file mode 100644 index 8b947467043..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/curl/di.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml deleted file mode 100644 index 84212dce5bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Adminhtml/Test/etc/fixture.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - flat - core_website - Magento\Store\Model\Resource\Website\Collection - code - - - flat - core_store_group - Magento\Store\Model\Resource\Group\Collection - - - flat - core_store - Magento\Store\Model\Resource\Store\Collection - code - - - flat - core_config_data - Mage\Core\Model\Resource\Config\Data\Collection - -
- section - virtual -
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php deleted file mode 100644 index 81b52aa04a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Block/Directpost/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - payment - - - select - - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml deleted file mode 100644 index ae5728ba108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize and Capture - authorize_capture - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 0 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize and Capture - authorize_capture - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorize Only - authorize - - - payment - 1 - authorize - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index d9b36410ecf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest - extends CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index d8f18353cac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Create full invoice for authorizenet directpost - authorizenet_directpost - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 5a30b94c8d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - Create full invoice with shipment for authorize.net - authorizenet_without_3d_secure - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet - default - comments for invoice - Capture Offline - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:authorize_net - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index 310a7614fbb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,95 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7280 - */ -class CreateOfflineRefundForAuthorizenetDirectpostMethodTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config, delete all tax rules and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index 8ffdfbe2be1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOfflineRefundForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Create full refund for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:authorize_net_dp - - - - - - - - - - Create partial credit memo for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - true - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index cd4c520851d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest - extends CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index 7a422fbd662..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - Create full invoice for authorizenet directpost - authorizenet_directpost - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index dda59eceab2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - Create full invoice with shipment for authorize.net - authorizenet_without_3d_secure - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - authorizenet - default - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:authorize_net - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index fff730c0051..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - authorizenet_directpost - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Authorization - Authorized - 105 - payment_method:authorize_net_dp - - - - - - - authorizenet_directpost - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Authorization - Authorized - 105 - payment_method:authorize_net_dp - - - - - - - authorizenet_directpost_capture - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - Capture - Captured - 105 - payment_method:authorize_net_dp - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml deleted file mode 100644 index 68ded19b8c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - authorizenet_with_3d_secure_action_authorized, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - customer_US - no - Flat Rate - Fixed - authorizenet - visa_3d_secure_positive_without_pass - visa_3d_secure_positive - 105.00 - true - payment_method:authorize_net - - - - - - authorizenet_with_3d_secure_action_authorized, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - customer_US - no - Flat Rate - Fixed - authorizenet - visa_3d_secure_negative_without_pass - visa_3d_secure_negative - 105.00 - false - payment_method:authorize_net - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index e1862182529..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - authorizenet_without_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - authorizenet - default - Authorization - Authorized - 105 - payment_method:authorize_net, main:ce - - - - - - - authorizenet_without_3d_secure - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - authorizenet - default - Authorization - Authorized - 105 - payment_method:authorize_net - - - - - - - authorizenet_without_3d_secure_action_capture - catalogProductSimple::order_default - default_frontend_new - register - no - customer_UK - Flat Rate - Fixed - authorizenet - default - Capture - Captured - 105 - payment_method:authorize_net - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php deleted file mode 100644 index ca7bd241977..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Ship' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Shipment' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7251 - */ -class CreateShipmentForAuthorizenetDirectpostMethodTest - extends CreateShipmentForOnlinePaymentMethodsWithIFrameTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml deleted file mode 100644 index ad5ea89cc92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestCase/CreateShipmentForAuthorizenetDirectpostMethodTest.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - Create full shipment for Authorize.net direct post - catalogProductSimple::default - authorizenet_directpost - default_frontend_new - register - no - customer_US_login - Flat Rate - Fixed - authorizenet_directpost - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:authorize_net_dp - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php deleted file mode 100644 index 4a4daea7559..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/TestStep/FillCreditCardStep.php +++ /dev/null @@ -1,69 +0,0 @@ -create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - $this->checkoutOnepage = $checkoutOnepage; - } - - /** - * Fill credit card step. - * - * @return void - */ - public function run() - { - $this->checkoutOnepage->getAuthorizenetDirectpostForm()->fill($this->payment['cc']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml deleted file mode 100644 index 4565cb0ed5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Authorizenet/Test/etc/testcase.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php deleted file mode 100644 index 8f59ae70637..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ /dev/null @@ -1,141 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option', - ['element' => $this->_rootElement->find(sprintf($this->bundleOptionsBlock, $blockNumber))] - ); - } - - /** - * Fill bundle options. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['bundle_selections'])) { - foreach ($fields['bundle_selections']['value'] as $key => $bundleOption) { - $this->createAndEditOption($key); - $this->getBundleOptionBlock($key)->fillOption($bundleOption); - } - unset($fields['bundle_selections']); - } - parent::fillFormTab($fields, $element); - } - - /** - * Open exist option for edit or create new. - * - * @param int $optionKey - * @return void - */ - protected function createAndEditOption($optionKey) - { - $itemOption = $this->_rootElement->find(sprintf($this->openOption, $optionKey)); - $isContent = $this->_rootElement->find(sprintf($this->optionContent, $optionKey))->isVisible(); - if ($itemOption->isVisible() && !$isContent) { - $itemOption->click(); - } elseif (!$itemOption->isVisible()) { - $this->_rootElement->find($this->addNewOption)->click(); - } - } - - /** - * Get data from fields on bundle items tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $newFields = []; - if (isset($fields['bundle_selections'])) { - foreach ($fields['bundle_selections']['value'] as $key => $bundleOption) { - $bundleOption = $this->prepareBundleOptions($bundleOption); - $newFields['bundle_selections'][$key] = $this->getBundleOptionBlock($key)->getOptionData($bundleOption); - } - unset($fields['bundle_selections']); - } - - return array_merge($newFields, parent::getDataFormTab($fields, $element)); - } - - /** - * Prepare bundle options. - * - * @param array $bundleOption - * @return array - */ - protected function prepareBundleOptions(array $bundleOption) - { - foreach ($bundleOption['assigned_products'] as $productKey => $product) { - $bundleOption['assigned_products'][$productKey]['getProductSku'] = $product['sku']; - $bundleOption['assigned_products'][$productKey]['getProductName'] = $product['name']; - } - - return $bundleOption; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php deleted file mode 100644 index 0ffc18db1c5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ /dev/null @@ -1,162 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Search\Grid', - ['element' => $this->_rootElement->find($this->searchGridBlock)] - ); - } - - /** - * Get item selection product block. - * - * @param int $rowIndex - * @return Selection - */ - protected function getSelectionBlock($rowIndex) - { - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option\Selection', - ['element' => $this->_rootElement->find(sprintf($this->selectionBlock, $rowIndex), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get backend abstract block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill bundle option. - * - * @param array $fields - * @return void - */ - public function fillOption(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - $this->addAssignedProducts($fields['assigned_products']); - } - - /** - * Add assigned products. - * - * @param array $assignedProducts - * @return void - */ - protected function addAssignedProducts(array $assignedProducts) - { - foreach ($assignedProducts as $key => $product) { - $this->addProduct(['sku' => $product['sku']]); - $this->getSelectionBlock(++$key)->fillProductRow($product); - } - } - - /** - * Add product to option. - * - * @param array $filter - * @return void - */ - protected function addProduct(array $filter) - { - $this->_rootElement->find($this->addSelection)->click(); - $this->getTemplateBlock()->waitLoader(); - $searchBlock = $this->getSearchGridBlock(); - $searchBlock->searchAndSelect($filter); - $searchBlock->addProducts(); - } - - /** - * Get data bundle option. - * - * @param array $fields - * @return array - */ - public function getOptionData(array $fields) - { - $mapping = $this->dataMapping($fields); - $newField = $this->_getData($mapping); - foreach ($fields['assigned_products'] as $key => $field) { - $newField['assigned_products'][$key] = $this->getSelectionBlock($key + 1)->getProductRow($field); - } - - return $newField; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml deleted file mode 100644 index 1b6c3f92a8f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - <selector>[name$="[title]"]</selector> - <strategy>css selector</strategy> - - - [name$='[type]'] - css selector - select - - - [name$="[required]"] - css selector - select - - - [name$='[position]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php deleted file mode 100644 index 76cbb6ceb81..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ /dev/null @@ -1,57 +0,0 @@ - [ - 'selector' => 'input[name=sku]' - ] - ]; - - /** - * Press 'Add Selected Product(s) to Option' button. - * - * @return void - */ - public function addProducts() - { - $this->_rootElement->find($this->addProducts)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php deleted file mode 100644 index fbd7de763ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ /dev/null @@ -1,93 +0,0 @@ -dataMapping($this->unsetElements($fields)); - $this->_fill($mapping); - } - - /** - * Get data item selection. - * - * @param array $fields - * @return array - */ - public function getProductRow(array $fields) - { - $mapping = $this->dataMapping($this->unsetElements($fields)); - $newFields = $this->_getData($mapping); - $newFields['sku'] = $this->getProductSku($mapping['getProductSku']); - $newFields['name'] = $this->getProductName($mapping['getProductName']); - unset($newFields['getProductSku'], $newFields['getProductName']); - - return $newFields; - } - - /** - * Get product SKU. - * - * @param array $skuField - * @return string - */ - protected function getProductSku(array $skuField) - { - $productSku = $this->_rootElement->find($skuField['selector'], $skuField['strategy'])->getText(); - return preg_replace('@SKU: (.*)@', '$1', $productSku); - } - - /** - * Get product name. - * - * @param array $nameField - * @return string - */ - protected function getProductName(array $nameField) - { - $productName = $this->_rootElement->find($nameField['selector'], $nameField['strategy'])->getText(); - preg_match('@(.*)\n@', $productName, $matches); - return isset($matches[1]) ? $matches[1] : ''; - } - - protected function unsetElements(array $fields) - { - foreach($this->unsetElementsData as $value) { - unset($fields[$value]); - } - - return $fields; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml deleted file mode 100644 index d19b3725278..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - [name$="[is_default]"] - checkbox - - - [name$='[selection_price_value]'] - - - [name$='[selection_price_type]'] - select - - - [name$='[selection_qty]'] - - - [name$='[selection_can_change_qty]'] - select - - - [name$="[is_default]"] - checkbox - - - ./td[1]/div[@class="nobr"] - xpath - - - ./td[1][div[@class="nobr"]] - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml deleted file mode 100644 index 11672972468..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - //ul[@id="product_info_tabs"]/li[1]/a - xpath - product - - - select - - - select - - - - - \Mage\Bundle\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle - #product_info_tabs_bundle_items - css selector - product - - - select - - - - - \Mage\Adminhtml\Test\Block\Catalog\Product\Edit\Tab\Prices - //ul[@id="product_info_tabs"]/li[2]/a - xpath - product - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php deleted file mode 100644 index 84a5eb42a6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/Price.php +++ /dev/null @@ -1,67 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'old_price' => [ - 'selector' => '.old-price .price' - ], - 'minimal_price' => [ - 'selector' => 'p.minimal-price .price', - ], - 'price_from' => [ - 'selector' => 'p.price-from .price', - ], - 'price_to' => [ - 'selector' => 'p.price-to .price', - ] - ]; - - /** - * Get price from. - * - * @param string $currency - * @return string - */ - public function getPriceFrom($currency = '$') - { - return $this->getTypePrice('price_from', $currency); - } - - /** - * Get price to. - * - * @param string $currency - * @return string - */ - public function getPriceTo($currency = '$') - { - return $this->getTypePrice('price_to', $currency); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php deleted file mode 100644 index 84f7cdeabfd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View.php +++ /dev/null @@ -1,170 +0,0 @@ -blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get bundle options block. - * - * @return Bundle - */ - public function getBundleBlock() - { - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\View\Type\Bundle', - ['element' => $this->_rootElement->find($this->bundleBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - $options['bundle_options'] = $this->getBundleBlock()->getOptions($product); - $options += parent::getOptions($product); - - return $options; - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - /** @var BundleProduct $product */ - $bundleCheckoutData = $this->prepareBundleCheckoutData($product); - $this->getBundleBlock()->fillBundleOptions($bundleCheckoutData); - } - - /** - * Prepare checkout data for fill bundle options. - * - * @param BundleProduct $product - * @return array - */ - protected function prepareBundleCheckoutData(BundleProduct $product) - { - $assignedProducts = $product->getDataFieldConfig('bundle_selections')['source']->getProducts(); - $bundleOptions = $product->getBundleSelections(); - $checkoutData = $product->getCheckoutData(); - $checkoutData = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - - foreach ($checkoutData as $optionKey => $option) { - $optionIndex = str_replace('option_key_', '', $optionKey); - $names = explode(',', $checkoutData[$optionKey]['value']['name']); - $checkoutData[$optionKey]['title'] = $bundleOptions[$optionIndex]['title']; - $checkoutData[$optionKey]['type'] = $bundleOptions[$optionIndex]['type']; - $checkoutData[$optionKey]['value']['name'] = $this->prepareOptionValue( - $names, - $assignedProducts[$optionIndex] - ); - } - - return $checkoutData; - } - - /** - * Prepare option value. - * - * @param array $values - * @param array $assignedProducts - * @return mixed - */ - protected function prepareOptionValue(array $values, array $assignedProducts) - { - return (count($values) > 1) - ? $this->prepareOptionMultiValue($values, $assignedProducts) - : $this->prepareOptionSimpleValue($values[0], $assignedProducts); - } - - /** - * Prepare option simple value. - * - * @param string $value - * @param array $assignedProducts - * @return string - */ - protected function prepareOptionSimpleValue($value, array $assignedProducts) - { - $productIndex = str_replace('product_key_', '', $value); - return $assignedProducts[$productIndex]->getName(); - } - - /** - * Prepare option multilpe value. - * - * @param array $values - * @param array $assignedProducts - * @return array - */ - protected function prepareOptionMultiValue(array $values, array $assignedProducts) - { - $optionValues = []; - foreach ($values as $key => $value) { - $optionValues[$key] = $this->prepareOptionSimpleValue($value, $assignedProducts); - } - - return $optionValues; - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getBundleStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php deleted file mode 100644 index 4cc095ce57b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Bundle.php +++ /dev/null @@ -1,305 +0,0 @@ -getBundleSelections(); - $listFormOptions = $this->getListOptions(); - $formOptions = []; - - foreach ($bundleSelections as $option) { - $optionData = $this->prepareOption($listFormOptions, $option); - $getTypeData = 'get' . $this->optionNameConvert($option['type']) . 'Data'; - $formOptions[] = array_merge($optionData, $this->$getTypeData($listFormOptions[$option['title']])); - } - - return $formOptions; - } - - /** - * Prepare option data. - * - * @param array $listFormOptions - * @param array $fixtureOption - * @return array - * @throws \Exception - */ - protected function prepareOption(array $listFormOptions, array $fixtureOption) - { - $title = $fixtureOption['title']; - if (!isset($listFormOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - /** @var Element $optionElement */ - $optionElement = $listFormOptions[$title]; - $optionData = [ - 'title' => $title, - 'type' => $fixtureOption['type'], - 'is_require' => $this->checkRequireOption($optionElement) - ]; - - return $optionData; - } - - /** - * Check option is require or not. - * - * @param Element $optionElement - * @return string - */ - protected function checkRequireOption(Element $optionElement) - { - return $optionElement->find($this->required, Locator::SELECTOR_XPATH)->isVisible() ? 'Yes' : 'No'; - } - - /** - * Fill bundle options. - * - * @param array $bundleOptions - * @return void - */ - public function fillBundleOptions($bundleOptions) - { - foreach ($bundleOptions as $option) { - $this->getItemOptionForm($option)->fillOption($option['value']); - } - } - - /** - * Get item option form. - * - * @param array $option - * @return Option - */ - protected function getItemOptionForm(array $option) - { - $selector = sprintf($this->bundleOptionForm, $option['title']); - return $this->blockFactory->create( - 'Mage\Bundle\Test\Block\Catalog\Product\View\Type\Option\\' . $this->optionNameConvert($option['type']), - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get list options. - * - * @return array - */ - protected function getListOptions() - { - $options = []; - $titles = $this->_rootElement->getElements($this->title, Locator::SELECTOR_XPATH); - foreach ($titles as $key => $title) { - $options[$title->getText()] = $this->_rootElement->find( - sprintf($this->optionElement, $key + 1), - Locator::SELECTOR_XPATH - ); - } - - return $options; - } - - /** - * Get data of "Drop-down" option. - * - * @param Element $option - * @return array - */ - protected function getDropdownData(Element $option) - { - $select = $option->find($this->selectOption, Locator::SELECTOR_XPATH, 'select'); - // Skip "Choose a selection ..."(option #1) - return $this->getSelectOptionsData($select, 2); - } - - /** - * Get data of "Multiple select" option. - * - * @param Element $option - * @return array - */ - protected function getMultipleselectData(Element $option) - { - $multiselect = $option->find($this->selectOption, Locator::SELECTOR_XPATH, 'multiselect'); - $data = $this->getSelectOptionsData($multiselect, 1); - - foreach ($data['options'] as $key => $option) { - $option['title'] = trim(preg_replace('/^[\d]+ x/', '', $option['title'])); - $data['options'][$key] = $option; - } - - return $data; - } - - /** - * Get data of "Radio buttons" option. - * - * @param Element $option - * @return array - */ - protected function getRadiobuttonsData(Element $option) - { - $listOptions = []; - $optionLabels = $option->getElements($this->optionLabel, Locator::SELECTOR_XPATH); - - foreach ($optionLabels as $optionLabel) { - if ($optionLabel->isVisible()) { - $listOptions[] = $this->parseOptionText($optionLabel->getText()); - } - } - - return ['options' => $listOptions]; - } - - /** - * Get data of "Checkbox" option. - * - * @param Element $option - * @return array - */ - protected function getCheckboxData(Element $option) - { - $data = $this->getRadiobuttonsData($option); - - foreach ($data['options'] as $key => $option) { - $option['title'] = trim(preg_replace('/^[\d]+ x/', '', $option['title'])); - $data['options'][$key] = $option; - } - - return $data; - } - - /** - * Get data from option of select and multiselect. - * - * @param Element $element - * @param int $firstOption - * @return array - */ - protected function getSelectOptionsData(Element $element, $firstOption = 1) - { - $listOptions = []; - - $count = $firstOption; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); - ++$count; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - } - - return ['options' => $listOptions]; - } - - /** - * Parse option text to title and price. - * - * @param string $optionText - * @return array - */ - protected function parseOptionText($optionText) - { - preg_match('`^(.*?)\+ ?\$(\d.*?)$`', $optionText, $match); - $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; - $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; - - return [ - 'title' => $optionTitle, - 'price' => $optionPrice - ]; - } - - /** - * Convert option name. - * - * @param string $optionType - * @return string - */ - protected function optionNameConvert($optionType) - { - $trimmedOptionType = preg_replace('/[^a-zA-Z]/', '', $optionType); - return ucfirst(strtolower($trimmedOptionType)); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php deleted file mode 100644 index 17f7e0f919e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option.php +++ /dev/null @@ -1,36 +0,0 @@ -dataMapping($data); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php deleted file mode 100644 index ce8f2660d41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Checkbox.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - .//label[contains(.,"%product_name%")]/../preceding-sibling::input - xpath - checkbox - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php deleted file mode 100644 index 51e8e11bc97..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Dropdown.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - select - select - - - input.qty - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php deleted file mode 100644 index 41b457366b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Multipleselect.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - .multiselect - multiselect - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php deleted file mode 100644 index 73fbf645055..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.php +++ /dev/null @@ -1,38 +0,0 @@ -dataMapping($data); - $mapping['name']['selector'] = str_replace('%product_name%', $data['name'], $mapping['name']['selector']); - $mapping['name']['value'] = 'Yes'; - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml deleted file mode 100644 index ac17bf1b6fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Block/Catalog/Product/View/Type/Option/Radiobuttons.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - .//label[contains(.,"%product_name%")]/../preceding-sibling::input - xpath - checkbox - - - .//input[contains(@class, "qty")] - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php deleted file mode 100644 index d8c04344d8e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleItemsOnProductPage.php +++ /dev/null @@ -1,185 +0,0 @@ -product = $product; - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $productOptions = $this->prepareBundleOptions(); - $formOptions = $catalogProductView->getViewBlock()->getOptions($product)['bundle_options']; - $formOptions = $this->prepareFormData($formOptions); - - $error = $this->verifyData($productOptions, $formOptions); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare form data. - * - * @param array $formOptions - * @return array - */ - protected function prepareFormData(array $formOptions) - { - foreach ($formOptions as $key => $formOption) { - $formOptions[$key] = $this->sortDataByPath($formOption, 'options::title'); - } - - return $this->sortDataByPath($formOptions, '::title'); - } - - /** - * Prepare bundle options. - * - * @return array|null - */ - protected function prepareBundleOptions() - { - $result = []; - $bundleSelections = $this->product->getBundleSelections(); - $assignedProducts = $this->product->getDataFieldConfig('bundle_selections')['source']->getProducts(); - foreach ($bundleSelections as $optionKey => $bundleOption) { - $options = $this->getOptions( - $bundleOption['assigned_products'], - $assignedProducts[$optionKey], - $bundleOption['type'] - ); - $optionData = [ - 'title' => $bundleOption['title'], - 'type' => $bundleOption['type'], - 'is_require' => $bundleOption['required'], - 'options' => $options - ]; - - $result[$optionKey] = $this->sortDataByPath($optionData, 'options::title'); - } - - return $this->sortDataByPath($result, '::title'); - } - - /** - * Get item bundle selections option. - * - * @param array $dataAssignedProducts - * @param array $fixturesAssignedProducts - * @param string $optionType - * @return array - */ - protected function getOptions(array $dataAssignedProducts, array $fixturesAssignedProducts, $optionType) - { - $result = []; - foreach ($fixturesAssignedProducts as $productKey => $fixtureProduct) { - $assignedProductPrice = $this->getAssignedProductPrice( - $dataAssignedProducts[$productKey], - $fixtureProduct, - $optionType - ); - $result[$productKey] = [ - 'title' => $fixtureProduct->getName(), - 'price' => $this->getOptionPrice($assignedProductPrice) - ]; - } - - return $result; - } - - /** - * Get assigned product price. - * - * @param array $dataAssignedProduct - * @param InjectableFixture $fixtureAssignedProduct - * @param string $optionType - * @return float - */ - protected function getAssignedProductPrice( - array $dataAssignedProduct, - InjectableFixture $fixtureAssignedProduct, - $optionType - ) { - $resultPrice = $fixtureAssignedProduct->getPrice(); - if (isset($dataAssignedProduct['selection_price_value'])) { - $assignedItemPrice = ($dataAssignedProduct['selection_price_type'] == 'Fixed') - ? $dataAssignedProduct['selection_price_value'] - : $this->product->getPrice() * $dataAssignedProduct['selection_price_value'] / 100; - $resultPrice = ($optionType == 'Drop-down' || $optionType == 'Radio Buttons') - ? $assignedItemPrice - : $assignedItemPrice * $dataAssignedProduct['selection_qty']; - } - - return $resultPrice; - } - - /** - * Get item option price for item bundle selection. - * - * @param float $assignedProductPrice - * @param string $customerGroup [optional] - * @return string - */ - protected function getOptionPrice($assignedProductPrice, $customerGroup = 'NOT LOGGED IN') - { - if ($this->product->hasData('group_price')) { - $groupPrice = $this->product->getGroupPrice(); - $groupPriceType = array_search($customerGroup, $groupPrice); - $assignedProductPrice -= $assignedProductPrice / 100 * $groupPrice[$groupPriceType]['price']; - } - $assignedProductPrice *= $this->product->hasData('special_price') ? $this->product->getSpecialPrice() / 100 : 1; - - return number_format($assignedProductPrice, 2); - } - - /** - * Return Text if displayed on frontend equals with fixture. - * - * @return string - */ - public function toString() - { - return 'Bundle options data on product page equals to passed from fixture preset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php deleted file mode 100644 index 9821efa2883..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceType.php +++ /dev/null @@ -1,119 +0,0 @@ -product = $product; - $checkoutCartView->open()->getCartBlock()->clearShoppingCart(); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - - //Process assertions - $this->assertPrice($checkoutCartView); - } - - /** - * Assert prices on the product view page and shopping cart page. - * - * @param CheckoutCart $checkoutCartView - * @return void - */ - protected function assertPrice(CheckoutCart $checkoutCartView) - { - $formCartItem = $checkoutCartView->getCartBlock()->getCartItem($this->product); - $fixtureCartItem = $this->product->getCheckoutData()['cartItem']; - - $this->assertCartOptions($fixtureCartItem['options']['bundle_options'], $formCartItem->getOptions()); - $this->assertCartPrice($fixtureCartItem['price'], $formCartItem->getCartItemTypePrice('price')); - } - - /** - * Assert cart bundle options. - * - * @param array $fixtureBundleOptions - * @param array $formBundleOptions - * @return void - */ - protected function assertCartOptions(array $fixtureBundleOptions, array $formBundleOptions) - { - foreach ($fixtureBundleOptions as $key => $fixtureOption) { - $cartIndex = str_replace('option_key_', '', $key); - preg_match('`\d+ x .* \$*(.*)`', $formBundleOptions[$cartIndex]['value'], $matches); - \PHPUnit_Framework_Assert::assertEquals($fixtureOption['price'], number_format($matches[1], 2)); - } - } - - /** - * Assert cart price. - * - * @param $fixtureCartPrice - * @param $formCartPrice - * @return void - */ - protected function assertCartPrice($fixtureCartPrice, $formCartPrice) - { - \PHPUnit_Framework_Assert::assertEquals($fixtureCartPrice, number_format($formCartPrice, 2)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Bundle price on shopping cart page is not correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php deleted file mode 100644 index 900bbf36b4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundlePriceView.php +++ /dev/null @@ -1,83 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView); - } - - /** - * Assert prices on the product view Page - * - * @param BundleProduct $product - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView) - { - $priceData = $product->getDataFieldConfig('price')['source']->getPriceData(); - $priceBlock = $catalogProductView->getBundleViewBlock()->getPriceBlock(); - $priceLow = ($product->getPriceView() == 'Price Range') - ? $priceBlock->getPriceFrom() - : $priceBlock->getRegularPrice(); - - \PHPUnit_Framework_Assert::assertEquals($priceData['price_from'], $priceLow); - - if ($product->getPriceView() == 'Price Range') { - \PHPUnit_Framework_Assert::assertEquals($priceData['price_to'], $priceBlock->getPriceTo()); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Bundle price on product view page is not correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php deleted file mode 100644 index b5beafa6b5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertBundleProductForm.php +++ /dev/null @@ -1,41 +0,0 @@ -product->getDataFieldConfig('price')['source']->getPriceData(); - $priceBlock = $this->catalogProductView->getBundleViewBlock()->getPriceBlock(); - $priceLow = ($this->product->getPriceView() == 'Price Range') - ? $priceBlock->getPriceFrom() - : $priceBlock->getRegularPrice(); - $priceTo = $priceBlock->getPriceTo(); - - if ($priceData['price_from'] != $priceLow) { - $errors[] = "Bundle price 'From' on product view page is not correct:" - . "\n$priceLow != {$priceData['price_from']}"; - } - if ($this->product->getPriceView() == 'Price Range' && $priceData['price_to'] != $priceTo) { - $errors[] = "Bundle price 'To' on product view page is not correct:" - . "\n$priceTo != {$priceData['price_to']}"; - } - - return empty($errors) ? null : implode("\n", $errors); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php deleted file mode 100644 index 772bf63b4d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Constraint/AssertProductTierPriceOnBundleProductPage.php +++ /dev/null @@ -1,83 +0,0 @@ -getTierPrice(); - foreach ($tierPrices as $key => $tierPrice) { - $tierPrices[$key]['price'] = number_format($tierPrices[$key]['price'], $this->priceFormat); - } - - return $tierPrices; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tier price is displayed on the bundle product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml deleted file mode 100644 index 487e8d7a466..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - bundle - - bundle - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php deleted file mode 100644 index c434e57418d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/BundleProduct/BundleSelections.php +++ /dev/null @@ -1,128 +0,0 @@ -repositoryFactory = $repositoryFactory; - $this->params = $params; - $this->objectManager = $objectManager; - $this->data = $this->prepareData($data); - } - - /** - * Prepare dataset data. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - $dataset = isset($data['dataset']) && isset($this->params['repository']) - ? $this->data = $this->repositoryFactory->get($this->params['repository'])->get($data['dataset']) - : []; - $this->products = isset($dataset['products']) ? $this->createProducts($dataset['products']) : []; - return $this->prepareBundleOptions($dataset['bundle_options']); - } - - /** - * Prepare bundle options. - * - * @param array $data - * @return array - */ - protected function prepareBundleOptions(array $data) - { - foreach ($data as $optionKey => $bundleOption) { - foreach ($bundleOption['assigned_products'] as $key => $assignedProduct) { - $data[$optionKey]['assigned_products'][$key]['sku'] = $this->products[$optionKey][$key]->getSku(); - $data[$optionKey]['assigned_products'][$key]['name'] = $this->products[$optionKey][$key]->getName(); - } - } - - return $data; - } - - /** - * Create products. - * - * @param array $products - * @return array - */ - protected function createProducts(array $products) - { - $resultProduct = []; - foreach ($products as $key => $product) { - $resultProduct[$key] = $this->objectManager - ->create('Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => implode(',', $product)]) - ->run()['products']; - } - - return $resultProduct; - } - - /** - * Return products' fixtures. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php deleted file mode 100644 index e0809569842..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Fixture/Cart/Item.php +++ /dev/null @@ -1,105 +0,0 @@ -getBundleSelections(); - $checkoutData = $product->getCheckoutData(); - $checkoutBundleOptions = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - foreach ($checkoutBundleOptions as $checkoutOptionKey => $checkoutOption) { - // Find option and value keys - $attributeKey = null; - $optionKey = null; - $productKey = null; - foreach ($bundleSelection as $key => $option) { - if ($option['title'] == $checkoutOption['title']) { - $attributeKey = $key; - $optionKey = $checkoutOptionKey; - } - foreach ($option['assigned_products'] as $keyProduct => $product) { - $productKey = $keyProduct; - } - } - // Prepare option data - $bundleOptions = $bundleSelection[$attributeKey]['assigned_products'][$productKey]; - $value = $bundleOptions['sku']; - $qty = isset($checkoutOption['value']['qty']) - ? $checkoutOption['value']['qty'] - : $bundleOptions['selection_qty']; - $price = number_format($checkoutData['cartItem']['options']['bundle_options'][$optionKey]['price'], 2); - $optionData = [ - 'title' => $checkoutOption['title'], - 'value' => "{$qty} x {$value} {$price}", - ]; - $checkoutBundleOptions[$checkoutOptionKey] = $optionData; - } - $this->data['options'] += $checkoutBundleOptions; - } - - /** - * Persist fixture. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php deleted file mode 100644 index b9265ee0141..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/BundleProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -mappingData += [ - 'selection_can_change_qty' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'sku_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'price_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'weight_type' => [ - 'Dynamic' => 0, - 'Fixed' => 1, - ], - 'shipment_type' => [ - 'Together' => 0, - 'Separately' => 1, - ], - 'type' => [ - 'Drop-down' => 'select', - 'Radio Buttons' => 'radio', - 'Checkbox' => 'checkbox', - 'Multiple Select' => 'multi', - ], - 'selection_price_type' => [ - 'Fixed' => 0, - 'Percent' => 1, - ] - ]; - } - - /** - * Post request for creating bundle product product. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $this->fixture = $fixture; - return parent::persist($fixture); - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $data = parent::prepareData($fixture, null); - $bundleOptions = $this->prepareBundleOptions($data['bundle_selections']); - $bundleSelections = $this->prepareBundleSelections($data['bundle_selections']); - $data = $prefix ? [$prefix => $data] : $data; - $data['bundle_selections'] = $bundleSelections; - $data['bundle_options'] = $bundleOptions; - - return $this->replaceMappingData($data); - } - - /** - * Prepare bundle selections data. - * - * @param array $bundleData - * @return array - */ - protected function prepareBundleSelections(array $bundleData) - { - $result = []; - $products = $this->fixture->getDataFieldConfig('bundle_selections')['source']->getProducts(); - foreach ($bundleData as $optionKey => $option) { - $result[$optionKey] = $this->prepareItemSelectionData($option['assigned_products'], $products[$optionKey]); - } - - return $result; - } - - /** - * Prepare item selection data. - * - * @param array $selections - * @param array $products - * @return array - */ - protected function prepareItemSelectionData(array $selections, array $products) - { - foreach ($selections as $key => $selection) { - $selections[$key]['product_id'] = $products[$key]->getId(); - unset($selections[$key]['sku']); - $selections[$key]['delete'] = ''; - } - - return $selections; - } - - /** - * Prepare bundle options data. - * - * @param array $bundleData - * @return array - */ - protected function prepareBundleOptions(array $bundleData) - { - foreach ($bundleData as $key => $option) { - $bundleData[$key] = array_intersect_key($bundleData[$key], array_flip($this->optionsFields)); - $bundleData[$key]['delete'] = ''; - } - - return $bundleData; - } - - /** - * Parse response. - * - * @param string $response - * @return array - */ - protected function parseResponse($response) - { - $result = parent::parseResponse($response); - return array_replace_recursive($result, $this->parseResponseSelections($result['id'])); - } - - /** - * Parse bundle selections in response. - * - * @param string $id - * @return array - */ - protected function parseResponseSelections($id) - { - $url = $_ENV['app_backend_url'] . "bundle_product_edit/form/id/{$id}/back/edit/tab/product_info_tabs_group_7/"; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - $selectionIdKey = 1; - $optionIdKey = 2; - $productNameKey = 3; - $responseSelections = []; - $bundleSelections = $this->fixture->getBundleSelections(); - - preg_match_all( - '/{.*"selection_id":"(\d+)".*"option_id":"(\d+)".*"name":"([^"]+)".*}/', - $response, - $matches, - PREG_SET_ORDER - ); - foreach ($matches as $match) { - $productName = $match[$productNameKey]; - $responseSelections[$productName] = [ - 'selection_id' => $match[$selectionIdKey], - 'option_id' => $match[$optionIdKey], - ]; - } - - foreach ($bundleSelections as $optionKey => $option) { - foreach ($option['assigned_products'] as $assignedKey => $optionValue) { - $productName = $optionValue['name']; - $bundleSelections[$optionKey]['assigned_products'][$assignedKey] += $responseSelections[$productName]; - } - } - - return ['bundle_selections' => $bundleSelections]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index bb1bbcb5f6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml deleted file mode 100644 index 717b2e8df2f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - BundleProduct %isolation% - Dynamic - Dynamic - Dynamic - Bundle product %isolation% - Short description bundle product %isolation% - Enabled - Catalog, Search - bundleproduct-%isolation% - - - - Bundle dynamic product %isolation% - sku_bundle_dynamic_product_%isolation% - Dynamic - Dynamic - - - - default_dynamic - - Dynamic - Separately - - Taxable Goods - - - - main_website - - - - Yes - Yes - Yes - In Stock - - bundle-dynamic-product-%isolation% - Catalog, Search - - default_dynamic - - Default - - default_dynamic - - Description for bundle dynamic product - Short description for bundle dynamic product - Enabled - - - Bundle fixed product %isolation% - sku_bundle_fixed_product_%isolation% - Fixed - Fixed - - 750.00 - default_bundle_fixed - - - Taxable Goods - - 1.0000 - Fixed - Together - - - main_website - - - - Yes - Yes - Yes - In Stock - - bundle-fixed-product-%isolation% - Catalog, Search - - default_fixed - - Default - - default_fixed - - Description for bundle dynamic product - Short description for bundle dynamic product - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml deleted file mode 100644 index c480775924f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/BundleSelections.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 0 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - Radio Button Option - Radio Buttons - Yes - 2 - - - %product_sku% - 5 - Fixed - 2 - Yes - - - %product_sku% - 6 - Fixed - 3 - Yes - - - - - Checkbox Option - Checkbox - Yes - 3 - - - %product_sku% - 5 - Fixed - 2 - - - %product_sku% - 6 - Fixed - 3 - - - - - Multiple Select Option - Multiple Select - Yes - 4 - - - %product_sku% - 5 - Fixed - 2 - - - %product_sku% - 6 - Fixed - 3 - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - Yes - 1 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - Radio Button Option - Radio Buttons - Yes - 2 - - - %product_sku% - 2 - Yes - - - %product_sku% - 3 - Yes - - - - - Checkbox Option - Checkbox - Yes - 3 - - - %product_sku% - 2 - - - %product_sku% - 3 - - - - - Multiple Select Option - Multiple Select - Yes - 4 - - - %product_sku% - 2 - - - %product_sku% - 3 - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - - - - Drop-down Option - Drop-down - No - 0 - - - %product_sku% - 2 - 45 - Fixed - Yes - - - %product_sku% - 3 - 43 - Fixed - Yes - - - - - Radio Button Option - Radio Buttons - No - 0 - - - %product_sku% - 2 - 45 - Fixed - Yes - - - %product_sku% - 3 - 43 - Fixed - Yes - - - - - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - catalogProductSimple::default - catalogProductSimple::50_dollar_product - - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml deleted file mode 100644 index 6139dc93078..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/CheckoutData.xml +++ /dev/null @@ -1,286 +0,0 @@ - - - - - - - - - Drop-down Option - Drop-down - - product_key_1 - 2 - - - - - - - - - 50 - - - - 100 - 100 - - - - - - - - Drop-down Option - Drop-down - - product_key_1 - 3 - - - - - 1 - - - - - 6 - - - - 768 - 768 - - - - - - - - - product_key_0 - 2 - - - - - 15 - - - - - 76 - - - - 152 - 2,280.00 - - - - - - - - - product_key_0 - 4 - - - - - 7 - - - - - 10 - - - - 40 - 40 - - - - - - - - - product_key_1 - 3 - - - - - 2 - - - - - 0.6 - - - - 11.8 - 23.6 - - - - - - - - - product_key_1 - 1 - - - - - 3 - - - - - 50 - - - - 50 - 150 - - - - - - - - - product_key_1 - 2 - - - - - 4 - - - - - 6 - - - - 112 - 448 - - - - - - - - - product_key_0 - 2 - - - - - product_key_0 - 2 - - - - - product_key_0 - - - - - product_key_0 - - - - - - attribute_key_0 - Field - - - attribute_key_1 - Area - - - attribute_key_3 - option_key_0 - - - attribute_key_4 - option_key_0 - - - attribute_key_5 - option_key_0 - - - attribute_key_6 - option_key_0 - - - attribute_key_7 - 12/12/2014 - - - attribute_key_8 - 12/12/2014/12/30/AM - - - attribute_key_9 - 12/12/AM - - - - 4 - - - - - 5 - - - 5 - - - 5 - - - 5 - - - - 290 - 1,160.00 - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml deleted file mode 100644 index e70538200dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/Repository/BundleProduct/Price.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - 150.00 - 200.00 - - - - 760.00 - 768.00 - - - - 760.00 - 768.00 - - - - 150.00 - 200.00 - - - - 15.00 - 20.00 - - - - 11.00 - 11.80 - - - - 150.00 - - - - 110.00 - - - - 290.00 - 372.00 - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index ec2e0b2421a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Add Bundle dynamic product to Wishlist - bundleProduct::bundle_dynamic_product - true - - - - - - Add Bundle fixed product to Wishlist - bundleProduct::bundle_fixed_product - true - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 7a2649127a3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - 2 - 2 - - - - - bundleProduct::bundle_fixed_product - 2 - 2 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml deleted file mode 100644 index 5cb342161cd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - 100 - - - - - - - - bundleProduct::bundle_fixed_product - 768 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index c5236c55c98..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php deleted file mode 100644 index cb21dca3b85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select Bundle Product and Attribute set. - * 5. Fill in all data according to data set. - * 6. Save product. - * 7. Verify created product. - * - * @group Bundle_Product_(CS) - * @ZephyrId MPERF-6886 - */ -class CreateBundleProductEntityTest extends Injectable -{ - /** - * Product page on backend. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * New product page on backend. - * - * @var CatalogProductNew - */ - protected $catalogProductNew; - - /** - * Persist category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $catalogProductIndex - * @param CatalogProductNew $catalogProductNew - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndex, CatalogProductNew $catalogProductNew) - { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductNew = $catalogProductNew; - } - - /** - * Test create bundle product. - * - * @param BundleProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(BundleProduct $product, CatalogCategory $category) - { - // Steps: - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product, null, $category); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml deleted file mode 100644 index c6a07d36395..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - Create default dynamic bundle product - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - default_dynamic - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - default_dynamic - default_dynamic - Catalog, Search - main:ce - - - - - - - - - - Create default fixed bundle product - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 750 - default_fixed - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - Separately - default_fixed - default_fixed - Catalog, Search - - - - - - - - - - Create out of stock fixed bundle product - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 10 - Taxable Goods - Out of Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - default_fixed - Catalog - - - - - - - - - Create dynamic bundle product with tier price and visible in search - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_with_tier_price - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - for_all_groups - Price Range - Together - default_dynamic - dynamic_with_tier_price - Search - - - - - - - - - - - - Create dynamic bundle product with grouped price and visible in catalog only - BundleProduct %isolation% - Dynamic - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_with_group_price - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - for_not_logged_users - Price Range - Together - default_dynamic - dynamic_with_group_price - Catalog - - - - - - - - - - - - Create fixed bundle product with special price - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - fixed_with_special_price - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - 10 - Price Range - Together - default_fixed - fixed_with_special_price - Catalog, Search - - - - - - - - Create default dynamic bundle product with as low as price view - Bundle Dynamic %isolation% - Dynamic - sku_bundle_dynamic_%isolation% - bundle-product-%isolation% - Enabled - Dynamic - dynamic_as_low_as_price - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - As Low as - default_dynamic - dynamic_as_low_as_price - Catalog, Search - - - - - - - - - - Create default fixed bundle product with as low as price view - Bundle Fixed %isolation% - Fixed - sku_bundle_fixed_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - fixed_as_low_as_price - Taxable Goods - In Stock - Bundle Product Description %isolation% - Bundle product short description %isolation% - As Low as - default_fixed - fixed_as_low_as_price - Catalog, Search - - - - - - - - - - Create fixed bundle product with custom options - BundleProduct %isolation% - Fixed - bundle_sku_%isolation% - bundle-product-%isolation% - Enabled - Fixed - 100 - all_types_bundle_fixed_and_custom_options - Taxable Goods - In Stock - Fixed - 10 - Bundle Product Description %isolation% - Bundle product short description %isolation% - Price Range - Together - all_types_fixed - all_types_bundle_fixed_and_custom_options - all_types - Catalog, Search - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml deleted file mode 100644 index c26850fdd51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/DeleteBundleProductEntityTest.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - - bundleProduct::bundle_fixed_product - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 8a6d27cbc4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - - - - - - - bundleProduct::bundle_fixed_product - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml deleted file mode 100644 index a0132f4ce69..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml deleted file mode 100644 index c43252ab717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Bundle/Test/etc/fixture.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - eav - catalog_product - bundle - Mage\Bundle\Model\Resource\Product\Collection - sku - - - id - virtual - - - bundle_selections - virtual - 1 - bundle - Mage\Bundle\Test\Fixture\BundleProduct\BundleSelections - - - stock_data - virtual - inventory - - - checkout_data - virtual - 1 - Mage\Bundle\Test\Fixture\BundleProduct\CheckoutData - - - custom_options - virtual - 0 - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - - - bundle - 4 - - product - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php deleted file mode 100644 index 5dc7e8dec92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/AbstractConfigureBlock.php +++ /dev/null @@ -1,78 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\CustomOptions', - ['element' => $this->_rootElement] - ); - } - - /** - * Set quantity. - * - * @param int $qty - * @return void - */ - abstract public function setQty($qty); - - /** - * Replace index fields to name fields in checkout data - * - * @param array $options - * @param array $checkoutData - * @return array - */ - protected function prepareCheckoutData(array $options, array $checkoutData) - { - $result = []; - - foreach ($checkoutData as $checkoutOption) { - $attribute = str_replace('attribute_key_', '', $checkoutOption['title']); - $option = str_replace('option_key_', '', $checkoutOption['value']); - - if (isset($options[$attribute])) { - - $result[] = [ - 'type' => strtolower(preg_replace('/[^a-z]/i', '', explode('/', $options[$attribute]['type']))[1]), - 'title' => isset($options[$attribute]['title']) - ? $options[$attribute]['title'] - : $attribute, - 'value' => isset($options[$attribute]['options'][$option]['title']) - ? $options[$attribute]['options'][$option]['title'] - : $option - ]; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php deleted file mode 100644 index cb2e9de84ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Category/View.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find($this->description)->getText(); - } - - /** - * Get view block text. - * - * @return string - */ - public function getText() - { - return $this->_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php deleted file mode 100644 index 5e388e5924b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Layer/View.php +++ /dev/null @@ -1,84 +0,0 @@ -_rootElement->find(sprintf($this->filterPriceLink, $priceLink), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Select attribute. - * - * @param array $filter - * @return void - */ - public function selectAttribute(array $filter) - { - $selector = sprintf($this->filterAttributeLink, $filter['attribute'], $filter['option']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get array of available filters. - * - * @return array - */ - public function getFilters() - { - $options = $this->_rootElement->getElements($this->optionTitle); - $data = []; - foreach ($options as $option) { - $data[] = $option->getText(); - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php deleted file mode 100644 index de0e9a1bbf5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Msrp/Popup.php +++ /dev/null @@ -1,63 +0,0 @@ -escape($this->_rootElement->find($this->priceBox)->getText()); - } - - /** - * Check if price visible in popup dialog. - * - * @return bool - */ - public function isPriceVisible() - { - return $this->_rootElement->find($this->priceBox)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php deleted file mode 100644 index 40b998cba91..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/ListCompare.php +++ /dev/null @@ -1,211 +0,0 @@ -getCompareProductInfo($index); - if ($attributeKey == 'price') { - return $this->getPrice($infoBlock, $currency); - } else { - return strtolower($infoBlock->find($this->nameSelector, Locator::SELECTOR_XPATH)->getText()); - } - } - - /** - * Get product price. - * - * @param SimpleElement $infoBlock - * @param string $currency - * @return string|array - */ - protected function getPrice(SimpleElement $infoBlock, $currency) - { - if ($infoBlock->find($this->priceFrom, Locator::SELECTOR_XPATH)->isVisible()) { - return [ - 'price_from' => $this->getPriceFromPage($infoBlock, $currency, $this->priceFrom), - 'price_to' => $this->getPriceFromPage($infoBlock, $currency, $this->priceTo) - ]; - } elseif ($infoBlock->find($this->priceFromString, Locator::SELECTOR_XPATH)->isVisible()) { - return ['price_from' => $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector)]; - } elseif ($infoBlock->find($this->priceStartingAtString, Locator::SELECTOR_XPATH)->isVisible()) { - return ['price_starting' => $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector)]; - } else { - return $this->getPriceFromPage($infoBlock, $currency, $this->priceSelector); - } - } - - /** - * Get price from page. - * - * @param SimpleElement $infoBlock - * @param string $currency - * @param string $selector - * @return string - */ - protected function getPriceFromPage(SimpleElement $infoBlock, $currency, $selector) - { - return $this->preparePrice( - $infoBlock->find($selector, Locator::SELECTOR_XPATH)->getText(), - $currency - ); - } - - /** - * Prepare price. - * - * @param string $price - * @param string $currency - * @return string - * @throws \Exception - */ - protected function preparePrice($price, $currency) - { - preg_match('/.(\d+.*)/', $price, $prices); - if (!empty($prices[1])) { - return trim($prices[1], $currency); - } else { - throw new \Exception("Price is absent on price block! \n" . $price); - } - } - - /** - * Get product meta data (sku, description and short description). - * - * @param int $index - * @param string $attributeKey - * @return string - */ - public function getProductMetaData($index, $attributeKey) - { - return strtolower( - $this->_rootElement->find( - sprintf($this->productBlock, $attributeKey, $index), - Locator::SELECTOR_XPATH - )->getText() - ); - } - - /** - * Get item compare product info. - * - * @param int $index - * @return SimpleElement - */ - protected function getCompareProductInfo($index) - { - return $this->_rootElement->find(sprintf($this->productInfo, $index), Locator::SELECTOR_XPATH); - } - - /** - * Check is visible attribute. - * - * @param string $attributeName - * @return bool - */ - public function isAttributeVisible($attributeName) - { - $selector = sprintf($this->attribute, $attributeName); - return $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php deleted file mode 100644 index b8763aadada..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Compare/Sidebar.php +++ /dev/null @@ -1,88 +0,0 @@ -_rootElement; - $selector = $this->productName; - $this->_rootElement->waitUntil( - function () use ($rootElement, $selector) { - return $rootElement->find($selector)->isVisible() ? true : null; - } - ); - $elements = $this->_rootElement->getElements($this->productName); - foreach ($elements as $element) { - $result[] = $element->getText(); - } - return $result; - } catch (\Exception $e) { - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); - } else { - throw $e; - } - } - } - - /** - * Click "Clear All" on "My Account" page. - * - * @return void - */ - public function clickClearAll() - { - $this->_rootElement->find($this->clearAll)->click(); - $this->_rootElement->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php deleted file mode 100644 index 71ce80cce7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ConfigurableProductView.php +++ /dev/null @@ -1,99 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\ConfigurableOptions', - ['element' => $this->_rootElement] - ); - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - /** @var ConfigurableProduct $product */ - $attributesData = $product->getConfigurableOptions()['attributes_data']; - $checkoutData = $product->getCheckoutData(); - - // Prepare attribute data - foreach ($attributesData as $attributeKey => $attribute) { - $attributesData[$attributeKey] = [ - 'type' => $attribute['frontend_input'], - 'title' => $attribute['frontend_label'], - 'options' => [], - ]; - - foreach ($attribute['options'] as $optionKey => $option) { - $attributesData[$attributeKey]['options'][$optionKey] = [ - 'title' => $option['label'], - ]; - } - $attributesData[$attributeKey]['options'] = array_values($attributesData[$attributeKey]['options']); - } - $attributesData = array_values($attributesData); - - $configurableCheckoutData = isset($checkoutData['options']['configurable_options']) - ? $checkoutData['options']['configurable_options'] - : []; - $checkoutOptionsData = $this->prepareCheckoutData($attributesData, $configurableCheckoutData); - $this->getConfigurableOptionsBlock()->fillOptions($checkoutOptionsData); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - $options = ['configurable_options' => $this->getConfigurableOptionsBlock()->getOptions($product)]; - $options += parent::getOptions($product); - - return $options; - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getConfigurableStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php deleted file mode 100644 index f1068a8ab64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/GroupedProductView.php +++ /dev/null @@ -1,120 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\GroupedProduct', - ['element' => $this->_rootElement->find($this->groupedProductBlock)] - ); - } - - /** - * Return product options. - * - * @param InjectableFixture $product [optional] - * @return array - */ - public function getOptions(InjectableFixture $product = null) - { - return $this->getGroupedProductBlock()->getOptions($product); - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getGroupedStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } - - /** - * Change price selector. - * - * @param int $index - * @return void - */ - public function itemPriceProductBlock($index) - { - $this->priceBlock = str_replace('%row-number%', $index, $this->formatSpecialPrice); - } - - /** - * Change tier price selector. - * - * @param int $index - * @return void - */ - public function itemTierPriceProductBlock($index) - { - $this->tierPricesSelector = str_replace('%row-number%', $index, $this->formatTierPrice); - } - - /** - * Fill grouped product options. - * - * @param InjectableFixture $product - * @return void - */ - public function fillOptions(InjectableFixture $product) - { - $checkoutData = $checkoutData = $product->getCheckoutData(); - $associatedProducts = $product->getAssociated(); - if (isset($checkoutData['options'])) { - $groupedBlock = $this->getGroupedProductBlock(); - foreach ($checkoutData['options'] as $key => $option) { - $groupedBlock->getGroupedItemForm($associatedProducts[$key]['name'])->fillOption($option); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php deleted file mode 100644 index 6a543ea3916..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ListProduct.php +++ /dev/null @@ -1,196 +0,0 @@ -getProductDetailsElement($productName); - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Product\Price', - ['element' => $productDetails->find($this->priceBlockClass, Locator::SELECTOR_CLASS_NAME)] - ); - } - - /** - * Check if product with specified name is visible. - * - * @param InjectableFixture $product - * @return bool - */ - public function isProductVisible($product) - { - return $this->getProductNameElement($product->getName())->isVisible(); - } - - /** - * Check if regular price is visible. - * - * @return bool - */ - public function isRegularPriceVisible() - { - return $this->_rootElement->find($this->regularPriceClass)->isVisible(); - } - - /** - * Open product view page by clicking on product name. - * - * @param string $productName - * @return void - */ - public function openProductViewPage($productName) - { - $this->getProductNameElement($productName)->click(); - } - - /** - * This method returns the element representing the product details for the named product. - * - * @param string $productName String containing the name of the product - * @return Element - */ - protected function getProductDetailsElement($productName) - { - return $this->_rootElement->find( - sprintf($this->productDetailsSelector, $productName), - Locator::SELECTOR_XPATH - ); - } - - /** - * This method returns the element on the page associated with the product name. - * - * @param string $productName String containing the name of the product - * @return Element - */ - protected function getProductNameElement($productName) - { - return $this->_rootElement->find(sprintf($this->productTitle, $productName)); - } - - /** - * Get Minimum Advertised Price on Category page. - * - * @return string - */ - public function getOldPriceCategoryPage() - { - return $this->_rootElement->find($this->oldPrice, Locator::SELECTOR_CSS)->getText(); - } - - /** - * Retrieve product price by specified Id. - * - * @param int $productId - * @return string - */ - public function getPrice($productId) - { - return $this->_rootElement->find(sprintf($this->priceBox, $productId), Locator::SELECTOR_CSS)->getText(); - } - - /** - * Check 'Add To Card' button availability. - * - * @return bool - */ - public function checkAddToCardButton() - { - return $this->_rootElement->find($this->addToCard, Locator::SELECTOR_CSS)->isVisible(); - } - - /** - * Get all terms used in sort. - * - * @return array - */ - public function getSortByValues() - { - return explode("\n", $this->_rootElement->find($this->sorter)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php deleted file mode 100644 index a1a2b968190..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/Price.php +++ /dev/null @@ -1,228 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'old_price' => [ - 'selector' => '.old-price .price' - ], - 'special_price' => [ - 'selector' => '.special-price .price' - ], - 'price_from' => [ - 'selector' => 'p.price-from .price', - ], - 'price_to' => [ - 'selector' => 'p.price-to .price', - ], - 'minimal_price' => [ - 'selector' => 'p.minimal-price .price', - ], - 'final_price' => [ - 'selector' => '.price', - ], - 'category_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'category_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ] - ]; - - /** - * 'Add to Cart' button. - * - * @var string - */ - protected $addToCart = '.action.tocart'; - - /** - * 'Click for price' link selector. - * - * @var string - */ - protected $clickForPrice = '.map-link'; - - /** - * MAP popup selector. - * - * @var string - */ - protected $map = './ancestor::body//*[@id="map-popup"]'; - - /** - * This method returns the price represented by the block. - * - * @param string $currency - * @return string - */ - public function getPrice($currency = '$') - { - return $this->getTypePrice('price', $currency); - } - - /** - * This method returns the regular price represented by the block. - * - * @return string - */ - public function getRegularPrice() - { - // either return the old price (implies special price display or a regular price - $priceElement = $this->getTypePriceElement('old_price'); - if (!$priceElement->isVisible()) { - $priceElement = $this->getTypePriceElement('price')->isVisible() - ? $this->getTypePriceElement('price') - : $this->getTypePriceElement('minimal_price'); - } - // return the actual value of the price - $price = preg_replace('#[^\d\.\s]+#umis', '', $priceElement->getText()); - return number_format(trim($price), 2); - } - - /** - * This method returns the special price represented by the block. - * - * @param string $currency - * @return string - */ - public function getSpecialPrice($currency = '$') - { - return $this->getTypePrice('special_price', $currency); - } - - /** - * Get final price. - * - * @param string $currency - * @return string - */ - public function getFinalPrice($currency = '$') - { - return $this->getTypePrice('final_price', $currency); - } - - /** - * This method returns if the regular price is visible. - * - * @return bool - */ - public function isRegularPriceVisible() - { - return $this->getTypePriceElement('price')->isVisible(); - } - - /** - * Get specify type price. - * - * @param string $type - * @param string $currency [optional] - * @return string|null - */ - protected function getTypePrice($type, $currency = '$') - { - $typePriceElement = $this->getTypePriceElement($type); - return $typePriceElement->isVisible() ? $this->escape($typePriceElement->getText(), $currency) : null; - } - - /** - * Get specify type price element. - * - * @param string $type - * @return Element - */ - public function getTypePriceElement($type) - { - $mapTypePrice = $this->mapTypePrices[$type]; - return $this->_rootElement->find( - $mapTypePrice['selector'], - isset($mapTypePrice['strategy']) ? $mapTypePrice['strategy'] : Locator::SELECTOR_CSS - ); - } - - /** - * Escape currency and separator for price. - * - * @param string $price - * @param string $currency - * @return string - */ - protected function escape($price, $currency = '$') - { - return str_replace([',', $currency], '', $price); - } - - /** - * Click on 'Click for price' link. - * - * @return void - */ - public function clickForPrice() - { - $this->_rootElement->find($this->clickForPrice)->click(); - } - - /** - * Get MAP popup block. - * - * @return Popup - */ - public function getMapBlock() - { - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Msrp\Popup', - [ - 'element' => $this->_rootElement->find($this->map, Locator::SELECTOR_XPATH) - ] - ); - } - - /** - * Get Result price. - * - * @return string - */ - public function getResultPrice() - { - return ($this->getTypePriceElement('price')->isVisible()) - ? $this->getTypePrice('price') - : $this->getTypePrice('special_price'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php deleted file mode 100644 index e93bc364dfe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/BottomToolbar.php +++ /dev/null @@ -1,47 +0,0 @@ -_rootElement->find($this->nextPageSelector); - - if ($nextPageItem->isVisible()) { - $nextPageItem->click(); - return true; - } - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php deleted file mode 100644 index 7c68fd51f39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Compare.php +++ /dev/null @@ -1,139 +0,0 @@ -_rootElement->find($this->compareButton)->click(); - } - - /** - * Get the number of products added to compare list. - * - * @return string - */ - public function getQtyInCompareList() - { - $compareProductLink = $this->_rootElement->find($this->qtyCompareProducts); - preg_match('/.*(\d+)/', $compareProductLink->getText(), $matches); - - return $matches[1]; - } - - /** - * Get url from compare link. - * - * @return string - */ - public function getCompareLinkUrl() - { - $link = $this->_rootElement->find($this->compareButton)->getAttribute('onclick'); - return trim($link); - } - - /** - * Get compare products block content. - * - * @throws \Exception - * @return array|string - */ - public function getProducts() - { - try { - $result = []; - $rootElement = $this->_rootElement; - $selector = $this->productName; - $this->_rootElement->waitUntil( - function () use ($rootElement, $selector) { - return $rootElement->find($selector)->isVisible() ? true : null; - } - ); - $elements = $this->_rootElement->getElements($this->productName); - foreach ($elements as $element) { - $result[] = strtolower($element->getText()); - } - return $result; - } catch (\Exception $e) { - $isEmpty = $this->_rootElement->find($this->isEmpty); - if ($isEmpty->isVisible()) { - return $isEmpty->getText(); - } else { - throw $e; - } - } - } - - /** - * Click "Clear All". - * - * @return void - */ - public function clickClearAll() - { - if ($this->_rootElement->find($this->clearAll, Locator::SELECTOR_XPATH)->isVisible()) { - $this->_rootElement->find($this->clearAll, Locator::SELECTOR_XPATH)->click(); - $this->browser->acceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php deleted file mode 100644 index aa1d73e36f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell.php +++ /dev/null @@ -1,53 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Crosssell\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->crosssellProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php deleted file mode 100644 index a9ad12e6097..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Crosssell/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->addToCart)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php deleted file mode 100644 index 92b2a9f894e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related.php +++ /dev/null @@ -1,54 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Related\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->relatedProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php deleted file mode 100644 index f3995a0fcc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Related/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->productName)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php deleted file mode 100644 index d5ca055cbf4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/TopToolbar.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->sorter)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php deleted file mode 100644 index f0ab953c3b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell.php +++ /dev/null @@ -1,54 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\ProductList\Upsell\Item', - [ - 'element' => $this->_rootElement->find( - sprintf($this->upsellProduct, $product->getName()), - Locator::SELECTOR_XPATH - ) - ] - ); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php deleted file mode 100644 index 833e1a89ef8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/ProductList/Upsell/Item.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->productName)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php deleted file mode 100644 index f3deb07219a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View.php +++ /dev/null @@ -1,389 +0,0 @@ -blockFactory->create( - 'Mage\Catalog\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Add product to shopping cart. - * - * @param InjectableFixture $product - * @return void - */ - public function addToCart(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickAddToCart(); - } - - /** - * Configure product. - * - * @param InjectableFixture $product - * @return void - */ - protected function configureProduct(InjectableFixture $product) - { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - if (isset($checkoutData['options'])) { - $this->fillOptions($product); - } - if (isset($checkoutData['qty'])) { - $this->setQty($checkoutData['qty']); - } - } - - /** - * Fill in the option specified for the product. - * - * @param InjectableFixture $product - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function fillOptions(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - $checkoutData = null; - - /** @var CatalogProductSimple $product */ - if ($this->hasRender($typeId)) { - $this->callRender($typeId, 'fillOptions', ['product' => $product]); - } - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - if (!isset($checkoutData['options']['custom_options'])) { - return; - } - $customOptions = $product->getCustomOptions(); - if (isset($customOptions)) { - $checkoutCustomOptions = $this->prepareCheckoutData( - $customOptions, - $checkoutData['options']['custom_options'] - ); - $this->getCustomOptionsBlock()->fillCustomOptions($checkoutCustomOptions); - } - } - - /** - * Return product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getOptions(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - - return $this->hasRender($typeId) - ? $this->callRender($typeId, 'getOptions', ['product' => $product]) - : $this->getCustomOptionsBlock()->getOptions($product); - } - - /** - * Click add to card button. - * - * @return void - */ - public function clickAddToCart() - { - $this->_rootElement->find($this->addToCart)->click(); - } - - /** - * Check add to card button. - * - * @return bool - */ - public function checkAddToCartButton() - { - return $this->_rootElement->find($this->addToCart)->isVisible(); - } - - /** - * Set quantity. - * - * @param int $qty - * @return void - */ - public function setQty($qty) - { - $this->browser->selectWindow(); - $this->_rootElement->find($this->qty)->setValue($qty); - $this->_rootElement->click(); - } - - /** - * Get product name displayed on page. - * - * @return string - */ - public function getProductName() - { - return $this->_rootElement->find($this->productName)->getText(); - } - - /** - * Return product short description on page. - * - * @return string|null - */ - public function getProductShortDescription() - { - if ($this->_rootElement->find($this->productShortDescription)->isVisible()) { - return $this->_rootElement->find($this->productShortDescription)->getText(); - } - return null; - } - - /** - * Return product description on page. - * - * @return string|null - */ - public function getProductDescription() - { - if ($this->_rootElement->find($this->productDescription)->isVisible()) { - return $this->_rootElement->find($this->productDescription)->getText(); - } - return null; - } - - /** - * Get text of Stock Availability control. - * - * @param InjectableFixture $product - * @return string - */ - public function getStockAvailability(InjectableFixture $product) - { - $dataConfig = $product->getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - - return $this->hasRender($typeId) - ? $this->callRender($typeId, 'get' . ucfirst($typeId) . 'StockAvailability') - : strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } - - /** - * This method return array tier prices. - * - * @param int $lineNumber [optional] - * @return array - */ - public function getTierPrices($lineNumber = 1) - { - return $this->_rootElement->find(sprintf($this->tierPricesSelector, $lineNumber), Locator::SELECTOR_XPATH) - ->getText(); - } - - /** - * Add product to Wishlist. - * - * @param InjectableFixture $product - * @return void - */ - public function addToWishlist(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickAddToWishlist(); - } - - /** - * Update product in Wishlist. - * - * @param InjectableFixture $product - * @return void - */ - public function updateWishlist(InjectableFixture $product) - { - $this->configureProduct($product); - $this->clickUpdateWishlist(); - } - - /** - * Click "Add to Wishlist" button. - * - * @return void - */ - public function clickAddToWishlist() - { - $this->_rootElement->find($this->addToWishlist)->click(); - } - - /** - * Click "Update Wishlist" button. - * - * @return void - */ - protected function clickUpdateWishlist() - { - $this->_rootElement->find($this->updateWishlist)->click(); - } - - /** - * Click "Add to Compare" button. - * - * @return void - */ - public function clickAddToCompare() - { - /** @var \Mage\Core\Test\Block\Messages $messageBlock */ - $messageBlock = $this->blockFactory->create( - 'Mage\Core\Test\Block\Messages', - ['element' => $this->browser->find($this->messageBlock)] - ); - $this->_rootElement->find($this->clickAddToCompare, Locator::SELECTOR_CSS)->click(); - $messageBlock->waitSuccessMessage(); - } - - /** - * Open custom information tab. - * - * @param string $tabName - * @return void - */ - public function openCustomInformationTab($tabName) - { - $this->_rootElement->find(sprintf($this->customInformationTab, $tabName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php deleted file mode 100644 index b14c52e5e51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.php +++ /dev/null @@ -1,126 +0,0 @@ -hasData('configurable_options') - ? $product->getConfigurableOptions()['attributes_data'] - : []; - $listOptions = $this->getListOptions(); - $result = []; - - foreach ($attributesData as $option) { - $title = $option['label']; - if (!isset($listOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - - /** @var Element $optionElement */ - $result[$title] = $this->getOptionsData($listOptions, $option, $title); - - if (!empty($result) && $this->_rootElement->find('#attribute' . $option['attribute_id'])->isDisabled()) { - $availableOptionData = current($result); - foreach($availableOptionData['options'] as $optionKey => $value) { - $availableOptionData['type'] = 'dropdown'; - $availableOptionData['value'] = $availableOptionData['options'][$optionKey]['title']; - $fillOption[0] = $availableOptionData; - unset($fillOption[0]['options'], $fillOption[0]['is_require']); - $this->fillOptions($fillOption); - $disableOptionData[$optionKey] = $this->getOptionsData($listOptions, $option, $title); - $result[$title]['options'][$optionKey] = $disableOptionData[$optionKey]['options'][0]; - } - } - } - - return $result; - } - - /** - * Get options data. - * - * @param $listOptions - * @param $option - * @param $title - * @return Element - */ - protected function getOptionsData($listOptions, $option, $title) - { - $optionElement = $listOptions[$title]; - $type = $option['frontend_input']; - $option['frontend_input'] = explode('/', $option['frontend_input'])[1]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $option['frontend_input']); - $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; - - $optionData = $this->$getTypeData($optionElement); - $optionData['title'] = $title; - $optionData['type'] = $type; - $isRequire = $this->_rootElement->find(sprintf($this->required, $title), Locator::SELECTOR_XPATH) - ->isVisible(); - $optionData['is_require'] = $isRequire ? 'Yes' : 'No'; - - return $optionData; - } - - /** - * Get options context. - * - * @return Element - */ - protected function getOptionsContext() - { - return $this->_rootElement->find(sprintf($this->optionsContext, 1), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml deleted file mode 100644 index 66920cd658a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/ConfigurableOptions.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - .//select - select - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php deleted file mode 100644 index 9396f88c5af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.php +++ /dev/null @@ -1,504 +0,0 @@ -hasData('custom_options') ? $product->getCustomOptions() : []; - if (empty($dataOptions)) { - return $dataOptions; - } - $listCustomOptions = $this->getListOptions(); - $result = []; - - foreach ($dataOptions as $option) { - $title = $option['title']; - if (!isset($listCustomOptions[$title])) { - throw new \Exception("Can't find option: \"{$title}\""); - } - - /** @var Element $optionElement */ - $optionElement = $listCustomOptions[$title]; - $option['type'] = explode('/', $option['type'])[1]; - $typeMethod = preg_replace('/[^a-zA-Z]/', '', $option['type']); - $getTypeData = 'get' . ucfirst(strtolower($typeMethod)) . 'Data'; - - $optionData = $this->$getTypeData($optionElement); - $optionData['title'] = $title; - $optionData['type'] = $option['type']; - $optionData['is_require'] = $optionElement['title']->find($this->required, Locator::SELECTOR_XPATH) - ->isVisible() - ? 'Yes' - : 'No'; - - $result[$title] = $optionData; - } - - return ['custom_options' => $result]; - } - - /** - * Get list custom options. - * - * @return array - */ - protected function getListOptions() - { - $customOptions = []; - $context = $this->getOptionsContext(); - $count = 1; - $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH); - $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH); - while ($optionElementTitle->isVisible()) { - $title = $optionElementTitle->find($this->title)->getText(); - $customOptions[$title]['title'] = $optionElementTitle; - $customOptions[$title]['content'] = $optionElement; - ++$count; - $optionElementTitle = $context->find(sprintf($this->optionElementTitle, $count), Locator::SELECTOR_XPATH); - $optionElement = $context->find(sprintf($this->optionElement, $count), Locator::SELECTOR_XPATH); - } - return $customOptions; - } - - /** - * Get options context. - * - * @return Element - */ - protected function getOptionsContext() - { - return $this->_rootElement->find(sprintf($this->optionsContext, 2), Locator::SELECTOR_XPATH)->isVisible() - ? $this->_rootElement->find(sprintf($this->optionsContext, 2), Locator::SELECTOR_XPATH) - : $this->_rootElement->find(sprintf($this->optionsContext, 1), Locator::SELECTOR_XPATH); - } - - /** - * Get data of "Field" custom option. - * - * @param array $option - * @return array - */ - protected function getFieldData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - $maxCharacters = $option['content']->find($this->maxCharacters, Locator::SELECTOR_XPATH); - return [ - 'options' => [ - 'price' => floatval($price), - 'max_characters' => $maxCharacters->isVisible() ? $maxCharacters->getText() : null, - ] - ]; - } - - /** - * Get data of "Area" custom option. - * - * @param array $option - * @return array - */ - protected function getAreaData(array $option) - { - return $this->getFieldData($option); - } - - /** - * Get data of "File" custom option. - * - * @param array $option - * @return array - */ - protected function getFileData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - - return [ - 'options' => [ - 'price' => floatval($price), - 'file_extension' => $this->getOptionNotice($option['content'], 1), - 'image_size_x' => preg_replace('/[^0-9]/', '', $this->getOptionNotice($option['content'], 2)), - 'image_size_y' => preg_replace('/[^0-9]/', '', $this->getOptionNotice($option['content'], 3)), - ] - ]; - } - - /** - * Get data of "Drop-down" custom option. - * - * @param array $option - * @return array - */ - protected function getDropdownData(array $option) - { - $select = $option['content']->find($this->selectOption, Locator::SELECTOR_XPATH, 'select'); - // Skip "Choose option ..."(option #1) - return $this->getSelectOptionsData($select, 2); - } - - /** - * Get data of "Multiple Select" custom option. - * - * @param array $option - * @return array - */ - protected function getMultipleSelectData(array $option) - { - $multiSelect = $option['content']->find($this->selectOption, Locator::SELECTOR_XPATH, 'multiselect'); - return $this->getSelectOptionsData($multiSelect, 1); - } - - /** - * Get data of "Radio Buttons" custom option. - * - * @param array $option - * @return array - */ - protected function getRadioButtonsData(array $option) - { - $listOptions = []; - - $count = 1; - $optionLabel = $option['content']->find(sprintf($this->optionLabel, $count), Locator::SELECTOR_XPATH); - while ($optionLabel->isVisible()) { - $listOptions[] = $this->parseOptionText($optionLabel->getText()); - ++$count; - $optionLabel = $option['content']->find(sprintf($this->optionLabel, $count), Locator::SELECTOR_XPATH); - } - - return [ - 'options' => $listOptions - ]; - } - - /** - * Get data of "Checkbox" custom option. - * - * @param array $option - * @return array - */ - protected function getCheckboxData(array $option) - { - return $this->getRadioButtonsData($option); - } - - /** - * Get data of "Date" custom option. - * - * @param array $option - * @return array - */ - protected function getDateData(array $option) - { - $price = $this->getOptionPriceNotice($option['title']); - - return [ - 'options' => [ - 'price' => floatval($price) - ] - ]; - } - - /** - * Get data of "Date & Time" custom option. - * - * @param array $option - * @return array - */ - protected function getDateTimeData(array $option) - { - return $this->getDateData($option); - } - - /** - * Get data of "Time" custom option. - * - * @param array $option - * @return array - */ - protected function getTimeData(array $option) - { - return $this->getDateData($option); - } - - /** - * Get data from option of select and multiselect. - * - * @param Element $element - * @param int $firstOption - * @return array - */ - protected function getSelectOptionsData(Element $element, $firstOption = 1) - { - $listOptions = []; - - $count = $firstOption; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - while ($selectOption->isVisible()) { - $listOptions[] = $this->parseOptionText($selectOption->getText()); - ++$count; - $selectOption = $element->find(sprintf($this->option, $count), Locator::SELECTOR_XPATH); - } - - return ['options' => $listOptions]; - } - - /** - * Get price from price-notice of custom option. - * - * @param Element $option - * @return array - */ - protected function getOptionPriceNotice(Element $option) - { - $priceNotice = $option->find($this->priceNotice, Locator::SELECTOR_XPATH); - if (!$priceNotice->isVisible()) { - return null; - } - return preg_replace('/[^0-9\.]/', '', $priceNotice->getText()); - } - - /** - * Get notice of option by number. - * - * @param Element $option - * @param int $number - * @return mixed - */ - protected function getOptionNotice(Element $option, $number) - { - $note = $option->find(sprintf($this->noteByNumber, $number), Locator::SELECTOR_XPATH); - return $note->isVisible() ? $note->getText() : null; - } - - /** - * Parse option text to title and price. - * - * @param string $optionText - * @return array - */ - protected function parseOptionText($optionText) - { - preg_match('`^(.*?)\+\$(\d.*?)$`', $optionText, $match); - $optionPrice = isset($match[2]) ? str_replace(',', '', $match[2]) : 0; - $optionTitle = isset($match[1]) ? trim($match[1]) : $optionText; - - return [ - 'title' => $optionTitle, - 'price' => $optionPrice - ]; - } - - /** - * Fill custom options. - * - * @param array $checkoutData - * @return void - */ - public function fillCustomOptions(array $checkoutData) - { - $checkoutOptions = $this->prepareOptions($checkoutData); - $this->fillOptions($checkoutOptions); - } - - /** - * Prepare composite fields in checkout options data. - * - * @param array $options - * @return array - */ - protected function prepareOptions(array $options) - { - $result = []; - - foreach ($options as $key => $option) { - switch ($option['type']) { - case 'datetime': - list($day, $month, $year, $hour, $minute, $dayPart) = explode('/', $option['value']); - $option['value'] = [ - 'day' => $day, - 'month' => $month, - 'year' => $year, - 'hour' => $hour, - 'minute' => $minute, - 'day_part' => $dayPart - ]; - break; - case 'date': - list($day, $month, $year) = explode('/', $option['value']); - $option['value'] = [ - 'day' => $day, - 'month' => $month, - 'year' => $year, - ]; - break; - case 'time': - list($hour, $minute, $dayPart) = explode('/', $option['value']); - $option['value'] = [ - 'hour' => $hour, - 'minute' => $minute, - 'day_part' => $dayPart - ]; - break; - } - - $result[$key] = $option; - } - - return $result; - } - - /** - * Fill product options. - * - * @param array $options - * @return void - */ - public function fillOptions(array $options) - { - foreach ($options as $option) { - $optionBlock = $this->_rootElement->find( - sprintf($this->optionByName, $option['title']), - Locator::SELECTOR_XPATH - ); - $type = $option['type']; - $mapping = $this->dataMapping([$type => $option['value']]); - - if ('radiobuttons' == $type || 'checkbox' == $type) { - $mapping[$type]['selector'] = str_replace( - '%option_name%', - $mapping[$type]['value'], - $mapping[$type]['selector'] - ); - $mapping[$type]['value'] = 'Yes'; - } - $this->_fill($mapping, $optionBlock); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml deleted file mode 100644 index b28194a408a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/CustomOptions.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - .//select - select - xpath - - - .//select - multiselect - xpath - - - .//div[label[span[contains(text(), "%option_name%")]]]/input - checkbox - xpath - - - .//div[label[span[contains(text(), "%option_name%")]]]/input - checkbox - xpath - - - - [name$="[month]"] - select - - - [name$="[day]"] - select - - - [name$="[year]"] - select - - - - - [name$="[month]"] - select - - - [name$="[day]"] - select - - - [name$="[year]"] - select - - - [name$="[hour]"] - select - - - [name$="[minute]"] - select - - - [name$="[day_part]"] - select - - - - - .//textarea - xpath - - - .//input - xpath - - - .//input - xpath - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php deleted file mode 100644 index 3b2e6e24a9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.php +++ /dev/null @@ -1,37 +0,0 @@ -dataMapping($option); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml deleted file mode 100644 index cff94ae49b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedItemForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - .qty - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php deleted file mode 100644 index ac25fbe43af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Product/View/GroupedProduct.php +++ /dev/null @@ -1,87 +0,0 @@ -getAssociated(); - - foreach ($associatedProducts as $product) { - $subProductBlock = $this->_rootElement->find( - sprintf($this->subProductByName, $product['name']), - Locator::SELECTOR_XPATH - ); - - $options[] = [ - 'name' => $subProductBlock->find($this->productName)->getText(), - 'qty' => $subProductBlock->find($this->qty)->getValue(), - ]; - } - - return $options; - } - - /** - * Get grouped item block. - * - * @param string $key - * @return GroupedItemForm - */ - public function getGroupedItemForm($key) - { - return $this->blockFactory->create( - 'Mage\Catalog\Test\Block\Product\View\GroupedItemForm', - ['element' => $this->_rootElement->find(sprintf($this->subProductByName, $key), Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php deleted file mode 100644 index 9ca4c0187e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Block/Search.php +++ /dev/null @@ -1,100 +0,0 @@ -fillSearch($keyword); - $this->_rootElement->find($this->searchButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Fills the search field - * - * @param string $text - * @return void - */ - public function fillSearch($text) - { - $this->_rootElement->find($this->searchInput, Locator::SELECTOR_CSS)->setValue($text); - } - - /** - * Checking block visibility "Suggest Search" - * - * @param string $text - * @param int|null $amount - * @return bool - */ - public function isSuggestSearchVisible($text, $amount = null) - { - $searchAutocomplete = sprintf($this->searchAutocomplete, $text); - if ($amount !== null) { - $searchAutocomplete .= sprintf($this->searchItemAmount, $amount); - } - - $rootElement = $this->_rootElement; - return (bool)$this->_rootElement->waitUntil( - function () use ($rootElement, $searchAutocomplete) { - return $rootElement->find($searchAutocomplete, Locator::SELECTOR_XPATH)->isVisible() ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php deleted file mode 100644 index 0c2b924b19b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertPriceOnGroupedProductPage.php +++ /dev/null @@ -1,78 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $groupedData = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($groupedData as $key => $subProduct) { - $catalogProductView->getGroupedProductViewBlock()->{'item' . $typePrice . 'PriceProductBlock'}(++$key); - $object->setErrorMessage(sprintf($this->errorMessage, $subProduct->getName())); - $object->assertPrice($subProduct, $catalogProductView->getGroupedProductViewBlock(), 'Grouped'); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php deleted file mode 100644 index 0def27b3f20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AbstractAssertProductsVisibleOnCategoryPageShopByFilter.php +++ /dev/null @@ -1,47 +0,0 @@ - $product) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - $expected = in_array($key, $searchProductsIndexes) ? true : false; - \PHPUnit_Framework_Assert::assertEquals($expected, $isProductVisible); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php deleted file mode 100644 index 8a22b5502b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddToCartButtonPresent.php +++ /dev/null @@ -1,54 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getViewBlock()->checkAddToCartButton(), - 'Add to Cart button is absent on product page' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add to Cart button is present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php deleted file mode 100644 index 26301f87265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAddedProductAttributeOnProductForm.php +++ /dev/null @@ -1,66 +0,0 @@ -open(); - $productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeLabel($attribute->getData()), - "Product Attribute is absent on Product form." - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute is present on Product form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php deleted file mode 100644 index 3e519db3935..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeForm.php +++ /dev/null @@ -1,70 +0,0 @@ - $attribute->getAttributeCode()]; - $catalogProductAttributeIndex->open()->getGrid()->searchAndOpen($filter); - - $dataFixture = $attribute->getData(); - $dataForm = $catalogProductAttributeEdit->getAttributeForm()->getData($attribute); - $errors = $this->verifyData($dataFixture, $dataForm); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Displayed attribute data on edit page equals passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php deleted file mode 100644 index ed10d30efe7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertAttributeOptionsOnProductForm.php +++ /dev/null @@ -1,69 +0,0 @@ -getOptions(); - $attributeOptionsFromFixture = []; - foreach ($options as $option) { - $attributeOptionsFromFixture[] = $option['admin']; - } - $catalogProductIndex->open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $productForm = $catalogProductEdit->getProductForm(); - $attributeOptions = $productForm->getAttributeElement($attribute)->getValues(); - - \PHPUnit_Framework_Assert::assertEquals($attributeOptionsFromFixture, $attributeOptions); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "Configurable options are available on configurable product Edit form."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php deleted file mode 100644 index 02b80487a9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnBackend.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $catalogCategoryIndex->getTreeCategories()->isCategoryVisible($category), - 'Category is displayed in backend catalog category tree.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category is not displayed in backend catalog category tree.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php deleted file mode 100644 index 5a52a3f37ef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryAbsenceOnFrontend.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . $category->getUrlKey() . '.html'); - $notFoundMessage = ($notFoundMessage !== null) ? $notFoundMessage : self::NOT_FOUND_MESSAGE; - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $categoryView->getViewBlock()->getText(), - 'Category is present on frontend.' - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category is absent on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php deleted file mode 100644 index 59d4784845c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForAssignedProducts.php +++ /dev/null @@ -1,64 +0,0 @@ -open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $products = $category->getDataFieldConfig('category_products')['source']->getProducts(); - foreach ($products as $productFixture) { - \PHPUnit_Framework_Assert::assertTrue( - $categoryView->getListProductBlock()->isProductVisible($productFixture), - "Products '{$productFixture->getName()}' is not find." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed assigned products on category page equal to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php deleted file mode 100644 index 9811ad7a16f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryForm.php +++ /dev/null @@ -1,71 +0,0 @@ -getData(); - $catalogCategoryIndex->open(); - $catalogCategoryIndex->getTreeCategories()->selectCategory($category); - $dataForm = $catalogCategoryIndex->getCategoryForm()->getDataCategory($category); - $error = $this->verifyData($data, $dataForm); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed category data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php deleted file mode 100644 index 943e6d7a14d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryPage.php +++ /dev/null @@ -1,110 +0,0 @@ -createByCode( - 'catalogProductSimple', - [ - 'dataset' => 'default', - 'data' => [ - 'category_ids' => [ - 'category' => $initialCategory - ] - ] - ] - ); - $categoryData = array_merge($initialCategory->getData(), $category->getData()); - $product->persist(); - $url = $_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'; - $browser->open($url); - \PHPUnit_Framework_Assert::assertEquals( - $url, - $browser->getUrl(), - 'Wrong page URL.' - ); - - if (isset($categoryData['name'])) { - \PHPUnit_Framework_Assert::assertEquals( - strtoupper($categoryData['name']), - $categoryView->getTitleBlock()->getTitle(), - 'Wrong page title.' - ); - } - - if (isset($categoryData['description'])) { - \PHPUnit_Framework_Assert::assertEquals( - $categoryData['description'], - $categoryView->getViewBlock()->getDescription(), - 'Wrong category description.' - ); - } - - if (isset($categoryData['default_sort_by'])) { - $sortBy = strtolower($categoryData['default_sort_by']); - $sortType = $categoryView->getTopToolbar()->getSelectSortType(); - \PHPUnit_Framework_Assert::assertEquals( - $sortBy, - $sortType, - 'Wrong sorting type.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category data on category page equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php deleted file mode 100644 index 0f02bebf7f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategoryRedirect.php +++ /dev/null @@ -1,65 +0,0 @@ -open(str_replace('index', 'cron', $_ENV['app_frontend_url'])); - $browser->open($_ENV['app_frontend_url'] . $initialCategory->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - $catalogCategoryView->getTitleBlock()->getTitle(), - strtoupper($category->getName()), - 'Old category URL does not lead to appropriate Category in frontend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Old category URL lead to appropriate Category in frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php deleted file mode 100644 index bb700376df6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySaveMessage.php +++ /dev/null @@ -1,63 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertEquals( - self::SUCCESS_MESSAGE, - $actualMessage, - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php deleted file mode 100644 index 867485a1d11..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCategorySuccessDeleteMessage.php +++ /dev/null @@ -1,54 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Return string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Category success delete message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php deleted file mode 100644 index 0cfd5c0745b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductForm.php +++ /dev/null @@ -1,110 +0,0 @@ - $attribute) { - foreach ($attribute['options'] as $optionKey => $option) { - $attribute['options'][$optionKey] = array_diff_key($option, array_flip($this->skippedOptionFields)); - } - $attribute['options'] = $this->sortDataByPath($attribute['options'], '::admin'); - $attributeData[$attributeKey] = array_diff_key($attribute, array_flip($this->skippedAttributeFields)); - } - $data['configurable_options']['attributes_data'] = $this->sortDataByPath( - $attributeData, - '::frontend_label' - ); - } - - return parent::prepareFixtureData($data, $sortFields); - } - - /** - * Prepares form data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFormData(array $data, array $sortFields = []) - { - // prepare attributes data - if (isset($data['configurable_options'])) { - $attributeData = $data['configurable_options']['attributes_data']; - foreach ($attributeData as $attributeKey => $attribute) { - $attribute['options'] = $this->sortDataByPath($attribute['options'], '::admin'); - $attributeData[$attributeKey] = $attribute; - } - $data['configurable_options']['attributes_data'] = $this->sortDataByPath( - $attributeData, - '::frontend_label' - ); - - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php deleted file mode 100644 index 1fee5eab6f5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductInCart.php +++ /dev/null @@ -1,69 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutData = $product->getCheckoutData(); - $price = $checkoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'); - \PHPUnit_Framework_Assert::assertEquals( - $checkoutData['cartItem']['price'], - $price, - 'Product price in shopping cart is not correct.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product price in shopping cart is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php deleted file mode 100644 index b59be9eafa1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertConfigurableProductPage.php +++ /dev/null @@ -1,131 +0,0 @@ -verifyAttributes(); - - return array_filter($errors); - } - - /** - * Verify displayed product attributes on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyAttributes() - { - $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']); - $fixtureOptions = $this->prepareFixtureOptions(); - $errors = $this->verifyData($fixtureOptions, $formOptions, true, false); - return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:'); - } - - /** - * Prepare fixture options data. - * - * @return array - */ - protected function prepareFixtureOptions() - { - $configurableOptions = []; - $attributesData = $this->product->getConfigurableOptions()['attributes_data']; - $countAttributes = count($attributesData); - for ($i = 0; $i < $countAttributes; $i++) { - $attributeKey = 'attribute_key_' . $i; - $configurableOptions[$attributesData[$attributeKey]['frontend_label']] = [ - 'title' => $attributesData[$attributeKey]['frontend_label'], - 'type' => $attributesData[$attributeKey]['frontend_input'], - 'is_require' => 'Yes', - 'options' => $this->getOptionsData($attributesData[$attributeKey]['options']) - ]; - } - - return $this->sortOptions($configurableOptions); - } - - /** - * Get options data. - * - * @param array $options - * @return array - */ - protected function getOptionsData(array $options) - { - $optionsData = []; - foreach ($options as $option) { - $optionsData[] = [ - 'title' => $option['label'], - 'price' => $this->getOptionPrice($option) - ]; - } - - return $optionsData; - } - - /** - * Options sort. - * - * @param array $options - * @return array - */ - protected function sortOptions(array $options) - { - $options = $this->sortDataByPath($options, '::title'); - foreach ($options as $key => $option) { - $options[$key] = $this->sortDataByPath($option, 'options::title'); - } - - return $options; - } - - /** - * Get price for option. - * - * @param array $optionData - * @return string - */ - protected function getOptionPrice(array $optionData) - { - $price = ('Percentage' == $optionData['price_type']) - ? ($this->product->getPrice() * $optionData['price']) / 100 - : $optionData['price']; - - return number_format($price, 2); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php deleted file mode 100644 index 8254bb1a3e9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProducts.php +++ /dev/null @@ -1,135 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $crossSellProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $crossSellProducts = $productsData[$index]['crossSellProducts']['cross_sell_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($productCheck); - $this->assertCrossSellSection($checkoutCart, $crossSellProducts); - - $index = $crossSellProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $crossSellProducts = $productsData[$index]['crossSellProducts']['cross_sell_products']['value']; - $this->addToCartFromCrossSell($catalogProductView, $checkoutCart, $productCheck); - unset($crossSellProducts[$crossSellProductsData['firstProduct']['productIndex']]); - $this->assertCrossSellSection($checkoutCart, $crossSellProducts); - - $index = $crossSellProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->addToCartFromCrossSell($catalogProductView, $checkoutCart, $productCheck); - $this->assertCrossSellSectionAbsent($checkoutCart); - } - - /** - * Add to cart. - * - * @param CatalogProductView $catalogProductView - * @param CheckoutCart $checkoutCart - * @param InjectableFixture $productCheck - * @return void - */ - protected function addToCartFromCrossSell( - CatalogProductView $catalogProductView, - CheckoutCart $checkoutCart, - InjectableFixture $productCheck - ) { - $crossSellBlock = $checkoutCart->getCrosssellBlock(); - $crossSellBlock->getItemBlock($productCheck)->addToCart(); - if ($catalogProductView->getViewBlock()->isVisible()) { - $catalogProductView->getViewBlock()->addToCart($productCheck); - } - } - - /** - * Check products on crossSell section. - * - * @param CheckoutCart $checkoutCart - * @param array $crossSellProducts - * @return void - */ - protected function assertCrossSellSection(CheckoutCart $checkoutCart, array $crossSellProducts) - { - $errors = []; - $crossSellBlock = $checkoutCart->getCrosssellBlock(); - foreach ($crossSellProducts as $crossSellProduct) { - if (!$crossSellBlock->getItemBlock($crossSellProduct)->isVisible()) { - $errors[] = "Product {$crossSellProduct->getName()} is absent in cross-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that crossSell section is absent. - * - * @param CheckoutCart $checkoutCart - * @return void - */ - protected function assertCrossSellSectionAbsent(CheckoutCart $checkoutCart) - { - \PHPUnit_Framework_Assert::assertFalse($checkoutCart->getCrosssellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in crossSell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php deleted file mode 100644 index 6e998d7db72..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertCrossSellProductsSection.php +++ /dev/null @@ -1,75 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $errors = []; - $crosssellBlock = $checkoutCart->getCrosssellBlock(); - foreach ($crossSellProducts as $crossSellProduct) { - if (!$crosssellBlock->getItemBlock($crossSellProduct)->isVisible()) { - $errors[] = "Product {$crossSellProduct->getName()} is absent in cross-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php deleted file mode 100644 index eeb098422bf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $groupedPrice, $browser); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php deleted file mode 100644 index 99486a531dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertGroupedProductsDefaultQty.php +++ /dev/null @@ -1,93 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $pageOptions = $groupedProductView->getViewBlock()->getOptions($product); - - $fixtureQtyData = $this->prepareFixtureQtyData($product); - $pageQtyData = $this->prepareFormQtyData($pageOptions); - $error = $this->verifyData($fixtureQtyData, $pageQtyData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare form's qty data. - * - * @param array $options - * @return array - */ - protected function prepareFormQtyData(array $options) - { - $qtyData = []; - foreach ($options as $option) { - $qtyData[] = ['name' => $option['name'], 'qty' => $option['qty']]; - } - - return $this->sortDataByPath($qtyData, '::name'); - } - - /** - * Prepare fixture's qty data. - * - * @param GroupedProduct $product - * @return array - */ - protected function prepareFixtureQtyData(GroupedProduct $product) - { - $qtyData = []; - $associatedProducts = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($product->getAssociated() as $key => $option) { - $qtyData[] = ['name' => $associatedProducts[$key]->getName(), 'qty' => $option['qty']]; - } - - return $this->sortDataByPath($qtyData, '::name'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Default qty for sub products in grouped product displays according to dataset on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php deleted file mode 100644 index 8dba3e97c10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertPriceOnProductPageInterface.php +++ /dev/null @@ -1,42 +0,0 @@ -hasData('cross_sell_products') - ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - : []; - } - - $checkoutCart->open(); - $checkoutCart->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutCart->open(); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible(), - 'Product \'' . $promotedProduct->getName() . '\' is exist in cross-sell section.' - ); - } - } - - /** - * Text success product is not displayed in cross-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php deleted file mode 100644 index 76bde86f564..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentRelatedProducts.php +++ /dev/null @@ -1,72 +0,0 @@ -hasData('related_products') - ? $product->getDataFieldConfig('related_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getRelatedProductBlock()->getItemBlock($promotedProduct)->isVisible(), - "Product {$promotedProduct->getName()} is exist in related products." - ); - } - } - - /** - * Text success product is not displayed in related products section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php deleted file mode 100644 index e9a02c1ea01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAbsentUpSells.php +++ /dev/null @@ -1,68 +0,0 @@ -hasData('up_sell_products') - ? $product->getDataFieldConfig('up_sell_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getUpsellBlock()->getItemBlock($promotedProduct)->isVisible(), - 'Product \'' . $promotedProduct->getName() . '\' is exist in up-sells products.' - ); - } - } - - /** - * Text success product is not displayed in up-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed in up-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php deleted file mode 100644 index 6546a077e5a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeDisplayingOnSearchForm.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $formLabels = $advancedSearch->getForm()->getFormlabels(); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array($label, $formLabels), - 'Attribute is absent on advanced search form.' - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present on advanced search form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php deleted file mode 100644 index bdd39db8d4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $code = $attribute->getAttributeCode(); - \PHPUnit_Framework_Assert::assertTrue( - $attributeIndexPage->getGrid()->isRowVisible(['attribute_code' => $code]), - 'Attribute with attribute code "' . $code . '" is absent in attribute grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product attribute is present in attribute grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php deleted file mode 100644 index 5208d644304..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsComparable.php +++ /dev/null @@ -1,73 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->clickAddToCompare(); - $catalogProductCompare->open(); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductCompare->getCompareProductsBlock()->isAttributeVisible($label), - 'Attribute is absent on product compare page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present on product compare page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php deleted file mode 100644 index 36e3bbfd8d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterable.php +++ /dev/null @@ -1,67 +0,0 @@ -open()->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(strtoupper($label), $catalogCategoryView->getLayeredNavigationBlock()->getFilters()), - 'Attribute is absent in layered navigation on category page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in layered navigation on category page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php deleted file mode 100644 index 9aa1317deb7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsFilterableInSearch.php +++ /dev/null @@ -1,67 +0,0 @@ -open()->getSearchBlock()->search($product->getName()); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(strtoupper($label), $catalogsearchResult->getLayeredNavigationBlock()->getFilters()), - 'Attribute is absent in layered navigation on search page.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in layered navigation on search page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php deleted file mode 100644 index 5013ed15322..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsGlobal.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $code = $attribute->getAttributeCode(); - $filter = ['attribute_code' => $code, 'is_global' => $attribute->getIsGlobal()]; - \PHPUnit_Framework_Assert::assertTrue( - $attributeIndexPage->getGrid()->isRowVisible($filter), - "Attribute with attribute code '$code' isn't global." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Attribute is global.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php deleted file mode 100644 index e4d7d1e4c28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsRequired.php +++ /dev/null @@ -1,76 +0,0 @@ -open()->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $productForm = $catalogProductEdit->getProductForm(); - $productForm->getAttributeElement($attribute)->setValue(''); - $catalogProductEdit->getFormPageActions()->save(); - $failedAttributes = $productForm->getRequireNoticeAttributes($product); - $actualMessage = $failedAttributes['general'][$attribute->getFrontendLabel()]; - - \PHPUnit_Framework_Assert::assertEquals( - self::REQUIRE_MESSAGE, - $actualMessage, - 'JS error notice on product edit page is not equal to expected.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return "The attribute is mandatory."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php deleted file mode 100644 index fa469c01066..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUnique.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $catalogProductAttributeIndex->getPageActionsBlock()->addNew(); - $attributeNew->getAttributeForm()->fill($attribute); - $attributeNew->getPageActions()->saveAndContinue(); - - $actualMessage = $attributeNew->getMessagesBlock()->getErrorMessages(); - \PHPUnit_Framework_Assert::assertEquals(self::UNIQUE_MESSAGE, $actualMessage); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is unique.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php deleted file mode 100644 index bab3ac89a8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeIsUsedInSortOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -open()->getSearchBlock()->search($product->getName()); - $label = $attribute->hasData('manage_frontend_label') - ? $attribute->getManageFrontendLabel() - : $attribute->getFrontendLabel(); - - \PHPUnit_Framework_Assert::assertTrue( - in_array($label, $catalogsearchResult->getListProductBlock()->getSortByValues()), - 'Attribute is absent in sort dropdown on search results page on frontend.' - ); - } - - /** - * Return string representation of object. - * - * @return string - */ - public function toString() - { - return 'Attribute is present in sort dropdown on search results page on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php deleted file mode 100644 index e6bd31460b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductAttributeSearchableByLabel.php +++ /dev/null @@ -1,95 +0,0 @@ -open(); - $filter = $this->prepareFilter($product, $attribute); - $cmsIndex->getSearchBlock()->search($filter); - $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertTrue($isProductVisible, 'Product was not found by option label.'); - } - - /** - * Prepare filter for search. - * - * @param InjectableFixture $product - * @param CatalogProductAttribute $attribute - * @return string - */ - protected function prepareFilter(InjectableFixture $product, CatalogProductAttribute $attribute) - { - $filter = ''; - $attributesFillData = $product->getAttributes(); - $attributeOptions = $attribute->getOptions(); - foreach ($attributesFillData['dataset'] as $optionsFillData) { - foreach ($optionsFillData as $optionKey) { - $optionKey = str_replace('option_key_', '', $optionKey); - $filter .= isset($attributeOptions[$optionKey]['view']) - ? $attributeOptions[$optionKey]['view'] - : $attributeOptions[$optionKey]['admin']; - } - } - - return $filter; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is searchable by attribute label."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php deleted file mode 100644 index 5a16a48983b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCanNotAddToCart.php +++ /dev/null @@ -1,62 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->checkAddToCartButton(), - 'Add to Cart button is present on product page' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add to Cart button is absent on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php deleted file mode 100644 index 2cdda0a6e6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareBlockOnCmsPage.php +++ /dev/null @@ -1,67 +0,0 @@ -createByCode('cmsPage', ['dataset' => '3_column_template']); - $newCmsPage->persist(); - $browser->open($_ENV['app_frontend_url'] . $newCmsPage->getIdentifier()); - foreach ($products as &$product) { - $product = strtolower($product->getName()); - } - \PHPUnit_Framework_Assert::assertEquals( - $products, - $cmsIndex->getCompareBlock()->getProducts(), - 'Compare product block contains NOT valid information about compared products.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Compare product block contains valid information about compared products.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php deleted file mode 100644 index 99a89705985..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLink.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertEquals( - count($products), - $cmsIndex->getCompareBlock()->getQtyInCompareList(), - 'Qty is not correct in "Compare Products" link.' - ); - - \PHPUnit_Framework_Assert::assertTrue( - str_contains($cmsIndex->getCompareBlock()->getCompareLinkUrl(), $this->compareProductUrl), - 'Compare product link isn\'t lead to Compare Product Page.' - ); - } - - /** - * Returns a string representation of the object - * - * @return string - */ - public function toString() - { - return '"Compare Products..." link on top menu of page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php deleted file mode 100644 index 5e8e5a05021..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareItemsLinkIsAbsent.php +++ /dev/null @@ -1,52 +0,0 @@ -getLinksBlock()->isLinkVisible("Compare Products"), - 'The link "Compare Products..." is visible at the top of page.' - ); - } - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The link is NOT visible at the top of page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php deleted file mode 100644 index 9b169564f23..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductComparePage.php +++ /dev/null @@ -1,124 +0,0 @@ - 'SKU', - 'description' => 'Description', - 'short_description' => 'Short Description', - ]; - - /** - * Catalog product compare page. - * - * @var CatalogProductCompare - */ - protected $comparePage; - - /** - * Assert that "Compare Product" page contains product(s) that was added: - * - Product name - * - Price - * - SKU - * - Description (if exists, else text "No") - * - Short Description (if exists, else text "No") - * - * @param CatalogProductCompare $comparePage - * @param array $products - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function processAssert(CatalogProductCompare $comparePage, array $products) - { - $this->comparePage = $comparePage; - $comparePage->open(); - foreach ($products as $key => $product) { - $attributeData = $this->prepareAttributeData($product, $key); - \PHPUnit_Framework_Assert::assertEquals( - $attributeData['attributeValues'], - $attributeData['attributeValuesFromPage'], - "Product {$product->getName()} is not equals with data from fixture." - ); - } - } - - /** - * Prepare attribute data. - * - * @param InjectableFixture $product - * @param int $key - * @return array - */ - protected function prepareAttributeData(InjectableFixture $product, $key) - { - $data = []; - foreach ($this->attributeProduct as $attributeKey => $attribute) { - $value = $attribute; - $attribute = is_numeric($attributeKey) ? $attribute : $attributeKey; - - $attributeValue = $attribute != 'price' - ? ($product->hasData($attribute) - ? $product->getData($attribute) - : 'N/A') - : ($product->getDataFieldConfig('price')['source']->getPriceData() !== null - ? $product->getDataFieldConfig('price')['source']->getPriceData() - : number_format($product->getPrice(), 2)); - - $data['attributeValues'][$attribute] = !is_array($attributeValue) ? strtolower( - $attributeValue - ) : $attributeValue; - $attributeName = ($value === 'name' || $value === 'price') ? 'Info' : 'MetaData'; - $data['attributeValuesFromPage'][$attribute] = $this->comparePage->getCompareProductsBlock( - )->{'getProduct' . $attributeName}( - $key + 1, - $value - ); - } - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return '"Compare Product" page has valid data for all products.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php deleted file mode 100644 index ca4d938dd85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessAddMessage.php +++ /dev/null @@ -1,59 +0,0 @@ -getName()); - $actualMessage = $catalogProductView->getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertEquals($successMessage, $actualMessage); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product has been added to compare products list."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php deleted file mode 100644 index 621d9adaca9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCompareSuccessRemoveAllProductsMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Compare Product success message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php deleted file mode 100644 index c7ef11f5a6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCrossSells.php +++ /dev/null @@ -1,82 +0,0 @@ -hasData('cross_sell_products') - ? $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - : []; - } - - $checkoutCart->open(); - $checkoutCart->getCartBlock()->clearShoppingCart(); - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - $checkoutCart->open(); - foreach ($promotedProducts as $promotedProduct) { - if (!$checkoutCart->getCrosssellBlock()->getItemBlock($promotedProduct)->isVisible()) { - $errors[] = 'Product \'' . $promotedProduct->getName() . '\' is absent in cross-sell section.'; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode(" ", $errors)); - } - - /** - * Text success product is displayed in cross-sell section. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in cross-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php deleted file mode 100644 index 67ecd4f9a51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductCustomOptionsOnProductPage.php +++ /dev/null @@ -1,136 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $fixtureCustomOptions = $this->prepareOptions($product); - $formCustomOptions = $catalogProductView->getViewBlock()->getOptions($product)['custom_options']; - $error = $this->verifyData($fixtureCustomOptions, $formCustomOptions); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Preparation options before comparing. - * - * @param InjectableFixture $product - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function prepareOptions(InjectableFixture $product) - { - $result = []; - $customOptions = $product->getCustomOptions(); - $actualPrice = $this->getProductActualPrice($product); - foreach ($customOptions as $customOption) { - $customOptionsPriceType = isset($customOption['options']['price_type']) - ? $customOption['options']['price_type'] - : null; - if ($customOptionsPriceType) { - if ($customOptionsPriceType === 'Percent') { - $customOptionPrice = $customOption['options']['price']; - $customOption['options']['price'] = $this->calculatePrice($actualPrice, $customOptionPrice); - } - $customOption['options'] = array_diff_key( - $customOption['options'], - array_flip($this->skippedFieldOptions) - ); - } else { - foreach ($customOption['options'] as &$option) { - if ('Percent' === $option['price_type']) { - $option['price'] = $this->calculatePrice($actualPrice, $option['price']); - } - $option = array_diff_key($option, array_flip($this->skippedFieldOptions)); - } - } - $customOption['type'] = explode('/', $customOption['type'])[1]; - $result[$customOption['title']] = $customOption; - } - - return $result; - } - - /** - * Calculate price. - * - * @param int $actualPrice - * @param int $customOptionPrice - * @return int - */ - protected function calculatePrice($actualPrice, $customOptionPrice) - { - return round((($actualPrice * $customOptionPrice) / 100), 2); - } - - /** - * Get product actual price. - * - * @param InjectableFixture $product - * @return int - */ - protected function getProductActualPrice(InjectableFixture $product) - { - return $product->hasData('special_price') ? $product->getSpecialPrice() : $product->getPrice(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Value of custom option on the page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php deleted file mode 100644 index de53d5782b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateForm.php +++ /dev/null @@ -1,147 +0,0 @@ - [ - 'decimals' => 2, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - 'qty' => [ - 'decimals' => 4, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - 'weight' => [ - 'decimals' => 4, - 'dec_point' => '.', - 'thousands_sep' => '', - ], - ]; - - /** - * Format for url key field. - * - * @var string - */ - protected $urlKeyFormat; - - /** - * Assert form data equals fixture data. - * - * @param InjectableFixture $product - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $productPage - * @param string $urlKeyFormat [optional] - * @return void - */ - public function processAssert( - InjectableFixture $product, - CatalogProduct $productGrid, - CatalogProductEdit $productPage, - $urlKeyFormat = '%s' - ) { - $this->product = $product; - $this->urlKeyFormat = $urlKeyFormat; - $this->catalogProductEdit = $productPage; - $filter = ['name' => $product->getName(), 'status' => 'Disabled']; - $productGrid->open()->getProductGrid()->searchAndOpen($filter); - - $formData = $productPage->getProductForm()->getData($product); - $fixtureData = $this->prepareFixtureData($product->getData()); - - $errors = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepares fixture data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFixtureData(array $data, array $sortFields = []) - { - $compareData = array_filter($data); - - array_walk_recursive( - $compareData, - function (&$item, $key, $formattingOptions) { - if (isset($formattingOptions[$key])) { - $item = number_format( - $item, - $formattingOptions[$key]['decimals'], - $formattingOptions[$key]['dec_point'], - $formattingOptions[$key]['thousands_sep'] - ); - } - }, - $this->formattingOptions - ); - - if (isset($compareData['status'])) { - $compareData['status'] = 'Disabled'; - } - if (isset($compareData['stock_data']['qty'])) { - $compareData['stock_data'] = ['qty' => 0, 'is_in_stock' => 'Out of Stock']; - } - $compareData['sku'] = ''; - $compareData['url_key'] = sprintf($this->urlKeyFormat, $compareData['url_key']); - - return parent::prepareFixtureData($compareData, $sortFields); - } - - /** - * Prepare url key. - * - * @param string $urlKey - * @return string - */ - protected function prepareUrlKey($urlKey) - { - return $urlKey; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Form data equals to fixture data of duplicated product.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php deleted file mode 100644 index 0812f3937bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,58 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '-1' . '.html'); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->isVisible(), - 'Duplicate Product is displayed on frontend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The product does not appear on the frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php deleted file mode 100644 index dfef3530646..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicateMessage.php +++ /dev/null @@ -1,54 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product duplicated message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php deleted file mode 100644 index 3a56a4a4944..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductDuplicatedInGrid.php +++ /dev/null @@ -1,61 +0,0 @@ -getDataConfig(); - $filter = [ - 'name' => $product->getName(), - 'visibility' => $product->getVisibility(), - 'status' => 'Disabled', - 'type' => ucfirst($config['create_url_params']['type']) . ' Product', - 'price_to' => number_format($product->getPrice(), 2), - ]; - $productGrid->open()->getProductGrid()->search($filter); - - \PHPUnit_Framework_Assert::assertTrue( - $productGrid->getProductGrid()->isRowVisible($filter, false, false), - 'Product duplicate is absent in Products grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'The product has been successfully found, according to the filters.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php deleted file mode 100644 index 662644d94e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductForm.php +++ /dev/null @@ -1,213 +0,0 @@ -product = $product; - $this->catalogProductEdit = $productPage; - $filter = ['sku' => $product->getSku()]; - $productGrid->open(); - $productGrid->getProductGrid()->searchAndOpen($filter); - - $productData = $product->getData(); - $fixtureData = $this->prepareFixtureData($productData, $this->sortFields); - $formData = $this->prepareFormData($productPage->getProductForm()->getData($product), $this->sortFields); - $error = $this->verifyData($fixtureData, $formData); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Prepares fixture data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFixtureData(array $data, array $sortFields = []) - { - $data = array_diff_key($data, array_flip($this->skippedFixtureFields)); - - if (!$this->catalogProductEdit->getProductForm()->getTabElement('websites')->isVisible()) { - unset($data['website_ids']); - } - if (isset($data['website_ids']) && !is_array($data['website_ids'])) { - $data['website_ids'] = [$data['website_ids']]; - } - if (!empty($this->specialArray)) { - $data = $this->prepareSpecialPriceArray($data); - } - if (isset($data['category_ids'])) { - $data['category_ids'] = $this->getFullPathCategories(); - } - - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - return $data; - } - - /** - * Get full path for all categories. - * - * @return array - */ - protected function getFullPathCategories() - { - $result = []; - $categories = $this->product->getDataFieldConfig('category_ids')['source']->getCategories(); - foreach ($categories as $key => $itemCategory) { - $fullPath = $this->prepareFullCategoryPath($itemCategory); - $result[$key] = implode('/', $fullPath); - } - - return $result; - } - - /** - * Prepare category path. - * - * @param CatalogCategory $category - * @return array - */ - protected function prepareFullCategoryPath(CatalogCategory $category) - { - $path = []; - $parentCategory = $category->getDataFieldConfig('parent_id')['source']->getParentCategory(); - - if ($parentCategory != null) { - $path = $this->prepareFullCategoryPath($parentCategory); - } - return array_filter(array_merge($path, [$category->getPath(), $category->getName()])); - } - - /** - * Prepare special price array for product. - * - * @param array $fields - * @return array - */ - protected function prepareSpecialPriceArray(array $fields) - { - foreach ($this->specialArray as $key => $value) { - if (array_key_exists($key, $fields)) { - if (isset($value['type']) && $value['type'] == 'date') { - $fields[$key] = vsprintf('%d/%d/%d', explode('/', $fields[$key])); - } - } - } - return $fields; - } - - /** - * Prepares form data for comparison. - * - * @param array $data - * @param array $sortFields [optional] - * @return array - */ - protected function prepareFormData(array $data, array $sortFields = []) - { - foreach ($sortFields as $path) { - $data = $this->sortDataByPath($data, $path); - } - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Form data equal the fixture data.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php deleted file mode 100644 index 5004950bb20..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductGroupedPriceOnProductPage.php +++ /dev/null @@ -1,120 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set $errorMessage for grouped price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product special price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @param string $customerGroup [optional] - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock, $customerGroup = 'NOT LOGGED IN') - { - $this->customerGroup = $customerGroup; - $groupPrice = $this->getGroupedPrice($productViewBlock, $product); - \PHPUnit_Framework_Assert::assertEquals($groupPrice['fixture'], $groupPrice['onPage'], $this->errorMessage); - } - - /** - * Get grouped price with fixture product and product page. - * - * @param View $view - * @param InjectableFixture $product - * @return array - */ - protected function getGroupedPrice(View $view, InjectableFixture $product) - { - $fields = $product->getData(); - $groupPrice['onPage'] = $view->getPriceBlock()->getSpecialPrice(); - $groupPrice['fixture'] = number_format( - $fields['group_price'][array_search($this->customerGroup, $fields['group_price'])]['price'], - 2 - ); - - return $groupPrice; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assert that displayed grouped price on product page equals passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php deleted file mode 100644 index 8692f40dfda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCart.php +++ /dev/null @@ -1,133 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->addToCart($product); - - // Check price - $this->assertOnShoppingCart($product, $checkoutCart); - } - - /** - * Assert prices on the shopping cart. - * - * @param InjectableFixture $product - * @param CheckoutCart $checkoutCart - * @return void - */ - protected function assertOnShoppingCart(InjectableFixture $product, CheckoutCart $checkoutCart) - { - $cartItem = $checkoutCart->getCartBlock()->getCartItem($product); - $formPrice = $cartItem->getCartItemTypePrice('price'); - $fixturePrice = number_format($this->prepareFixturePrice($product), 2); - - \PHPUnit_Framework_Assert::assertEquals( - $fixturePrice, - $formPrice, - 'Product price in shopping cart is not correct.' - ); - } - - /** - * Prepare product price from fixture. - * - * @param InjectableFixture $product - * @return float - */ - protected function prepareFixturePrice(InjectableFixture $product) - { - /** @var CatalogProductSimple $product */ - $customOptions = $product->getCustomOptions(); - $checkoutData = $product->getCheckoutData(); - $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) - ? $checkoutData['options']['custom_options'] - : []; - - if (isset($checkoutData['cartItem'])) { - $fixturePrice = $checkoutData['cartItem']['price']; - } else { - $fixturePrice = $product->getPrice(); - $groupPrice = $product->getGroupPrice(); - $specialPrice = $product->getSpecialPrice(); - if ($groupPrice) { - $groupPrice = reset($groupPrice); - $fixturePrice = $groupPrice['price']; - } - if ($specialPrice) { - $fixturePrice = $specialPrice; - } - foreach ($checkoutCustomOptions as $checkoutOption) { - $attributeKey = str_replace('attribute_key_', '', $checkoutOption['title']); - $optionKey = str_replace('option_key_', '', $checkoutOption['value']); - $option = $customOptions[$attributeKey]['options'][$optionKey]; - - if ('Fixed' == $option['price_type']) { - $fixturePrice += $option['price']; - } else { - $fixturePrice += ($fixturePrice / 100) * $option['price']; - } - } - } - - return $fixturePrice; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is correctly displayed in cart.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php deleted file mode 100644 index feceab3f941..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInCategory.php +++ /dev/null @@ -1,102 +0,0 @@ -getName(); - if ($product->hasData('category_ids')) { - $categoryIds = $product->getCategoryIds(); - $categoryName = is_array($categoryIds) ? reset($categoryIds) : $categoryName; - } - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - 'Product is absent on category page.' - ); - - //Process price asserts - $this->assertPrice($product, $catalogCategoryView); - } - - /** - * Verify product price on category view page. - * - * @param InjectableFixture $product - * @param CatalogCategoryView $catalogCategoryView - * @return void - */ - protected function assertPrice(InjectableFixture $product, CatalogCategoryView $catalogCategoryView) - { - $price = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()) - ->getRegularPrice(); - - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $price, - 'Product regular price on category page is not correct.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product price on category page correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php deleted file mode 100644 index bcdb65edf01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInGrid.php +++ /dev/null @@ -1,95 +0,0 @@ -product = $product; - $productGrid->open(); - \PHPUnit_Framework_Assert::assertTrue( - $productGrid->getProductGrid()->isRowVisible($this->prepareFilter()), - 'Product \'' . $this->product->getName() . '\' is absent in Products grid.' - ); - } - - /** - * Prepare filter for product grid. - * - * @return array - */ - protected function prepareFilter() - { - $filter = [ - 'type' => $this->getProductType(), - 'sku' => $this->product->getSku(), - 'status' => $this->product->getStatus(), - ]; - - return $filter; - } - - /** - * Get product type - * - * @return string - */ - protected function getProductType() - { - $config = $this->product->getDataConfig(); - - return ucfirst($config['type_id']) . ' Product'; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php deleted file mode 100644 index 5ee428a724c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductInStock.php +++ /dev/null @@ -1,67 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - self::STOCK_AVAILABILITY, - $catalogProductView->getViewBlock()->getStockAvailability($product), - 'Control "' . self::STOCK_AVAILABILITY . '" is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'In stock control is visible.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php deleted file mode 100644 index 6faff6752ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,160 +0,0 @@ -browser = $browser; - $this->catalogProductView = $catalogProductView; - $this->cmsIndex = $cmsIndex; - $this->catalogSearchResult = $catalogSearchResult; - $this->catalogCategoryView = $catalogCategoryView; - $this->category = $category; - $products = is_array($product) ? $product : [$product]; - foreach ($products as $product) { - $errors = $this->isNotDisplayingOnFrontendAssert($product); - \PHPUnit_Framework_Assert::assertEmpty( - $errors, - "In the process of checking product availability on the frontend, found the following errors:\n" - . implode("\n", $errors) - ); - } - } - - /** - * Verify product displaying on frontend. - * - * @param InjectableFixture $product - * @return array - */ - protected function isNotDisplayingOnFrontendAssert(InjectableFixture $product) - { - $errors = []; - //Check that product is not available by url - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - if ($this->catalogProductView->getViewBlock()->isVisible()) { - $errors[] = '- product view block is visible in product page.'; - } - //Check that product can't be found - $this->cmsIndex->open()->getSearchBlock()->search($product->getSku()); - if ($this->catalogSearchResult->getListProductBlock()->isProductVisible($product)) { - $errors[] = '- successful product search.'; - } - //Check that product is not available in category page - $categoryName = $product->hasData('category_ids') ? $product->getCategoryIds()[0] : $this->category->getName(); - $this->cmsIndex->open()->getTopmenu()->selectCategory($categoryName); - $isProductVisible = $this->catalogCategoryView->getListProductBlock()->isProductVisible($product); - $bottomToolBar = $this->catalogCategoryView->getBottomToolbar(); - while (!$isProductVisible && $bottomToolBar->nextPage()) { - $isProductVisible = $this->catalogCategoryView->getListProductBlock() - ->isProductVisible($product); - } - if ($isProductVisible) { - $errors[] = "- product with name '{$product->getName()}' is found in this category."; - } - - return $errors; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is not displayed on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php deleted file mode 100644 index b15feb5d2dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedBeforeCheckout.php +++ /dev/null @@ -1,122 +0,0 @@ -getCartBlock()->clearShoppingCart(); - $productName = $products[$i]->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - - // Check that price is not present on category page. - $listProductBlock = $catalogCategoryView->getListProductBlock(); - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - \PHPUnit_Framework_Assert::assertFalse( - $productPriceBlock->getMapBlock()->isPriceVisible(), - 'Price is present in MSRP dialog on category page.' - ); - - // Check that price is not present on product page. - $listProductBlock->openProductViewPage($productName); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), - 'Price is present in View block on product page.' - ); - - // Check that price is not present on cart. - $catalogProductView->getViewBlock()->addToCart($products[$i]); - \PHPUnit_Framework_Assert::assertTrue( - $cart->getCartBlock()->getCartItem($products[$i])->isMsrpVisible(), - "MSRP link is not visible in cart." - ); - - // Check that price is present on review block in onepage checkout page. - $cart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout(); - $checkoutMethodBlock = $checkoutOnePage->getLoginBlock(); - $billingBlock = $checkoutOnePage->getBillingBlock(); - $paymentMethodBlock = $checkoutOnePage->getPaymentMethodsBlock(); - $shippingBlock = $checkoutOnePage->getShippingMethodBlock(); - $checkoutMethodBlock->guestCheckout(); - $checkoutMethodBlock->clickContinue(); - $billingBlock->fillBilling($address, $customer); - $billingBlock->clickContinue(); - $shippingBlock->selectShippingMethod(['shipping_service' => 'Flat Rate', 'shipping_method' => 'Fixed']); - $shippingBlock->clickContinue(); - $paymentMethodBlock->selectPaymentMethod(['method' => 'checkmo']); - $paymentMethodBlock->clickContinue(); - \PHPUnit_Framework_Assert::assertEquals( - number_format($products[$i]->getPrice(), 2), - $checkoutOnePage->getReviewBlock()->getTotalBlock()->getData('subtotal'), - "Subtotal in checkout one page for $productName is not equal to expected." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied before checkout."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php deleted file mode 100644 index c9d349c7d8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedInCart.php +++ /dev/null @@ -1,94 +0,0 @@ -getCartBlock()->clearShoppingCart(); - $productName = $product->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $listProductBlock = $catalogCategoryView->getListProductBlock(); - - // Check that price is not present on category page. - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - \PHPUnit_Framework_Assert::assertFalse( - $productPriceBlock->getMapBlock()->isPriceVisible(), - 'Price is present in MSRP dialog on category page.' - ); - - // Check that price is not present on product page. - $listProductBlock->openProductViewPage($productName); - \PHPUnit_Framework_Assert::assertFalse( - $catalogProductView->getViewBlock()->getPriceBlock()->isRegularPriceVisible(), - 'Price is present in View block on product page.' - ); - - // Check that price is present in cart. - $catalogProductView->getViewBlock()->addToCart($product); - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $cart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'), - "MAP of $productName product in cart is not equal to product price." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied in cart."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php deleted file mode 100644 index 4256e9d88d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductMapAppliedOnGesture.php +++ /dev/null @@ -1,76 +0,0 @@ -getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $listProductBlock = $catalogCategoryView->getListProductBlock(); - - // Check that price is present in MAP popup. - $productPriceBlock = $listProductBlock->getProductPriceBlock($productName); - $productPriceBlock->clickForPrice(); - $msrpPopupBlock = $productPriceBlock->getMapBlock(); - $map = $msrpPopupBlock->isVisible() ? $msrpPopupBlock->getMap() : null; - - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getPrice(), 2), - $map, - "MAP of $productName product is not visible or not equal to product price." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products' MAP has been applied on gesture."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php deleted file mode 100644 index 4eda79bdd87..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotInGrid.php +++ /dev/null @@ -1,69 +0,0 @@ -open(); - $this->assert($product, $productGrid); - } - - /** - * Check product on product grid. - * - * @param InjectableFixture $product - * @param CatalogProduct $productGrid - * @return void - */ - public function assert(InjectableFixture $product, CatalogProduct $productGrid) - { - $filter = ['sku' => $product->getSku(), 'name' => $product->getName()]; - \PHPUnit_Framework_Assert::assertFalse( - $productGrid->getProductGrid()->isRowVisible($filter), - "Product with sku {$filter['sku']} and name {$filter['name']} is present in Products grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that product is absent in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php deleted file mode 100644 index 8ecbe08d811..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductNotSearchableBySku.php +++ /dev/null @@ -1,65 +0,0 @@ -open(); - $cmsIndex->getSearchBlock()->search($product->getSku()); - \PHPUnit_Framework_Assert::assertFalse( - $catalogSearchResult->getListProductBlock()->isProductVisible($product), - 'Product was found by SKU.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is not searchable by SKU."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php deleted file mode 100644 index bdc2e710e98..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStock.php +++ /dev/null @@ -1,67 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - \PHPUnit_Framework_Assert::assertEquals( - self::STOCK_AVAILABILITY, - $catalogProductView->getViewBlock()->getStockAvailability($product), - 'Control \'' . self::STOCK_AVAILABILITY . '\' is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Out of stock control is visible.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php deleted file mode 100644 index 7bfab0514ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockOnCategory.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - \PHPUnit_Framework_Assert::assertFalse($isProductVisible, 'Product is present on category page.'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is absent in the category page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php deleted file mode 100644 index 591e04f2299..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductOutOfStockVisibleInCategory.php +++ /dev/null @@ -1,73 +0,0 @@ -hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - "Product is absent on category page." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Out of stock product is visible in the assigned category"; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php deleted file mode 100644 index 5a518cb970e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductPage.php +++ /dev/null @@ -1,211 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $this->product = $product; - $this->productView = $catalogProductView->getViewBlock(); - $this->catalogProductView = $catalogProductView; - - $errors = $this->verify(); - \PHPUnit_Framework_Assert::assertEmpty( - $errors, - "\nFound the following errors:\n" . implode(" \n", $errors) - ); - } - - /** - * Verify displayed product data on product page(front-end) equals passed from fixture. - * - * @return array - */ - protected function verify() - { - $errors = []; - - $errors[] = $this->verifyName(); - $errors[] = $this->verifyPrice(); - $errors[] = $this->verifyDescription(); - $errors[] = $this->verifyShortDescription(); - - return array_filter($errors); - } - - /** - * Verify displayed product name on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyName() - { - $fixtureProductName = strtoupper($this->product->getName()); - $formProductName = $this->productView->getProductName(); - - if ($fixtureProductName == $formProductName) { - return null; - } - return "Displayed product name on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductName}, expected: {$fixtureProductName}."; - } - - /** - * Verify displayed product price on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyPrice() - { - if ($this->product->hasData('price') == false) { - return null; - } - $fixtureProductPrice = number_format($this->product->getPrice(), 2); - $formProductPrice = $this->productView->getPriceBlock()->getRegularPrice(); - if ($fixtureProductPrice == $formProductPrice) { - return null; - } - $error = "Displayed product price on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductPrice}, expected: {$fixtureProductPrice}."; - - $verifySpecialPriceResult = $this->verifySpecialPrice(); - if ($verifySpecialPriceResult !== null) { - $error .= $verifySpecialPriceResult; - } - - return $error; - } - - /** - * Verify displayed product special price on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifySpecialPrice() - { - $fixtureProductSpecialPrice = $this->product->getSpecialPrice(); - if (!$fixtureProductSpecialPrice) { - return null; - } - - $fixtureProductSpecialPrice = number_format($fixtureProductSpecialPrice, 2); - $formProductSpecialPrice = $this->productView->getPriceBlock()->getSpecialPrice(); - if ($fixtureProductSpecialPrice == $formProductSpecialPrice) { - return null; - } - return "\nDisplayed product special price on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductSpecialPrice}, expected: {$fixtureProductSpecialPrice}."; - } - - /** - * Verify displayed product description on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyDescription() - { - $fixtureProductDescription = $this->product->getDescription(); - $formProductDescription = $this->productView->getProductDescription(); - - if ($fixtureProductDescription == $formProductDescription) { - return null; - } - return "Displayed product description on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductDescription}, expected: {$fixtureProductDescription}."; - } - - /** - * Verify displayed product short description on product page(front-end) equals passed from fixture. - * - * @return string|null - */ - protected function verifyShortDescription() - { - $fixtureProductShortDescription = $this->product->getShortDescription(); - $formProductShortDescription = $this->productView->getProductShortDescription(); - - if ($fixtureProductShortDescription == $formProductShortDescription) { - return null; - } - return "Displayed product short description on product page(front-end) not equals passed from fixture. " - . "Actual: {$formProductShortDescription}, expected: {$fixtureProductShortDescription}."; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product on product view page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php deleted file mode 100644 index 21cbc735acb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductRelatedProducts.php +++ /dev/null @@ -1,72 +0,0 @@ -hasData('related_products') - ? $product->getDataFieldConfig('related_products')['source']->getProducts() - : []; - } - - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($promotedProducts as $promotedProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getRelatedProductBlock()->getItemBlock($promotedProduct)->isVisible(), - "Product {$promotedProduct->getName()} is absent in related products." - ); - } - } - - /** - * Text success product is displayed in related products section. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php deleted file mode 100644 index 4da463759b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSaveMessage.php +++ /dev/null @@ -1,66 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; - \PHPUnit_Framework_Assert::assertContains( - self::SUCCESS_MESSAGE, - $actualMessages, - 'Wrong success message is displayed.' - . "\nExpected: " . self::SUCCESS_MESSAGE - . "\nActual:\n" . implode("\n - ", $actualMessages) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php deleted file mode 100644 index 80e1a721e9b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSearchable.php +++ /dev/null @@ -1,150 +0,0 @@ -filter as $param) { - $this->verifySearchResult($catalogSearchResult, $cmsIndex, $product, $param); - } - } - - /** - * Process assert search result. - * - * @param CatalogsearchResult $catalogSearchResult - * @param CmsIndex $cmsIndex - * @param InjectableFixture $product - * @param string $param - * @throws \Exception - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function verifySearchResult( - CatalogsearchResult $catalogSearchResult, - CmsIndex $cmsIndex, - InjectableFixture $product, - $param - ) { - $cmsIndex->open(); - $searchValue = ($product->hasData($param) !== false) ? $product->getData($param) : null; - if ($searchValue === null) { - throw new \Exception("Product '$product->getName()' doesn't have '$param' parameter."); - } - $param = strtoupper($param); - $this->errorMessage = sprintf($this->formatForErrorMessage, $param); - $this->successfulMessage = sprintf($this->formatForSuccessfulMessage, $param); - - $cmsIndex->getSearchBlock()->search($searchValue); - - $quantityAndStockStatus = $product->getStockData(); - $stockStatus = isset($quantityAndStockStatus['is_in_stock']) - ? $quantityAndStockStatus['is_in_stock'] - : null; - - $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - while (!$isVisible && $catalogSearchResult->getBottomToolbar()->nextPage()) { - $isVisible = $catalogSearchResult->getListProductBlock()->isProductVisible($product); - } - - if ($product->getVisibility() === 'Catalog' || $stockStatus === 'Out of Stock') { - $isVisible = !$isVisible; - list($this->errorMessage, $this->successfulMessage) = [$this->successfulMessage, $this->errorMessage]; - } - - \PHPUnit_Framework_Assert::assertTrue( - $isVisible, - $this->errorMessage - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php deleted file mode 100644 index b6b84fbf82a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceNotLargerActual.php +++ /dev/null @@ -1,57 +0,0 @@ -getProductForm()->getRequireNoticeAttributes($product); - \PHPUnit_Framework_Assert::assertEquals(self::ERROR_MESSAGE, $errorMessages['prices']['specialprice']); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Notice message is displayed in price tab on new product page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php deleted file mode 100644 index 9ad7f61503f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductSpecialPriceOnProductPage.php +++ /dev/null @@ -1,95 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set $errorMessage for special price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product special price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock) - { - \PHPUnit_Framework_Assert::assertEquals( - number_format($product->getSpecialPrice(), 2), - $productViewBlock->getPriceBlock()->getSpecialPrice(), - $this->errorMessage - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Assert that displayed special price on product page equals passed from fixture."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php deleted file mode 100644 index 1af33c10875..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateForm.php +++ /dev/null @@ -1,77 +0,0 @@ - $attributeSet->getAttributeSetName(), - ]; - $productSet->open(); - $productSet->getGrid()->searchAndOpen($filterAttribute); - \PHPUnit_Framework_Assert::assertEquals( - $filterAttribute['set_name'], - $productSetEdit->getAttributeSetEditBlock()->getAttributeSetName() - ); - if ($productAttribute !== null) { - $attributeLabel = $productAttribute->getFrontendLabel(); - \PHPUnit_Framework_Assert::assertTrue( - $productSetEdit->getAttributeSetEditBlock()->checkProductAttribute($attributeLabel), - "Product Attribute '$attributeLabel' is absent on Product Template Groups." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Data from the Product Template form matched with fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php deleted file mode 100644 index fa97c089e5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ - $attributeSet->getAttributeSetName(), - ]; - - $productSetPage->open(); - \PHPUnit_Framework_Assert::assertTrue( - $productSetPage->getGrid()->isRowVisible($filterAttributeSet), - "Attribute Set '{$filterAttributeSet['set_name']}' is absent in Product Template grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product template is present in Product Templates grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php deleted file mode 100644 index a7de660e11a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateOnProductForm.php +++ /dev/null @@ -1,100 +0,0 @@ -open(); - $productGrid->getGridPageActionBlock()->addNew(); - - /**@var CatalogProductSimple $productSimple */ - $productSimple = $fixtureFactory->createByCode( - 'catalogProductSimple', - [ - 'dataset' => 'default', - 'data' => [ - 'attribute_set_id' => ['attribute_set' => $attributeSet], - ], - ] - ); - $newProductPage->getProductForm()->fill($productSimple); - $newProductPage->getFormPageActions()->saveAndContinue(); - - $attributeSetName = $attributeSet->getAttributeSetName(); - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeSet($attributeSetName), - "Product isn't in '$attributeSetName' Attribute Set." - ); - - if ($attributeSetOriginal === null) { - $productEdit->getProductForm()->openTab('general'); - - \PHPUnit_Framework_Assert::assertTrue( - $productEdit->getProductForm()->checkAttributeLabel($productAttribute), - "Product Attribute is absent on Product form." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute and Attribute Set are present on the Product form.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php deleted file mode 100644 index bea3f92a448..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTemplateSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product Attribute Set success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php deleted file mode 100644 index 1618c4ecfb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductTierPriceOnProductPage.php +++ /dev/null @@ -1,173 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - //Process assertions - $this->assertPrice($product, $catalogProductView->getViewBlock()); - } - - /** - * Set error message for tier price assert. - * - * @param string $errorMessage - * @return void - */ - public function setErrorMessage($errorMessage) - { - $this->errorMessage = $errorMessage; - } - - /** - * Verify product tier price on product view page. - * - * @param InjectableFixture $product - * @param View $productViewBlock - * @return void - */ - public function assertPrice(InjectableFixture $product, View $productViewBlock) - { - $errors = []; - $tierPrices = $this->prepareTierPrices($product); - foreach ($tierPrices as $key => $tierPrice) { - $formTierPrice = $productViewBlock->getTierPrices($key + 1); - preg_match($this->pattern, $formTierPrice, $match); - $errors = $this->verifyItemTierPrice($tierPrice, $match); - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Verify item tier price. - * - * @param array $fixtureTierPrice - * @param array $formTierPrice - * @return string - */ - protected function verifyItemTierPrice(array $fixtureTierPrice, array $formTierPrice) - { - $errors = []; - if (count($formTierPrice) < $this->matchCount) { - $errors[] = "Not all data exist in product page.\n"; - } - foreach ($this->verifyFields as $key => $field) { - if ($formTierPrice[$key + 1] != $fixtureTierPrice[$field]) { - $errors[] = "'$field' in form doesn't equal to fixture:\n" - . "{$formTierPrice[$key + 1]} != {$fixtureTierPrice[$field]}"; - } - } - - return implode("\n", $errors); - } - - /** - * Prepare tier price data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareTierPrices(InjectableFixture $product) - { - $tierPrices = $product->getTierPrice(); - $percents = $product->getDataFieldConfig('price')['source']->getPriceData(); - foreach ($tierPrices as $key => $tierPrice) { - $tierPrices[$key]['price'] = number_format($tierPrices[$key]['price'], $this->priceFormat); - $tierPrices[$key]['percent'] = $percents[$key]['percent']; - } - - return $tierPrices; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tier price is displayed on the product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php deleted file mode 100644 index 9052f221e72..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductVisibleInCategory.php +++ /dev/null @@ -1,109 +0,0 @@ -hasData('category_ids') ? $product->getCategoryIds()[0] : $category->getName(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - - if (($product->getVisibility() === 'Search') || ($this->getStockStatus($product) === 'Out of Stock')) { - $isProductVisible = !$isProductVisible; - $this->errorMessage = 'Product found in this category.'; - $this->successfulMessage = 'Asserts that the product could not be found in this category.'; - } - - \PHPUnit_Framework_Assert::assertTrue( - $isProductVisible, - $this->errorMessage - ); - } - - /** - * Getting is in stock status. - * - * @param InjectableFixture $product - * @return string|null - */ - protected function getStockStatus(InjectableFixture $product) - { - $quantityAndStockStatus = $product->getStockData(); - return isset($quantityAndStockStatus['is_in_stock']) ? $quantityAndStockStatus['is_in_stock'] : null; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return $this->successfulMessage; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php deleted file mode 100644 index f427edfd9d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsIsNotDisplayingOnFrontend.php +++ /dev/null @@ -1,81 +0,0 @@ -processAssert( - $product, - $browser, - $catalogProductView, - $cmsIndex, - $catalogSearchResult, - $catalogCategoryView, - $category - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products is not displayed on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php deleted file mode 100644 index c8d20784fce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotInGrid.php +++ /dev/null @@ -1,59 +0,0 @@ -open(); - foreach ($products as $product) { - $assertProductNotInGrid->assert($product, $productGrid); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that products is absent in products grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php deleted file mode 100644 index 1f472b25626..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsNotVisibleInCategory.php +++ /dev/null @@ -1,70 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - foreach ($unassignedProducts as $product) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - while (!$isProductVisible && $catalogCategoryView->getBottomToolbar()->nextPage()) { - $isProductVisible = $catalogCategoryView->getListProductBlock()->isProductVisible($product); - } - \PHPUnit_Framework_Assert::assertFalse( - $isProductVisible, - "Product {$product->getName()} is present in category page." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are absent in category page'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php deleted file mode 100644 index 78c7e826447..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsSuccessDeleteMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Assertion that products success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php deleted file mode 100644 index bca222813ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByAttribute.php +++ /dev/null @@ -1,92 +0,0 @@ -open()->getIndexManagementGrid()->massactionForAll('Reindex Data'); - $browser->open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $filter = $this->prepareFilter($products[$searchProductsIndexes], $filterLink); - $catalogCategoryView->getLayeredNavigationBlock()->selectAttribute($filter); - - $this->verify($catalogCategoryView, $products, $searchProductsIndexes); - } - - /** - * Prepare filter for attribute. - * - * @param ConfigurableProduct $product - * @param string $filterLink - * @return array - */ - protected function prepareFilter(ConfigurableProduct $product, $filterLink) - { - list($attributeKey, $optionKey) = explode('::', $filterLink); - $attributesData = $product->getConfigurableOptions()['attributes_data']; - return [ - 'attribute' => $attributesData[$attributeKey]['frontend_label'], - 'option' => $attributesData[$attributeKey]['options'][$optionKey]['label'] - ]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in category after filter by attribute.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php deleted file mode 100644 index 0ee16e6408e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertProductsVisibleOnCategoryPageShopByPrice.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . strtolower($category->getUrlKey()) . '.html'); - $catalogCategoryView->getLayeredNavigationBlock()->selectPrice($filterLink); - - $this->verify($catalogCategoryView, $products, $searchProductsIndexes); - } - - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in category after filter by price.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php deleted file mode 100644 index 0b76e5180fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $relatedProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $relatedProducts = $productsData[$index]['relatedProducts']['related_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $this->assertRelatedSection($catalogProductView, $relatedProducts); - - $index = $relatedProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $relatedProducts = $productsData[$index]['relatedProducts']['related_products']['value']; - $this->openRelatedProduct($catalogProductView, $productCheck); - $this->assertRelatedSection($catalogProductView, $relatedProducts); - - $index = $relatedProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->openRelatedProduct($catalogProductView, $productCheck); - $this->assertRelatedSectionAbsent($catalogProductView); - } - - /** - * Open related product. - * - * @param CatalogProductView $catalogProductView - * @param InjectableFixture $productCheck - * @return void - */ - protected function openRelatedProduct(CatalogProductView $catalogProductView, InjectableFixture $productCheck) - { - $relatedBlock = $catalogProductView->getRelatedProductBlock(); - $relatedBlock->getItemBlock($productCheck)->openProduct(); - } - - /** - * Check products on related section. - * - * @param CatalogProductView $catalogProductView - * @param array $relatedProducts - * @return void - */ - protected function assertRelatedSection(CatalogProductView $catalogProductView, array $relatedProducts) - { - $errors = []; - $relatedBlock = $catalogProductView->getRelatedProductBlock(); - foreach ($relatedProducts as $relatedProduct) { - if (!$relatedBlock->getItemBlock($relatedProduct)->isVisible()) { - $errors[] = "Product {$relatedProduct->getName()} is absent in up-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that related section is absent. - * - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertRelatedSectionAbsent(CatalogProductView $catalogProductView) - { - \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in related section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php deleted file mode 100644 index 2939b6172d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertRelatedProductsSection.php +++ /dev/null @@ -1,66 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($relatedProducts as $relatedProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getRelatedProductBlock()->getItemBlock($relatedProduct)->isVisible(), - "Product {$relatedProduct->getName()} is absent in related products." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is displayed in related products section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php deleted file mode 100644 index c6e669f2b7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertSpecialPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $specialPrice, $browser); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php deleted file mode 100644 index 27d0f603346..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertTierPriceOnGroupedProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -processAssertPrice($product, $catalogProductView, $tierPrice, $browser, 'Tier'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php deleted file mode 100644 index 73b4bda4cd5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -open()->getCartBlock()->clearShoppingCart(); - - $index = $upSellProductsData['firstProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $upSellProducts = $productsData[$index]['upSellProducts']['up_sell_products']['value']; - $browser->open($_ENV['app_frontend_url'] . $productCheck->getUrlKey() . '.html'); - $this->assertUpSellSection($catalogProductView, $upSellProducts); - - $index = $upSellProductsData['secondProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $upSellProducts = $productsData[$index]['upSellProducts']['up_sell_products']['value']; - $this->openUpSellProduct($catalogProductView, $productCheck); - unset($upSellProducts[$upSellProductsData['firstProduct']['productIndex']]); - $this->assertUpSellSection($catalogProductView, $upSellProducts); - - $index = $upSellProductsData['thirdProduct']['productIndex']; - $productCheck = $productsData[$index]['product']; - $this->openUpSellProduct($catalogProductView, $productCheck); - $this->assertUpSellSectionAbsent($catalogProductView); - } - - /** - * Open UpSell product. - * - * @param CatalogProductView $catalogProductView - * @param InjectableFixture $productCheck - * @return void - */ - protected function openUpSellProduct(CatalogProductView $catalogProductView, InjectableFixture $productCheck) - { - $catalogProductView->getUpsellBlock()->getItemBlock($productCheck)->openProduct(); - } - - /** - * Check products on upSell section. - * - * @param CatalogProductView $catalogProductView - * @param array $upSellProducts - * @return void - */ - protected function assertUpSellSection(CatalogProductView $catalogProductView, array $upSellProducts) - { - $errors = []; - $upSellBlock = $catalogProductView->getUpsellBlock(); - foreach ($upSellProducts as $upSellProduct) { - if (!$upSellBlock->getItemBlock($upSellProduct)->isVisible()) { - $errors[] = "Product {$upSellProduct->getName()} is absent in up-sell section."; - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, implode("\n", $errors)); - } - - /** - * Check that upSell section is absent. - * - * @param CatalogProductView $catalogProductView - * @return void - */ - protected function assertUpSellSectionAbsent(CatalogProductView $catalogProductView) - { - \PHPUnit_Framework_Assert::assertFalse($catalogProductView->getUpsellBlock()->isVisible()); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in upSell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php deleted file mode 100644 index 03b6e70ba7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/AssertUpSellProductsSection.php +++ /dev/null @@ -1,66 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - foreach ($upSellProducts as $upSellProduct) { - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getUpsellBlock()->getItemBlock($upSellProduct)->isVisible(), - "Product {$upSellProduct->getName()} is absent in up-sells products." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are displayed in up-sell section.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php deleted file mode 100644 index 4aaef4143ce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductConfigurableHandler.php +++ /dev/null @@ -1,83 +0,0 @@ -getCheckoutDataOptions($product, 'configurable_options'); - $productKey = $this->getProductKey($options); - $products = $this->getAssignedProducts($product); - - return $products[$productKey]->getSku(); - } - - /** - * Get product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getProductOptions(InjectableFixture $product) - { - $options = $this->getCheckoutDataOptions($product, 'configurable_options'); - $productOptions = $product->getConfigurableOptions()['attributes_data']; - $configurableOptions = (!empty($options) && !empty($productOptions)) - ? $this->getOptions($options, $productOptions, 'label', false) - : []; - - return array_merge(parent::getProductOptions($product), $configurableOptions); - } - - /** - * Get assigned products. - * - * @param InjectableFixture $product - * @return array - */ - protected function getAssignedProducts(InjectableFixture $product) - { - return $product->getDataFieldConfig('configurable_options')['source']->getProducts(); - } - - /** - * Get product key. - * - * @param array $data - * @return string - */ - protected function getProductKey(array $data) - { - $key = ''; - foreach ($data as $itemData) { - $key .= $itemData['title'] . ':' . $itemData['value'] . ' '; - } - - return trim($key); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php deleted file mode 100644 index 1b4c4ba0981..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Constraint/ProductHandler.php +++ /dev/null @@ -1,136 +0,0 @@ -getSku(); - } - - /** - * Get product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getProductOptions(InjectableFixture $product) - { - $options = $this->getCheckoutDataOptions($product, 'custom_options'); - $productOptions = $product->getCustomOptions(); - - return (!empty($options) && !empty($productOptions)) ? $this->getOptions($options, $productOptions) : []; - } - - /** - * Get options. - * - * @param array $checkoutOptions - * @param array $fixtureOptions - * @param string $key [optional] - * @param bool $prepareKeys [optional] - * @return array - */ - protected function getOptions(array $checkoutOptions, array $fixtureOptions, $key = 'title', $prepareKeys = true) - { - $result = []; - foreach ($checkoutOptions as $option) { - list($attributeKey, $optionKey) = $this->getOptionKeys($option, $prepareKeys); - $result[] = [ - 'title' => $fixtureOptions[$attributeKey][$key], - 'value' => $fixtureOptions[$attributeKey]['options'][$optionKey][$key] - ]; - } - - return $result; - } - - /** - * Get option keys. - * - * @param array $option - * @param bool $prepareKeys - * @return array - */ - protected function getOptionKeys(array $option, $prepareKeys) - { - return [ - $prepareKeys ? $this->getAttributeKey($option['title']) : $option['title'], - $prepareKeys ? $this->getOptionKey($option['value']) : $option['value'] - ]; - } - - /** - * Get attribute key. - * - * @param string $attributeKey - * @return string - */ - protected function getAttributeKey($attributeKey) - { - return $this->getKey($attributeKey, 'attribute_key'); - } - - /** - * Get option key. - * - * @param string $optionKey - * @return string - */ - protected function getOptionKey($optionKey) - { - return $this->getKey($optionKey, 'option_key'); - } - - /** - * Get key. - * - * @param string $key - * @param string $replace - * @return string - */ - protected function getKey($key, $replace) - { - return str_replace($replace . '_', '', $key); - } - - /** - * Get checkout data options. - * - * @param InjectableFixture $product - * @param string $optionKey - * @return array - */ - protected function getCheckoutDataOptions(InjectableFixture $product, $optionKey = '') - { - $checkoutData = $product->getCheckoutData(); - return ($optionKey == '') - ? (isset($checkoutData['options']) ? $checkoutData['options'] : []) - : (isset($checkoutData['options'][$optionKey]) ? $checkoutData['options'][$optionKey] : []); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php deleted file mode 100644 index 7c6112299f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/Cart/Item.php +++ /dev/null @@ -1,67 +0,0 @@ -getCheckoutData(); - $cartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $customOptions = $product->hasData('custom_options') ? $product->getCustomOptions() : []; - $checkoutCustomOptions = isset($checkoutData['options']['custom_options']) - ? $checkoutData['options']['custom_options'] - : []; - - foreach ($checkoutCustomOptions as $key => $checkoutCustomOption) { - $attribute = str_replace('attribute_key_', '', $checkoutCustomOption['title']); - $option = str_replace('option_key_', '', $checkoutCustomOption['value']); - - $checkoutCustomOptions[$key] = [ - 'title' => isset($customOptions[$attribute]['title']) - ? $customOptions[$attribute]['title'] - : $attribute, - 'value' => isset($customOptions[$attribute]['options'][$option]['title']) - ? $customOptions[$attribute]['options'][$option]['title'] - : $option, - ]; - } - - $cartItem['options'] = $checkoutCustomOptions; - $cartItem['qty'] = isset($checkoutData['qty']) - ? $checkoutData['qty'] - : 1; - - $this->data = $cartItem; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml deleted file mode 100644 index ff102e8437e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php deleted file mode 100644 index eef87ecc22a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/AssignedAttributes.php +++ /dev/null @@ -1,76 +0,0 @@ -params = $params; - if (isset($data['dataset']) && is_string($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $preset) { - /** @var CatalogProductAttribute $attribute */ - $attribute = $fixtureFactory->createByCode('catalogProductAttribute', ['dataset' => $preset]); - $attribute->persist(); - - $this->data[] = $attribute->getAttributeCode(); - $this->attributes[] = $attribute; - } - } elseif (isset($data['attributes']) && is_array($data['attributes'])) { - foreach ($data['attributes'] as $attribute) { - /** @var CatalogProductAttribute $attribute */ - $this->data[] = $attribute->getAttributeCode(); - $this->attributes[] = $attribute; - } - } else { - $this->data = $data; - } - } - - /** - * Get Attributes. - * - * @return array - */ - public function getAttributes() - { - return $this->attributes; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php deleted file mode 100644 index e67ef8f8d80..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogAttributeSet/SkeletonSet.php +++ /dev/null @@ -1,65 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $parentSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); - if (!$parentSet->hasData('attribute_set_id')) { - $parentSet->persist(); - } - /** @var CatalogAttributeSet $parentSet */ - $this->data = $parentSet->getAttributeSetName(); - $this->attributeSet = $parentSet; - } - } - - /** - * Get Attribute Set. - * - * @return array - */ - public function getAttributeSet() - { - return $this->attributeSet; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml deleted file mode 100644 index d36d9a00a96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php deleted file mode 100644 index 98db28736c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/CategoryProducts.php +++ /dev/null @@ -1,68 +0,0 @@ -params = $params; - if (isset($data['data']) && isset($data['products'])) { - $this->data = $data['data']; - $this->products = $data['products']; - } elseif (isset($data['dataset'])) { - $products = explode(',', $data['dataset']); - foreach ($products as $value) { - $explodeValue = explode('::', $value); - $product = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - if (!$product->getId()) { - $product->persist(); - } - $this->data[] = $product->getSku(); - $this->products[] = $product; - } - } - } - /** - * Return products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php deleted file mode 100644 index a77c6d86725..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogCategory/ParentId.php +++ /dev/null @@ -1,106 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->parentCategory = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $data['dataset']]); - if (!$this->parentCategory->hasData('id')) { - $this->parentCategory->persist(); - } - $this->data = $this->parentCategory->getId(); - } elseif (isset($data['data']) && isset($data['parent_category'])) { - $this->data = $data['data']; - $this->parentCategory = $data['parent_category']; - } else { - $this->data = $data; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return entity. - * - * @return CatalogCategory - */ - public function getParentCategory() - { - return $this->parentCategory; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml deleted file mode 100644 index 913c0df4f6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php deleted file mode 100644 index 4babe6c2c64..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductAttribute/Options.php +++ /dev/null @@ -1,60 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } elseif (isset($data['value'])) { - $this->data = $data['value']; - } - - $this->optionsIds = isset($data['optionsIds']) ? $data['optionsIds'] : $this->optionsIds; - } - - /** - * Get options ids. - * - * @return array - */ - public function getOptionsIds() - { - return $this->optionsIds; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml deleted file mode 100644 index bb4311e41f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - simple - - simple - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php deleted file mode 100644 index ac96891a4e8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AbstractRelatedProducts.php +++ /dev/null @@ -1,125 +0,0 @@ -params = $params; - - if (isset($data['presets'])) { - $presets = array_map('trim', explode(',', $data['presets'])); - foreach ($presets as $preset) { - list($fixtureCode, $dataset) = explode('::', $preset); - - /** @var InjectableFixture $product */ - $product = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); - if (!$product->hasData('id')) { - $product->persist(); - } - - $this->products[] = $product; - $this->data[] = [ - 'entity_id' => $product->getId(), - 'name' => $product->getName(), - 'sku' => $product->getSku(), - ]; - } - } - - if (isset($data['data'])) { - $this->data = array_replace_recursive($this->data, $data['data']); - } - } - - /** - * Persist related products. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return array - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return related products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php deleted file mode 100644 index dc5288a1365..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/AttributeSetId.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - if (isset($data['dataset']) && $data['dataset'] !== '-') { - $attributeSet = $fixtureFactory->createByCode('catalogAttributeSet', ['dataset' => $data['dataset']]); - if (!$attributeSet->hasData('attribute_set_id')) { - $attributeSet->persist(); - } - } - if (isset($data['attribute_set']) && $data['attribute_set'] instanceof CatalogAttributeSet) { - $attributeSet = $data['attribute_set']; - } - /** @var CatalogAttributeSet $attributeSet */ - if (!isset($data['dataset']) && !isset($data['attribute_set'])) { - $this->data = $data; - } else { - $this->data = $attributeSet->getAttributeSetName(); - $this->attributeSet = $attributeSet; - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return Attribute Set fixture. - * - * @return CatalogAttributeSet - */ - public function getAttributeSet() - { - return $this->attributeSet; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php deleted file mode 100644 index e6befed0cfb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Attributes.php +++ /dev/null @@ -1,42 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $this->data['dataset'] = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - if (isset($data['value'])) { - $this->data['value'] = $data['value']; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php deleted file mode 100644 index 4402371d95d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CategoryIds.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - - if (!empty($data['category']) && empty($data['dataset'])) { - /** @var CatalogCategory $category */ - $category = $data['category']; - if (!$category->hasData('id')) { - $category->persist(); - } - $this->data[] = $category->getName(); - $this->categories[] = $category; - } elseif (isset($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $preset) { - $category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => $preset]); - $category->persist(); - - /** @var CatalogCategory $category */ - $this->data[] = $category->getName(); - $this->categories[] = $category; - } - } - - if (!empty($this->categories) && count($this->categories) == 1) { - $this->productCategory = $this->categories[0]; - } - } - - /** - * Return category array. - * - * @return array - */ - public function getCategories() - { - return $this->categories; - } - - /** - * Get product category. - * - * @return mixed - */ - public function getProductCategory() - { - return $this->productCategory; - } - - /** - * Get id of categories. - * - * @return array - */ - public function getIds() - { - $ids = []; - foreach ($this->categories as $category) { - $ids[] = $category->getId(); - } - - return $ids; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php deleted file mode 100644 index 02930603c53..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/CrossSellProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - $this->customOptions = $this->data; - unset($data['dataset']); - } - $this->data = array_merge_recursive($data, $this->data); - } - - /** - * Replace custom options data. - * - * @param array $data - * @param int $replace - * @return array - */ - protected function replaceData(array $data, $replace) - { - $result = []; - foreach ($data as $key => $value) { - if (is_array($value)) { - $value = $this->replaceData($value, $replace); - } - $result[$key] = str_replace('%isolation%', $replace, $value); - } - - return $result; - } - - - /** - * Return all custom options. - * - * @return array - */ - public function getCustomOptions() - { - return $this->customOptions; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php deleted file mode 100644 index b42f45ec536..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Fpt.php +++ /dev/null @@ -1,42 +0,0 @@ -params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php deleted file mode 100644 index b74f6ecb863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/Price.php +++ /dev/null @@ -1,67 +0,0 @@ -params = $params; - $this->data = (!isset($data['dataset']) && !isset($data['value'])) ? $data : null; - - if (isset($data['value'])) { - $this->data = $data['value']; - } - - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->priceData = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - } - } - - /** - * Get price data for different pages. - * - * @return array|null - */ - public function getPriceData() - { - return $this->priceData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php deleted file mode 100644 index 199e990af8a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/RelatedProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - $this->configuration = $configuration; - if ((!isset($data['dataset']) && !isset($data['tax_product_class']))) { - $this->data = $data; - return; - } - - if (isset($data['dataset'])) { - $this->taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $data['dataset']]); - $this->data = $this->taxClass->getClassName(); - if (!$this->taxClass->hasData('id')) { - $this->taxClass->persist(); - } - } - - if (isset($data['tax_product_class']) && $data['tax_product_class'] instanceof FixtureTaxClass) { - $this->taxClass = $data['tax_product_class']; - $this->data = $this->taxClass->getClassName(); - } - - if ($this->taxClass->hasData('id')) { - $this->taxClassId = $this->taxClass->getId(); - } else { - $this->setTaxClassId($this->data); - } - } - - /** - * Set tax class id. - * - * @param string $taxClassName - * @return void - * @throws \Exception - */ - protected function setTaxClassId($taxClassName) - { - $url = $_ENV['app_backend_url'] . 'tax/rule/new/'; - $curl = new BackendDecorator(new CurlTransport(), $this->configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('~~', $response, $matches); - if (!isset($matches[1]) || empty($matches[1])) { - throw new \Exception('Product tax class id ' . $taxClassName . ' undefined!'); - } - - $this->taxClassId = (int)$matches[1]; - } - - /** - * Persist custom selections tax classes. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return tax class fixture. - * - * @return FixtureTaxClass - */ - public function getTaxClass() - { - return $this->taxClass; - } - - /** - * Return tax class id. - * - * @return int - */ - public function getTaxClassId() - { - return (int)$this->taxClassId; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php deleted file mode 100644 index 9279be629f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductSimple/UpSellProducts.php +++ /dev/null @@ -1,24 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - foreach ($data['datasets'] as $dataset) { - $website = $fixtureFactory->createByCode('website', ['dataset' => $dataset]); - /** @var Website $website */ - if (!$website->getWebsiteId()) { - $website->persist(); - } - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - if (isset($data['websites'])) { - foreach ($data['websites'] as $website) { - if ($website instanceof Website && $website->hasData('website_id')) { - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - } - } - - /** - * Persist attribute options. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Websites fixtures array. - * - * @return array - */ - public function getWebsites() - { - return $this->websites; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml deleted file mode 100644 index e4b6bd906b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/CatalogProductVirtual.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - virtual - - virtual - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml deleted file mode 100644 index 860ce8992d0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - configurable - - configurable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php deleted file mode 100644 index a0507d27faf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/Cart/Item.php +++ /dev/null @@ -1,66 +0,0 @@ -getCheckoutData(); - $cartItem = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $attributesData = $product->getConfigurableOptions()['attributes_data']; - $checkoutConfigurableOptions = isset($checkoutData['options']['configurable_options']) - ? $checkoutData['options']['configurable_options'] - : []; - - foreach ($checkoutConfigurableOptions as $key => $checkoutConfigurableOption) { - $attribute = $checkoutConfigurableOption['title']; - $option = $checkoutConfigurableOption['value']; - - $checkoutConfigurableOptions[$key] = [ - 'title' => isset($attributesData[$attribute]['label']) - ? $attributesData[$attribute]['label'] - : $attribute, - 'value' => isset($attributesData[$attribute]['options'][$option]['label']) - ? $attributesData[$attribute]['options'][$option]['label'] - : $option, - ]; - } - $cartItem['options'] = isset($cartItem['options']) - ? $cartItem['options'] + $checkoutConfigurableOptions - : $checkoutConfigurableOptions; - $this->data = array_merge($this->data, $cartItem); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php deleted file mode 100644 index f6fdd2291fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/ConfigurableProduct/ConfigurableOptions.php +++ /dev/null @@ -1,339 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->params = $params; - $dataset = []; - $isSetData = false; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $dataset = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - unset($data['dataset']); - } - - if (isset($data['data'])) { - $this->setData($data['data']); - if (isset($data['data']['data'])) { - $data = $data['data']['data']; - $isSetData = true; - } - unset($data['data']); - } - $this->data = array_replace_recursive($data, $dataset); - if (!empty($this->data)) { - $this->prepareProducts($this->data); - if (!$isSetData) { - $this->prepareData(); - } - } - } - - /** - * Set data to source properties. - * - * @param array $data - * @return void - */ - protected function setData(array $data) - { - $this->products = isset($data['assigned_product']) ? $data['assigned_product'] : []; - $this->attributesData = isset($data['attributes_data']) - ? $data['attributes_data'] - : []; - } - /** - * Prepare products. - * - * @param array $data - * @return void - */ - protected function prepareProducts(array $data) - { - if (empty($this->products)) { - $attributeSetData = $this->prepareAttributesData($data); - foreach ($data['products'] as $key => $product) { - if (is_string($product)) { - list($fixture, $dataset) = explode('::', $product); - $attributeData = ['attributes' => $this->getProductAttributeData($key)]; - $product = $this->fixtureFactory->createByCode( - $fixture, - ['dataset' => $dataset, 'data' => array_merge($attributeSetData, $attributeData)] - ); - } - if (!$product->hasData('id') && $product->getData('isPersist') !== 'No') { - $product->persist(); - } - - $this->products[$key] = $product; - } - } - foreach ($this->products as $key => $product) { - $this->data['products'][$key] = $product->getSku(); - } - } - - /** - * Prepare attributes data. - * - * @param array $data - * @return array - */ - protected function prepareAttributesData(array $data) - { - $attributeSetData = []; - if (isset($data['attributeSet'])) { - if (!isset($this->attributesData['attributeSet'])) { - $this->attributesData['attributeSet'] = $this->createAttributeSet($data['attributeSet']); - } - if ($this->isSetAttributes()) { - $this->attributesData['attributes'] = $this->attributesData['attributeSet'] - ->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - } - $attributeSetData['attribute_set_id'] = ['attribute_set' => $this->attributesData['attributeSet']]; - } - - return $attributeSetData; - } - - /** - * Check attributes data in source. - * - * @return bool - */ - protected function isSetAttributes() - { - return $this->attributesData['attributeSet']->hasData('assigned_attributes') - && !isset($this->attributesData['attributes']); - } - - /** - * Create attribute set. - * - * @param array $attributeSet - * @return CatalogAttributeSet - */ - protected function createAttributeSet(array $attributeSet) - { - $attributeSet = $this->fixtureFactory->createByCode('catalogAttributeSet', $attributeSet); - $attributeSet->persist(); - - return $attributeSet; - } - - /** - * Get prepared attribute data for persist product. - * - * @param string $key - * @return array - */ - protected function getProductAttributeData($key) - { - $compositeKeys = explode(' ', $key); - $data = []; - - foreach ($compositeKeys as $compositeKey) { - $attributeId = $this->getAttributeOptionId($compositeKey); - if ($attributeId) { - $compositeKey = explode(':', $compositeKey); - $attributeKey = $this->getKey($compositeKey[0]); - $data[$this->attributesData['attributes'][$attributeKey]->getAttributeCode()] = $attributeId; - } - } - - return ['value' => $data]; - } - - /** - * Get id of attribute option by composite key. - * - * @param string $compositeKey - * @return int|null - */ - protected function getAttributeOptionId($compositeKey) - { - $compositeKey = explode(':', $compositeKey); - $attributeKey = $this->getKey($compositeKey[0]); - $optionKey = $this->getKey($compositeKey[1]); - - $attributeOptions = $this->attributesData['attributes'][$attributeKey]->getOptions(); - return isset($attributeOptions[$optionKey]['id']) - ? $attributeOptions[$optionKey]['id'] - : null; - } - - /** - * Prepare data from source. - * - * @return void - */ - protected function prepareData() - { - $attributeFields = [ - 'frontend_label', - 'label', - 'frontend_input', - 'attribute_code', - 'attribute_id', - 'is_required', - 'options', - ]; - $optionFields = [ - 'admin', - 'label', - 'price', - 'price_type', - 'include', - ]; - $resultData = [ - 'attributes_data', - 'products' - ]; - - foreach ($this->attributesData['attributes'] as $attributeIndex => $attribute) { - $attribute = $attribute->getData(); - $attributeKey = 'attribute_key_' . $attributeIndex; - $options = []; - foreach ($attribute['options'] as $optionIndex => $option) { - $option['label'] = isset($option['view']) ? $option['view'] : $option['label']; - $optionKey = 'option_key_' . $optionIndex; - if (isset($this->data['attributes_data'][$attributeKey]['options'][$optionKey])) { - $options[$optionKey] = array_intersect_key($option, array_flip($optionFields)); - } - } - $attribute['options'] = $options; - $attribute['label'] = isset($attribute['label']) - ? $attribute['label'] - : (isset($attribute['frontend_label']) ? $attribute['frontend_label'] : null); - $attribute = array_intersect_key($attribute, array_flip($attributeFields)); - - $this->data['attributes_data'][$attributeKey] = array_merge_recursive( - $this->data['attributes_data'][$attributeKey], - $attribute - ); - } - - $this->data = array_intersect_key($this->data, array_flip($resultData)); - } - - /** - * Get prepared products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } - - /** - * Get data by key. - * - * @param null $key - * @return array - */ - public function getData($key = null) - { - if ($key === null) { - return $this->data; - } else { - return $this->data[$key]; - } - } - - /** - * Get attribute set. - * - * @return CatalogAttributeSet - */ - public function getAttributeSet() - { - return $this->attributesData['attributeSet']; - } - - /** - * Prepare key for array. - * - * @param string $key - * @return int - */ - protected function getKey($key) - { - return str_replace(['attribute_key_', 'option_key_'], '', $key); - } - - /** - * Get attribute set. - * - * @return array - */ - public function getAttributesData() - { - return $this->attributesData['attributes']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml deleted file mode 100644 index 177c18ef3fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - grouped - - grouped - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php deleted file mode 100644 index 050fd7fe946..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Associated.php +++ /dev/null @@ -1,90 +0,0 @@ -objectManager = $objectManager; - $this->params = $params; - $associatedData = isset($data['dataset']) - ? $repositoryFactory->get($this->params['repository'])->get($data['dataset']) - : $data; - if ($associatedData) { - $this->products = $this->createProducts($associatedData['products'])['products']; - foreach ($this->products as $key => $product) { - $this->data[] = - [ - 'id' => $product->getId(), - 'name' => $product->getName(), - 'qty' => $associatedData['assigned_products'][$key]['qty'], - 'position' => $key + 1 - ]; - } - } - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => $products]) - ->run(); - } - - /** - * Return products' fixtures. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php deleted file mode 100644 index dd05d2cdd1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Fixture/GroupedProduct/Cart/Item.php +++ /dev/null @@ -1,97 +0,0 @@ -getCheckoutData(); - $this->data = isset($checkoutData['cartItem']) ? $checkoutData['cartItem'] : []; - $products = $product->getDataFieldConfig('associated')['source']->getProducts(); - $cartItem = []; - $associatedProducts = []; - - foreach ($products as $key => $product) { - $key = 'product_key_' . $key; - $associatedProducts[$key] = $product; - } - - // Replace key in checkout data - foreach ($this->data as $fieldName => $fieldValues) { - foreach ($fieldValues as $key => $value) { - $cartItem[$fieldName][$associatedProducts[$key]->getSku()] = $value; - } - } - - // Add empty "options" field - foreach ($associatedProducts as $product) { - $cartItem['options'][] = [ - 'title' => $product->getName(), - 'value' => $cartItem['qty'][$product->getSku()], - ]; - } - - $this->data = $cartItem; - } - - /** - * Persist fixture. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - // - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php deleted file mode 100644 index 1f219cf8eaf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogAttributeSet/CatalogAttributeSetInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -hasData('attribute_set_id') - ? $this->getDefaultAttributeSet($fixture) - : $this->createAttributeSet($fixture); - - $attributeSetId = $fixture->hasData('attribute_set_id') - ? $fixture->getAttributeSetId() - : $this->getData($this->attributeSetId, $response); - - $assignedAttributes = $fixture->hasData('assigned_attributes') - ? $fixture->getDataFieldConfig('assigned_attributes')['source']->getAttributes() - : []; - $dataAttribute = $this->getDataAttributes($response); - - $lastAttribute = array_pop($dataAttribute['attributes']); - - foreach ($assignedAttributes as $key => $assignedAttribute) { - $dataAttribute['attributes'][] = [ - $assignedAttribute->getAttributeId(), - $dataAttribute['groups'][0][0], - ($lastAttribute[2] + ($key + 1)), - null, - ]; - } - - $this->updateAttributeSet($attributeSetId, $dataAttribute); - - return ['attribute_set_id' => $attributeSetId]; - } - - /** - * Create Attribute Set. - * - * @param CatalogAttributeSet $fixture - * @return string - */ - protected function createAttributeSet(CatalogAttributeSet $fixture) - { - $data = $fixture->getData(); - if (!isset($data['gotoEdit'])) { - $data['gotoEdit'] = 1; - } - - $data['skeleton_set'] = $fixture->getDataFieldConfig('skeleton_set')['source']->getAttributeSet() - ->getAttributeSetId(); - - $url = $_ENV['app_backend_url'] . 'catalog_product_set/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Get Default Attribute Set page with curl. - * - * @param CatalogAttributeSet $fixture - * @return string - */ - protected function getDefaultAttributeSet(CatalogAttributeSet $fixture) - { - $url = $_ENV['app_backend_url'] . 'catalog_product_set/edit/id/' . $fixture->getAttributeSetId() . '/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - return $response; - } - - /** - * Update Attribute Set. - * - * @param int $attributeSetId - * @param array $dataAttribute - * @return void - */ - protected function updateAttributeSet($attributeSetId, array $dataAttribute) - { - $data = ['data' => json_encode($dataAttribute)]; - $url = $_ENV['app_backend_url'] . 'catalog_product_set/save/id/' . $attributeSetId . '/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $curl->read(); - $curl->close(); - } - - /** - * Get data attributes for curl. - * - * @param string $response - * @return array - */ - protected function getDataAttributes($response) - { - $attributes = $this->getData($this->attributes, $response, true); - $dataAttribute = []; - - $index = 1; - foreach ($attributes as $key => $parentAttributes) { - $dataAttribute['groups'][$key][] = $parentAttributes['id']; - $dataAttribute['groups'][$key][] = $parentAttributes['text']; - $dataAttribute['groups'][$key][] = $key + 1; - - if (isset($parentAttributes['children'])) { - foreach ($parentAttributes['children'] as $attribute) { - $dataAttribute['attributes'][$index][] = $attribute['id']; - $dataAttribute['attributes'][$index][] = $parentAttributes['id']; - $dataAttribute['attributes'][$index][] = $index; - $dataAttribute['attributes'][$index][] = $attribute['entity_id']; - $index++; - } - } - } - $dataAttribute['not_attributes'] = []; - $dataAttribute['removeGroups'] = []; - $dataAttribute['attribute_set_name'] = $this->getData($this->attributeSetName, $response); - - return $dataAttribute; - } - - /** - * Select data from response by regular expression. - * - * @param string $regularExpression - * @param string $response - * @param bool $isJson [optional] - * @return mixed - * @throws \Exception - */ - protected function getData($regularExpression, $response, $isJson = false) - { - preg_match($regularExpression, $response, $matches); - if (!isset($matches[1])) { - throw new \Exception("Can't find data in response by regular expression \"{$regularExpression}\"."); - } - - return $isJson ? json_decode($matches[1], true) : $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php deleted file mode 100644 index fba80d37a47..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogCategory/CatalogCategoryInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_anchor' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'include_in_menu' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'display_mode' => [ - 'Static block and products' => 'PRODUCTS_AND_PAGE', - 'Static block only' => 'PAGE', - 'Products only' => 'PRODUCTS', - ], - ]; - - /** - * Post request for creating Subcategory. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $data['general'] = $this->replaceMappingData($fixture->getData()); - if ($fixture->hasData('landing_page')) { - $data['general']['landing_page'] = $this->getBlockId($fixture->getLandingPage()); - } - if ($fixture->hasData('category_products')) { - $data['category_products'] = $this->prepareCategoryProducts($fixture); - } - - $diff = array_diff($this->dataUseConfig, array_keys($data['general'])); - if (!empty($diff)) { - $data['use_config'] = $diff; - } - $parentCategoryId = $data['general']['parent_id']; - $url = $_ENV['app_backend_url'] . 'catalog_category/save/store/0/parent/' . $parentCategoryId . '/?isAjax=true'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - preg_match('~http://.+/id/(\d+).+?isAjax~', $response, $matches); - $id = isset($matches[1]) ? (int)$matches[1] : null; - - return ['id' => $id]; - } - - /** - * Prepare assigned products for category. - * - * @param CatalogCategory $category - * @return string - */ - protected function prepareCategoryProducts(CatalogCategory $category) - { - $products = $category->getDataFieldConfig('category_products')['source']->getProducts(); - $productIds = []; - foreach ($products as $product) { - $productIds[] = $product->getId(); - } - - return implode('=&', $productIds); - } - - /** - * Getting block id by name - * - * @param string $landingName - * @return int|null - */ - protected function getBlockId($landingName) - { - $url = $_ENV['app_backend_url'] . 'catalog_category'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::POST); - $response = $curl->read(); - $curl->close(); - preg_match('~' . preg_quote($landingName, '~') . '~', $response, $matches); - $id = isset($matches[1]) ? (int)$matches[1] : null; - - return $id; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php deleted file mode 100644 index 9f9b37d9cd0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductAttribute/CatalogProductAttributeInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Text Field' => 'text', - 'Text Area' => 'textarea', - 'Date' => 'date', - 'Yes/No' => 'boolean', - 'Select/Multiple Select' => 'multiselect', - 'Select/Dropdown' => 'select', - 'Price' => 'price', - 'Media Image' => 'media_image', - 'Fixed Product Tax' => 'weee', - ], - 'is_required' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_configurable' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_filterable' => [ - 'Filterable (with results)' => 1 - ] - ]; - - /** - * Post request for creating Product Attribute. - * - * @param FixtureInterface|null $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->replaceMappingData($fixture->getData()); - $data['frontend_label'] = [0 => $data['frontend_label']]; - - if (isset($data['options'])) { - foreach ($data['options'] as $key => $values) { - if ($values['is_default'] == 'Yes') { - $data['default'][] = $values['view']; - } - $index = 'option_' . $key; - $data['option']['value'][$index] = [$values['admin'], $values['view']]; - $data['option']['order'][$index] = $key; - } - unset($data['options']); - } - - $url = $_ENV['app_backend_url'] . 'catalog_product_attribute/save/back/edit'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product Attribute creating by curl handler was not successful! \n" . $response); - } - - $resultData = []; - $matches = []; - preg_match('#attribute_id[^>]+value="(\d+)"#', $response, $matches); - $resultData['attribute_id'] = $matches[1]; - - $matches = []; - preg_match_all('#"id":"(\d+)"#Umi', $response, $matches); - krsort($matches[1]); - $optionsIds = array_values($matches[1]); - - if ($fixture->hasData('options')) { - $optionsData = $fixture->getData()['options']; - foreach ($optionsIds as $key => $optionId) { - $optionsData[$key]['id'] = $optionId; - } - $resultData['options'] = $optionsData; - } - - return $resultData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php deleted file mode 100644 index 0e3f1b0a9af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductSimple/CatalogProductSimpleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_notify_stock_qty' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_shareable' => [ - 'Yes' => 1, - 'No' => 0, - 'Use config' => 2 - ], - 'required' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_manage_stock' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_virtual' => [ - 'Yes' => 1 - ], - 'use_config_enable_qty_increments' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'use_config_qty_increments' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_in_stock' => [ - 'In Stock' => 1, - 'Out of Stock' => 0 - ], - 'visibility' => [ - 'Not Visible Individually' => 1, - 'Catalog' => 2, - 'Search' => 3, - 'Catalog, Search' => 4 - ], - 'website_ids' => [ - 'Main Website' => 1 - ], - 'status' => [ - 'Disabled' => 2, - 'Enabled' => 1 - ], - 'is_require' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'is_recurring' => [ - 'Yes' => 1, - 'No' => 0 - ], - 'msrp_display_actual_price_type' => [ - 'Use config' => 4, - 'On Gesture' => 1, - 'In Cart' => 2, - 'Before Order Confirmation' => 3 - ], - 'enable_qty_increments' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'msrp_enabled' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_anchor' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Placeholder for price data sent Curl. - * - * @var array - */ - protected $priceData = [ - 'customer_group' => [ - 'name' => 'cust_group', - 'data' => [ - 'ALL GROUPS' => 32000, - 'NOT LOGGED IN' => 0, - 'General' => 1 - ] - ] - ]; - - /** - * Placeholder for fpt data sent Curl - * - * @var array - */ - protected $fptData = [ - 'website' => [ - 'name' => 'website_id', - 'data' => [ - 'All Websites [USD]' => 0 - ] - ], - 'country_name' => [ - 'name' => 'country', - 'data' => [ - 'United States' => 'US' - ] - ], - 'state_name' => [ - 'name' => 'state', - 'data' => [ - 'California' => 12, - '*' => 0 - ] - ] - ]; - - /** - * Select custom options. - * - * @var array - */ - protected $selectOptions = ['Drop-down', 'Radio Buttons', 'Checkbox', 'Multiple Select']; - - /** - * Post request for creating simple product. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - public function persist(FixtureInterface $fixture = null) - { - /** @var InjectableFixture $fixture */ - $config = $this->prepareConfig($fixture); - $prefix = isset($config['input_prefix']) ? $config['input_prefix'] : null; - $data = $this->prepareData($fixture, $prefix); - return $this->createProduct($data, $config); - } - - /** - * Prepare config data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareConfig(InjectableFixture $product) - { - $config = $product->getDataConfig(); - if ($product->hasData('attribute_set_id')) { - $config['create_url_params']['set'] = $product->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet() - ->getAttributeSetId(); - } - - return $config; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - * - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $fields = $this->replaceMappingData($fixture->getData()); - - // Getting Tax class id - if ($fixture->hasData('tax_class_id')) { - $fields['tax_class_id'] = $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClassId(); - } - - if (isset($fields['tier_price'])) { - $fields['tier_price'] = $this->preparePriceData($fields['tier_price']); - } - if (isset($fields['group_price'])) { - $fields['group_price'] = $this->preparePriceData($fields['group_price']); - } - if (isset($fields['fpt'])) { - $attributeLabel = $fixture->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes()[0]->getFrontendLabel(); - $fields[$attributeLabel] = $this->prepareFptData($fields['fpt']); - } - if ($isCustomOptions = isset($fields['custom_options'])) { - $fields = $this->prepareCustomOptionsData($fields); - } - - if (!empty($fields['website_ids'])) { - $result = []; - foreach ($fields['website_ids'] as $key => $value) { - $result[] = isset($this->mappingData['website_ids'][$value]) - ? $this->mappingData['website_ids'][$value] - : $fixture->getDataFieldConfig('website_ids')['source']->getWebsites()[$key]->getWebsiteId(); - } - $fields['website_ids'] = $result; - } - - if (isset($fields['attribute_set_id'])) { - unset($fields['attribute_set_id']); - } - - // Prepare assigned attribute - if (isset($fields['attributes'])) { - $fields = $this->prepareAttributes($fields, $fixture); - } - - if (!empty($fields['category_ids'])) { - $this->withCategory = true; - unset($fields['category_ids']); - } - - $fields = $this->prepareStockData($fields); - $fields = $prefix ? [$prefix => $fields] : $fields; - - if ($this->withCategory) { - foreach ($fixture->getDataFieldConfig('category_ids')['source']->getCategories() as $category) { - $fields['category_ids'][] = $category->getId(); - } - } - - if ($isCustomOptions) { - $fields['affect_product_custom_options'] = 1; - } - - if (isset($fields['product']['weight'])) { - unset($fields['product']['is_virtual']); - } - - return $fields; - } - - /** - * Prepare attributes data. - * - * @param array $data - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareAttributes(array $data, FixtureInterface $fixture) - { - $result = isset($data['attributes']['value']) ? $data['attributes']['value'] : []; - if (isset($data['attributes']['preset'])) { - $attributes = $fixture->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes(); - foreach ($data['attributes']['preset'] as $key => $attribute) { - $attributeKey = str_replace('attribute_key_', '', $key); - $options = $attributes[$attributeKey]->getOptions(); - if ($options !== null) { - foreach ($attribute as $optionKey) { - $optionKey = str_replace('option_key_', '', $optionKey); - $option = $options[$optionKey]; - $optionsIds = $attributes[$attributeKey]->getDataFieldConfig('options' )['source'] - ->getOptionsIds(); - if (empty($optionsIds)) { - $optionsData = $attributes[$attributeKey]->getOptions(); - $optionsIds = $this->prepareOptionsIds($optionsData); - } - $result[$attributes[$attributeKey]->getAttributeCode()] = $optionsIds[$option['admin']]; - } - } - } - } - unset($data['attributes']); - - return array_merge($data, $result); - } - - /** - * Prepare options ids. - * - * @param array $options - * @return array - */ - protected function prepareOptionsIds(array $options) - { - $result = []; - foreach ($options as $option) { - $result[$option['admin']] = $option['id']; - } - return $result; - } - - /** - * Preparation of stock data. - * - * @param array $fields - * @return array - */ - protected function prepareStockData(array $fields) - { - if (!isset($fields['stock_data']['manage_stock'])) { - $fields['stock_data']['manage_stock'] = (int)(!empty($fields['stock_data']['qty']) - || !empty($fields['stock_data']['is_in_stock'])); - } - - return $this->filter($fields); - } - - /** - * Preparation of custom options data. - * - * @param array $fields - * @return array - */ - protected function prepareCustomOptionsData(array $fields) - { - $options = []; - foreach ($fields['custom_options'] as $key => $customOption) { - $options[$key] = ['option_id' => 0, 'is_delete' => '']; - foreach ($customOption['options'] as $index => $option) { - $customOption['options'][$index]['is_delete'] = ''; - $customOption['options'][$index]['price_type'] = strtolower($option['price_type']); - } - $customOption['type'] = explode('/', $customOption['type'])[1]; - $options[$key] += in_array($customOption['type'], $this->selectOptions) - ? ['values' => $customOption['options']] - : $customOption['options'][0]; - unset($customOption['options']); - $options[$key] += $customOption; - $options[$key]['type'] = $this->optionNameConvert($customOption['type']); - } - $fields['options'] = $options; - unset($fields['custom_options']); - - return $fields; - } - - /** - * Convert option name. - * - * @param string $optionName - * @return string - */ - protected function optionNameConvert($optionName) - { - $optionName = str_replace(['-', ' & '], "_", trim($optionName)); - $end = strpos($optionName, ' '); - if ($end !== false) { - $optionName = substr($optionName, 0, $end); - } - return strtolower($optionName); - } - - /** - * Preparation of tier price data. - * - * @param array $fields - * @return array - * - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - protected function preparePriceData(array $fields) - { - foreach ($fields as &$field) { - foreach ($this->priceData as $key => $data) { - $field[$data['name']] = $this->priceData[$key]['data'][$field[$key]]; - unset($field[$key]); - } - $field['delete'] = ''; - } - return $fields; - } - - /** - * Preparation of fpt data. - * - * @param array $fields - * @return array - */ - protected function prepareFptData(array $fields) - { - foreach ($fields as &$field) { - foreach ($this->fptData as $key => $data) { - $field[$data['name']] = $this->fptData[$key]['data'][$field[$key]]; - unset($field[$key]); - } - $field['delete'] = ''; - } - return $fields; - } - - /** - * Remove items from a null. - * - * @param array $data - * @return array - */ - protected function filter(array $data) - { - foreach ($data as $key => $value) { - if ($value === null) { - unset($data[$key]); - } elseif (is_array($data[$key])) { - $data[$key] = $this->filter($data[$key]); - } - } - return $data; - } - - /** - * Create product via curl. - * - * @param array $data - * @param array $config - * @return array - * @throws \Exception - */ - protected function createProduct(array $data, array $config) - { - $url = $this->getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - - return $this->parseResponse($response); - } - - /** - * Parse data in response. - * - * @param string $response - * @return array - */ - protected function parseResponse($response) - { - preg_match('~a href=[^\s]*\/id\/(\d+)~', $response, $matches); - $id = isset($matches[1]) ? $matches[1] : null; - return ['id' => $id]; - } - - /** - * Retrieve URL for request with all necessary parameters. - * - * @param array $config - * @param string $type [optional] - * @return string - */ - protected function getUrl(array $config, $type = 'save') - { - $requestParams = isset($config['create_url_params']) ? $config['create_url_params'] : []; - $params = ''; - foreach ($requestParams as $key => $value) { - $params .= $key . '/' . $value . '/'; - } - - return $_ENV['app_backend_url'] . "catalog_product/$type/{$params}back/edit"; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php deleted file mode 100644 index c9e7917410a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/CatalogProductVirtual/CatalogProductVirtualInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->mappingData += [ - 'include' => [ - 'Yes' => 1, - 'No' => 0, - ] - ]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $product - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $product, $prefix = null) - { - /** @var ConfigurableProduct $product */ - $valuesIndexes = $this->getIndexValues($product); - $data = parent::prepareData($product, $prefix); - $data['configurable_products_data'] = $this->prepareConfigurableProductData($product, $valuesIndexes); - $data['configurable_attributes_data'] = $this->prepareConfigurableAttributeData($product, $valuesIndexes); - $data['affect_configurable_product_attributes'] = 1; - - return $this->replaceMappingData($data); - } - - /** - * Get configurable product data for curl. - * - * @param ConfigurableProduct $product - * @param array $valuesIndexes - * @return string - */ - protected function prepareConfigurableAttributeData(ConfigurableProduct $product, array $valuesIndexes) - { - $result = []; - $configurableOptions = $product->getConfigurableOptions(); - - foreach ($configurableOptions['attributes_data'] as $attributeKey => $attribute) { - $key = str_replace('attribute_key_', '', $attributeKey); - $result[$key] = [ - 'label' => $attribute['label'], - 'attribute_id' => $attribute['attribute_id'], - 'attribute_code' => $attribute['attribute_code'], - 'frontend_label' => $attribute['frontend_label'], - 'store_label' => $attribute['frontend_label'], - ]; - foreach ($attribute['options'] as $optionKey => $option) { - $result[$key]['values'][] = [ - 'label' => $option['label'], - 'value_index' => $valuesIndexes[$attributeKey . ':' . $optionKey], - 'pricing_value' => $option['price'], - 'is_percent' => ($option['price_type'] == 'Percentage') ? 1 : 0 - ]; - } - } - - return json_encode($result, true); - } - - /** - * Get params of configurable items attributes. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function getIndexValues(ConfigurableProduct $product) - { - $config = $this->prepareConfigDataForNew($product); - $url = $this->getUrl($config, 'new'); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - preg_match_all('/class="value-json" value="(.*)"/', $response, $tempResult); - $valueIndexes = []; - krsort($tempResult[1]); - $optionIndex = 0; - foreach ($tempResult[1] as $value) { - $arrayResult = json_decode(str_replace('"', '"', $value), true); - foreach ($arrayResult as $key => $item) { - $valueIndexes['attribute_key_' . $key . ':' . 'option_key_' . $optionIndex] = $item['value_index']; - } - $optionIndex++; - } - - return $valueIndexes; - } - - /** - * Prepare config data. - * - * @param InjectableFixture $product - * @return array - */ - protected function prepareConfig(InjectableFixture $product) - { - $config = parent::prepareConfig($product); - $config['create_url_params']['set'] = $product->getDataFieldConfig('configurable_options')['source'] - ->getAttributeSet() - ->getAttributeSetId(); - - return $config; - } - - /** - * Prepare config data for product. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function prepareConfigDataForNew(ConfigurableProduct $product) - { - $attributeSet = $product->getDataFieldConfig('configurable_options')['source']->getAttributeSet(); - $attributes = $attributeSet->getDataFieldConfig('assigned_attributes')['source']->getAttributes(); - $attributesIds = $this->getAttributesIds($attributes); - - $customUrlParam['create_url_params'] = [ - 'attributes' => $this->codeAttribute($attributesIds), - 'set' => $attributeSet->getAttributeSetId() - ]; - - return array_replace_recursive($product->getDataConfig(), $customUrlParam); - } - - /** - * Prepare attributes ids. - * - * @param array $attributes - * @return string - */ - protected function getAttributesIds(array $attributes) - { - $attributesIds = ""; - foreach ($attributes as $attribute) { - $attributesIds .= $attribute->getAttributeId() . ","; - } - return substr($attributesIds, 0, strlen($attributesIds) - 1); - } - - /** - * Prepare configurable attribute data to GET request. - * - * @param string $attributes - * @return string - */ - protected function codeAttribute($attributes) - { - $res = base64_encode($attributes); - $res = str_replace('/', '%2F', $res); - $res = str_replace('=', '%3D', $res); - - return $res; - } - - /** - * Prepare configurable product data. - * - * @param ConfigurableProduct $product - * @param array $valuesIndexes - * @return string - */ - protected function prepareConfigurableProductData(ConfigurableProduct $product, array $valuesIndexes) - { - $result = []; - $configurableOptions = $product->getConfigurableOptions(); - $configurableOptionsSource = $product->getDataFieldConfig('configurable_options')['source']; - $associatedProducts = $this->splitProducts($configurableOptionsSource->getProducts()); - - foreach ($configurableOptions['attributes_data'] as $attributeKey => $attribute) { - foreach ($attribute['options'] as $optionKey => $option) { - $productId = $associatedProducts[$attributeKey . ':' . $optionKey]->getId(); - $result[$productId][] = [ - 'label' => $option['label'], - 'attribute_id' => $attribute['attribute_id'], - 'value_index' => $valuesIndexes[$attributeKey . ':' . $optionKey], - 'is_percent' => ($option['price_type'] == 'Percentage') ? 1 : 0, - 'pricing_value' => $option['price'] - ]; - } - } - - return json_encode($result, true); - } - - /** - * Split products. - * - * @param array $products - * @return array - */ - protected function splitProducts(array $products) - { - $result = []; - foreach ($products as $key => $product) { - $indexes = explode(' ', $key); - foreach ($indexes as $index) { - $result[$index] = $product; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php deleted file mode 100644 index 091f35673d0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/Curl.php +++ /dev/null @@ -1,52 +0,0 @@ - $data] : $data; - $links = ''; - $fKey = md5('associated'); - foreach ($assignedProducts as $key => $item) { - $links .= $item['id']. '=' . $fKey . '&'; - } - $data['links']['grouped'] = $links; - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php deleted file mode 100644 index 8823902b842..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Handler/GroupedProduct/GroupedProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml deleted file mode 100644 index c7127b6d0ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProduct.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml deleted file mode 100644 index 498c050b485..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml deleted file mode 100644 index d1f0cf91327..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeIndex.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml deleted file mode 100644 index 1f2f0dcb7a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductAttributeNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml deleted file mode 100644 index 94d5834834c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml deleted file mode 100644 index 50b1cfee468..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml deleted file mode 100644 index b347c4f48bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetAdd.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml deleted file mode 100644 index 00182f834c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml deleted file mode 100644 index ece55c26d57..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Adminhtml/CatalogProductSetIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml deleted file mode 100644 index 61f1290674a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Category/CatalogCategoryView.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml deleted file mode 100644 index 6e5fcc23724..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductCompare.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index 41aa8f284e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml deleted file mode 100644 index a54a2efbca2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogAttributeSet.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Default - 4 - - - - Custom_attribute_set%isolation% - - default - - - attribute_type_dropdown,attribute_type_dropdown - - - - - Custom_attribute_set%isolation% - - default - - - - - Filterable_attribute_set%isolation% - - default - - - filterable_attribute,filterable_attribute - - - - - Custom_attribute_set%isolation% - - default - - - attribute_type_fpt - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml deleted file mode 100644 index 970183f8596..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogCategory.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - Category%isolation% - Default Category - category%isolation% - Yes - Yes - 2 - - - - Default Category - 1 - Yes - 2 - - - - DefaultSubcategory%isolation% - default-subcategory-%isolation% - - default_category - - Yes - Yes - - - - RootCategory%isolation% - root-category-%isolation% - 1 - Yes - Yes - - - - AnchorSubcategory%isolation% - anchor-subcategory-%isolation% - - default_category - - Yes - Yes - Yes - - - - DefaultSubcategory%isolation% - default-subcategory-%isolation% - - default_category - - Yes - Yes - - catalogProductSimple::default,catalogProductSimple::default,catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml deleted file mode 100644 index 0f5a9e7cd39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - attribute_label%isolation% - attribute_label%isolation% - Text Field - No - - - - attribute_dropdown%isolation% - attribute_dropdown%isolation% - Select/Dropdown - Yes - - with_three_options - - - - - filterable_attribute%isolation% - filterable_attribute%isolation% - Select/Dropdown - Yes - Filterable (with results) - - with_three_options - - - - - fpt_%isolation% - fpt_%isolation% - Fixed Product Tax - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml deleted file mode 100644 index e2b20ebeb2a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductAttribute/Options.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - Yes - blue - blue - - - black - black - - - - - - Yes - black - black - - - No - white - white - - - No - green - green - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml deleted file mode 100644 index d6706062265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/CheckoutData.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 160.00 - 2 - 320.00 - - - - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 194.80 - 2 - 389.60 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml deleted file mode 100644 index 381801df7bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/ConfigurableOptions.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - custom_attribute_set - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::default - catalogProductSimple::default - catalogProductSimple::default - - - - - - with_filterable_options - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::default - catalogProductSimple::default - catalogProductSimple::default - - - - - - - - - 121.00 - Percentage - - - - - - - 412.00 - Fixed - - - - - - catalogProductSimple::quickCreation - - - - - - - - - 11.00 - Percentage - - - - - - - 76.00 - Fixed - - - - - - catalogProductSimple::withoutPersist - - - - - - - - - 33.00 - Percentage - - - - - - - 62.00 - Fixed - - - - - - catalogProductSimple::withoutPersist - - - - - - custom_attribute_set - - - - - - 12 - Percentage - - - 20 - Percentage - - - 18 - Percentage - - - - - - - 42.00 - Fixed - - - 40.00 - Fixed - - - 48.00 - Fixed - - - - - - catalogProductSimple::out_of_stock - catalogProductSimple::out_of_stock - catalogProductSimple::out_of_stock - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml deleted file mode 100644 index ff976f8dd5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductConfigurable/Price.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - 86 - - - 77 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml deleted file mode 100644 index 63d7518a343..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple.xml +++ /dev/null @@ -1,1000 +0,0 @@ - - - - - - Test simple product %isolation% - Simple product description %isolation% - Simple product short description %isolation% - test_simple_sku_%isolation% - 12.0000 - Enabled - test-simple-product-%isolation% - Catalog, Search - - 100.00 - - - Taxable Goods - - - 1000 - In Stock - - - default_subcategory - - - - main_website - - - - default - - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - order_default - - - - main_website - - - simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default_subcategory - - - - main_website - - - test-simple-product-%isolation% - - - - Simple Product for sales rule 1 %isolation% - Description for Simple product for sales rule 1 - Short description for Simple product for sales rule 1. - sku_simple_product_%isolation% - - default - - Enabled - simple - - 666 - In Stock - - - 100 - - 100 - - default_subcategory - - - - main_website - - - simple-product-for-sales-rule-1-%isolation% - - - - Simple Product for sales rule 2 %isolation% - Description for Simple product for sales rule 2 - Short description for Simple product for sales rule 2. - sku_simple_product_%isolation% - - default - - Enabled - simple - - 666 - In Stock - - - 50 - - 50 - - default_subcategory - - - - main_website - - - simple-product-for-sales-rule-2-%isolation% - - - - 100_dollar_product%isolation% - 100_dollar_product%isolation% - Description for 100_dollar_product. - Short description for 100_dollar_product. - simple - - 666 - In Stock - - 1 - - default - - Enabled - - 100 - - - - main_website - - - 100-dollar-product%isolation% - - - - Simple product with special price and category %isolation% - Description for Simple product with special price and category - Short description for Simple product with special price and category - Enabled - Catalog, Search - simple_product_with_special_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - 90 - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - simple-product-with-special-price-and-category-%isolation% - - 3 - - - - - Simple Product %isolation% - Description for Simple product with category and one custom option - Short description for Simple product with category and one custom option - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - default - - - 300 - - - 10 - In Stock - - 1 - - drop_down_with_one_option_percent_price - - - drop_down_with_one_option_percent_price - - - default_subcategory - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with default website %isolation%. - Description for default Simple product with default website. - Short description for default Simple product with category. - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - default - - - - main_website - - - simple-product-with-default-website-%isolation% - - - - 50_dollar_product%isolation% - 50_dollar_product%isolation% - Description for 50_dollar_product. - Short description for 50_dollar_product. - simple - - 666 - In Stock - - 1 - - default - - Enabled - - 50 - - - - main_website - - - 50-dollar-product%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - Use config - test-simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - In Cart - test-simple-product-%isolation% - - - - Simple product with group price and category %isolation% - Description for Simple product with group price and category - Short description for Simple product with group price and category - Enabled - Catalog, Search - simple_product_with_group_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - for_not_logged_users - - test-simple-product-%isolation% - - 3 - - - - - Simple product with group price and category %isolation% - Description for Simple product with group price and category - Short description for Simple product with group price and category - Enabled - Catalog, Search - simple_product_with_group_price_and_category%isolation% - - Taxable Goods - - - default - - - 100 - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - tax_calculation - - test-simple-product-%isolation% - - 3 - - - - - Simple product with tier price and category %isolation% - Description for Simple product with tier price and category - Short description for Simple product with tier price and category - Enabled - Catalog, Search - simple_product_with_tier_price_and_category%isolation% - - Taxable Goods - - - default - - - 300 - with_tier_price - - - 10 - In Stock - - 1 - - default_subcategory - - - - main_website - - - - for_all_groups - - test-simple-product-%isolation% - - 3 - - - - - simple_for_composite_products%isolation% - Description for Simple composite products - Short description for Simple composite products - Enabled - Catalog, Search - simple_for_composite_products%isolation% - - 560 - - - - - default - - - Taxable Goods - - 1 - - - main_website - - - - 10 - In Stock - - simple-for-composite-products%isolation% - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 5 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - simple - Simple Product %isolation% - Description for simple product with two custom option - Short description for simple product with two custom option - Enabled - simple-product-%isolation% - sku_simple_product_%isolation% - Catalog, Search - - default - - - 300 - - - 100 - In Stock - - 1 - - - main_website - - - - two_options - - - with_two_custom_option - - - - - simple - Simple Product%isolation% - Description for simple product with category with anchor - Short description for simple product with category with anchor - Enabled - simple-product-with-category-with-anchor%isolation% - sku_simple_product_with_category_with_anchor%isolation% - Catalog, Search - - 100 - In Stock - - 1 - - 100 - - - anchor_category - - - - main_website - - - - Taxable Goods - - - with_one_attribute - - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 3 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product %isolation% - sku_simple_product_%isolation% - Enabled - Catalog, Search - 12 - - 100 - In Stock - - No - - - - Simple Product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - No - - - - Out of Stock Simple Product %isolation% - Description for Out of Stock default Simple product with category - Short description for Out of Stock default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - Out of Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product offline %isolation% - Description for offline default Simple product with category - Short description for offline default Simple product with category - Disabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product not visible %isolation% - Description for not visible default Simple product with category - Short description for not visible default Simple product with category - Enabled - Not Visible Individually - sku_not_visible_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 100 - In Stock - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with cart limit %isolation% - Description for default Simple product with cart limit and category - Short description for default Simple product cart limit and category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 2 - 5 - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Simple Product with qty increments %isolation% - Description for default Simple product with qty increments and category - Short description for default Simple product with qty increments and category - Enabled - Catalog, Search - sku_simple_product_with_qty_increments_%isolation% - - Taxable Goods - - - 100 - - 12 - - Yes - 2 - - - default - - - default - - - - main_website - - - simple-product-%isolation% - - - - Test simple product %isolation% - Description for Simple product with category - Short description for Simple product with category - Enabled - Catalog, Search - - - main_website - - - test_simple_sku_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - Yes - Before Order Confirmation - test-simple-product-%isolation% - - - - - default - - - default_subcategory - - - - main_website - - - Description for Simple product - Short description for Simple product - Enabled - Simple Product With Fpt %isolation% - sku_simple_product_%isolation% - - 70 - - - 10 - In Stock - - 1 - - drop_down_with_one_option_fixed_price - - - drop_down_with_one_option_fixed_price - - simple-product-%isolation% - - one_fpt_for_all_states - - - Taxable Goods - - - - - - default - - - default_subcategory - - - - main_website - - - Description for Simple product - Short description for Simple product - Enabled - Simple Product With Fpt %isolation% - sku_simple_product_%isolation% - - 110 - - - 10 - In Stock - - 100 - 1 - simple-product-%isolation% - - one_fpt_for_all_states - - - Taxable Goods - - - - - simple product %isolation% - Description for default Simple product with category - Short description for default Simple product with category - Enabled - Catalog, Search - sku_simple_product_%isolation% - - Taxable Goods - - - 100 - - 12 - - 10 - In Stock - - - default - - - order_default - - - - main_website - - - simple-product-%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml deleted file mode 100644 index ee769546f39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Attributes.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - option_key_0 - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml deleted file mode 100644 index 59e87857e1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CheckoutData.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - 3 - - 100.00 - 300.00 - - - - - 1 - - 100.00 - 100.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 10034.00 - 20068.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - - - - - - - attribute_key_0 - option_key_0 - - - attribute_key_1 - Content option %isolation% - - - - 1 - - 340 - 340 - - - - - - - - attribute_key_0 - option_key_0 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml deleted file mode 100644 index a8e668d1247..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/CustomOptions.xml +++ /dev/null @@ -1,262 +0,0 @@ - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 10 bucks - 10 - Percent - sku_drop_down_row_1 - - - 20 bucks - 20 - Percent - sku_drop_down_row_2 - - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 30 bucks - 30 - Fixed - sku_drop_down_row_1 - - - 40 bucks - 40 - Percent - sku_drop_down_row_2 - - - - - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 40 bucks - 40 - Percent - sku_drop_down_row_2 - - - - - - - - custom option item %isolation% - Yes - Text/Field - - 10 - Fixed - sku_item_option_%isolation% - 1024 - - - - custom option Area %isolation% - Yes - Text/Area - - 10 - Fixed - sku_area_row_%isolation% - 10 - - - - custom option File %isolation% - No - File/File - - 10 - Fixed - sku_file_row_%isolation% - jpg - 100 - 100 - - - - custom option Drop-down %isolation% - Yes - Select/Drop-down - - - 10 percent - 10 - Percent - sku_drop_down_row_1_%isolation% - - - 20 percent - 20 - Percent - sku_drop_down_row_2_%isolation% - - - 30 fixed - 30 - Fixed - sku_drop_down_row_3_%isolation% - - - - - custom option Radio Buttons %isolation% - Yes - Select/Radio Buttons - - - 20 percent - 20 - Fixed - sku_radio_buttons_row%isolation% - - - - - custom option Checkbox %isolation% - Yes - Select/Checkbox - - - 20 percent - 20 - Fixed - sku_checkbox_row%isolation% - - - - - custom option Multiple Select %isolation% - Yes - Select/Checkbox - - - 20 fixed - 20 - Fixed - sku_multiple_select_row%isolation% - - - - - custom option Date %isolation% - Yes - Date/Date - - 20 - Fixed - sku_date_row%isolation% - - - - custom option Date & Time %isolation% - Yes - Date/Date & Time - - 20 - Fixed - sku_multiple_select_row%isolation% - - - - custom option Time %isolation% - Yes - Date/Time - - 20 - Fixed - sku_time_row%isolation% - - - - - - - custom option drop down %isolation% - Yes - Select/Drop-down - - - 10 percent - 10 - Percent - sku_drop_down_row_1 - - - 20 percent - 20 - Percent - sku_drop_down_row_2 - - - - - custom option item %isolation% - Yes - Text/Field - - - 10 - Fixed - sku_item_option_%isolation% - 1024 - - - - - - - - custom option drop down %isolation% - Yes - Select/Drop-down - - - 30 bucks - 30 - Fixed - sku_drop_down_row_1 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml deleted file mode 100644 index 1984831ef1e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Fpt.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - 10 - All Websites [USD] - United States - * - - - - \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml deleted file mode 100644 index 49cca4c76e2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/GroupPriceOptions.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 90.00 - NOT LOGGED IN - - - - - - 90.99 - All Websites [USD] - General - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml deleted file mode 100644 index da56085eec9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/Price.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - 95 - - - 92 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml deleted file mode 100644 index cceefd01935..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductSimple/TierPriceOptions.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - 15.00 - 3 - ALL GROUPS - - - 24.00 - 15 - ALL GROUPS - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml deleted file mode 100644 index 3e7d47fea7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Test virtual product %isolation% - test_virtual_sku_%isolation% - - 100.00 - - - 10.0000 - In Stock - - Yes - test-virtual-product-%isolation% - - - main_website - - - - - - Virtual Product %isolation% - Description for default Virtual product with category - Short description for default Virtual product with category - Enabled - Catalog, Search - sku_virtual_product_%isolation% - - Taxable Goods - - - 100 - - Yes - - 10 - In Stock - - - order_default - - - - main_website - - - virtual-product-%isolation% - - - - Virtual Product %isolation% - Description for default Virtual product with category - Short description for default Virtual product with category - Enabled - Catalog, Search - sku_virtual_product_%isolation% - - Taxable Goods - - - 1000 - - Yes - - 10 - In Stock - - - order_default - - - - main_website - - - virtual-product-%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml deleted file mode 100644 index 1f6c496de92..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/CheckoutData.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - 3 - - 10 - 3 - 30 - - - - - 1 - - 100.00 - 100.00 - - - - - - - - attribute_key_0 - option_key_0 - - - - 2 - - 120.00 - 240.00 - - - - - 2 - - 10 - 3 - 20 - - - - - 4 - - 15 - 4 - 60 - - - - - 2 - - 90.00 - 180.00 - - - - - - - product_key_0 - 3 - - - product_key_1 - 1 - - - product_key_2 - 2 - - - - - 560 - 40 - 100 - - - 3 - 1 - 2 - - - 1680 - 40 - 200 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml deleted file mode 100644 index 0cbaf235d8d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/CatalogProductVirtual/Price.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - 100.00 - 90.00 - 100.00 - 90.00 - 126.00 - - - - - - 85 - - - 76 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml deleted file mode 100644 index 3179abc0da6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - catalog - 1 - Manual - manual - - - catalog - 1 - - 10 - - - catalog - 1 - - 10 - - - - - catalog - 1 - Automatic (equalize price ranges) - auto - - - - - cataloginventory - 1 - Yes - 1 - - - - - cataloginventory - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml deleted file mode 100644 index 5bc6fd8f863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/ConfigurableProduct.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - default - - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - - - main_website - - - Description for default Configurable product with category - Short description for default Configurable product with category - Yes - Use config - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - - - main_website - - - Description for default Configurable product with category - Short description for default Configurable product with category - Yes - In Cart - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - with_filterable_options - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with category - Short description for default Configurable product with category - - default - - - - main_website - - - - default_subcategory - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - with_out_of_stock_items - - - 100 - - 12 - - In Stock - - Enabled - Catalog, Search - Description for Configurable product with out of stock items - Short description for Configurable product with with out of stock items - - default - - - - main_website - - - - - - Configurable Product %isolation% - sku_configurable_product_%isolation% - configurable - - Taxable Goods - - configurable-product-%isolation% - - default - - - 100 - - 10 - 12 - - In Stock - - Enabled - Catalog, Search - Description for default Configurable product with special price - Short description for default Configurable product with special price - - default - - - - main_website - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml deleted file mode 100644 index f33670ae9a3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - Test grouped product %isolation% - test_grouped_sku_%isolation% - - Taxable Goods - - 12.0000 - - 10.0000 - In Stock - - Enabled - - defaultSimpleProducts - - test-grouped-product-%isolation% - - - - Grouped product %isolation% - grouped_product_%isolation% - Catalog, Search - Enabled - - three_simple_products - - - Taxable Goods - - test-grouped-product-%isolation% - 12.0000 - This is description for grouped product with three simple products - This is short description for grouped product with three simple products - - 10.0000 - In Stock - - - - main_website - - - - default - - - three_simple_products - - - default_subcategory - - - - - Grouped product %isolation% - grouped_product_%isolation% - Catalog, Search - Enabled - - three_simple_products - - - Taxable Goods - - test-grouped-product-%isolation% - 12.0000 - This is description for grouped product with three simple products - This is short description for grouped product with three simple products - - 10.0000 - In Stock - - - - main_website - - - - default - - - three_simple_products - - - - - Test grouped product with price %isolation% - sku_test_grouped_product_with_price_%isolation% - Catalog, Search - Enabled - This is description for grouped product with price - This is short description for grouped product with price - - - - starting-100 - - - defaultSimpleProducts - - - Taxable Goods - - test-grouped-product-with-price%isolation% - 12.0000 - - 10.0000 - In Stock - - - - main_website - - - - default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml deleted file mode 100644 index b1f58571aa2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Associated.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - 3 - - - 2 - - - catalogProductSimple::default, - catalogProductSimple::100_dollar_product - - - - - - - 2 - - - 4 - - - - catalogProductSimple::product_with_special_price_and_category,catalogProductSimple::product_with_special_price_and_category - - - - - - - 3 - - - 4 - - - catalogProductSimple::simple_with_group_price, - catalogProductSimple::simple_with_group_price - - - - - - - 4 - - - 3 - - - catalogProductSimple::simple_with_tier_price, - catalogProductSimple::simple_with_tier_price - - - - - - - 4 - - - 2 - - - catalogProductVirtual::order_default, - catalogProductVirtual::order_default - - - - - - - 17 - - - 36 - - - 20 - - - catalogProductSimple::grouped_default, - catalogProductSimple::grouped_default,catalogProductSimple::100_dollar_product - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml deleted file mode 100644 index 5636f8d3a1c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/CheckoutData.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - product_key_0 - 3 - - - product_key_1 - 1 - - - product_key_2 - 2 - - - - - 100 - 100 - 100 - - - 3 - 1 - 2 - - - 300 - 100 - 200 - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml deleted file mode 100644 index dd23c857863..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/Repository/GroupedProduct/Price.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - 100.00 - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php deleted file mode 100644 index f27bb4808f5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.php +++ /dev/null @@ -1,71 +0,0 @@ -Categories->Manage Categories. - * 3. Select parent category. - * 4. Click on 'Add Category' button. - * 5. Fill out all data according to data set. - * 6. Save category. - * 7. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-6712 - */ -class CreateCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Inject page. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - } - - /** - * Create category. - * - * @param CatalogCategory $category - * @param string $addCategory - * @return void - */ - public function test(CatalogCategory $category, $addCategory) - { - // Steps - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category, false); - $this->catalogCategoryIndex->getTreeCategories()->$addCategory(); - $this->catalogCategoryIndex->getCategoryForm()->fill($category); - $this->catalogCategoryIndex->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml deleted file mode 100644 index e51312fade8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml +++ /dev/null @@ -1,178 +0,0 @@ - - - - - - addRootCategory - - - RootCategory%isolation% - - - Yes - RootCategory Required - - - - - - - - - - - No - Best Value - Name - Price - - - - - - - main:ce - - - - - addRootCategory - - - RootCategory%isolation% - - - Yes - RootCategory All Fields - RootCategory Page Title - Yes - Static block and products - Yes - No - Best Value - Name - Price - No - Name - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Subcategory Required - - - - - - - - - - - Yes - - - - - - - - - - - - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Subcategory For Anchor Subcategory - - - Yes - - - - - No - Yes - - - - - - - Yes - - - catalogProductSimple::default,catalogProductSimple::default - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Anchor Subcategory All Fields - Subcategory Page Title - Yes - Products only - Yes - No - Best Value - Name - Price - No - Price - catalogProductSimple::default,catalogProductSimple::default - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Not active category - - - Yes - - - - - - - Yes - - - - - - - Yes - - - - - - - - - addSubcategory - default_category - Subcategory%isolation% - subcategory%isolation% - Yes - Not included in menu - - - No - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php deleted file mode 100644 index 4e17cbc6118..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.php +++ /dev/null @@ -1,72 +0,0 @@ - Categories -> Manage Categories. - * 3. Open category created in preconditions. - * 4. Click 'Delete' button. - * 5. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-7330 - */ -class DeleteCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Injection page. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - } - - /** - * Delete category. - * - * @param CatalogCategory $category - * @return void - */ - public function test(CatalogCategory $category) - { - // Preconditions: - $category->persist(); - - // Steps: - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category); - $this->catalogCategoryIndex->getFormPageActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml deleted file mode 100644 index ac8d945e344..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/DeleteCategoryEntityTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - root_category - - - - - default_subcategory - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php deleted file mode 100644 index da207606a0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.php +++ /dev/null @@ -1,194 +0,0 @@ -Categories->Manage Categories. - * 3. Open category created in preconditions. - * 4. Update data according to data set. - * 5. Save category. - * 6. Perform all assertions. - * - * @group Category_Management_(MX) - * @ZephyrId MPERF-7032 - */ -class UpdateCategoryEntityTest extends Injectable -{ - /** - * Catalog category index page. - * - * @var CatalogCategoryIndex - */ - protected $catalogCategoryIndex; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Array unassigned products. - * - * @var array - */ - protected $unassignedProducts = []; - - /** - * Unassigned category products keys. - * - * @var mixed - */ - protected $unassignedProductsKeys; - - /** - * Injection data. - * - * @param CatalogCategoryIndex $catalogCategoryIndex - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __inject(CatalogCategoryIndex $catalogCategoryIndex, FixtureFactory $fixtureFactory) - { - $this->catalogCategoryIndex = $catalogCategoryIndex; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Update category. - * - * @param CatalogCategory $category - * @param CatalogCategory $initialCategory - * @param string $unassignedProductsKeys [optional] - * @return array - */ - public function test(CatalogCategory $category, CatalogCategory $initialCategory, $unassignedProductsKeys = '') - { - $this->unassignedProductsKeys = $unassignedProductsKeys; - $initialCategory->persist(); - $this->catalogCategoryIndex->open(); - $this->catalogCategoryIndex->getTreeCategories()->selectCategory($initialCategory); - $category = $this->updateCategoryFixture($initialCategory, $category); - $this->catalogCategoryIndex->getCategoryForm()->fill($category); - $this->catalogCategoryIndex->getFormPageActions()->save(); - - return ['category' => $category, 'unassignedProducts' => $this->unassignedProducts]; - } - - /** - * Update category fixture. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return CatalogCategory - */ - protected function updateCategoryFixture(CatalogCategory $initialCategory, CatalogCategory $category) - { - $categoryData = $this->prepareCategoryData($initialCategory, $category); - return $this->fixtureFactory->createByCode( - 'catalogCategory', - ['data' => $categoryData] - ); - } - - /** - * Prepare category date. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareCategoryData(CatalogCategory $initialCategory, CatalogCategory $category) - { - $categoryData = array_merge($initialCategory->getData(), $category->getData()); - if (isset($categoryData['category_products'])) { - $categoryData['category_products'] = $this->prepareCategoryProducts($initialCategory, $category); - } - $categoryData['parent_id'] = $this->prepareParentCategory($initialCategory, $category); - unset($categoryData['path']); - - return $categoryData; - } - - /** - * Prepare category products. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareCategoryProducts(CatalogCategory $initialCategory, CatalogCategory $category) - { - $data = []; - $initialCategoryProducts = $this->getCategoryProducts($initialCategory); - $categoryProducts = $this->getCategoryProducts($category); - if ($this->unassignedProductsKeys !== '') { - $this->unassignedProductsKeys = explode(',', $this->unassignedProductsKeys); - foreach ($this->unassignedProductsKeys as $key) { - $key = trim($key); - $this->unassignedProducts[] = $initialCategoryProducts[$key]; - unset($initialCategoryProducts[$key]); - } - } - $resultProducts = array_merge($initialCategoryProducts, $categoryProducts); - foreach ($resultProducts as $product) { - $data[] = $product->getSku(); - } - - return ['data' => $data, 'products' => $resultProducts]; - } - - /** - * Get category products. - * - * @param CatalogCategory $category - * @return array - */ - protected function getCategoryProducts(CatalogCategory $category) - { - return $category->hasData('category_products') - ? $category->getDataFieldConfig('category_products')['source']->getProducts() - : []; - } - - /** - * Prepare parent category data. - * - * @param CatalogCategory $initialCategory - * @param CatalogCategory $category - * @return array - */ - protected function prepareParentCategory(CatalogCategory $initialCategory, CatalogCategory $category) - { - $category = $category->hasData('parent_id') ? $category : $initialCategory; - return [ - 'data' => $category->getParentId(), - 'parent_category' => $category->getDataFieldConfig('parent_id')['source']->getParentCategory() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml deleted file mode 100644 index b71386ada6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Update category name, url_key, include_in_menu fields. - subcategory_with_assigned_products - Name%isolation% - Yes - updated-url-key%isolation% - Yes - Yes - No - Name - - - - - - - Update category description, name, url_key, available_product_listing_config, available_sort_by fields. - subcategory_with_assigned_products - Name%isolation% - Yes - updated-url-key%isolation% - Category Description - Category Title - Yes - No - Name - Price - No - Name - - - - - - - Update category to inactive. - Name%isolation% - No - - - - - Unasigned products from category. - subcategory_with_assigned_products - Name%isolation% - 0,2 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php deleted file mode 100644 index 47a84817759..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.php +++ /dev/null @@ -1,129 +0,0 @@ -category = $fixtureFactory->createByCode('catalogCategory', ['dataset' => 'anchor_category']); - $this->category->persist(); - - return ['category' => $this->category]; - } - - /** - * Run filter product list test. - * - * @param string $products - * @return array - */ - public function test($products) - { - // Precondition - $this->setupConfigData(); - return $this->createProducts($products); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products, 'data' => $this->prepareProductsData($products)] - )->run(); - } - - /** - * Prepare products data. - * - * @param string $products - * @return array - */ - protected function prepareProductsData($products) - { - $resultData = []; - $productsCount = substr_count($products, ','); - for ($i = 0; $i <= $productsCount; $i++) { - $resultData[] = ['category_ids' => ['category' => $this->category]]; - } - - return $resultData; - } - - /** - * Setup configuration. - * - * @param bool $rollback [optional] - * @return void - */ - protected function setupConfigData($rollback = false) - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'manual_layered_navigation_mysql', 'rollback' => $rollback] - )->run(); - } - - /** - * Rollback configuration after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'manual_layered_navigation_mysql', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml deleted file mode 100644 index bda548e1028..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Layer/FilterProductListTest.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - Filter by price - downloadableProduct::with_two_separately_links,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $20.00 - 0 - main:ce - - - - Filter by price - catalogProductSimple::order_default,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $50.00 - 1 - - - - Filter by price - groupedProduct::three_simple_products_without_category,catalogProductSimple::50_dollar_product,catalogProductSimple::50_dollar_product - $100.00 - 0 - - - - Filter by price - bundleProduct::bundle_fixed_product,catalogProductSimple::50_dollar_product,catalogProductVirtual::order_default - $760.00 - 0 - - - - Filter by price - catalogProductSimple::order_default,catalogProductVirtual::order_default_expensive,catalogProductVirtual::order_default - $1,000.00 - 1 - - - - Filter by configurable attribute - catalogProductSimple::order_default,catalogProductVirtual::order_default,configurableProduct::with_filterable_options - attribute_key_0::option_key_0 - 2 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php deleted file mode 100644 index 2359e211eef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractAddAppurtenantProductsEntityTest.php +++ /dev/null @@ -1,111 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * Inject data. - * - * @param CatalogProduct $catalogProductIndex - * @param CatalogProductNew $catalogProductNew - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndex, CatalogProductNew $catalogProductNew) - { - $this->catalogProductIndex = $catalogProductIndex; - $this->catalogProductNew = $catalogProductNew; - } - - /** - * Get product by data. - * - * @param string $productData - * @param array $relatedProductsData - * @return InjectableFixture - */ - protected function getProductByData($productData, array $relatedProductsData) - { - list($fixtureName, $dataset) = explode('::', $productData); - $relatedProductsPresets = []; - foreach ($relatedProductsData as $type => $presets) { - $relatedProductsPresets[$type]['presets'] = $presets; - } - - return $this->fixtureFactory->createByCode( - $fixtureName, - [ - 'dataset' => $dataset, - 'data' => $relatedProductsPresets - ] - ); - } - - /** - * Create and save product. - * - * @param InjectableFixture $product - * @return void - */ - protected function createAndSaveProduct(InjectableFixture $product) - { - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php deleted file mode 100644 index 52d0a36665e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractProductsCompareTest.php +++ /dev/null @@ -1,179 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->browser = $browser; - $this->assertProductCompareSuccessAddMessage = $assertProductCompareSuccessAddMessage; - $customer->persist(); - $this->customer = $customer; - } - - /** - * Injection data. - * - * @param CmsIndex $cmsIndex - * @param CatalogProductView $catalogProductView - * @param CustomerAccountLogin $customerAccountLogin - * @return void - */ - public function __inject( - CmsIndex $cmsIndex, - CatalogProductView $catalogProductView, - CustomerAccountLogin $customerAccountLogin - ) { - $this->cmsIndex = $cmsIndex; - $this->catalogProductView = $catalogProductView; - $this->customerAccountLogin = $customerAccountLogin; - } - - /** - * Login customer. - * - * @return void - */ - protected function loginCustomer() - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $this->customer] - )->run(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - $products = $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run(); - - return $products['products']; - } - - /** - * Add product to compare list. - * - * @param InjectableFixture $product - * @return void - */ - protected function addProduct(InjectableFixture $product) - { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->clickAddToCompare(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php deleted file mode 100644 index ca8788ba5f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AbstractPromoteAppurtenantProductsEntityTest.php +++ /dev/null @@ -1,177 +0,0 @@ -fixtureFactory = $fixtureFactory; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductEdit $editProductPage) - { - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - } - - /** - * Run test promote cross sell products entity. - * - * @param string $products - * @param array $appurtenantProductsData - * @return array - */ - public function test($products, array $appurtenantProductsData) - { - $editProduct = null; - $productsDataResult = []; - $createdProducts = $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - foreach ($appurtenantProductsData as $productData) { - $appurtenant = $this->prepareAppurtenantProducts($createdProducts, $productData, $this->appurtenantType); - $editProduct = $createdProducts[$productData['productIndex']]; - if ($appurtenant !== false) { - $this->addAppurtenantProducts($editProduct, $appurtenant); - $productsDataResult[] = ['product' => $editProduct, $this->appurtenantType['arrayIndex'] => $appurtenant]; - } else { - $productsDataResult[] = ['product' => $editProduct]; - } - } - - return ['productsData' => $productsDataResult]; - } - - /** - * Get appurtenant products. - * - * @param array $createdProducts - * @param string $appurtenantProductsIndex - * @return array|bool - */ - protected function prepareAppurtenantProducts( - array $createdProducts, - $appurtenantProductsIndex - ) { - if (isset($appurtenantProductsIndex[$this->appurtenantType['arrayIndex']])) { - $appurtenantIndex = explode(',', $appurtenantProductsIndex[$this->appurtenantType['arrayIndex']]); - $result = []; - foreach ($appurtenantIndex as $index) { - $result[$this->appurtenantType['formIndex']]['value'][] = $createdProducts[$index]; - } - return $result; - } else { - return false; - } - } - - /** - * Add appurtenant products and save product. - * - * @param InjectableFixture $product - * @param array $appurtenantData - * @return void - */ - protected function addAppurtenantProducts( - InjectableFixture $product, - array $appurtenantData - ) { - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $form = $this->editProductPage->getProductForm(); - $form->openTab($this->tabName); - $appurtenantTab = $form->getTabElement($this->tabName); - $appurtenantData[$this->appurtenantType['formIndex']]['value'] = $this->prepareData( - $appurtenantData[$this->appurtenantType['formIndex']]['value'] - ); - $appurtenantTab->fillFormTab($appurtenantData); - $this->editProductPage->getFormPageActions()->save(); - } - - /** - * Prepare data. - * - * @param array $appurtenantProducts - * @return array - */ - protected function prepareData(array $appurtenantProducts) - { - $data = []; - foreach ($appurtenantProducts as $product) { - $data[] = $product->getData(); - } - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php deleted file mode 100644 index 8268693a4d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.php +++ /dev/null @@ -1,52 +0,0 @@ - Catalog. - * 3. Click Add new product. - * 4. Fill data from dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Cross-sells_(MX) - * @ZephyrId MPERF-6832 - */ -class AddCrossSellProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add cross sell products entity. - * - * @param string $productData - * @param string $crossSellProductsData - * @return array - */ - public function test($productData, $crossSellProductsData) - { - $product = $this->getProductByData($productData, ['cross_sell_products' => $crossSellProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'crossSellProducts' => $product->getDataFieldConfig('cross_sell_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml deleted file mode 100644 index 40a47ced56d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddCrossSellProductsEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php deleted file mode 100644 index d43dc80e098..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.php +++ /dev/null @@ -1,89 +0,0 @@ -catalogProductCompare = $catalogProductCompare; - $this->cmsIndex->open(); - if ($isCustomerLoggedIn === 'Yes') { - $this->loginCustomer($this->customer); - } - $this->products = $this->createProducts($products); - foreach ($this->products as $itemProduct) { - $this->addProduct($itemProduct); - $this->assertProductCompareSuccessAddMessage->processAssert($this->catalogProductView, $itemProduct); - } - - return ['products' => $this->products]; - } - - /** - * Clear compare list after test variation. - * - * @return void - */ - public function tearDown() - { - $this->cmsIndex->open(); - $this->cmsIndex->getCompareBlock()->clickClearAll(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml deleted file mode 100644 index d4018df4774..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddProductsToCompareTest.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - catalogProductSimple::simple_for_composite_products - No - - - - - - catalogProductSimple::simple_for_composite_products,bundleProduct::bundle_dynamic_product - No - - - - - - configurableProduct::default - Yes - - - - - - catalogProductSimple::simple_for_composite_products,catalogProductVirtual::order_default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product - Yes - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php deleted file mode 100644 index b7388e08eff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.php +++ /dev/null @@ -1,53 +0,0 @@ - Catalog. - * 3. Press "Add product" button. - * 4. Fill data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Related_Products_(MX) - * @ZephyrId MPERF-6822 - */ -class AddRelatedProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add related products. - * - * @param string $productData - * @param string $relatedProductsData - * @return array - */ - public function test($productData, $relatedProductsData) - { - $product = $this->getProductByData($productData, ['related_products' => $relatedProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'relatedProducts' => $product->getDataFieldConfig('related_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml deleted file mode 100644 index 4eab70970e5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddRelatedProductsEntityTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php deleted file mode 100644 index f036a98fe51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.php +++ /dev/null @@ -1,53 +0,0 @@ - Catalog. - * 3. Press "Add product" button. - * 4. Fill data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-6834 - */ -class AddUpSellProductsEntityTest extends AbstractAddAppurtenantProductsEntityTest -{ - /** - * Run test add up sell products. - * - * @param string $productData - * @param string $upSellProductsData - * @return array - */ - public function test($productData, $upSellProductsData) - { - $product = $this->getProductByData($productData, ['up_sell_products' => $upSellProductsData]); - $this->createAndSaveProduct($product); - - return [ - 'product' => $product, - 'upSellProducts' => $product->getDataFieldConfig('up_sell_products')['source']->getProducts() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml deleted file mode 100644 index 5b63e721632..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/AddUpSellProductsEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - catalogProductSimple::default - catalogProductSimple::default, catalogProductSimple::default - - - - - - - catalogProductSimple::default - catalogProductSimple::default, configurableProduct::default - - - - - - - configurableProduct::default - catalogProductSimple::default, configurableProduct::default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php deleted file mode 100644 index e455552d59e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.php +++ /dev/null @@ -1,108 +0,0 @@ -createByCode('catalogCategory', ['dataset' => 'default_subcategory']); - $category->persist(); - - return ['category' => $category]; - } - - /** - * Run Apply MAP test. - * - * @param CatalogCategory $category - * @param string $products - * @param string $configData - * @return array - */ - public function test(CatalogCategory $category, $products, $configData) - { - // Preconditions: - // Creating products: - $products = $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductsStep', - [ - 'products' => $products, - 'data' => $this->prepareProductData($category, $products) - ] - )->run()['products']; - - // Setup configuration: - $this->objectManager->create('Mage\Core\Test\TestStep\SetupConfigurationStep',['configData' => $configData]) - ->run(); - - return ['products' => $products, 'category' => $category]; - } - - /** - * Prepare products data for persist. - * - * @param CatalogCategory $category - * @param $products - * @return array - */ - protected function prepareProductData(CatalogCategory $category, $products) - { - $data = []; - $productsCount = count(explode(',', $products)); - while ($productsCount > 0) { - $data[] = ['category_ids' => ['category' => $category]]; - $productsCount--; - } - - return $data; - } - - /** - * Rollback configuration after test variation. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml deleted file mode 100644 index 6be4fb7b57f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ApplyMapTest.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - Apply MAP on gesture in config. Products use config. - catalogProductSimple::product_with_map_use_config - enable_map_on_gesture - - - - Apply MAP in cart in config. Products use config. - catalogProductSimple::product_with_map_use_config - enable_map_in_cart - - - - Apply MAP before order in config. Products use config. - catalogProductSimple::product_with_map_use_config - default_frontend - customer_US - enable_map_before_order - - - - Apply MAP on gesture in config. Products use MAP in cart. - catalogProductSimple::product_with_map_in_cart - enable_map_on_gesture - - - - Apply MAP on gesture in config. Products use config. - catalogProductSimple::product_with_map_use_config, configurableProduct::default_with_map_use_config - enable_map_on_gesture - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php deleted file mode 100644 index 0f086743a50..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.php +++ /dev/null @@ -1,63 +0,0 @@ -persist(); - $this->products = $this->createProducts($products); - - //Steps - $this->cmsIndex->open(); - $this->loginCustomer($this->customer); - foreach ($this->products as $itemProduct) { - $this->addProduct($itemProduct); - $this->assertProductCompareSuccessAddMessage->processAssert($this->catalogProductView, $itemProduct); - } - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink("My Account"); - $customerAccountIndex->getCompareBlock()->clickClearAll(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml deleted file mode 100644 index da55c20ba28..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/ClearAllCompareProductsTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - compare_products - catalogProductSimple::simple_for_composite_products,catalogProductVirtual::order_default,downloadableProduct::default,groupedProduct::grouped_product_with_price,configurableProduct::default,bundleProduct::bundle_dynamic_product,bundleProduct::bundle_fixed_product - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php deleted file mode 100644 index cf8d39780b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.php +++ /dev/null @@ -1,101 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select Configurable Product and Attribute set. - * 5. Select attribute. - * 6. Fill in data according to data sets. - * 7. Save product. - * 8. Perform all assertions. - * - * @group Configurable_Product_(MX) - * @ZephyrId MPERF-6685 - */ -class CreateConfigurableProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productIndex; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $productNew; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productIndex - * @param CatalogProductNew $productNew - * @return void - */ - public function __inject(CatalogProduct $productIndex, CatalogProductNew $productNew) - { - $this->productIndex = $productIndex; - $this->productNew = $productNew; - } - - /** - * Test create catalog Configurable product run. - * - * @param ConfigurableProduct $product - * @param CatalogCategory $category - * @return array - */ - public function test(ConfigurableProduct $product, CatalogCategory $category) - { - // Steps - $this->productIndex->open(); - $this->productIndex->getGridPageActionBlock()->addNew(); - $this->productNew->getProductForm()->fill($product, null, $category); - $this->productNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml deleted file mode 100644 index 729204b37f4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateConfigurableProductEntityTest.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - Create Simplified configurable product - default - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 100 - Default configurable product - Simplified configurable product - 2 - In Stock - default - main:ce - - - - - - - - Create configurable product with special price - default - 52 - 104 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 101 - Configurable product with special price - Configurable product with special price - 3 - In Stock - default - 10 - - - - - - - - Create configurable product with group price - default - 148 - 296 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 102 - Configurable product with group price - Configurable product with group price - 4 - In Stock - default - for_not_logged_users - - - - - - - - Create configurable product with tier price - default - 58 - 232 - 4 - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 103 - Configurable product with tier price - Configurable product with tier price - 5 - In Stock - default - for_all_groups - with_tier_price - - - - - - - - Create configurable product with custom options - with_custom_options - Enabled - Configurable Product %isolation% - configurable_sku_%isolation% - configurable-product-%isolation% - Taxable Goods - 104 - Configurable product with custom options - Configurable product with custom options - 6 - In Stock - default - drop_down_with_two_options - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php deleted file mode 100644 index 5511b0a89ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.php +++ /dev/null @@ -1,102 +0,0 @@ - Manage Products. - * 3. Click "Add Product" button. - * 4. Select "Grouped Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform all assertions. - * - * @group Products_(CS) - * @ZephyrId MPERF-6919 - */ -class CreateGroupedProductEntityTest extends Injectable -{ - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Create category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Test create grouped product. - * - * @param GroupedProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(GroupedProduct $product, CatalogCategory $category) - { - //Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml deleted file mode 100644 index 9febe32d05f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateGroupedProductEntityTest.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - Create default grouped product with assigned simple products - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - main:ce - - - - - - Create out of stock grouped product - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - Out of Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - Create grouped product with assigned product special price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_specialPrice - This is short description for grouped product - - - - - - Create grouped product with assigned product group price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_groupPrice - This is short description for grouped product - - - - - - Create default grouped product with assigned virtual products - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultVirtualProducts - This is short description for grouped product - - - - - Create grouped product with assigned product (tier price) - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - - - In Stock - This is description for grouped product - defaultSimpleProduct_with_tierPrice - This is short description for grouped product - - - - - - Create grouped product visible in catalog only - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - Catalog - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - - - Create grouped product visible in search only - GroupedProduct %isolation% - GroupedProduct_sku%isolation% - grouped-product%isolation% - Enabled - Search - In Stock - This is description for grouped product - defaultSimpleProducts - This is short description for grouped product - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php deleted file mode 100644 index 10fa8aff6b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.php +++ /dev/null @@ -1,117 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select "Simple Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform appropriate assertions. - * - * @group Products_(CS) - * @ZephyrId MPERF-6559 - */ -class CreateSimpleProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection data. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Run create product simple entity test. - * - * @param CatalogProductSimple $product - * @param CatalogCategory $category - * @param string $configData - * @return void - */ - public function test(CatalogProductSimple $product, CatalogCategory $category, $configData) - { - // Preconditions - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $configData] - )->run(); - - // Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml deleted file mode 100644 index e8aa851ad0a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml +++ /dev/null @@ -1,289 +0,0 @@ - - - - - - Create Simple default product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10000 - - - Enabled - Short description for Default Simple product - Description for Default Simple product - 50 - 657 - In Stock - Catalog, Search - - - main:ce - - - - - - - - - - Create Simple product with Tier price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 300 - - - Enabled - Short description for Simple Product with Tier price - Description for Simple Product with Tier price - 51 - 658 - In Stock - with_tier_price - with_tier_price - for_all_groups - - - - - - - - - - - - Create Simple product with Special price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10001 - 90 - Enabled - Short description for Simple Product with Special price - Description for Simple Product with Special price - 51 - 658 - In Stock - with_special_price - with_special_price - - - - - - - - - - - - Create Simple product with Group price - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10002 - - - Enabled - Short description for Simple Product with Group price - Description for Simple Product with Group price - 52 - 659 - In Stock - with_group_price - with_group_price - for_not_logged_users - - - - - - - - - - - - - - Create Out of Stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10003 - - - Enabled - Short description for Out of Stock Simple Product - Description for Out of Stock Simple Product - 53 - - - Out of Stock - - - - - - - - - - - - Create Simple product with Custom options - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product with Custom options - Description for Simple Product with Custom options - 54 - 661 - In Stock - drop_down_with_two_options - with_one_custom_option - - - - - - - - - - - Create Simple product visibility in Catalog only - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product visibility in Catalog only - Description for Simple Product visibility in Catalog only - 54 - 661 - In Stock - Catalog - - - - - - - - - - Create Simple product visibility in Search only - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10004 - Enabled - Short description for Simple Product visibility in Search only - Description for Simple Product visibility in Search only - 54 - 661 - In Stock - Search - - - - - - - - - - Create Simple product with Tier price and Custom options - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 300 - Enabled - Short description for Simple Product with Tier price and Custom options - Description for Simple Product with Tier price and Custom options - 51 - 658 - In Stock - drop_down_with_two_options - with_tier_price - for_all_groups - - - - - - - Create Simple product with Special price larger than actual - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 101 - 102 - Enabled - Short description for Simple Product with Special price - Description for Simple Product with Special price - 51 - 658 - In Stock - - - - - - Create out of stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10000 - Enabled - Short description for out of stock Simple product - Description for out of stock Simple product - 50 - 657 - Out of Stock - Catalog, Search - - - - - - - - - - - Create Out of Stock Simple product - Simple Product %isolation% - simple_sku_%isolation% - simple-sku-%isolation% - Taxable Goods - 10003 - Enabled - Short description for Out of Stock Simple Product - Description for Out of Stock Simple Product - 53 - - - Out of Stock - display_out_of_stock_products - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php deleted file mode 100644 index 3de9e53aeb1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.php +++ /dev/null @@ -1,96 +0,0 @@ - Manage Products. - * 3. Click "Add Product". - * 4. Select "Virtual Product" in product type field and click "Continue". - * 5. Fill in data according to attached data set. - * 6. Save Product. - * 7. Perform appropriate assertions. - * - * @group Virtual_Product_(CS) - * @ZephyrId MPERF-6740 - */ -class CreateVirtualProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to create a product. - * - * @var CatalogProductNew - */ - protected $newProductPage; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductNew $newProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductNew $newProductPage) - { - $this->productGrid = $productGrid; - $this->newProductPage = $newProductPage; - } - - /** - * Run create product virtual entity test. - * - * @param CatalogProductVirtual $product - * @param CatalogCategory $category - * @return void - */ - public function test(CatalogProductVirtual $product, CatalogCategory $category) - { - // Steps - $this->productGrid->open(); - $this->productGrid->getGridPageActionBlock()->addNew(); - $this->newProductPage->getProductForm()->fill($product, null, $category); - $this->newProductPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml deleted file mode 100644 index f771f21f693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/CreateVirtualProductEntityTest.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - Create default virtual product - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for Default virtual product - Short description for Default virtual product - 10 - - - Taxable Goods - - - - - - - - - - - 12 - In Stock - - - - - default - main:ce - - - - - - - Create virtual product with none tax class - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with none tax class - Short description for virtual product with none tax class - 10 - - - None - - - - - - - No - Yes - 999 - In Stock - - - Catalog, Search - - - - - - - - - Create out of stock virtual product - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for out of stock virtual product - Short description for out of stock virtual product - 10 - default - Taxable Goods - - - - - - - - - - - 999 - Out of Stock - - - Search - - - - - - - - Create virtual product with grouped price - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with grouped price - Short description for virtual product with grouped price - 100 - - - Taxable Goods - for_not_logged_users - - - - - - - - - 123 - In Stock - - - Catalog - with_grouped_price - - - - - - - - Create virtual product with custom options - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with custom options - Short description for virtual product with custom options - 90.00 - - - Taxable Goods - - - - - - - - - - - 123 - In Stock - drop_down_with_two_options - - - with_one_custom_option - - - - - - - - Create virtual product with special perice - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with special perice - Short description for virtual product with special perice - 1000 - default - Taxable Goods - - - - - 10 - No - No - - - - - with_special_price - - - - - - - Create virtual product with tier perice - VirtualProduct %isolation% - virtual_sku_%isolation% - virtual-sku-%isolation% - Enabled - Description for virtual product with tier perice - Short description for virtual product with tier perice - 100 - with_tier_price - Taxable Goods - - - for_all_groups - - - - - - - 999 - In Stock - - - - - with_tier_price - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php deleted file mode 100644 index 53ee7c08576..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.php +++ /dev/null @@ -1,125 +0,0 @@ - Manege Products. - * 3. Select products created in preconditions. - * 4. Select delete from mass-action. - * 5. Submit form. - * 6. Perform all asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7327 - */ -class DeleteProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - $this->category = $category; - - return ['category' => $category]; - } - - /** - * Injection data. - * - * @param CatalogProduct $catalogProductIndexPage - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndexPage) - { - $this->catalogProductIndex = $catalogProductIndexPage; - } - - /** - * Run delete product test. - * - * @param string $products - * @return array - */ - public function test($products) - { - //Preconditions - $products = $this->createProducts($products); - $deleteProducts = $this->prepareFilter($products); - //Steps - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getProductGrid()->massaction($deleteProducts, 'Delete', true); - - return ['products' => $products]; - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products, 'data' => ['category_ids' => ['category' => $this->category]]] - )->run()['products']; - } - - /** - * Prepare filter. - * - * @param array $products - * @return array - */ - protected function prepareFilter(array $products) - { - $deleteProducts = []; - foreach ($products as $product) { - $deleteProducts[] = ['sku' => $product->getSku()]; - } - - return $deleteProducts; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml deleted file mode 100644 index 5d4c6c4ca4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DeleteProductEntityTest.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - catalogProductSimple::default - main:ce - - - - - - catalogProductVirtual::order_default - - - - - - configurableProduct::default - - - - - - groupedProduct::default - - - - - - catalogProductSimple::default,catalogProductVirtual::order_default - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php deleted file mode 100644 index 0ac0eaf473b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.php +++ /dev/null @@ -1,134 +0,0 @@ - Manage Products. - * 3. Search and open product. - * 4. Click "Duplicate". - * 5. Perform asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7489 - */ -class DuplicateProductEntityTest extends Injectable -{ - /** - * Category fixture. - * - * @var CatalogCategory - */ - protected $category; - - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to update a product. - * - * @var CatalogProductEdit - */ - protected $editProductPage; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare data. - * - * @param CatalogCategory $category - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare( - CatalogCategory $category, - CatalogProduct $productGrid, - CatalogProductEdit $editProductPage, - FixtureFactory $fixtureFactory - ) { - $this->category = $category; - $this->category->persist(); - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Run test duplicate product entity. - * - * @param string $productType - * @return array - */ - public function test($productType) - { - // Precondition - $product = $this->createProduct($productType); - - // Steps - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $product->getSku()]); - $this->editProductPage->getFormPageActions()->duplicate(); - - return ['product' => $product]; - } - - /** - * Creating a product according to the type of. - * - * @param string $productType - * @return InjectableFixture - */ - protected function createProduct($productType) - { - list($fixture, $dataset) = explode('::', $productType); - $product = $this->fixtureFactory->createByCode( - $fixture, - [ - 'dataset' => $dataset, - 'data' => [ - 'category_ids' => [ - 'category' => $this->category, - ], - ] - ] - ); - $product->persist(); - - return $product; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml deleted file mode 100644 index 6055aa77eb0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/DuplicateProductEntityTest.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - catalogProductSimple::default - main:ce - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php deleted file mode 100644 index 96771f1e5d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open config1 product. - * 4. For config1 add as cross-sells: simp1, simp2. - * 5. Save product. - * 6. Open simp1 product. - * 7. For simp1 add as cross-sells: config1, simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Cross-sells_(MX) - * @ZephyrId MPERF-7447 - */ -class PromoteProductsAsCrossSellsTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'crosssells'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'crossSellProducts', - 'formIndex' => 'cross_sell_products' - ]; - - /** - * Run test promote cross sell products entity. - * - * @param string $crossSellProducts - * @param array $crossSellProductsData - * @return array - */ - public function test($crossSellProducts, array $crossSellProductsData) - { - return parent::test($crossSellProducts, $crossSellProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml deleted file mode 100644 index 32353c12372..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsCrossSellsTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 0,2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php deleted file mode 100644 index 35750759f9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open simp1 product. - * 4. For simp1 add as related: config1, simp2. - * 5. Save product. - * 6. Open config1 product. - * 7. For config1 add as related: simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-7469 - */ -class PromoteProductsAsRelatedTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'related-products'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'relatedProducts', - 'formIndex' => 'related_products' - ]; - - /** - * Run test promote related products entity. - * - * @param string $relatedProducts - * @param array $relatedProductsData - * @return array - */ - public function test($relatedProducts, array $relatedProductsData) - { - return parent::test($relatedProducts, $relatedProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml deleted file mode 100644 index 582ba85e2a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsRelatedTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php deleted file mode 100644 index 8120fe565d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.php +++ /dev/null @@ -1,66 +0,0 @@ - Manage Products. - * 3. Open simp1 product. - * 4. For simp1 add as up-sells: config1, simp2. - * 5. Save product. - * 6. Open config1 product. - * 7. For config1 add as up-sells: simp2. - * 8. Save product. - * 9. Perform all assertions. - * - * @group Up-sells_(MX) - * @ZephyrId MPERF-7458 - */ -class PromoteProductsAsUpSellsTest extends AbstractPromoteAppurtenantProductsEntityTest -{ - /** - * Tab name. - * - * @var string - */ - protected $tabName = 'up-sells'; - - /** - * Appurtenant type. - * - * @var array - */ - protected $appurtenantType = [ - 'arrayIndex' => 'upSellProducts', - 'formIndex' => 'up_sell_products' - ]; - - /** - * Run test promote upSell products entity. - * - * @param string $upSellProducts - * @param array $upSellProductsData - * @return array - */ - public function test($upSellProducts, array $upSellProductsData) - { - return parent::test($upSellProducts, $upSellProductsData); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml deleted file mode 100644 index 68efbedf511..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/PromoteProductsAsUpSellsTest.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - 0 - 1,2 - - - 1 - 2 - - - 2 - - - catalogProductSimple::default, configurableProduct::default, catalogProductSimple::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php deleted file mode 100644 index f66b6693c4d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ - Manage Products. - * 3. Search and open configurable product from preconditions. - * 4. Fill in data according to dataset. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Configurable_Product_(MX) - * @ZephyrId MPERF-7439 - */ -class UpdateConfigurableProductEntityTest extends Scenario -{ - /** - * Update configurable product. - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml deleted file mode 100644 index 1ee95339fd2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateConfigurableProductEntityTest.xml +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - Delete one option and update one options. - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 166 - - - - - 1 - - - - 0 - 0 - - 123 - Fixed - - - - - - - - - - - - Add two options. - - - - - attribute_key_0 - option_key_1 - - - attribute_key_1 - option_key_1 - - - - 2 - - 209 - - - - - 1 - 2 - - - - 1 - - - - 11 - Fixed - - - - - 98 - Fixed - - - - catalogProductSimple::default - - - 2 - - - - 22 - Percentage - - - - - 31 - Percentage - - - - catalogProductSimple::default - - - - - - - - - - - Create new products(all types). - - - - - attribute_key_0 - option_key_0 - - - attribute_key_1 - option_key_0 - - - - 2 - - 633 - - - - - 0 - 1 - 2 - - - - quickCreation - - - createEmpty - - - copyFromConfigurable - - - - - - - - - - - Delete all option. - - - 0 - 1 - 2 - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php deleted file mode 100644 index 9cb282b2d86..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.php +++ /dev/null @@ -1,105 +0,0 @@ - Manage Products. - * 3. Select a product in the grid. - * 4. Edit test value(s) according to dataset. - * 5. Click "Save". - * 6. Perform asserts. - * - * @group Products_(MX) - * @ZephyrId MPERF-7051 - */ -class UpdateSimpleProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $productGrid; - - /** - * Page to update a product. - * - * @var CatalogProductEdit - */ - protected $editProductPage; - - /** - * Injection pages. - * - * @param CatalogProduct $productGrid - * @param CatalogProductEdit $editProductPage - * @return void - */ - public function __inject(CatalogProduct $productGrid, CatalogProductEdit $editProductPage) - { - $this->productGrid = $productGrid; - $this->editProductPage = $editProductPage; - } - - /** - * Run update product simple entity test. - * - * @param CatalogProductSimple $initialProduct - * @param CatalogProductSimple $product - * @return array - */ - public function test(CatalogProductSimple $initialProduct, CatalogProductSimple $product) - { - // Preconditions - $initialProduct->persist(); - - // Steps - $this->productGrid->open(); - $this->productGrid->getProductGrid()->searchAndOpen(['sku' => $initialProduct->getSku()]); - $this->editProductPage->getProductForm()->fill($product); - $this->editProductPage->getFormPageActions()->save(); - - return ['category' => $this->getCategory($initialProduct, $product)]; - } - - /** - * Get category. - * - * @param CatalogProductSimple $initialProduct - * @param CatalogProductSimple $product - * @return CatalogCategory|null - */ - protected function getCategory(CatalogProductSimple $initialProduct, CatalogProductSimple $product) - { - return $product->hasData('category_ids') - ? $product->getDataFieldConfig('category_ids')['source']->getProductCategory() - : ($initialProduct->hasData('category_ids') - ? $initialProduct->getDataFieldConfig('category_ids')['source']->getProductCategory() - : null); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml deleted file mode 100644 index e114feed8fa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/Product/UpdateSimpleProductEntityTest.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - Default update - - - Test simple product %isolation% - test_simple_product_%isolation% - 245.00 - 200 - - - test-simple-product-%isolation% - 120 - Catalog, Search - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - Update visibility to Not Visible Individually - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.00 - 123 - - - test-simple-product-%isolation% - 129 - Not Visible Individually - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - Update to only catalog searchable - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.01 - 125 - - - test-simple-product-%isolation% - 25 - Catalog - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - Update to only search searchable - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.02 - 89 - - - test-simple-product-%isolation% - 89 - Search - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - - Update to Out of Stock - - - Test simple product %isolation% - test_simple_product_%isolation% - 325.03 - 25 - Out of Stock - test-simple-product-%isolation% - 125 - - - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - - - - Update to status Disabled - - - Test simple product %isolation% - test_simple_product_%isolation% - 74.00 - 87 - - - test-simple-product-%isolation% - 333 - - - Disabled - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - Update category - default_subcategory - Test simple product %isolation% - test_simple_product_%isolation% - 74.00 - 87 - - - test-simple-product-%isolation% - 333 - - - - - Description for update simple product %isolation% - Short description for update simple product %isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php deleted file mode 100644 index 501c0df1f9e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.php +++ /dev/null @@ -1,103 +0,0 @@ - Attributes > Manage Attribute Sets. - * 3. Start to create new Attribute Set. - * 4. Fill out fields data according to data set. - * 5. Add created Product Attribute to Attribute Set. - * 6. Save new Attribute Set. - * 7. Verify created Attribute Set. - * - * @group Product_Attributes_(CS) - * @ZephyrId MPERF-6745 - */ -class CreateAttributeSetEntityTest extends Injectable -{ - /** - * Catalog Product Set page. - * - * @var CatalogProductSetIndex - */ - protected $productSetIndex; - - /** - * Catalog Product Set add page. - * - * @var CatalogProductSetAdd - */ - protected $productSetAdd; - - /** - * Catalog Product Set edit page. - * - * @var CatalogProductSetEdit - */ - protected $productSetEdit; - - /** - * Injection pages. - * - * @param CatalogProductSetIndex $productSetIndex - * @param CatalogProductSetAdd $productSetAdd - * @param CatalogProductSetEdit $productSetEdit - * @return void - */ - public function __inject( - CatalogProductSetIndex $productSetIndex, - CatalogProductSetAdd $productSetAdd, - CatalogProductSetEdit $productSetEdit - ) { - $this->productSetIndex = $productSetIndex; - $this->productSetAdd = $productSetAdd; - $this->productSetEdit = $productSetEdit; - } - - /** - * Run CreateAttributeSetEntity test. - * - * @param CatalogAttributeSet $attributeSet - * @param CatalogProductAttribute $productAttribute - * @return void - */ - public function test(CatalogAttributeSet $attributeSet, CatalogProductAttribute $productAttribute) - { - // Precondition - $productAttribute->persist(); - - // Steps: - $this->productSetIndex->open(); - $this->productSetIndex->getPageActionsBlock()->addNew(); - - $this->productSetAdd->getAttributeSetForm()->fill($attributeSet); - $this->productSetAdd->getPageActions()->save(); - $this->productSetEdit->getAttributeSetEditBlock()->moveAttribute($productAttribute->getData()); - $this->productSetEdit->getPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml deleted file mode 100644 index 284f35526ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateAttributeSetEntityTest.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - ProductTemplate%isolation% - default - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php deleted file mode 100644 index 7760138b1b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.php +++ /dev/null @@ -1,67 +0,0 @@ - Attributes > Manage Attributes. - * 3. Click 'Add New Attribute' button. - * 4. Fill out fields data according to data set. - * 5. Save Product Attribute. - * 6. Perform appropriate assertions. - * - * @group Product_Attributes_(CS) - * @ZephyrId MPERF-7278 - */ -class CreateProductAttributeEntityTest extends Scenario -{ - /** - * Run CreateProductAttributeEntity test. - * - * @param string $product - * @return array - */ - public function test($product) - { - $this->executeScenario(); - // Prepare data for asserts - return $this->createProduct($product, $this->localArguments['productTemplate']); - } - - /** - * Create product. - * - * @param string $product - * @param CatalogAttributeSet $attributeSet - * @return array - */ - protected function createProduct($product, CatalogAttributeSet $attributeSet) { - $stepArguments = [ - 'product' => $product, - 'data' => ['attribute_set_id' => ['attribute_set' => $attributeSet]] - ]; - - return $this->objectManager->create('Mage\Catalog\Test\TestStep\CreateProductStep', $stepArguments)->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml deleted file mode 100644 index 88d0aee8717..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_dropdown_%isolation% - Dropdown - default - Yes - attr_dropdown_%isolation% - Global - No - Yes - Yes - Yes - Filterable (with results) - Yes - Yes - Yes - Yes - Yes - - - - - - - - - - - - - - to_maintain:yes - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Text_Field_Admin_%isolation% - Text Field - No - attr_textfield_%isolation% - default_value_text%isolation% - Global - No - Yes - Yes - Yes - Yes - Yes - Yes - Yes - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_textarea_%isolation% - Text Area - Yes - attr_textarea_%isolation% - Store View - - - default_value_textarea%isolation% - No - Area_Field%isolation% - Yes - Yes - Yes - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Date_Admin_%isolation% - Date - No - attr_date_%isolation% - n/j/y - No - Date_Store_View - Yes - Yes - No - Yes - Yes - Yes - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Yes/No_Admin_%isolation% - Yes/No - Yes - attr_yesno_%isolation% - Global - No - Yes/No_Global - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_multiselect_%isolation% - Multiple Select - default - No - attr_multiselect_%isolation% - Website - Yes - Yes - Yes - Yes - Filterable (with results) - Yes - Yes - Yes - Yes - - - - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_price_%isolation% - Price - No - attr_price_%isolation% - 1000 - No - Price - Yes - Yes - No - Filterable (with results) - Yes - Yes - Yes - - - - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - attr_fpt_code_%isolation% - Fixed Product Tax - attr_fpt_code_%isolation% - Fixed_Product_Tax_Storeview - - - - - - custom_attribute_set_without_attributes - catalogProductSimple::product_with_anchor_category - Text_Field_Admin_%isolation% - Text Field - Yes - attr_textfield_%isolation% - Store View - default_value_text%isolation% - Yes - Text_Field%isolation% - Yes - Yes - Yes - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php deleted file mode 100644 index 5a23d986a04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductAttributeStep.php +++ /dev/null @@ -1,132 +0,0 @@ -attribute = $productAttribute; - $this->attributeNew = $attributeNew; - $this->attributeEdit = $attributeEdit; - $this->catalogProductAttributeIndex = $catalogProductAttributeIndex; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Fill attribute form on attribute new page. - * - * @return array - */ - public function run() - { - $this->catalogProductAttributeIndex->open(); - $this->catalogProductAttributeIndex->getPageActionsBlock()->addNew(); - - $this->attributeNew->getAttributeForm()->fill($this->attribute); - $this->attributeNew->getPageActions()->saveAndContinue(); - $this->prepareAttribute(); - - return ['attribute' => $this->attribute, 'templatesData' => ['attributes' => [$this->attribute]]]; - } - - /** - * Prepare attribute fixture. - * - * @return void - */ - protected function prepareAttribute() - { - $data = $this->attribute->getData(); - if (isset($data['options'])) { - $data['options'] = $this->prepareOptionsData($data['options']); - } - $data['attribute_id'] = $this->attributeEdit->getAttributeForm()->getAttributeId(); - $this->attribute = $this->fixtureFactory->createByCode('catalogProductAttribute', ['data' => $data]); - } - - /** - * Prepare options data. - * - * @param array $optionsData - * @return array - */ - protected function prepareOptionsData(array $optionsData) - { - return [ - 'value' => $optionsData, - 'optionsIds' => $this->attributeEdit->getAttributeForm()->getOptionsIds() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php deleted file mode 100644 index 109538dc7aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductStep.php +++ /dev/null @@ -1,80 +0,0 @@ -product = $product; - $this->fixtureFactory = $fixtureFactory; - $this->data = $data; - } - - /** - * Create product. - * - * @return array - */ - public function run() - { - list($fixtureClass, $dataset) = explode('::', $this->product); - /** @var FixtureInterface $product */ - $product = $this->fixtureFactory->createByCode( - trim($fixtureClass), - ['dataset' => trim($dataset), 'data' => $this->data] - ); - if ($product->hasData('id') === false) { - $product->persist(); - } - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php deleted file mode 100644 index 39a09ebb2c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductTemplateStep.php +++ /dev/null @@ -1,79 +0,0 @@ -productTemplate = $productTemplate; - $this->templatesData = $templatesData; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create product attribute template. - * - * @return array - */ - public function run() - { - $attributeSet = $this->fixtureFactory->createByCode( - 'catalogAttributeSet', - [ - 'dataset' => $this->productTemplate['dataset'], - 'data' => ['assigned_attributes' => $this->templatesData] - ] - ); - $attributeSet->persist(); - - return ['productTemplate' => $attributeSet]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php deleted file mode 100644 index bcb691e4436..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/CreateProductsStep.php +++ /dev/null @@ -1,101 +0,0 @@ -products = $products; - $this->data = $data; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create products. - * - * @return InjectableFixture[] - */ - public function run() - { - $products = []; - $productsdatasets = explode(',', $this->products); - foreach ($productsdatasets as $key => $productdataset) { - list($fixtureClass, $dataset) = $this->resolveProductFixture($productdataset); - $data = isset($this->data[$key]) ? $this->data[$key] : []; - /** @var InjectableFixture[] $products */ - $products[$key] = $this->fixtureFactory->createByCode( - $fixtureClass, - ['dataset' => $dataset, 'data' => $data] - ); - if ($products[$key]->hasData('id') === false) { - $products[$key]->persist(); - } - } - - return ['products' => $products]; - } - - /** - * Get product fixture type and dataset. - * - * @param string $productdataset - * @return array - */ - protected function resolveProductFixture($productdataset) - { - $productdataset = explode('::', $productdataset); - $fixtureClass = trim($productdataset[0]); - $dataset = isset($productdataset[1]) ? trim($productdataset[1]) : ''; - return [$fixtureClass, $dataset]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php deleted file mode 100644 index 458bfbf7dc9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/OpenProductOnBackendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -product = $product; - $this->catalogProductIndex = $catalogProductIndex; - } - - /** - * Open products on backend. - * - * @return void - */ - public function run() - { - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getProductGrid()->searchAndOpen(['sku' => $this->product->getSku()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php deleted file mode 100644 index abad9610d76..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/SaveProductStep.php +++ /dev/null @@ -1,51 +0,0 @@ -catalogProductEdit = $catalogProductEdit; - } - - /** - * Save product. - * - * @return void - */ - public function run() - { - $this->catalogProductEdit->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php deleted file mode 100644 index 45c613d6d0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep.php +++ /dev/null @@ -1,264 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->objectManager = $objectManager; - $this->catalogProductEdit = $catalogProductEdit; - $this->product = $product; - $this->configurableOptionsEditData = $configurableOptionsEditData; - $this->currentAssignedProducts = $this->getOriginalProductAssignedProducts(); - $this->currentAttributes = $this->getOriginalProductAttributes(); - $this->currentConfigurableOptionsData = $this->product->getConfigurableOptions()['attributes_data']; - $this->checkoutData = $checkoutData; - } - - /** - * Update configurable product. - * - * @return array - */ - public function run() - { - $this->openConfigurableTab(); - foreach ($this->subSteps as $subStepName) { - if (isset($this->configurableOptionsEditData[$subStepName])) { - $subStep = $this->getSubStep($subStepName); - $subStep->run(); - $this->updateArguments($subStep); - } - } - - return ['product' => $this->prepareResultProduct()]; - } - - /** - * Get sub step. - * - * @param string $subStepName - * @return AbstractSubStep - */ - protected function getSubStep($subStepName) - { - $class = 'Mage\Catalog\Test\TestStep\UpdateConfigurableProductStep\\' . ucfirst($subStepName) . 'SubStep'; - $arguments = [ - 'product' => $this->product, - 'configurableOptionsEditData' => $this->configurableOptionsEditData, - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentAttributes' => $this->currentAttributes, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData, - 'checkoutData' => $this->checkoutData - - ]; - - return $this->objectManager->create($class, $arguments); - } - - /** - * Update local arguments. - * - * @param AbstractSubStep $subStep - * @return void - */ - protected function updateArguments(AbstractSubStep $subStep) - { - $returnSubStepArguments = $subStep->returnArguments(); - foreach ($returnSubStepArguments as $argumentName => $value) { - $this->$argumentName = $value; - } - } - - /** - * Prepare result product. - * - * @return ConfigurableProduct - */ - protected function prepareResultProduct() - { - $originalProductData = $this->product->getData(); - $originalProductData['configurable_options'] = $this->getCurrentConfigurableOptions(); - $originalProductData['price'] = ['value' => $this->product->getPrice()]; - if (!empty($this->checkoutData)) { - $originalProductData['checkout_data'] = $this->checkoutData; - } - - return $this->fixtureFactory->createByCode('configurableProduct', ['data' => $originalProductData]); - } - - /** - * Get current configurable options. - * - * @return array - */ - protected function getCurrentConfigurableOptions() - { - return !empty($this->currentAssignedProducts) - ? [ - 'data' => [ - 'data' => ['attributes_data' => $this->currentConfigurableOptionsData], - 'attributes_data' => [ - 'attributes' => $this->currentAttributes, - 'attributeSet' => $this->getOriginalProductOptionsSource()->getAttributeSet() - ], - 'assigned_product' => $this->currentAssignedProducts - ] - ] - : []; - } - - /** - * Open configurable specify tab. - * - * @return void - */ - protected function openConfigurableTab() - { - $this->catalogProductEdit->getProductForm()->openTab('configurable'); - } - - /** - * Get assigned products from original configurable product. - * - * @return InjectableFixture[] - */ - protected function getOriginalProductAssignedProducts() - { - return $this->getOriginalProductOptionsSource()->getProducts(); - } - - /** - * Get attributes' fixtures for original product. - * - * @return CatalogProductAttribute[] - */ - protected function getOriginalProductAttributes() - { - return $this->getOriginalProductOptionsSource()->getAttributesData(); - } - - /** - * Get configurable options source for original product. - * - * @return ConfigurableOptions - */ - protected function getOriginalProductOptionsSource() - { - return $this->product->getDataFieldConfig('configurable_options')['source']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php deleted file mode 100644 index f43e93ae416..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AbstractSubStep.php +++ /dev/null @@ -1,220 +0,0 @@ -objectManager = $objectManager; - $this->fixtureFactory = $fixtureFactory; - $this->catalogProductEdit = $catalogProductEdit; - $this->product = $product; - $this->configurableOptionsEditData = $configurableOptionsEditData; - $this->currentAssignedProducts = $currentAssignedProducts; - $this->currentAttributes = $currentAttributes; - $this->currentConfigurableOptionsData = $currentConfigurableOptionsData; - $this->checkoutData = $checkoutData; - } - - /** - * Fill attributes data. - * - * @param array $attributes - * @return void - */ - protected function fillAttributes(array $attributes) - { - $this->getConfigurableProductTab()->fillAttributes($attributes); - } - - /** - * Select products. - * - * @param array $products - * @return void - */ - protected function selectProducts(array $products) - { - $filter = []; - foreach ($products as $product) { - $filter[] = $product->getSku(); - } - $this->getConfigurableProductTab()->selectProducts($filter); - } - - /** - * Update configurable options. - * - * @param array $newData - * @return void - */ - protected function updateConfigurableOptionsData(array $newData) - { - foreach ($newData as $attributeKey => $itemAttribute) { - foreach ($itemAttribute['options'] as $optionKey => $option) { - $originalData = isset($this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey]) - ? $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] - : []; - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] = array_merge( - $originalData, - $option - ); - } - } - } - - /** - * Get special tab for configurable product. - * - * @return ConfigurableTab - */ - protected function getConfigurableProductTab() - { - return $this->catalogProductEdit->getProductForm()->getTabElement('configurable'); - } - - /** - * Get assigned products from original configurable product. - * - * @return InjectableFixture[] - */ - protected function getOriginalProductAssignedProducts() - { - return $this->getOriginalProductOptionsSource()->getProducts(); - } - - /** - * Get configurable options source for original product. - * - * @return ConfigurableOptions - */ - protected function getOriginalProductOptionsSource() - { - return $this->product->getDataFieldConfig('configurable_options')['source']; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php deleted file mode 100644 index c41bd7d1d6f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/AddOptionsSubStep.php +++ /dev/null @@ -1,139 +0,0 @@ -prepareNewProducts(); - $this->selectProducts($newProducts); - $configurableOptionsData = $this->prepareOptions(); - $this->updateConfigurableOptionsData($configurableOptionsData); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Prepare new products. - * - * @return array - */ - protected function prepareNewProducts() - { - $newProducts = []; - foreach ($this->configurableOptionsEditData['addOptions'] as $addOption) { - $productKey = $this->getProductKeyByOptionIndex($addOption['optionIndex']); - $newProducts[$productKey] = $this->createNewProduct($addOption); - } - $this->currentAssignedProducts = array_merge($this->currentAssignedProducts, $newProducts); - - return $newProducts; - } - - /** - * Get product key by option index. - * - * @param int $optionIndex - * @return string - */ - protected function getProductKeyByOptionIndex($optionIndex) - { - return "attribute_key_0:option_key_$optionIndex " . "attribute_key_1:option_key_$optionIndex"; - } - - /** - * Create new product. - * - * @param array $data - * @return InjectableFixture - */ - protected function createNewProduct(array $data) - { - list($fixtureClass, $dataset) = explode('::', $data['product']); - $productData = $this->prepareProductCreateData($data); - $product = $this->fixtureFactory->createByCode($fixtureClass, ['dataset' => $dataset, 'data' => $productData]); - $product->persist(); - - return $product; - } - - /** - * Prepare product create data. - * - * @param array $data - * @return array - */ - protected function prepareProductCreateData(array $data) - { - $attributeSet = $this->getOriginalProductOptionsSource()->getAttributeSet(); - $value = []; - foreach ($this->currentAttributes as $attribute) { - $value[$attribute->getAttributeCode()] = $attribute->getOptions()[$data['optionIndex']]['id']; - } - - return [ - 'attribute_set_id' => ['attribute_set' => $attributeSet], - 'attributes' => [ - 'value' => $value - ] - ]; - } - - /** - * Prepare options data. - * - * @return array - */ - protected function prepareOptions() - { - $result = []; - $originalData = $this->product->getConfigurableOptions(); - foreach ($this->configurableOptionsEditData['addOptions'] as $option) { - foreach ($option['data'] as $attributeKey => $itemData) { - $optionKey = 'option_key_' . $option['optionIndex']; - $originalOptionData = isset($originalData['attributes_data'][$attributeKey]['options'][$optionKey]) - ? $originalData['attributes_data'][$attributeKey]['options'][$optionKey] - : []; - $result[$attributeKey]['options'][$optionKey] = array_merge($originalOptionData, $itemData['value']); - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php deleted file mode 100644 index 3960fc82e44..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/CreateProductSubStep.php +++ /dev/null @@ -1,163 +0,0 @@ -configurableOptionsEditData['createProduct'] as $createType => $itemCreate) { - $data = $this->getCreationData($createType); - $source = $this->createConfigurableOptionsSource($data); - $newData = $source->getData('attributes_data'); - $newProducts = $source->getProducts(); - $this->$createType($newProducts); - $this->fillAttributes($newData); - $this->updateConfigurableOptionsData($newData); - $this->updateAssignedProducts($newProducts); - } - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Create product via 'Create Empty' button. - * - * @param array $newProducts - * @return void - */ - protected function createEmpty(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getSimpleAssociatedProductBlock()->clickCreateEmpty(); - $this->fillNewProduct($product); - } - } - - /** - * Create product via 'Copy From Configurable' button. - * - * @param array $newProducts - * @return void - */ - protected function copyFromConfigurable(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getSimpleAssociatedProductBlock()->clickCopyFromConfigurable(); - $this->fillNewProduct($product); - } - } - - /** - * Quick creation products. - * - * @param array $newProducts - * @return void - */ - protected function quickCreation(array $newProducts) - { - foreach ($newProducts as $product) { - $this->getConfigurableProductTab()->getQuickCreationBlock()->create($product); - } - } - - /** - * Fill new product. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillNewProduct(InjectableFixture $product) - { - $this->getConfigurableProductTab()->getNewProductPopup()->fill($product); - $this->getConfigurableProductTab()->getNewProductPopup()->getFormPageActions()->save(); - $this->getConfigurableProductTab()->getNewProductPopup()->close(); - } - - /** - * Get creation data. - * - * @param string $creationType - * @return array - */ - protected function getCreationData($creationType) - { - return [ - 'dataset' => $this->configurableOptionsEditData['createProduct'][$creationType]['dataset'], - 'data' => [ - 'attributes_data' => [ - 'attributes' => $this->currentAttributes, - 'attributeSet' => $this->getOriginalProductOptionsSource()->getAttributeSet() - ], - ] - ]; - } - - /** - * Update assigned products. - * - * @param array $newProducts - * @return void - */ - protected function updateAssignedProducts(array $newProducts) - { - $this->currentAssignedProducts = array_merge($this->currentAssignedProducts, $newProducts); - } - - /** - * Create configurable options source. - * - * @param array $data - * @return ConfigurableOptions - */ - protected function createConfigurableOptionsSource(array $data) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions', - [ - 'data' => $data, - 'params' => [ - 'is_required' => '0', - 'group' => 'configurable', - 'source' => 'Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions', - 'repository' => 'Mage\Catalog\Test\Repository\CatalogProductConfigurable\ConfigurableOptions' - ] - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php deleted file mode 100644 index 6b18d2b8ea3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php +++ /dev/null @@ -1,110 +0,0 @@ -unsetProductsKeys(); - $this->unsetAttributeOptions(); - $this->getConfigurableProductTab()->unselectAllProducts(); - if (!empty($this->currentAssignedProducts)) { - $this->selectProducts($this->currentAssignedProducts); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentAssignedProducts' => $this->currentAssignedProducts, - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Unset products. - * - * @return void - */ - protected function unsetProductsKeys() - { - $deleteProductsKey = $this->prepareDeleteProductsKeys(); - foreach ($deleteProductsKey as $key) { - unset($this->currentAssignedProducts[$key]); - } - } - - /** - * Prepare delete products keys. - * - * @return array - */ - protected function prepareDeleteProductsKeys() - { - $keys = []; - foreach ($this->configurableOptionsEditData['deleteOptions'] as $option) { - $keys = array_merge($keys, $this->searchKeysForOption($option)); - } - return $keys; - } - - /** - * Search keys for option index. - * - * @param int $optionIndex - * @return array - */ - protected function searchKeysForOption($optionIndex) - { - $keys = []; - $originalProductAssignedProducts = $this->getOriginalProductAssignedProducts(); - foreach ($originalProductAssignedProducts as $key => $product) { - if (strpos($key, 'option_key_' . $optionIndex) !== false) { - $keys[] = $key; - } - } - return $keys; - } - - /** - * Unset attribute options. - * - * @return void - */ - protected function unsetAttributeOptions() - { - foreach ($this->configurableOptionsEditData['deleteOptions'] as $option) { - foreach ($this->currentConfigurableOptionsData as &$attribute) { - unset($attribute['options']['option_key_' . $option]); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php b/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php deleted file mode 100644 index bad785c4123..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/UpdateOptionsSubStep.php +++ /dev/null @@ -1,62 +0,0 @@ -prepareOptionsForEdit(); - $this->fillAttributes($this->currentConfigurableOptionsData); - } - - /** - * Return arguments from sub step. - * - * @return array - */ - public function returnArguments() - { - return [ - 'currentConfigurableOptionsData' => $this->currentConfigurableOptionsData - ]; - } - - /** - * Prepare options for edit. - * - * @return void - */ - protected function prepareOptionsForEdit() - { - foreach ($this->configurableOptionsEditData['updateOptions'] as $editOption) { - $attributeKey = 'attribute_key_' . $editOption['attributeIndex']; - $optionKey = 'option_key_' . $editOption['optionIndex']; - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey] = array_replace( - $this->currentConfigurableOptionsData[$attributeKey]['options'][$optionKey], - $editOption['value'] - ); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml deleted file mode 100644 index c462c0f666e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/curl/di.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml deleted file mode 100644 index aec00f57a53..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/fixture.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - eav - catalog_product - simple - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CheckoutData - - - attributes - virtual - - - - - eav - catalog_category - Mage\Catalog\Model\Resource\Category\Collection - - - eav - catalog_product - configurable - sku - - - stock_data - virtual - inventory - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - null - - - configurable_options - virtual - 0 - configurable - Mage\Catalog\Test\Fixture\ConfigurableProduct\ConfigurableOptions - - - - - composite - - eav_attribute - catalog_eav_attribute - - - options - smallint - Mage\Catalog\Test\Fixture\CatalogProductAttribute\Options - - - - flat - eav_attribute_set - - - skeleton_set - virtual - - - assigned_attributes - virtual - Mage\Catalog\Test\Fixture\CatalogAttributeSet\AssignedAttributes - - - - - eav - catalog_product - virtual - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData - - - price - prices - Mage\Catalog\Test\Fixture\CatalogProductSimple\Price - - - - - eav - catalog_product - grouped - Mage\Catalog\Model\Resource\Product\Collection - sku - - - id - virtual - - - type_id - virtual - - - attribute_set_id - virtual - null - Mage\Catalog\Test\Fixture\CatalogProductSimple\AttributeSetId - - - custom_options - virtual - custom-options - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductVirtual\CheckoutData - - - associated - associated - Mage\Catalog\Test\Fixture\GroupedProduct\Associated - - - - diff --git a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml deleted file mode 100644 index bb9276c588b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Catalog/Test/etc/testcase.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php deleted file mode 100644 index b8becee5364..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInCatalogPage.php +++ /dev/null @@ -1,107 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $formPrices = $this->getFormPrices($product, $catalogCategoryView); - $fixturePrices = $this->prepareFixturePrices($prices); - $diff = $this->verifyData($fixturePrices, $formPrices); - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff . "\n On: " . date('l jS \of F Y h:i:s A')); - } - - /** - * Prepare fixture prices. - * - * @param array $prices - * @return array - */ - protected function prepareFixturePrices(array $prices) - { - return array_intersect_key($prices, array_flip($this->verifyFields)); - } - - /** - * Get form prices. - * - * @param InjectableFixture $product - * @param CatalogCategoryView $catalogCategoryView - * @return array - */ - protected function getFormPrices(InjectableFixture $product, CatalogCategoryView $catalogCategoryView) - { - $productPriceBlock = $catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()); - $actualPrices = [ - 'regular' => $productPriceBlock->getRegularPrice(), - 'special' => $productPriceBlock->getSpecialPrice() - ]; - $actualPrices['discount_amount'] = number_format($actualPrices['regular'] - $actualPrices['special'], 2); - - return $actualPrices; - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is applied for product(s) in Catalog according to Priority.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php deleted file mode 100644 index 6d0ff6942a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInProductPage.php +++ /dev/null @@ -1,70 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); - $productPriceBlock = $pageCatalogProductView->getViewBlock()->getPriceBlock(); - $actualPrices['regular'] = $productPriceBlock->getRegularPrice(); - $actualPrices['special'] = $productPriceBlock->getSpecialPrice(); - $actualPrices['discount_amount'] = number_format($actualPrices['regular'] - $actualPrices['special'], 2);; - $diff = $this->verifyData($actualPrices, $prices); - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Catalog Price Rule is applied & it impacts on product's discount price on Product page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php deleted file mode 100644 index 5e3b042adf1..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleAppliedInShoppingCart.php +++ /dev/null @@ -1,72 +0,0 @@ -open(); - $cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $catalogCategoryView->getListProductBlock()->openProductViewPage($product->getName()); - $pageCatalogProductView->getViewBlock()->addToCart($product); - $actualGrandTotal = $pageCheckoutCart->getCartBlock()->getCartItem($product)->getCartItemTypePrice('price'); - \PHPUnit_Framework_Assert::assertEquals($prices['grand_total'], $actualGrandTotal); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is applied for product(s) in Shopping Cart according to Priority.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php deleted file mode 100644 index e97a01ffc09..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleForm.php +++ /dev/null @@ -1,102 +0,0 @@ -getName(); - - $pageCatalogRuleIndex->open(); - $pageCatalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $formData = $this->prepareFormData($catalogRuleEdit->getEditForm()->getData($catalogPriceRule)); - $fixtureData = $this->prepareFixtureData($catalogPriceRule->getData()); - $diff = $this->verifyData($formData, $fixtureData); - - \PHPUnit_Framework_Assert::assertEmpty($diff, $diff); - } - - /** - * Prepare fixture data. - * - * @param array $fixtureData - * @return array - */ - protected function prepareFixtureData(array $fixtureData) - { - if (isset($fixtureData['discount_amount'])) { - $fixtureData['discount_amount'] = floatval($fixtureData['discount_amount']); - } - - return $fixtureData; - } - - /** - * Prepare form data. - * - * @param array $formData - * @return array - */ - protected function prepareFormData(array $formData) - { - if (isset($formData['discount_amount'])) { - $formData['discount_amount'] = floatval($formData['discount_amount']); - } - - return $formData; - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Displayed catalog price rule data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php deleted file mode 100644 index 2c8bd449878..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleInGrid.php +++ /dev/null @@ -1,76 +0,0 @@ -getData(); - $filter = [ - 'name' => $data['name'], - 'is_active' => $data['is_active'], - ]; - //add ruleWebsite to filter if there is one - if ($catalogPriceRule->hasData('website_ids')) { - $ruleWebsite = $catalogPriceRule->getWebsiteIds(); - $ruleWebsite = is_array($ruleWebsite) ? reset($ruleWebsite) : $ruleWebsite; - $filter['rule_website'] = $ruleWebsite; - } - //add from_date & to_date to filter if there are ones - if (isset($data['from_date']) && isset($data['to_date'])) { - $dateArray['from_date'] = date("M j, Y", strtotime($catalogPriceRule->getFromDate())); - $dateArray['to_date'] = date("M j, Y", strtotime($catalogPriceRule->getToDate())); - $filter = array_merge($filter, $dateArray); - } - - $pageCatalogRuleIndex->open(); - $errorMessage = implode(', ', $filter); - \PHPUnit_Framework_Assert::assertTrue( - $pageCatalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), - 'Catalog Price Rule with following data: \'' . $errorMessage . '\' ' - . 'is absent in Catalog Price Rule grid.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is present in Catalog Rule grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php deleted file mode 100644 index df5cca5114e..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInGrid.php +++ /dev/null @@ -1,59 +0,0 @@ - $catalogPriceRule->getId(), - 'name' => $catalogPriceRule->getName(), - ]; - $catalogRuleIndex->open(); - \PHPUnit_Framework_Assert::assertFalse( - $catalogRuleIndex->getCatalogRuleGrid()->isRowVisible($filter), - "Catalog Price Rule {$filter['rule_id']} with name {$filter['name']} is present in Catalog Price Rule grid." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Catalog Price Rule is NOT present in Catalog Rule grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php deleted file mode 100644 index 36f17b08aa3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNotInProductPage.php +++ /dev/null @@ -1,62 +0,0 @@ -persist(); - - $browser->open($_ENV['app_frontend_url'] . $productSimple->getUrlKey() . '.html'); - $productPriceFromFixture = $productSimple->getPrice(); - $productPrice = number_format($catalogProductView->getViewBlock()->getPriceBlock()->getPrice(), 2); - \PHPUnit_Framework_Assert::assertEquals($productPrice, $productPriceFromFixture); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Price stored in fixture equals to product price on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php deleted file mode 100644 index 295cdeb30e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleNoticeMessage.php +++ /dev/null @@ -1,65 +0,0 @@ -getMessagesBlock()->getNoticeMessages() - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that notice message is displayed'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php deleted file mode 100644 index 1c92d868329..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that success delete message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php deleted file mode 100644 index db3cf37dfbc..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Constraint/AssertCatalogPriceRuleSuccessSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - $actualMessages = is_array($actualMessages) ? $actualMessages : [$actualMessages]; - \PHPUnit_Framework_Assert::assertContains( - self::SUCCESS_MESSAGE, - $actualMessages - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Assert that success message is displayed'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml deleted file mode 100644 index 1c294887682..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Fixture/CatalogRule.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php deleted file mode 100644 index c512fcaca88..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Handler/CatalogRule/CatalogRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'type' => 'catalogrule/rule_condition_combine', - 'aggregator' => 'all', - 'value' => 1, - ], - 'Category' => [ - 'type' => 'catalogrule/rule_condition_product', - 'attribute' => 'category_ids', - ], - ]; - - /** - * Mapping values for data. - * - * @var array - */ - protected $mappingData = [ - 'simple_action' => [ - 'By Percentage of the Original Price' => 'by_percent', - 'By Fixed Amount' => 'by_fixed', - 'To Percentage of the Original Price' => 'to_percent', - 'To Fixed Amount' => 'to_fixed', - ], - 'is_active' => [ - 'Active' => 1, - 'Inactive' => 0, - ], - 'stop_rules_processing' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Mapping values for Websites. - * - * @var array - */ - protected $websiteIds = [ - 'Main Website' => 1, - ]; - - /** - * Mapping values for Customer Groups. - * - * @var array - */ - protected $customerGroupIds = [ - 'NOT LOGGED IN' => 0, - 'General' => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ]; - - /** - * POST request for creating Catalog Price Rule. - * - * @param FixtureInterface $fixture - * @return mixed|void - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'promo_catalog/save/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'id="messages"')) { - throw new \Exception( - "Catalog Price Rule entity creating by curl handler was not successful! Response: $response" - ); - } - - return ['id' => $this->getCategoryPriceRuleId()]; - } - - /** - * Prepare data from text to values. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData($fixture) - { - $data = $this->replaceMappingData($fixture->getData()); - if (isset($data['website_ids'])) { - $websiteIds = []; - foreach ($data['website_ids'] as $websiteId) { - $websiteIds[] = isset($this->websiteIds[$websiteId]) ? $this->websiteIds[$websiteId] : $websiteId; - } - $data['website_ids'] = $websiteIds; - } - if (isset($data['customer_group_ids'])) { - $customerGroupIds = []; - foreach ($data['customer_group_ids'] as $customerGroupId) { - $customerGroupIds[] = isset($this->customerGroupIds[$customerGroupId]) - ? $this->customerGroupIds[$customerGroupId] - : $customerGroupId; - } - $data['customer_group_ids'] = $customerGroupIds; - } - if (!isset($data['stop_rules_processing'])) { - $data['stop_rules_processing'] = 0; - } - - if (!isset($data['rule'])) { - $data['rule'] = null; - } - $data['rule'] = ['conditions' => $this->prepareCondition($data['rule'])]; - - return $data; - } - - /** - * Get id after creating Category Price Rule. - * - * @return int - * @throws \Exception - */ - public function getCategoryPriceRuleId() - { - // Sort data in grid to define category price rule id if more than 20 items in grid - $url = $_ENV['app_backend_url'] . 'promo_catalog/index/sort/rule_id/dir/desc'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url); - $response = $curl->read(); - $curl->close(); - - preg_match('~title="http[^\s]*\/id\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Category Price Rule id'); - } - - return $matches[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml deleted file mode 100644 index 2380acf09f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml deleted file mode 100644 index adfb8b51405..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Page/Adminhtml/CatalogRuleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml deleted file mode 100644 index 3057d52570d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/Repository/CatalogRule.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - - - main_website - - - - NOT LOGGED IN - - By Percentage of the Original Price - 50 - - - - catalog_price_rule_priority_0 %isolation% - -50% of price, Priority = 0 - Active - - - main_website - - - - NOT LOGGED IN - - 0 - By Percentage of the Original Price - 50 - - - - catalog_price_rule_priority_1_stop_further_rules %isolation% - Priority 1, -5 By fixed amount - Active - - - main_website - - - - NOT LOGGED IN - - 1 - By Fixed Amount - 5 - Yes - - - - catalog_price_rule_priority_2 %isolation% - Priority 2, -10 By fixed amount - Active - - - main_website - - - - NOT LOGGED IN - - 2 - By Fixed Amount - 10 - - - - Active Catalog Rule with conditions %isolation% - Rule Description - Active - - - main_website - - - - NOT LOGGED IN - General - Wholesale - Retailer - - [Category|is|2] - By Percentage of the Original Price - 10 - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php deleted file mode 100644 index af95ca20d7a..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/AbstractCatalogRuleEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ -objectManager->create('Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - } - - /** - * Injection data. - * - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __inject( - CatalogRuleIndex $catalogRuleIndex, - CatalogRuleEdit $catalogRuleEdit, - FixtureFactory $fixtureFactory - ) { - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Clear data after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php deleted file mode 100644 index 713b81cfb7d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,72 +0,0 @@ -catalogRuleIndex->open(); - foreach ($catalogRulesOriginal as $key => $catalogPriceRule) { - if ($catalogPriceRule === '-') { - continue; - } - $this->catalogRules[$key] = $this->fixtureFactory->createByCode( - 'catalogRule', - ['dataset' => $catalogPriceRule] - ); - $this->catalogRules[$key]->persist(); - - $filter = [ - 'name' => $this->catalogRules[$key]->getName(), - 'rule_id' => $this->catalogRules[$key]->getId(), - ]; - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $this->catalogRuleEdit->getFormPageActions()->saveAndApply(); - } - // Create product - $productSimple = $this->fixtureFactory->createByCode( - 'catalogProductSimple', - ['dataset' => 'simple_for_salesrule_1'] - ); - $productSimple->persist(); - - return ['product' => $productSimple]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml deleted file mode 100644 index 7ad69197135..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/ApplySeveralCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - catalog_price_rule_priority_0 - - - catalog_price_rule_priority_2 - 100 - 40 - 60 - 40 - 100 - main:ce - - - - - - catalog_price_rule_priority_0 - catalog_price_rule_priority_1_stop_further_rules - catalog_price_rule_priority_2 - 100 - 45 - 55 - 45 - 100 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php deleted file mode 100644 index cb2aef281ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ - Catalog Price Rules. - * 3. Click "Add New Rule" button. - * 4. Fill in data according to dataset. - * 5. Save catalog price rule. - * 6. Perform all assertions. - * - * @group Catalog_Price_Rules_(MX) - * @ZephyrId MPERF-6774 - */ -class CreateCatalogPriceRuleEntityTest extends AbstractCatalogRuleEntityTest -{ - /** - * Create Catalog Price Rule test. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - public function test(CatalogRule $catalogPriceRule) - { - // Steps: - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getGridPageActions()->addNew(); - $this->catalogRuleEdit->getEditForm()->fill($catalogPriceRule); - $this->catalogRuleEdit->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml deleted file mode 100644 index 67152c721ac..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/CreateCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - Active - Wholesale - By Percentage of the Original Price - 50 - - - - - - - CatalogPriceRule %isolation% - Catalog Price Rule Description - Inactive - General - By Fixed Amount - 10 - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php deleted file mode 100644 index c6e571ab37b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.php +++ /dev/null @@ -1,86 +0,0 @@ - Catalog Price Rules. - * 3. Select required catalog price rule from preconditions. - * 4. Click on the "Delete" button. - * 5. Perform all assertions. - * - * @group Catalog_Price_Rules_(MX) - * @ZephyrId MPERF-7033 - */ -class DeleteCatalogPriceRuleEntityTest extends Injectable -{ - /** - * Catalog Rule index page. - * - * @var CatalogRuleIndex - */ - protected $catalogRuleIndex; - - /** - * Catalog Rule edit page. - * - * @var CatalogRuleEdit - */ - protected $catalogRuleEdit; - - /** - * Injection data. - * - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @return void - */ - public function __inject(CatalogRuleIndex $catalogRuleIndex, CatalogRuleEdit $catalogRuleEdit) - { - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - } - - /** - * Delete Catalog Price Rule test. - * - * @param CatalogRule $catalogPriceRule - * @return void - */ - public function test(CatalogRule $catalogPriceRule) - { - // Precondition - $catalogPriceRule->persist(); - - $filter = [ - 'name' => $catalogPriceRule->getName(), - 'rule_id' => $catalogPriceRule->getId(), - ]; - // Steps - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen($filter); - $this->catalogRuleEdit->getFormPageActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml deleted file mode 100644 index c1eb11fd992..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestCase/DeleteCatalogPriceRuleEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - active_catalog_price_rule_with_conditions - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php deleted file mode 100644 index 7b3fff2bcf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/CreateCatalogRuleStep.php +++ /dev/null @@ -1,70 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->catalogRule = empty($catalogRule) ? null : $catalogRule; - } - - /** - * Create catalog rule - * - * @return array - */ - public function run() - { - $result['catalogRule'] = null; - if (!empty($this->catalogRule) && $this->catalogRule != '-') { - $catalogRule = $this->fixtureFactory->createByCode( - 'catalogRule', - ['dataset' => $this->catalogRule] - ); - $catalogRule->persist(); - $result['catalogRule'] = $catalogRule; - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php deleted file mode 100644 index c09cf7e10e5..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/DeleteAllCatalogRulesStep.php +++ /dev/null @@ -1,66 +0,0 @@ -catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - } - - /** - * Delete Catalog Rule on backend. - * - * @return array - */ - public function run() - { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->resetFilter(); - while ($this->catalogRuleIndex->getCatalogRuleGrid()->isFirstRowVisible()) { - $this->catalogRuleIndex->getCatalogRuleGrid()->openFirstRow(); - $this->catalogRuleEdit->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php deleted file mode 100644 index 4c91dcea1ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/TestStep/SaveAndApplyCatalogRuleStep.php +++ /dev/null @@ -1,75 +0,0 @@ -catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->catalogRuleId = $catalogRuleId; - } - - /** - * Save and apply catalog rule on backend. - * - * @return void - */ - public function run() - { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen(['rule_id' => $this->catalogRuleId]); - $this->catalogRuleEdit->getFormPageActions()->saveAndApply(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml deleted file mode 100644 index 089ff52bcf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml deleted file mode 100644 index 06a6e56dabe..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogRule/Test/etc/fixture.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - flat - catalogrule - Mage\CatalogRule\Model\Resource\Rule\Product\Price\Collection - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php deleted file mode 100644 index 91adc94cad4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Block/Advanced/Form.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->getElements($this->fieldSelector); - foreach ($elements as $element) { - $labels[] = $element->find($this->labelSelector)->getText(); - } - return $labels; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php deleted file mode 100644 index 56e2edcee97..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermForm.php +++ /dev/null @@ -1,66 +0,0 @@ -open()->getGrid()->searchAndOpen(['search_query' => $searchTerm->getQueryText()]); - \PHPUnit_Framework_Assert::assertEquals( - $searchTerm->getData(), - $editPage->getForm()->getData($searchTerm), - 'This form "Search Term" does not match the fixture data.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Search Term form correspond to the data passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php deleted file mode 100644 index 8e6771c1833..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermInGrid.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $filters = [ - 'search_query' => $searchTerm->getQueryText(), - 'synonym_for' => $searchTerm->getSynonymFor(), - 'redirect' => $searchTerm->getRedirect(), - 'display_in_terms' => $searchTerm->getDisplayInTerms(), - ]; - - $indexPage->getGrid()->search($filters); - \PHPUnit_Framework_Assert::assertTrue( - $indexPage->getGrid()->isRowVisible($filters, false), - 'Row terms according to the filters is not found.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Row term according to the filters is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php deleted file mode 100644 index c7afb603f03..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermOnFrontend.php +++ /dev/null @@ -1,108 +0,0 @@ -searchBlock = $cmsIndex->open()->getSearchBlock(); - - if ($searchTerm->hasData('display_in_terms') && $searchTerm->getDisplayInTerms() === 'Yes') { - $errors = (!$this->isSugestSearchisVisible( - $searchTerm - )) ? '- block "Suggest Search" when searching was not found' : []; - } - - $this->searchBlock->search($searchTerm->getQueryText()); - $windowUrl = $browser->getUrl(); - $redirectUrl = $searchTerm->getRedirect(); - if ($windowUrl !== $redirectUrl) { - $errors[] = '- url window (' . $windowUrl . ') does not match the url redirect(' . $redirectUrl . ')'; - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Check suggest block visibility. - * - * @param CatalogSearchQuery $searchTerm - * @return bool - */ - protected function isSugestSearchIsVisible(CatalogSearchQuery $searchTerm) - { - $queryText = $searchTerm->getQueryText(); - $this->searchBlock->fillSearch($queryText); - if ($searchTerm->hasData('num_results')) { - $isVisible = $this->searchBlock->isSuggestSearchVisible( - $queryText, - $searchTerm->getNumResults() - ); - } else { - $isVisible = $this->searchBlock->isSuggestSearchVisible($queryText); - } - - return $isVisible; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checking "Search terms" on frontend successful.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php deleted file mode 100644 index b27e53f709b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Search term success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php deleted file mode 100644 index 1a86895fcd3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSearchTermSynonymOnFrontend.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSearchBlock()->search($searchTerm->getSynonymFor()); - \PHPUnit_Framework_Assert::assertEquals( - $searchTerm->getRedirect(), - $browser->getUrl(), - 'Redirect by synonym was not executed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Redirect by synonym executed successfully.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php deleted file mode 100644 index 4aea30bc157..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Constraint/AssertSuggestSearchingResult.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $searchBlock = $cmsIndex->getSearchBlock(); - $queryText = $catalogSearch->getQueryText(); - $searchBlock->fillSearch($queryText); - - $isVisible = $catalogSearch->hasData('num_results') - ? $searchBlock->isSuggestSearchVisible($queryText, $catalogSearch->getNumResults()) - : $searchBlock->isSuggestSearchVisible($queryText); - - \PHPUnit_Framework_Assert::assertTrue($isVisible, 'Block "Suggest Search" when searching was not found.'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Asserts that window contains requested entity and quantity.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml deleted file mode 100644 index a3bc1568464..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php deleted file mode 100644 index e3cc1a534af..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Fixture/CatalogSearchQuery/QueryText.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - $explodeValue = explode('::', $data['value']); - if (!empty($explodeValue) && count($explodeValue) > 1) { - $fixtureCode = $explodeValue[0]; - $dataset = isset($explodeValue[2]) ? $explodeValue[1] : ''; - $searchValue = isset($explodeValue[2]) ? $explodeValue[2] : $explodeValue[1]; - $this->product = $fixtureFactory->createByCode($fixtureCode, ['dataset' => $dataset]); - if (!$this->product->hasData('id')) { - $this->product->persist(); - } - if ($this->product->hasData($searchValue)) { - $getProperty = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $searchValue))); - $this->data = $this->product->$getProperty(); - } else { - $this->data = $searchValue; - } - } else { - $this->data = strval($data['value']); - } - } - - /** - * Persist catalog search query. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data. - * - * @param string|null $key - * @return string - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get product fixture to search. - * - * @return InjectableFixture - */ - public function getProduct() - { - return $this->product; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml deleted file mode 100644 index 574384b771d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml deleted file mode 100644 index 344da335419..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/Adminhtml/CatalogSearchIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml deleted file mode 100644 index fa7e93757b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchAdvanced.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml deleted file mode 100644 index dbb9db343f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/Page/CatalogsearchResult.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php deleted file mode 100644 index cb2f63cca41..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.php +++ /dev/null @@ -1,81 +0,0 @@ - Search Terms. - * 5. Click "Add New Search Term" button. - * 6. Fill out all data according to dataset. - * 7. Save the Search Term. - * 8. Perform all assertions. - * - * @group Search_Terms_(MX) - * @ZephyrId MPERF-7591 - */ -class CreateSearchTermEntityTest extends Injectable -{ - /** - * Search term page. - * - * @var CatalogSearchIndex - */ - protected $indexPage; - - /** - * Search term edit page. - * - * @var CatalogSearchEdit - */ - protected $editPage; - - /** - * Inject pages. - * - * @param CatalogSearchIndex $indexPage - * @param CatalogSearchEdit $editPage - * @return void - */ - public function __inject(CatalogSearchIndex $indexPage, CatalogSearchEdit $editPage) - { - $this->indexPage = $indexPage; - $this->editPage = $editPage; - } - - /** - * Run create search term test. - * - * @param CatalogSearchQuery $searchTerm - * @return void - */ - public function test(CatalogSearchQuery $searchTerm) - { - // Steps - $this->indexPage->open(); - $this->indexPage->getGridPageActions()->addNew(); - $this->editPage->getForm()->fill($searchTerm); - $this->editPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml deleted file mode 100644 index a9350c446ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/CreateSearchTermEntityTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - catalogProductSimple::sku - Search Term Synonym %isolation% - http://example.com/ - No - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php deleted file mode 100644 index 881e8b2005d..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.php +++ /dev/null @@ -1,49 +0,0 @@ -open(); - $cmsIndex->getSearchBlock()->search($catalogSearch->getQueryText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml b/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml deleted file mode 100644 index e3267a7088a..00000000000 --- a/dev/tests/functional/tests/app/Mage/CatalogSearch/Test/TestCase/SuggestSearchingResultEntityTest.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - catalogProductSimple::name - main:ce - - - - catalogProductSimple::sku - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php deleted file mode 100644 index a236537a8ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/AbstractItem.php +++ /dev/null @@ -1,179 +0,0 @@ - ['selector' => '.product-cart-price .cart-price .price'], - 'subtotal' => ['selector' => '.product-cart-total .cart-price .price'], - 'cart_item_price' => ['selector' => '.product-cart-price .cart-price .price'], - 'cart_item_subtotal' => ['selector' => '.product-cart-total .cart-price .price'], - 'cart_item_price_excl_tax' => ['selector' => '.product-cart-price[data-rwd-tax-label="Excl. Tax"]'], - 'cart_item_price_incl_tax' => ['selector' => '.product-cart-price[data-rwd-tax-label="Incl. Tax"]'], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//td[@class="product-cart-total"][1]//*[@class="cart-price"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//td[@class="product-cart-total"][2]//*[@class="cart-price"]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ] - ]; - - /** - * Selector for product name. - * - * @var string - */ - protected $productName = '.product-name > a'; - - /** - * Quantity input selector. - * - * @var string - */ - protected $qty = '.input-text.qty'; - - /** - * Selector for options block. - * - * @var string - */ - protected $optionsBlock = 'dl.item-options'; - - /** - * Get product name. - * - * @return string - */ - public function getProductName() - { - return $this->_rootElement->find($this->productName)->getText(); - } - - /** - * Get product quantity. - * - * @return string - */ - public function getQty() - { - return $this->_rootElement->find($this->qty)->getValue(); - } - - /** - * Set product quantity. - * - * @param int $qty - * @return void - */ - public function setQty($qty) - { - $this->_rootElement->find($this->qty)->setValue($qty); - } - - /** - * Get price type. - * - * @param string $priceType - * @return string - */ - public function getCartItemTypePrice($priceType) - { - $strategy = isset($this->pricesType[$priceType]['strategy']) - ? $this->pricesType[$priceType]['strategy'] - : Locator::SELECTOR_CSS; - $selector = $this->prepareSelector($priceType); - $price = $this->_rootElement->find($selector, $strategy)->getText(); - - return $this->escapeCurrency($price); - } - - /** - * Get product options from cart. - * - * @param ElementInterface $element - * @return array - */ - public function getOptions(ElementInterface $element = null) - { - $element = ($element == null) ? $this->_rootElement : $element; - $optionsBlock = $element->find($this->optionsBlock); - $options = []; - - if ($optionsBlock->isVisible()) { - $titles = $optionsBlock->getElements('./dt', Locator::SELECTOR_XPATH); - $values = $optionsBlock->getElements('./dd', Locator::SELECTOR_XPATH); - - foreach ($titles as $key => $title) { - $value = $values[$key]->getText(); - $options[] = [ - 'title' => str_replace(':', '', $title->getText()), - 'value' => $this->escapeCurrencyForOption($value), - ]; - } - } - - return $options; - } - - /** - * Escape currency in option label. - * - * @param string $label - * @return string - */ - protected function escapeCurrencyForOption($label) - { - return preg_replace('/^(\d+) x (\w+) \W([\d\.,]+)$/', '$1 x $2 $3', $label); - } - - /** - * Prepare selector for field. - * - * @param string $field - * @return string - */ - protected function prepareSelector($field) - { - return $this->pricesType[$field]['selector']; - } - - /** - * Escape currency in price. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php deleted file mode 100644 index c64bac8935d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart.php +++ /dev/null @@ -1,195 +0,0 @@ -getDataConfig(); - $typeId = isset($dataConfig['type_id']) ? $dataConfig['type_id'] : null; - $cartItem = null; - - if ($this->hasRender($typeId)) { - $cartItem = $this->callRender($typeId, 'getCartItem', ['product' => $product]); - } else { - $cartItemBlock = $this->_rootElement->find( - sprintf($this->cartItemByProductName, $product->getName()), - Locator::SELECTOR_XPATH - ); - $cartItem = $this->blockFactory->create( - $this->cartItemClass, - ['element' => $cartItemBlock] - ); - } - - return $cartItem; - } - - /** - * Check if a product has been successfully added to the cart. - * - * @param InjectableFixture $product - * @return boolean - */ - public function isProductInShoppingCart(InjectableFixture $product) - { - return $this->getCartItem($product)->isVisible(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - public function clearShoppingCart() - { - if (!$this->_rootElement->find($this->emptyShoppingCart)->isVisible()){ - $clearShoppingCart = $this->_rootElement->find($this->clearShoppingCart); - if ($clearShoppingCart->isVisible()) { - $clearShoppingCart->click(); - } - } - } - - /** - * Get Proceed to checkout block. - * - * @return Link - */ - public function getProceedToCheckoutBlock() - { - return $this->blockFactory->create( - 'Mage\Checkout\Test\Block\Onepage\Link', - ['element' => $this->_rootElement->find($this->proceedToCheckoutButton)] - ); - } - - /** - * Get express shortcut block. - * - * @return Shortcut - */ - public function getExpressShortcutBlock() - { - return $this->blockFactory->create( - 'Mage\Paypal\Test\Block\Express\Shortcut', - ['element' => $this->_rootElement->find($this->payPalExpressCheckout)] - ); - } - - /** - * Update shopping cart. - * - * @return void - */ - public function updateShoppingCart() - { - $this->_rootElement->find($this->updateShoppingCart)->click(); - } - - /** - * Click on 'Checkout with Multiple Addresses' link. - * - * @return void - */ - public function clickCheckoutWithMultiAddress() - { - $this->_rootElement->find($this->checkoutWithMultiAddress)->click(); - } - - /** - * Check that empty cart block is visible. - * - * @return bool - */ - public function emptyCartBlockIsVisible() - { - return $this->_rootElement->find($this->emptyShoppingCart)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php deleted file mode 100644 index 6625996e06f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/CartItem.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement->find($this->msrp)->isVisible(); - } - - /** - * Check that edit button visible. - * - * @return bool - */ - public function isEditButtonVisible() - { - return $this->_rootElement->find($this->edit)->isVisible(); - } - - /** - * Click on move to wishlist button. - * - * @return void - */ - public function moveToWishlist() - { - $this->_rootElement->find($this->wishlistButton)->click(); - } - - /** - * Remove product item from cart. - * - * @return void - */ - public function removeItem() - { - $this->_rootElement->find($this->removeItem)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php deleted file mode 100644 index 797a4c7dcf9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/DiscountCodes.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement->find($this->couponCode, Locator::SELECTOR_CSS)->setValue($code); - $this->_rootElement->find($this->applyButton, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php deleted file mode 100644 index b83f88b466c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.php +++ /dev/null @@ -1,82 +0,0 @@ -_rootElement->find($this->estimateButton)->click(); - } - - /** - * Select shipping method. - * - * @param array $shipping - * @return void - */ - public function selectShippingMethod(array $shipping) - { - $selector = sprintf($this->shippingMethod, $shipping['shipping_service'], $shipping['shipping_method']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->click(); - $this->_rootElement->find($this->updateTotalSelector, Locator::SELECTOR_CSS)->click(); - } - - /** - * Fill shipping and tax form. - * - * @param Address $address - * @return void - */ - public function fillEstimateShippingAndTax(Address $address) - { - $this->fill($address); - $this->clickEstimate(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml deleted file mode 100644 index 4c97b44f79d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Shipping.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - select - - - select - - - - #postcode - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php deleted file mode 100644 index 57f77b5dc51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Cart/Sidebar.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => '//tr[normalize-space(td)="Grand Total"]//span', - 'is_required' - ], - 'subtotal' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal"]//span', - 'is_required' - ], - 'subtotal_excl_tax' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal (Excl. Tax)"]//span', - 'is_required' - ], - 'subtotal_incl_tax' => [ - 'selector' => '//tr[normalize-space(td)="Subtotal (Incl. Tax)"]//span', - 'is_required' - ], - 'discount' => [ - 'selector' => '//tr[td[contains(text(),"Discount")]]//span' - ], - 'shipping_excl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Shipping") and contains(.,"Excl. Tax")]]//span' - ], - 'shipping_incl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Shipping") and contains(.,"Incl. Tax")]]//span' - ], - 'tax' => [ - 'selector' => '//tr[normalize-space(td)="Tax"]//span', - 'is_required' - ], - 'grand_total_excl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Grand Total") and contains(.,"Excl. Tax")]]//span', - 'is_required' - ], - 'grand_total_incl_tax' => [ - 'selector' => '//tr[.//*[contains(.,"Grand Total") and contains(.,"Incl. Tax")]]//span', - 'is_required' - ], - 'shipping_price' => [ - 'selector' => '//td[contains(.,"Shipping &")]/following-sibling::td/span[contains(@class,"price")]', - 'is_required' - ] - ]; - - /** - * Shipping price block selector. - * - * @var string - */ - protected $shippingPriceBlockSelector = '//td[contains(.,"Shipping & Handling")]'; - - /** - * Get data from block. - * - * @param string $type - * @return null|string - */ - public function getData($type) - { - $selector = $this->prepareSelector($type); - $element = $this->_rootElement->find($selector, Locator::SELECTOR_XPATH); - return isset($this->fieldType[$type]['is_required']) - ? $this->escapeCurrency($element->getText()) - : ($element->isVisible() ? $this->escapeCurrency($element->getText()) : null); - } - - /** - * Prepare selector. - * - * @param string $type - * @return string - */ - protected function prepareSelector($type) - { - return $this->fieldType[$type]['selector']; - } - - /** - * Method that escapes currency symbols. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } - - /** - * Check that shipping price block is visible. - * - * @return bool - */ - public function isVisibleShippingPriceBlock() - { - return $this->_rootElement->find($this->shippingPriceBlockSelector, Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php deleted file mode 100644 index 6a8f7ede568..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart.php +++ /dev/null @@ -1,65 +0,0 @@ -blockFactory->create( - 'Mage\Checkout\Test\Block\GroupedProductCart\CartItem', - [ - 'element' => $this->_rootElement, - 'config' => [ - 'associated_cart_items' => $this->getAssociatedItems($product), - ] - ] - ); - } - - /** - * Get associated items for grouped product. - * - * @param InjectableFixture $product - * @return array - */ - protected function getAssociatedItems(InjectableFixture $product) - { - $cartItems = []; - - /** @var GroupedProduct $product */ - $associatedProducts = $product->getDataFieldConfig('associated')['source']->getProducts(); - foreach ($associatedProducts as $product) { - $cartItems[$product->getSku()] = parent::getCartItem($product); - } - - return $cartItems; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php deleted file mode 100644 index 9a172481cdf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/GroupedProductCart/CartItem.php +++ /dev/null @@ -1,158 +0,0 @@ -config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getPrice(); - } - - return $result; - } - - /** - * Set product quantity. - * - * @param array $data - * @return void - */ - public function setQty($data) - { - foreach ($data as $productSku => $qty) { - /** @var CheckoutCartItem $cartItem */ - $cartItem = $this->config['associated_cart_items'][$productSku]; - $cartItem->setQty($qty); - } - } - - /** - * Get product quantity. - * - * @return string - */ - public function getQty() - { - $result = []; - foreach ($this->config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getQty(); - } - - return $result; - } - - /** - * Get sub-total for the specified item in the cart. - * - * @return string - */ - public function getSubtotalPrice() - { - $result = []; - foreach ($this->config['associated_cart_items'] as $productSku => $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[$productSku] = $cartItem->getSubtotalPrice(); - } - - return $result; - } - - /** - * Get product options in the cart. - * - * @param ElementInterface $element - * @return string - */ - public function getOptions(ElementInterface $element = null) - { - $result = []; - foreach ($this->config['associated_cart_items'] as $cartItem) { - /** @var CheckoutCartItem $cartItem */ - $result[] = [ - 'title' => strtolower($cartItem->getProductName()), - 'value' => $cartItem->getQty(), - ]; - } - - return $result; - } - - /** - * Get products sku. - * - * @return array - */ - public function getProductsSku() - { - $elementsData = []; - $elements = $this->_rootElement->getElements($this->productSku); - foreach ($elements as $element) { - $elementsData[] = str_replace('SKU: ', '', $element->getText()); - } - - return $elementsData; - } - - /** - * Get price type. - * - * @param string $priceType - * @return string - */ - public function getCartItemTypePrice($priceType) - { - $result = []; - foreach ($this->config['associated_cart_items'] as $key => $cartItem) { - $result[$key] = $cartItem->getCartItemTypePrice($priceType); - } - return $result; - } - - /** - * Remove product item from cart. - * - * @return void - */ - public function removeItem() - { - foreach ($this->config['associated_cart_items'] as $key => $cartItem) { - $this->_rootElement->find($this->removeItem)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php deleted file mode 100644 index 975862b619d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping.php +++ /dev/null @@ -1,68 +0,0 @@ -blockFactory->create($this->getItemsClass(), ['element' => $this->getItemsBlockElement()]); - } - - /** - * Click on 'Continue' button. - * - * @return void - */ - public function clickContinueButton() - { - $this->_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php deleted file mode 100644 index 133856b94f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/AbstractMultishipping/AbstractItems.php +++ /dev/null @@ -1,59 +0,0 @@ -blockFactory->create( - $this->getItemBlockClass(), - ['element' => $this->getItemBlockElement($entity, $itemIndex)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php deleted file mode 100644 index fd73893d954..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses.php +++ /dev/null @@ -1,76 +0,0 @@ -_rootElement->find($this->enterNewAddress)->click(); - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemsClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Addresses\Items'; - } - - /** - * Get items block element. - * - * @return ElementInterface - */ - protected function getItemsBlockElement() - { - return $this->_rootElement->find($this->itemsBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php deleted file mode 100644 index 5429e10b6ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items.php +++ /dev/null @@ -1,78 +0,0 @@ -itemBlock, $product->getName()); - ++$itemIndex; - $itemBlockElement = $this->_rootElement->find($itemBlockSelector . "[$itemIndex]", Locator::SELECTOR_XPATH); - if (!$itemBlockElement->isVisible()) { - $itemBlockElement = $this->_rootElement->find($itemBlockSelector, Locator::SELECTOR_XPATH); - } - - return $itemBlockElement; - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemBlockClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Addresses\Items\Item'; - } - - /** - * Click on 'Update Qty & Addresses' button. - */ - public function updateData() - { - $this->_rootElement->find($this->updateDataButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php deleted file mode 100644 index 9e91356f05b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Addresses/Items/Item.php +++ /dev/null @@ -1,58 +0,0 @@ -prepareAddressData($address); - $this->_rootElement->find($this->address, Locator::SELECTOR_CSS, 'select')->setValue($value); - } - - /** - * Prepare address data. - * - * @param Address $address - * @return string - */ - protected function prepareAddressData(Address $address) - { - return $address->getFirstname() . ' ' . $address->getLastname() . ', ' . $address->getStreet() . ', ' - . $address->getCity() . ', ' . $address->getRegionId() . ' ' . $address->getPostcode() . ', ' - . $address->getCountryId(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php deleted file mode 100644 index 90fc5b092a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Billing.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php deleted file mode 100644 index 14473ff3e77..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Overview.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->placeOrder)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php deleted file mode 100644 index 1d2df8bcbae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.php +++ /dev/null @@ -1,65 +0,0 @@ -getData(); - unset($customerData['address']); - $mapping = $this->dataMapping($customerData); - $this->_fill($mapping); - $address = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - $this->fillAddress($address); - $this->_rootElement->find($this->submit)->click(); - } - - /** - * Fill address data. - * - * @param Address $address - * @return void - */ - protected function fillAddress(Address $address) - { - $skipFields = ['email', 'default_shipping']; - $addressData = $address->getData(); - $addressData = array_flip(array_diff(array_flip($addressData), $skipFields)); - $mapping = $this->dataMapping($addressData); - $this->_fill($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml deleted file mode 100644 index d6aaa8cd27f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Register.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - #street_1 - - - - select - - - select - - - - checkbox - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php deleted file mode 100644 index f8d79526ca3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping.php +++ /dev/null @@ -1,51 +0,0 @@ -_rootElement; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php deleted file mode 100644 index c3503e76c05..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items.php +++ /dev/null @@ -1,76 +0,0 @@ -addressFields as $field) { - $conditions[] = "contains(., '{$address->getData($field)}')"; - } - $itemBlockSelector = sprintf($this->itemBlock, implode(' and ', $conditions)); - return $this->_rootElement->find($itemBlockSelector, Locator::SELECTOR_XPATH); - } - - /** - * Get path for items class. - * - * @return string - */ - protected function getItemBlockClass() - { - return 'Mage\Checkout\Test\Block\Multishipping\Shipping\Items\Item'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php deleted file mode 100644 index 24ad2550bab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Shipping/Items/Item.php +++ /dev/null @@ -1,65 +0,0 @@ -_rootElement->find( - sprintf($this->shippingMethodInput, $method['shipping_service'], $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if ($shippingInput->isVisible()) { - $shippingInput->click(); - } else { - $shippingLabel = $this->_rootElement->find( - sprintf($this->shippingMethodLabel, $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if (!$shippingLabel->isVisible()) { - throw new \Exception("{$method['shipping_service']} shipping doesn't exist."); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php deleted file mode 100644 index 4c511be0587..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Multishipping/Success.php +++ /dev/null @@ -1,47 +0,0 @@ -_rootElement->getElements($this->ordersIds); - foreach ($ordersIdsElements as $orderIdElement) { - $ordersIds[] = $orderIdElement->getText(); - } - - return $ordersIds; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php deleted file mode 100644 index 146ff9bbadb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/AbstractOnepage.php +++ /dev/null @@ -1,71 +0,0 @@ -continue)) { - $this->_rootElement->find($this->continue)->click(); - $this->waitLoader(); - } else { - throw new \Exception('Selector for continue button must be set!'); - } - } - - /** - * Wait for checkout loader. - * - * @return void - */ - protected function waitLoader() - { - $selector = $this->waiterSelector; - $browser = $this->_rootElement; - $browser->waitUntil( - function () use ($browser, $selector) { - $element = $browser->find($selector); - return $element->isVisible() == false ? true : null; - } - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php deleted file mode 100644 index 2bf7c69c2f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.php +++ /dev/null @@ -1,69 +0,0 @@ -fill($billingAddress); - } - if ($customer) { - if($this->browser->find('[id=\'billing:email\']')->isVisible() && ($customer->getData('email') != null)) { - $this->fill($customer); - } - } - if ($isShippingAddress) { - $this->_rootElement->find($this->useForShipping)->click(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml deleted file mode 100644 index 9ea1076a985..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Billing.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - billing - - - - - - - [id='billing:street1'] - - - - select - - - - select - - - - [name='billing[customer_password]'] - - - [name='billing[confirm_password]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php deleted file mode 100644 index 9cebe3df602..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Link.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php deleted file mode 100644 index 2cbfb16f5b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.php +++ /dev/null @@ -1,85 +0,0 @@ -_rootElement->find($this->guestCheckout)->click(); - } - - /** - * Register customer during checkout. - * - * @return void - */ - public function registerCustomer() - { - $this->_rootElement->find($this->registerCustomer)->click(); - } - - /** - * Login customer during checkout. - * - * @param Customer $customer - * @return void - */ - public function loginCustomer(Customer $customer) - { - $this->fill($customer); - $this->_rootElement->find($this->login)->click(); - $this->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml deleted file mode 100644 index 51f28e75355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Login.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - login - - - [name='login[username]'] - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php deleted file mode 100644 index 193e57a58f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Payment/Methods.php +++ /dev/null @@ -1,110 +0,0 @@ -_rootElement->find(sprintf($this->paymentMethodInput, $payment['method'])); - if ($paymentMethod->isVisible()) { - $paymentMethod->click(); - } else { - $paymentCount = count($this->_rootElement->getElements($this->paymentMethodLabels)); - $paymentMethodLabel = $this->_rootElement->find(sprintf($this->paymentMethodLabel, $payment['method'])); - if ($paymentCount !== 1 && !$paymentMethodLabel->isVisible()) { - throw new \Exception('Such payment method is absent.'); - } - } - if ($payment['method'] == "purchaseorder") { - $this->_rootElement->find($this->purchaseOrderNumber)->setValue($payment['po_number']); - } - if (isset($payment['cc']) && !isset($payment['iframe'])) { - $this->fillCreditCard($payment); - } - } - - /** - * Fill credit card. - * - * @param array $payment - * @return void - */ - protected function fillCreditCard(array $payment) - { - /** @var Cc $formBlock */ - $formBlock = $this->blockFactory->create( - 'Mage\Payment\Test\Block\Form\Cc', - ['element' => $this->_rootElement->find('#payment_form_' . $payment['method'])] - ); - $formBlock->fill($payment['cc']); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php deleted file mode 100644 index 536a2182c04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review.php +++ /dev/null @@ -1,199 +0,0 @@ -hasRender($productType) - ? $this->callRender($productType, 'getItemsBlock') - : $this->blockFactory->create($this->itemsBlock, ['element' => $this->_rootElement->find($this->items)]); - } - - /** - * Get items product block. - * - * @return Totals - */ - public function getTotalBlock() - { - return $this->blockFactory->create( - 'Mage\Checkout\Test\Block\Onepage\Review\Totals', - ['element' => $this->_rootElement->find($this->total)] - ); - } - - /** - * Get 3D secure Form. - * - * @return Centinel - */ - public function getCentinelForm() - { - return $this->blockFactory->create( - 'Mage\Paypal\Test\Block\Form\Centinel', - ['element' => $this->_rootElement->find($this->centinelForm)] - ); - } - - /** - * Get verification response text. - * - * @return string - */ - public function getVerificationResponseText() - { - $this->browser->switchToFrame(new Locator($this->iFrameSelector)); - $responseText = $this->browser->find($this->body)->getText(); - $this->browser->switchToFrame(); - return $responseText; - } - - /** - * Get alert massage. - * - * @return string - */ - protected function getAlertMassage() - { - try { - $alertText = $this->browser->getAlertText(); - } catch (\Exception $e) { - $alertText = ''; - } - return $alertText; - } - - /** - * Set agreement. - * - * @param CheckoutAgreement $agreement - * @param string $value - * @return void - */ - public function setAgreement(CheckoutAgreement $agreement, $value) - { - $agreementsInputSelector = sprintf($this->agreementCheckbox, $agreement->getCheckboxText()); - $this->_rootElement->find($agreementsInputSelector, Locator::SELECTOR_XPATH, 'checkbox')->setValue($value); - } - - /** - * Check agreement. - * - * @param CheckoutAgreement $agreement - * @return bool - */ - public function checkAgreement(CheckoutAgreement $agreement) - { - return $this->_rootElement - ->find(sprintf($this->agreement, $agreement->getCheckboxText()), Locator::SELECTOR_XPATH) - ->isVisible(); - } - - /** - * Click continue button. - * - * @return string - */ - public function clickContinue() - { - $this->_rootElement->find($this->continue)->click(); - $alertText = $this->getAlertMassage(); - $this->waitLoader(); - - return $alertText; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php deleted file mode 100644 index d2f60652bf9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Items.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '[data-rwd-label="Price (Excl. Tax)"] span.price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '[data-rwd-label="Price (Incl. Tax)"] span.price' - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '[data-rwd-label="Subtotal (Excl. Tax)"] span.price' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '[data-rwd-label="Subtotal (Incl. Tax)"] span.price' - ], - 'cart_item_price' => ['selector' => '[data-rwd-label="Price"] .cart-price .price'], - 'cart_item_subtotal' => ['selector' => '[data-rwd-label="Subtotal"] .cart-price .price'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php deleted file mode 100644 index a86cd8588b1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Review/Totals.php +++ /dev/null @@ -1,24 +0,0 @@ -waitForElementVisible($this->shippingForm); - $shippingInput = $this->_rootElement->find( - sprintf($this->shippingMethodInput, $method['shipping_service'], $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if ($shippingInput->isVisible()) { - $shippingInput->click(); - } else { - $shippingLabel = $this->_rootElement->find( - sprintf($this->shippingMethodLabel, $method['shipping_method']), - Locator::SELECTOR_XPATH - ); - if (!$shippingLabel->isVisible()) { - throw new \Exception("{$method['shipping_service']} shipping doesn't exist."); - } - } - } - - /** - * Click continue button. - * - * @return void - */ - public function clickContinue() - { - $this->waitForElementNotVisible($this->disableButton); - parent::clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php deleted file mode 100644 index 02d575081a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Block/Onepage/Success.php +++ /dev/null @@ -1,62 +0,0 @@ -waitForElementVisible($this->orderIdGuest, Locator::SELECTOR_XPATH); - $orderString = $this->_rootElement->find($this->orderIdGuest, Locator::SELECTOR_XPATH)->getText(); - preg_match('/[\d]+/', $orderString, $orderId); - return end($orderId); - } - - /** - * Click order id link. - * - * @return void - */ - public function openOrder() - { - $this->_rootElement->find($this->orderId, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php deleted file mode 100644 index 5bbfc43511f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AbstractAssertProductInShoppingCart.php +++ /dev/null @@ -1,111 +0,0 @@ -open(); - /** @var Items $sourceProducts */ - $sourceProducts = $cart->getDataFieldConfig('items')['source']; - $products = $sourceProducts->getProducts(); - $items = $cart->getItems(); - $productsData = []; - $cartData = []; - - foreach ($items as $key => $item) { - /** @var CatalogProductSimple $product */ - $product = $products[$key]; - $data = isset($verifyData[$key]) ? $verifyData[$key] : []; - $productName = $product->getName(); - /** @var FixtureInterface $item */ - $checkoutItem = $item->getData(); - $cartItem = $checkoutCart->getCartBlock()->getCartItem($product); - - $productsData[$productName] = $this->getProductData($checkoutItem, $data); - $cartData[$productName] = $this->getCartData($cartItem); - } - - $error = $this->verifyContainsData($productsData, $cartData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Verify product data. - * - * @param array $productsData - * @param array $cartData - * @return array|string - */ - protected function verifyContainsData(array $productsData, array $cartData) - { - return $this->verifyData($productsData, $cartData, true); - } - - /** - * Get cart data. - * - * @param CartItem $cartItem - * @return array - */ - protected function getCartData(CartItem $cartItem) - { - return [$this->dataType => $cartItem->getCartItemTypePrice($this->dataType)]; - } - - /** - * Get product data. - * - * @param array $checkoutItem - * @param array $verifyData - * @return array - */ - protected function getProductData(array $checkoutItem, array $verifyData) - { - return [ - $this->dataType => isset($verifyData[$this->dataType]) - ? $verifyData[$this->dataType] - : $checkoutItem[$this->dataType] - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php deleted file mode 100644 index 0188eecb957..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertAbstractOrderAddressSameAsPaypal.php +++ /dev/null @@ -1,123 +0,0 @@ - ['city', 'region', 'region_id', 'postcode'], - ['country_id'], - ['telephone'] - ]; - - /** - * Assert that address on order page in backend is same as address in PayPal. - * - * @param SalesOrderIndex $salesOrderIndex - * @param SalesOrderView $salesOrderView - * @param PaypalCustomer $paypalCustomer - * @param string $orderId - * @return void - */ - public function processAssert( - SalesOrderIndex $salesOrderIndex, - SalesOrderView $salesOrderView, - PaypalCustomer $paypalCustomer, - $orderId - ) - { - $addressBlock = "get{$this->addressType}AddressBlock"; - $salesOrderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - /** @var Info $informationTab */ - $informationTab = $salesOrderView->getOrderForm()->getTabElement('information'); - $orderAddress = $informationTab->$addressBlock()->getAddress(); - $payPalShippingAddress = $this->prepareCustomerAddress($paypalCustomer, $orderAddress); - - \PHPUnit_Framework_Assert::assertEquals($payPalShippingAddress, $orderAddress); - } - - /** - * Prepare customer address for assert. - * - * @param PaypalCustomer $customer - * @param $orderAddress - * @return string - */ - protected function prepareCustomerAddress(PaypalCustomer $customer, $orderAddress) - { - /** @var PaypalAddress $customerAddress */ - $customerAddress = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - - $availableFields = []; - foreach ($this->addressPattern as $key => $lineItems) { - foreach ($lineItems as $lineItem) { - if ($customerAddress->hasData($lineItem)) { - $availableFields[$key][] = $customerAddress->getData($lineItem); - } - } - $availableFields[$key] = ($key === 'implode_with_comma') - ? implode(', ', $availableFields[$key]) - : implode(' ', $availableFields[$key]); - - } - $availableFields = $this->prepareCustomerPhone($availableFields, $orderAddress); - $availableFields = implode("\n", $availableFields); - - return $availableFields; - } - - /** - * Remove customer telephone number, if telephone number isn't sent from PayPal side - * - * @param $availableFields - * @param $orderAddress - * @return mixed - * @internal param $customerPhone - * @internal param $orderBillingAddress - * @internal param $payPalShippingAddress - */ - protected function prepareCustomerPhone($availableFields, $orderAddress) - { - if (strpos($orderAddress, $availableFields[3]) == false) { - unset($availableFields[3]); - } - return $availableFields; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php deleted file mode 100644 index 528ca75f9c2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartIsEmpty.php +++ /dev/null @@ -1,55 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $checkoutCart->getCartBlock()->emptyCartBlockIsVisible(), - "Shopping cart is not empty." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shopping cart is empty.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php deleted file mode 100644 index de307372d5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertCartItemsOptions.php +++ /dev/null @@ -1,164 +0,0 @@ -dataType => $this->sortDataByPath($cartItem->getOptions(), '::title'),]; - } - - /** - * Get product data. - * - * @param array $checkoutItem - * @param array $verifyData - * @return array - */ - protected function getProductData(array $checkoutItem, array $verifyData) - { - return [$this->dataType => $this->sortDataByPath($checkoutItem[$this->dataType], '::title')]; - } - - /** - * Verify form data contains in fixture data. - * - * @param array $fixtureData - * @param array $formData - * @param bool $isStrict [optional] - * @param bool $isPrepareError [optional] - * @return array|string - */ - protected function verifyContainsData( - array $fixtureData, - array $formData, - $isStrict = false, - $isPrepareError = true - ) { - $errors = []; - - foreach ($fixtureData as $key => $value) { - if (in_array($key, $this->skippedFields)) { - continue; - } - - $formValue = isset($formData[$key]) ? $formData[$key] : null; - if ($formValue && !is_array($formValue)) { - $formValue = trim($formValue, '. '); - } - - if (null === $formValue) { - $errors[] = '- field "' . $key . '" is absent in form'; - } elseif (is_array($value) && is_array($formValue)) { - $valueErrors = $this->verifyContainsData($value, $formValue, true, false); - if (!empty($valueErrors)) { - $errors[$key] = $valueErrors; - } - } elseif (($key == 'value') && $this->equals($fixtureData['value'], $formData['value'])) { - $errors[] = $this->errorFormat($value, $formValue, $key); - } elseif (null === strpos($value, $formValue)) { - $errors[] = $this->errorFormat($value, $formValue, $key); - } - } - - if ($isStrict) { - $diffData = array_diff(array_keys($formData), array_keys($fixtureData)); - if ($diffData) { - $errors[] = '- fields ' . implode(', ', $diffData) . ' is absent in fixture'; - } - } - - if ($isPrepareError) { - return $this->prepareErrors($errors); - } - return $errors; - } - - /** - * Check that params are equals. - * - * @param mixed $expected - * @param mixed $actual - * @return bool - */ - protected function equals($expected, $actual) - { - return (null === strpos($expected, $actual)); - } - - /** - * Format error. - * - * @param mixed $value - * @param mixed $formValue - * @param mixed $key - * @return string - */ - protected function errorFormat($value, $formValue, $key) - { - if (is_array($value)) { - $value = $this->arrayToString($value); - } - if (is_array($formValue)) { - $formValue = $this->arrayToString($formValue); - } - - return sprintf($this->errorMessage, $key, $formValue, $value); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product options on the page match.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php deleted file mode 100644 index d94e87e3a83..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertGrandTotalInShoppingCart.php +++ /dev/null @@ -1,75 +0,0 @@ -login($customer); - } - $checkoutCart->open(); - \PHPUnit_Framework_Assert::assertEquals( - number_format($cart->getGrandTotal(), 2), - $checkoutCart->getTotalsBlock()->getData('grand_total') - ); - } - - /** - * Login customer in frontend. - * - * @param Customer $customer - * @return void - */ - protected function login(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand total price in the shopping cart equals to expected grand total price from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php deleted file mode 100644 index fc6bbdf84dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderBillingAddressSameAsPaypalShipping.php +++ /dev/null @@ -1,43 +0,0 @@ -getTitleBlock()->getTitle() - ); - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Success message on Checkout onepage success page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php deleted file mode 100644 index 9177c09684e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertOrderWithMultishippingSuccessPlacedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getTitleBlock()->getTitle() - ); - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Success message on Checkout onepage success page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php deleted file mode 100644 index 5c96bbc8bb4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertPriceInShoppingCart.php +++ /dev/null @@ -1,43 +0,0 @@ -getCartBlock()->getCartItem($product)->isEditButtonVisible(), - 'Added product is editable.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Added products by sku to shopping cart are not editable.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php deleted file mode 100644 index 7bb03d8cbb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInMiniShoppingCart.php +++ /dev/null @@ -1,74 +0,0 @@ -open()->getTopLinksBlock()->openMiniCart(); - /** @var Items $sourceProducts */ - $products = $cart->getDataFieldConfig('items')['source']->getProducts(); - $items = $cart->getItems(); - $productsData = []; - $miniCartData = []; - - foreach ($items as $key => $item) { - /** @var CatalogProductSimple $product */ - $product = $products[$key]; - $productName = $product->getName(); - /** @var FixtureInterface $item */ - $checkoutItem = $item->getData(); - - $productsData[$productName] = ['qty' => $checkoutItem['qty']]; - $miniCartData[$productName] = ['qty' => $cmsIndex->getCartSidebarBlock()->getCartItem($product)->getQty()]; - } - - $error = $this->verifyData($productsData, $miniCartData, true); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Quantity in the mini shopping cart equals to expected quantity from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php deleted file mode 100644 index b7ce3709610..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductQtyInShoppingCart.php +++ /dev/null @@ -1,56 +0,0 @@ -dataType => $cartItem->getQty()]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Quantity in the shopping cart equals to expected quantity from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php deleted file mode 100644 index 08ed4b1f327..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertProductsPresentInShoppingCart.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - foreach ($products as $product) { - \PHPUnit_Framework_Assert::assertTrue( - $checkoutCart->getCartBlock()->getCartItem($product)->isVisible(), - "Product '{$product->getName()}' is absent in shopping cart." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All expected products are present in shopping cart.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php deleted file mode 100644 index fef43625d24..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertSubtotalInShoppingCart.php +++ /dev/null @@ -1,43 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - $agreementIndex->getAgreementGridBlock()->isRowVisible(['name' => $checkoutAgreement->getName()]), - 'Checkout Agreement "' . $checkoutAgreement->getName() . '" is absent in agreement grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Checkout Agreement is present in agreement grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php deleted file mode 100644 index efbb9190ed2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermOnCheckout.php +++ /dev/null @@ -1,171 +0,0 @@ -objectManager = $objectManager; - $products = $this->createProducts($products); - $this->addToCart($products); - $this->startCheckout(); - $this->processCheckout($checkoutMethod, $billingAddress, $shipping, $payment); - $alertText = $checkoutOnepage->getReviewBlock()->clickContinue(); - - \PHPUnit_Framework_Assert::assertEquals( - self::NOTIFICATION_MESSAGE, - $alertText, - 'Notification required message of Terms and Conditions is absent.' - ); - - $checkoutOnepage->getReviewBlock()->setAgreement($checkoutAgreement, 'Yes'); - $checkoutOnepage->getReviewBlock()->clickContinue(); - $assertOrderSuccessPlacedMessage->processAssert($checkoutOnepageSuccess); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - )->run(); - } - - /** - * Start checkout. - * - * @return void - */ - protected function startCheckout() - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\ProceedToCheckoutStep')->run(); - } - - /** - * Process checkout. - * - * @param string $checkoutMethod - * @param Address $billingAddress - * @param array $shipping - * @param array $payment - * @return void - */ - protected function processCheckout($checkoutMethod, Address $billingAddress, array $shipping, array $payment) - { - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\SelectCheckoutMethodStep', - ['checkoutMethod' => $checkoutMethod] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\FillBillingInformationStep', - ['billingAddress' => $billingAddress] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\FillShippingMethodStep', - ['shipping' => $shipping] - )->run(); - $this->objectManager->create( - 'Mage\Checkout\Test\TestStep\SelectPaymentMethodStep', - ['payment' => $payment] - )->run(); - - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order was placed with checkout agreement successfully.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php deleted file mode 100644 index 1a4cfc30971..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermRequireMessageOnMultishippingCheckout.php +++ /dev/null @@ -1,207 +0,0 @@ -stepFactory = $stepFactory; - $customer->persist(); - $products = $this->createProducts($products); - $this->login($customer); - $this->addToCart($products); - $this->startCheckout(); - $this->processCheckoutWithMultishipping( - $customer, - $products, - $fillItemsData, - $shippingData, - $payment, - $newAddresses - ); - - $alertText = $checkoutMultishippingOverview->getOverviewBlock()->clickContinue(); - \PHPUnit_Framework_Assert::assertEquals( - self::NOTIFICATION_MESSAGE, - $alertText, - 'Notification required message of Terms and Conditions is absent.' - ); - - $checkoutMultishippingOverview->getOverviewBlock()->setAgreement($checkoutAgreement, 'Yes'); - $checkoutMultishippingOverview->getOverviewBlock()->clickContinue(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->stepFactory->create('\Mage\Catalog\Test\TestStep\CreateProductsStep', ['products' => $products]) - ->run()['products']; - } - - /** - * Login customer on frontend. - * - * @param Customer $customer - * @return void - */ - protected function login(Customer $customer) - { - $this->stepFactory - ->create('\Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', ['customer' => $customer]) - ->run(); - - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - )->run(); - } - - /** - * Start checkout with multishipping. - * - * @return void - */ - protected function startCheckout() - { - $this->stepFactory->create('\Mage\Checkout\Test\TestStep\ProceedToCheckoutWithMultishippingStep')->run(); - } - - /** - * Process checkout with multishipping. - * - * @param Customer $customer - * @param array $products - * @param array $fillItemsData - * @param array $shippingData - * @param array $payment - * @param string $newAddresses - * @return void - */ - protected function processCheckoutWithMultishipping( - Customer $customer, - array $products, - array $fillItemsData, - array $shippingData, - array $payment, - $newAddresses - ) { - $newAddresses = $this->stepFactory->create( - '\Mage\Customer\Test\TestStep\CreateNewAddressesFixturesStep', - ['newAddresses' => $newAddresses] - )->run()['newAddresses']; - - $addresses = $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\EnterNewAddressesStep', - ['newAddresses' => $newAddresses, 'customer' => $customer] - )->run()['addresses']; - - $addresses = $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\SelectAddressesStep', - [ - 'products' => $products, - 'customer' => $customer, - 'fillItemsData' => $fillItemsData, - 'addresses' => $addresses - ] - )->run()['addresses']; - - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\FillShippingMethodWithMultishippingStep', - ['shippingData' => $shippingData, 'addresses' => $addresses] - )->run(); - - $this->stepFactory->create( - '\Mage\Checkout\Test\TestStep\SelectPaymentMethodWithMultishippingStep', - ['payment' => $payment] - )->run(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Validation error message for terms and conditions checkbox is present on multishipping checkout.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php deleted file mode 100644 index 8206556ec03..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Constraint/AssertTermSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Terms and Conditions success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml deleted file mode 100644 index 5e39b06f1c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart.xml +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php deleted file mode 100644 index 683814fedc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/Cart/Items.php +++ /dev/null @@ -1,86 +0,0 @@ - 'Mage\Catalog\Test\Fixture\Cart\Item', - 'configurable' => 'Mage\Catalog\Test\Fixture\ConfigurableProduct\Cart\Item', - 'downloadable' => 'Mage\Downloadable\Test\Fixture\Cart\Item', - 'virtual' => 'Mage\Catalog\Test\Fixture\Cart\Item', - 'grouped' => 'Mage\Catalog\Test\Fixture\GroupedProduct\Cart\Item', - 'bundle' => 'Mage\Bundle\Test\Fixture\Cart\Item' - ]; - - /** - * List fixture products. - * - * @var FixtureInterface[] - */ - protected $products; - - /** - * @constructor - * @param array $params - * @param array $data - */ - public function __construct(array $params, array $data = []) - { - $this->params = $params; - $this->products = isset($data['products']) ? $data['products'] : []; - foreach ($this->products as $product) { - $this->data[] = $this->getCartItemClass($product); - } - } - - /** - * Get module name from fixture. - * - * @param FixtureInterface $product - * @return string - */ - protected function getCartItemClass(FixtureInterface $product) - { - $typeId = $product->getDataConfig()['type_id']; - return ObjectManager::getInstance()->create($this->itemRender[$typeId], ['product' => $product]); - } - - /** - * Get source products. - * - * @return array - */ - public function getProducts() - { - return $this->products; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml deleted file mode 100644 index f6ff0ad84bd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php deleted file mode 100644 index 8e7a2237b7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Fixture/CheckoutAgreement/Stores.php +++ /dev/null @@ -1,65 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - foreach ($data['datasets'] as $store) { - $store = $fixtureFactory->createByCode('store', ['dataset' => $store]); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Return array of stores fixtures. - * - * @return Store[] - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml deleted file mode 100644 index 513d9581438..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementEdit.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml deleted file mode 100644 index 404049561d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml deleted file mode 100644 index 50f3e81eeba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/Adminhtml/CheckoutAgreementNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml deleted file mode 100644 index 4ef3f8251d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutCart.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml deleted file mode 100644 index e23acc42783..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddressNewShipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml deleted file mode 100644 index 8a42de4aa38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingAddresses.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml deleted file mode 100644 index 0ccf545d94e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingBilling.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml deleted file mode 100644 index 8245e447141..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingLogin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml deleted file mode 100644 index c0b04506b27..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingOverview.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml deleted file mode 100644 index 3c3e45a73b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingRegister.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml deleted file mode 100644 index f6f8f9c90ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingShipping.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml deleted file mode 100644 index e055cfce445..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutMultishippingSuccess.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml deleted file mode 100644 index 5e92750871c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepage.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml deleted file mode 100644 index 5000ab5e501..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CheckoutOnepageSuccess.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml deleted file mode 100644 index 3357d6526f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml deleted file mode 100644 index 149f707cf2d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/CheckoutAgreement.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - checkout_agreement %isolation% - TestMessage%isolation% - test_checkbox%isolation% - Enabled - Text - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml deleted file mode 100644 index 4fb2a4f4eee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - shipping - 1 - Yes - 1 - - - - - checkout - 1 - Yes - 1 - - - - - checkout - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php deleted file mode 100644 index 8e034f2785d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.php +++ /dev/null @@ -1,54 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Run test add products to shopping cart. - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml deleted file mode 100644 index 3fffb3b52ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/AddProductsToShoppingCartEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - configurableProduct::default - 320 - - - - - - - - catalogProductSimple::with_two_custom_option - 340 - - - - - - - - downloadableProduct::with_two_separately_links - 22.43 - - - - - - - - catalogProductVirtual::order_default - 100.00 - - - - - - - - groupedProduct::three_simple_products - 600.00 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php deleted file mode 100644 index 386d65e28f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.php +++ /dev/null @@ -1,94 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs checkout with multishipping test. - * - * @param Customer $customer - * @return array - */ - public function test(Customer $customer) - { - $this->executeScenario(); - return ['billingAddress' => $this->getBillingAddress($customer)]; - } - - /** - * Get billing address for asserts. - * - * @param Customer $customer - * @return null|Address - */ - protected function getBillingAddress(Customer $customer) - { - return $customer->hasData('address') - ? $customer->getDataFieldConfig('address')['source']->getAddresses()[0] - : null; - } - - /** - * Logout after variation. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml deleted file mode 100644 index a10ca2f5b5f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CheckoutWithMultishippingTest.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - enable_multishipping, default_tax_configuration - catalogProductSimple::order_default,catalogProductSimple::order_default - johndoe_unique - login - customer_US_login - - - 0 - 0 - - - 1 - 1 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - 2 - - 105.00 - 105.00 - - - - - - - - - enable_multishipping - catalogProductSimple::order_default,catalogProductSimple::order_default - frontend_register_multiship_address - No - register - customer_US_login - - - 0 - 0 - - - 1 - 1 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - 2 - - 105.00 - 105.00 - - - - - - - enable_multishipping - catalogProductSimple::default - johndoe_unique - login - - - Flat Rate - Fixed - - - checkmo - 1 - - 315.00 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php deleted file mode 100644 index 9b6b0a5a7ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.php +++ /dev/null @@ -1,69 +0,0 @@ - Terms and conditions. - * 2. Click "Add New Condition". - * 3. Fill data from dataset. - * 4. Click "Save Condition". - * 5. Perform all assertions. - * - * @group Terms_and_Conditions_(CS) - * @ZephyrId MPERF-7583 - */ -class CreateTermEntityTest extends Scenario -{ - /** - * Create Term Entity test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Clear data after test variation. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\DeleteAllTermsEntityStep')->run(); - } - - /** - * Clear data after test suite. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'checkout_term_condition', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml deleted file mode 100644 index c549b7da92b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/CreateTermEntityTest.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - Create enabled term entity with text value - checkout_term_condition - default - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term entity with HTML value - checkout_term_condition - name%isolation% - Enabled - HTML - test_checkbox%isolation% - html - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term entity with text value - checkout_term_condition - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create disabled term entity - checkout_term_condition - name%isolation% - Disabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - US_address_for_checkout - guest - Flat Rate - Fixed - checkmo - - - - - - Create enabled term, check with multishipping - checkout_term_condition, enable_multishipping - name%isolation% - Enabled - Text - test_checkbox%isolation% - TestMessage%isolation% - catalogProductSimple::default - johndoe_unique - customer_US_for_checkout - - - 0 - 0 - - - 0 - 1 - - - 0 - 0 - - - - - Flat Rate - Fixed - - - Flat Rate - Fixed - - - checkmo - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php deleted file mode 100644 index 5a86f2766dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.php +++ /dev/null @@ -1,150 +0,0 @@ -browser = $browser; - $this->fixtureFactory = $fixtureFactory; - $this->catalogProductView = $catalogProductView; - $this->cartPage = $cartPage; - } - - /** - * Run test add products to shopping cart. - * - * @param string $productsData - * @return void - */ - public function test($productsData) - { - // Preconditions - $products = $this->prepareProducts($productsData); - - // Steps - $this->addToCart($products); - $this->removeProducts($products); - } - - /** - * Create products. - * - * @param string $productList - * @return InjectableFixture[] - */ - protected function prepareProducts($productList) - { - $createProductsStep = ObjectManager::getInstance()->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $productList] - ); - $result = $createProductsStep->run(); - - return $result['products']; - } - - /** - * Add products to cart. - * - * @param array $products - * @return void - */ - protected function addToCart(array $products) - { - $addToCartStep = ObjectManager::getInstance()->create( - 'Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', - ['products' => $products] - ); - $addToCartStep->run(); - } - - /** - * Remove products form cart. - * - * @param array $products - * @return void - */ - protected function removeProducts(array $products) - { - $this->cartPage->open(); - foreach ($products as $product) { - $this->cartPage->getCartBlock()->getCartItem($product)->removeItem(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml deleted file mode 100644 index f33f7d651cf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/DeleteProductsFromShoppingCartTest.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - bundleProduct::bundle_dynamic_product - main:ce - - - - bundleProduct::bundle_fixed_product - - - - catalogProductSimple::with_two_custom_option - - - - catalogProductVirtual::order_default - - - - configurableProduct::default - - - - downloadableProduct::with_two_separately_links - - - - groupedProduct::three_simple_products - - - - catalogProductSimple::with_two_custom_option, catalogProductVirtual::order_default, downloadableProduct::with_two_separately_links, groupedProduct::three_simple_products, configurableProduct::default, bundleProduct::bundle_dynamic_product, bundleProduct::bundle_dynamic_product - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php deleted file mode 100644 index b846147296f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.php +++ /dev/null @@ -1,85 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - if (isset($this->currentVariation['arguments']['configData'])) { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml deleted file mode 100644 index 04380f664a9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutTest.xml +++ /dev/null @@ -1,216 +0,0 @@ - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - catalogProductSimple::order_default - - - default_frontend_new - no - customer_UK - register - no - Flat Rate - Fixed - 105.00 - cashondelivery - - - Pending - Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - checkmo_specificcountry_gb - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 55.00 - checkmo - - - Pending - Back, Reorder, Cancel, Send Email, Hold, Invoice, Ship, Edit - - - - - - - catalogProductVirtual::order_default - - - default_frontend - customer_UK - guest - no - - - - - 100.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 55.00 - banktransfer - - - Pending - Back, Cancel, Send Email, Hold, Reorder, Invoice, Edit - banktransfer - - - - - - - catalogProductVirtual::order_default - active_sales_rule_for_not_logged_users - default_frontend - customer_UK - guest - no - - - - - 50.00 - checkmo - - - Pending - Back, Cancel, Send Email, Hold, Invoice, Edit - - - - - - - - - catalogProductSimple::order_default - - - default_frontend_new - customer_UK - register - no - Flat Rate - Fixed - 105.00 - purchaseorder - %isolation% - Pending - Back, Cancel, Send Email, Hold, Invoice, Reorder, Edit - purchaseorder - - - - - - - catalogProductSimple::order_default - active_sales_rule_for_all_groups - default_frontend_new - customer_US_login - login - Flat Rate - Fixed - 55.00 - cashondelivery - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - Checkout by configurable product with special price. - configurableProduct::default_with_special_price - active_sales_rule_for_all_groups - default_frontend_new - customer_US_login - login - Flat Rate - Fixed - 62.00 - cashondelivery - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - cashondelivery - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php deleted file mode 100644 index bccf639f301..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.php +++ /dev/null @@ -1,80 +0,0 @@ - $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => 'catalogProductSimple::order_default'] - )->run()['products']]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - - $this->objectManager->create( - 'Mage\CurrencySymbol\Test\TestStep\ApplyCurrencyInConfigStep', - ['currencySymbols' => 'usd'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml deleted file mode 100644 index 36a987be29b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinDhlShippingMethod.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - DHL shipping from UK to US - default_frontend - customer_US - guest - DHL - Express worldwide - checkmo - dhl_eu, shipping_origin_gb - usd, gbp - - - - DHL shipping from UK to UK - default_frontend - customer_UK - guest - DHL - Domestic express - checkmo - dhl_eu, shipping_origin_gb - usd, gbp - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php deleted file mode 100644 index dfe083b58d8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.php +++ /dev/null @@ -1,80 +0,0 @@ - $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => 'catalogProductSimple::order_default'] - )->run()['products']]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - - $this->objectManager->create( - 'Mage\CurrencySymbol\Test\TestStep\ApplyCurrencyInConfigStep', - ['currencySymbols' => 'usd'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml deleted file mode 100644 index 92e5dad9fec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/OnePageCheckoutWithinOnlineShippingMethods.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - UPS shipping from US to US - default_frontend - customer_US - guest - United Parcel Service - UPS Ground - checkmo - ups, shipping_origin - - - main:ce - - - - UPS shipping from US to UK - default_frontend - customer_UK - guest - United Parcel Service - UPS Worldwide Expedited - checkmo - ups, shipping_origin - - - - - - USPS shipping from US to US - default_frontend - customer_US - guest - United States Postal Service - Priority Mail 1-Day - checkmo - usps, shipping_origin - - - - - - USPS shipping from US to UK - default_frontend - customer_UK - guest - United States Postal Service - Priority Mail International - checkmo - usps, shipping_origin - - - - - - FedEx shipping from US to US - default_frontend - customer_US - guest - Federal Express - Ground - checkmo - fedex, shipping_origin - - - - - - FedEx shipping from US to DE - default_frontend - customer_DE - guest - Federal Express - International Economy - checkmo - fedex, shipping_origin - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php deleted file mode 100644 index d99b3673ae6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.php +++ /dev/null @@ -1,148 +0,0 @@ -browser = $browser; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Inject data. - * - * @param CatalogProductView $catalogProductView - * @param CheckoutCart $checkoutCart - * @return void - */ - public function __inject(CatalogProductView $catalogProductView, CheckoutCart $checkoutCart) - { - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - } - - /** - * Update Shopping Cart. - * - * @param CatalogProductSimple $product - * @param int $qty - * @return array - */ - public function test(CatalogProductSimple $product, $qty) - { - // Preconditions - $product->persist(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - - // Steps - $this->addProductToCart($product, $qty); - $this->updateShoppingCart($product); - - $cart['data']['items'] = ['products' => [$product]]; - return ['cart' => $this->fixtureFactory->createByCode('cart', $cart)]; - } - - /** - * Add product to cart. - * - * @param CatalogProductSimple $product - * @param int $qty - * @return void - */ - protected function addProductToCart(CatalogProductSimple $product, $qty) - { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $productView = $this->catalogProductView->getViewBlock(); - $productView->fillOptions($product); - $productView->setQty($qty); - $productView->clickAddToCart(); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - - /** - * Update shopping cart. - * - * @param CatalogProductSimple $product - * @return void - */ - protected function updateShoppingCart(CatalogProductSimple $product) - { - $qty = $product->getCheckoutData()['qty']; - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->getCartItem($product)->setQty($qty); - $this->checkoutCart->getCartBlock()->updateShoppingCart(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml deleted file mode 100644 index c65bc735108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestCase/UpdateShoppingCartTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 1 - default - 100 - 300 - - - - - - - 3 - with_two_custom_option - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php deleted file mode 100644 index f4945de4d17..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddNewCheckoutAgreementStep.php +++ /dev/null @@ -1,52 +0,0 @@ -agreementIndex = $agreementIndex; - } - - /** - * Add new checkout agreement step. - * - * @return void - */ - public function run() - { - $this->agreementIndex->open(); - $this->agreementIndex->getPageActionsBlock()->addNew(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php deleted file mode 100644 index c830c8b47ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/AddProductsToTheCartStep.php +++ /dev/null @@ -1,91 +0,0 @@ -products = $products; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $this->browser = $browser; - } - - /** - * Add products to the cart. - * - * @return void - */ - public function run() - { - // Ensure that shopping cart is empty - $this->checkoutCart->open()->getCartBlock()->clearShoppingCart(); - - foreach ($this->products as $product) { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->addToCart($product); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php deleted file mode 100644 index dc50baa0240..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/CreateCartItemStep.php +++ /dev/null @@ -1,61 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->cart = array_merge_recursive($cart, ['data' => ['items' => ['products' => $products]]]); - } - - /** - * Create cart item. - * - * @return array - */ - public function run() - { - return ['cart' => $this->fixtureFactory->createByCode('cart', $this->cart)]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php deleted file mode 100644 index 8eb2f87a5f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/DeleteAllTermsEntityStep.php +++ /dev/null @@ -1,65 +0,0 @@ -agreementEdit = $agreementEdit; - $this->agreementIndex = $agreementIndex; - } - - /** - * Delete all terms on backend. - * - * @return void - */ - public function run() - { - $this->agreementIndex->open(); - while ($this->agreementIndex->getAgreementGridBlock()->isFirstRowVisible()) { - $this->agreementIndex->getAgreementGridBlock()->openFirstRow(); - $this->agreementEdit->getPageActionsBlock()->deleteAndAcceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php deleted file mode 100644 index 5f0ab22491c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/EnterNewAddressesStep.php +++ /dev/null @@ -1,94 +0,0 @@ -checkoutMultishippingAddresses = $checkoutMultishippingAddresses; - $this->checkoutMultishippingAddressNewShipping = $checkoutMultishippingAddressNewShipping; - $this->newAddresses = $newAddresses; - $this->customer = $customer; - } - - /** - * Enter new addresses. - * - * @return array - */ - public function run() - { - if (empty($this->newAddresses)) { - return []; - } - foreach ($this->newAddresses as $address) { - $this->checkoutMultishippingAddresses->getAddressesBlock()->clickEnterNewAddress(); - $this->checkoutMultishippingAddressNewShipping->getAddressEditBlock()->fill($address); - $this->checkoutMultishippingAddressNewShipping->getAddressEditBlock()->save(); - } - - return ['addresses' => $this->newAddresses]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php deleted file mode 100644 index 0169872649c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillAndSaveCheckoutAgreementStep.php +++ /dev/null @@ -1,64 +0,0 @@ -agreementNew = $agreementNew; - $this->checkoutAgreement = $checkoutAgreement; - } - - /** - * Fill and save checkout agreement step. - * - * @return array - */ - public function run() - { - $this->agreementNew->getAgreementsForm()->fill($this->checkoutAgreement); - $this->agreementNew->getPageActionsBlock()->save(); - - return ['checkoutAgreement' => $this->checkoutAgreement]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php deleted file mode 100644 index a2734ab399b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillBillingInformationStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->billingAddress = $billingAddress; - $this->customer = $customer; - } - - /** - * Fill billing address. - * - * @return void - */ - public function run() - { - $this->checkoutOnepage->getBillingBlock()->fillBilling($this->billingAddress, $this->customer); - $this->checkoutOnepage->getBillingBlock()->clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php deleted file mode 100644 index 7d7925f5609..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodStep.php +++ /dev/null @@ -1,63 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->shipping = $shipping; - } - - /** - * Select shipping method. - * - * @return void - */ - public function run() - { - if ($this->shipping['shipping_service'] !== '-') { - $this->checkoutOnepage->getShippingMethodBlock()->selectShippingMethod($this->shipping); - $this->checkoutOnepage->getShippingMethodBlock()->clickContinue(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php deleted file mode 100644 index 043c3ec9382..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/FillShippingMethodWithMultishippingStep.php +++ /dev/null @@ -1,78 +0,0 @@ -checkoutMultishippingShipping = $checkoutMultishippingShipping; - $this->shippingData = $shippingData; - $this->addresses = $addresses; - } - - /** - * Select shipping method. - * - * @return void - */ - public function run() - { - if ($this->shippingData !== null) { - foreach ($this->addresses as $key => $address) { - $this->checkoutMultishippingShipping->getShippingBlock()->getItemsBlock()->getItemBlock($address, $key) - ->fillShippingMethod($this->shippingData[$key]); - } - } - $this->checkoutMultishippingShipping->getShippingBlock()->clickContinueButton(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php deleted file mode 100644 index c4498035fa5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderStep.php +++ /dev/null @@ -1,129 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->positiveCase = $positiveCase; - $this->fixtureFactory = $fixtureFactory; - $this->customer = $customer; - $this->products = $products; - } - - /** - * Place order after checking order totals on review step. - * - * @return mixed - */ - public function run() - { - $orderId = null; - if ($this->positiveCase) { - $this->checkoutOnepage->getReviewBlock()->clickContinue(); - $orderId = $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId(); - } - - return ['orderId' => $orderId, 'order' => $this->createOrderFixture($orderId)]; - } - - /** - * Create order fixture. - * - * @param string $id - * @return Order - */ - protected function createOrderFixture($id) - { - $data = [ - 'id' => $id, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products] - ]; - - return $this->fixtureFactory->createByCode('order', ['data' => $data]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php deleted file mode 100644 index cc309664ea0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/PlaceOrderWithMultishippingStep.php +++ /dev/null @@ -1,66 +0,0 @@ -checkoutMultishippingOverview = $checkoutMultishippingOverview; - $this->checkoutMultishippingSuccess = $checkoutMultishippingSuccess; - } - - /** - * Place order with multishipping. - * - * @return mixed - */ - public function run() - { - $this->checkoutMultishippingOverview->getOverviewBlock()->clickPlaceOrder(); - $ordersIds = $this->checkoutMultishippingSuccess->getSuccessBlock()->getOrdersIds(); - - return ['ordersIds' => $ordersIds]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php deleted file mode 100644 index ef4f1c55051..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Proceed to checkout. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->getProceedToCheckoutBlock()->proceedToCheckout(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php deleted file mode 100644 index 3e653cb8d1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/ProceedToCheckoutWithMultishippingStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Proceed to checkout with multi address. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->clickCheckoutWithMultiAddress(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php deleted file mode 100644 index 44e3be54201..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectAddressesStep.php +++ /dev/null @@ -1,119 +0,0 @@ -checkoutMultishippingAddresses = $checkoutMultishippingAddresses; - $this->products = $products; - $this->addresses = $addresses; - $this->customer = $customer; - $this->fillItemsData = $fillItemsData; - } - - /** - * Select addresses. - * - * @return array - */ - public function run() - { - $addresses = $this->getAddresses(); - if (!empty($this->fillItemsData)) { - foreach ($this->fillItemsData as $key => $itemData) { - $this->checkoutMultishippingAddresses->getAddressesBlock()->getItemsBlock() - ->getItemBlock($this->products[$itemData['productIndex']], $key) - ->fillItem($addresses[$itemData['addressIndex']]); - } - $this->checkoutMultishippingAddresses->getAddressesBlock()->getItemsBlock()->updateData(); - } - $this->checkoutMultishippingAddresses->getAddressesBlock()->clickContinueButton(); - - return ['addresses' => $addresses]; - } - - /** - * Get addresses. - * - * @return array - */ - protected function getAddresses() - { - $addresses = []; - if ($this->customer->hasData('address')) { - $addresses = $this->customer->getDataFieldConfig('address')['source']->getAddresses(); - } - return array_merge($addresses, $this->addresses); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php deleted file mode 100644 index d4f789d5a48..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodStep.php +++ /dev/null @@ -1,87 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutMethod = $checkoutMethod; - $this->customer = $customer; - } - - /** - * Run step that selecting checkout method. - * - * @return void - * @throws \Exception - */ - public function run() - { - $checkoutMethodBlock = $this->checkoutOnepage->getLoginBlock(); - switch ($this->checkoutMethod) { - case 'guest': - $checkoutMethodBlock->guestCheckout(); - $checkoutMethodBlock->clickContinue(); - break; - case 'register': - $checkoutMethodBlock->registerCustomer(); - $checkoutMethodBlock->clickContinue(); - break; - case 'login': - $checkoutMethodBlock->loginCustomer($this->customer); - break; - default: - throw new \Exception("Undefined checkout method."); - break; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php deleted file mode 100644 index 09af6280e38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectCheckoutMethodWithMultishippingStep.php +++ /dev/null @@ -1,97 +0,0 @@ -checkoutMultishippingLogin = $checkoutMultishippingLogin; - $this->checkoutMultishippingRegister = $checkoutMultishippingRegister; - $this->checkoutMethod = $checkoutMethod; - $this->customer = $customer; - } - - /** - * Run step that selecting checkout method. - * - * @return void - * @throws \Exception - */ - public function run() - { - $checkoutMethodBlock = $this->checkoutMultishippingLogin->getLoginBlock(); - switch ($this->checkoutMethod) { - case 'register': - $checkoutMethodBlock->createNewAccount(); - $this->checkoutMultishippingRegister->getRegisterForm()->registerCustomer($this->customer); - break; - case 'login': - $checkoutMethodBlock->login($this->customer); - break; - default: - throw new \Exception("Undefined checkout method."); - break; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php deleted file mode 100644 index fee007152ba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Run step that selecting payment method. - * - * @return array - */ - public function run() - { - if ($this->payment['method'] !== 'free') { - $this->checkoutOnepage->getPaymentMethodsBlock()->selectPaymentMethod($this->payment); - } - $this->checkoutOnepage->getPaymentMethodsBlock()->clickContinue(); - - return ['payment' => $this->payment]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php b/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php deleted file mode 100644 index bcb19337b93..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/TestStep/SelectPaymentMethodWithMultishippingStep.php +++ /dev/null @@ -1,74 +0,0 @@ -checkoutMultishippingBilling = $checkoutMultishippingBilling; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Select payment method. - * - * @return array - */ - public function run() - { - if ($this->payment['method'] !== 'free') { - $this->checkoutMultishippingBilling->getBillingBlock()->selectPaymentMethod($this->payment); - } - $this->checkoutMultishippingBilling->getBillingBlock()->clickContinue(); - - return ['payment' => $this->payment]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml deleted file mode 100644 index 7599fe182d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/fixture.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - flat - sales_flat_quote - Mage\Checkout\Model\Resource\Cart - - diff --git a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml deleted file mode 100644 index ccde1ea7872..00000000000 --- a/dev/tests/functional/tests/app/Mage/Checkout/Test/etc/testcase.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php deleted file mode 100644 index b9efcb2d20a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Block/Page.php +++ /dev/null @@ -1,135 +0,0 @@ - './/*/a[contains(.,"%s")]', - ]; - - /** - * Get page content. - * - * @param SimpleElement|null $element - * @return string - */ - public function getPageContent(SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - $this->waitForElementVisible($this->cmsPageContent); - return $element->find($this->cmsPageContent)->getText(); - } - - /** - * Get page title. - * - * @param SimpleElement|null $element - * @return string - */ - public function getPageTitle(SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - return $element->find($this->cmsPageTitle)->getText(); - } - - /** - * Get page head title. - * - * @return string - */ - public function getPageHeadTitle() - { - return $this->_rootElement->find($this->cmsPageHeadTitle)->getText(); - } - - /** - * Wait for text is visible in the block. - * - * @param string $text - * @return void - */ - public function waitUntilTextIsVisible($text) - { - $textSelector = sprintf($this->textSelector, $text); - $browser = $this->browser; - $this->_rootElement->waitUntil( - function () use ($browser, $textSelector) { - $blockText = $browser->find($textSelector, Locator::SELECTOR_XPATH); - return $blockText->isVisible() == true ? false : null; - } - ); - } - - /** - * Check is visible widget selector. - * - * @param array $widgetData - * @return bool - * @throws \Exception - */ - public function isWidgetVisible($widgetData) - { - if (isset($this->widgetSelectors[$widgetData['widget_type']])) { - return $this->_rootElement->find( - sprintf($this->widgetSelectors[$widgetData['widget_type']], $widgetData['anchor_text']), - Locator::SELECTOR_XPATH - )->isVisible(); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php deleted file mode 100644 index ed4ce18c73a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -open(); - $data = $cmsBlock->getData(); - $filter = [ - 'title' => $data['title'], - 'identifier' => $data['identifier'], - 'is_active' => $data['is_active'], - ]; - - $cmsBlockIndex->getCmsBlockGrid()->search($filter); - - \PHPUnit_Framework_Assert::assertTrue( - $cmsBlockIndex->getCmsBlockGrid()->isRowVisible($filter, false, false) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Block is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php deleted file mode 100644 index 34683828ef9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockNotOnCategoryPage.php +++ /dev/null @@ -1,71 +0,0 @@ -createByCode( - 'catalogCategory', - [ - 'dataset' => 'default_subcategory', - 'data' => [ - 'display_mode' => 'Static block and products', - 'landing_page' => $cmsBlock->getTitle(), - ] - ] - ); - $category->persist(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $categoryViewContent = $catalogCategoryView->getViewBlock()->getText(); - $cmsBlockContent = explode("\n", $categoryViewContent); - \PHPUnit_Framework_Assert::assertNotContains($cmsBlock->getContent(), $cmsBlockContent); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS block description is absent on Category page (frontend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php deleted file mode 100644 index a544c32f002..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockOnCategoryPage.php +++ /dev/null @@ -1,72 +0,0 @@ - Display settings> CMS Block). - * - * @param CmsIndex $cmsIndex - * @param CmsBlock $cmsBlock - * @param CatalogCategoryView $catalogCategoryView - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function processAssert( - CmsIndex $cmsIndex, - CmsBlock $cmsBlock, - CatalogCategoryView $catalogCategoryView, - FixtureFactory $fixtureFactory - ) { - $category = $fixtureFactory->createByCode( - 'catalogCategory', - [ - 'dataset' => 'default_subcategory', - 'data' => [ - 'display_mode' => 'Static block and products', - 'landing_page' => $cmsBlock->getTitle(), - ] - ] - ); - $category->persist(); - $cmsIndex->open(); - $cmsIndex->getTopmenu()->selectCategory($category->getName()); - $categoryViewContent = $catalogCategoryView->getViewBlock()->getText(); - $cmsBlockContent = explode("\n", $categoryViewContent); - \PHPUnit_Framework_Assert::assertContains($cmsBlock->getContent(), $cmsBlockContent); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS block description is present on Category page (frontend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php deleted file mode 100644 index c6a074926df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsBlockSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Block success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php deleted file mode 100644 index 9d9146faf39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php deleted file mode 100644 index a56a81af624..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnFrontend.php +++ /dev/null @@ -1,70 +0,0 @@ -open($_ENV['app_frontend_url'] . $cms->getIdentifier()); - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $frontendCmsPage->getCmsPageContentBlock()->getPageContent(), - 'Wrong page is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created CMS page with status "disabled" displays with error message on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php deleted file mode 100644 index d30f7ef16ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageDisabledOnUnassignedStoreView.php +++ /dev/null @@ -1,74 +0,0 @@ -open($_ENV['app_frontend_url'] . $cms->getIdentifier()); - $notFoundMessage = ($notFoundMessage !== null) ? $notFoundMessage : self::ERROR_MESSAGE; - $cmsIndex->getHeaderBlock()->selectStore('Default Store View'); - \PHPUnit_Framework_Assert::assertContains( - $notFoundMessage, - $frontendCmsPage->getCmsPageContentBlock()->getPageContent(), - 'Wrong page content is displayed.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Created CMS page displays with error message on unassigned store views on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php deleted file mode 100644 index f18ea84af7c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageForm.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $cmsPageIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cms->getTitle()]); - $cmsFormData = $cmsPageNew->getPageForm()->getData($cms); - $errors = $this->verifyData($cms->getData(), $cmsFormData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS page data on edit page equals data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php deleted file mode 100644 index bddc1966d4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $cmsTitle = $cms->getTitle(); - \PHPUnit_Framework_Assert::assertTrue( - $cmsPageIndex->getCmsPageGridBlock()->isRowVisible(['title' => $cmsTitle]), - "Cms page '$cmsTitle' is not present in pages grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page is present in pages grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php deleted file mode 100644 index 89e3e23a09a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageNotInGrid.php +++ /dev/null @@ -1,67 +0,0 @@ -open(); - $filter = [ - 'title' => $cmsPage->getTitle(), - 'identifier' => $cmsPage->getIdentifier(), - 'is_active' => $cmsPage->getIsActive() - ]; - \PHPUnit_Framework_Assert::assertFalse( - $cmsIndex->getCmsPageGridBlock()->isRowVisible($filter), - "Cms page {$cmsPage->getTitle()} is present in pages grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Cms page is not present in pages grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php deleted file mode 100644 index 340228b619b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPagePreview.php +++ /dev/null @@ -1,125 +0,0 @@ -open(); - $cmsPageIndex->getCmsPageGridBlock()->searchAndReview(['title' => $cms->getTitle()]); - $browser->selectWindow(); - if ($isIFrame) { - $this->switchToFrame($browser); - } - $element = $browser->find('body'); - - $fixtureContent = $cms->getContent(); - \PHPUnit_Framework_Assert::assertContains( - $fixtureContent['content'], - $frontendCmsPage->getCmsPageContentBlock()->getPageContent($element), - 'Wrong content is displayed.' - ); - if ($cms->getContentHeading()) { - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cms->getContentHeading()), - strtolower($frontendCmsPage->getCmsPageContentBlock()->getPageTitle($element)), - 'Wrong title is displayed.' - ); - } - if (isset($fixtureContent['widget'])) { - foreach ($fixtureContent['widget']['preset'] as $widget) { - \PHPUnit_Framework_Assert::assertTrue( - $frontendCmsPage->getCmsPageContentBlock()->isWidgetVisible($widget), - "Widget '{$widget['widget_type']}' is not displayed." - ); - } - } - $browser->closeWindow(); - $browser->selectWindow(); - $browser->switchToFrame(); - } - - /** - * Switch to frame. - * - * @param Browser $browser - * @return void - */ - protected function switchToFrame(Browser $browser) - { - $selector = $this->loader; - $browser->waitUntil( - function () use ($browser, $selector) { - return $browser->find($selector)->isVisible() == false ? true : null; - } - ); - $browser->switchToFrame(new Locator($this->iFrameSelector)); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'CMS Page content equals to data from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php deleted file mode 100644 index 08cac42095b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Constraint/AssertCmsPageSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message is displayed after save a CMS page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml deleted file mode 100644 index 920d716c0f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php deleted file mode 100644 index 4c23069c6e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlock/Stores.php +++ /dev/null @@ -1,75 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Get stores. - * - * @return Store[] - */ - public function getStores() - { - return $this->stores; - } - - public function setData($data) { - $this->data = $data; - } - - public function setStores($stores) { - $this->stores = $stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml deleted file mode 100644 index 3e7b8807167..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsBlockMultiStore.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml deleted file mode 100644 index af9b4702417..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php deleted file mode 100644 index 94accf04b50..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/Content.php +++ /dev/null @@ -1,76 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->params = $params; - $this->data = $data; - if (isset($data['widget']['preset'])) { - $this->data['widget']['preset'] = $this->getPreset($data['widget']['preset']); - } - } - - /** - * Preset for Widgets. - * - * @param string $name - * @return array|null - */ - protected function getPreset($name) - { - $presets = [ - 'default' => [ - 'widget_1' => [ - 'widget_type' => 'CMS Page Link', - 'anchor_text' => 'CMS Page Link anchor_text_%isolation%', - 'title' => 'CMS Page Link anchor_title_%isolation%', - 'template' => 'CMS Page Link Block Template', - 'chosen_option' => [ - 'filter_url_key' => 'home', - ], - ], - ], - ]; - if (!isset($presets[$name])) { - return null; - } - return $presets[$name]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php deleted file mode 100644 index a6295bb36ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPage/StoreId.php +++ /dev/null @@ -1,66 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->store[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Return Store fixture. - * - * @return Store - */ - public function getStore() - { - return $this->store; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml deleted file mode 100644 index e69858f288d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Fixture/CmsPageMultiStore.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php b/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php deleted file mode 100644 index 9c78145a09f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Handler/CmsPage/CmsPageInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Published' => 1, - 'Disabled' => 0, - 'Enabled' => 1 - ], - 'store_id' => [ - 'Main Website/Main Website Store/Default Store View' => 1 - ], - 'page_layout' => [ - '1 column' => '1column', - '2 columns with left bar' => '2columns-left', - '2 columns with right bar' => '2columns-right', - '3 columns' => '3columns', - ], - 'under_version_control' => [ - 'Yes' => 1, - 'No' => 0, - ], - ]; - - /** - * Url for save cms page. - * - * @var string - */ - protected $url = 'cms_page/save'; - - /** - * Post request for creating a cms page. - * - * @param FixtureInterface $fixture - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . $this->url; - $data = $this->replaceMappingData($fixture->getData()); - $data = $this->prepareData($data); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Cms page entity creating by curl handler was not successful! Response: $response"); - } - $id = $this->getCmsPageId($response); - - return ['page_id' => $id]; - } - - /** - * Prepare data. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - $resultStore = []; - foreach ($data['store_id'] as $key => $store) { - $resultStore['store_id'][$key] = $this->mappingData['store_id'][$store]; - } - $data['stores'] = $resultStore['store_id']; - unset($data['store_id']); - $data['content'] = $data['content']['content']; - if (!isset($data['is_active'])) { - $data['is_active'] = 1; - } - return $data; - } - - /** - * Return saved cms page id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getCmsPageId($response) - { - preg_match_all('~tr title=[^\s]*\/page_id\/(\d+)~', $response, $matches); - if (empty($matches[1])) { - throw new \Exception('Cannot find Cms Page id'); - } - - return max($matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml deleted file mode 100644 index 8ed0b776885..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml deleted file mode 100644 index 71a4183a7d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml deleted file mode 100644 index e62571e210f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsBlockNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml deleted file mode 100644 index 00a7b6222c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml deleted file mode 100644 index f57bb6cfacd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml deleted file mode 100644 index 3a13654d05c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/Adminhtml/CmsPageNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml deleted file mode 100644 index 8d946126630..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml deleted file mode 100644 index c4c49dd5cf1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Page/CmsPage.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml deleted file mode 100644 index 40557e52ae9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsBlock.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - cms-block-title-%isolation% - cms-block-identifier-%isolation% - - cms block text content - - Enabled - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml deleted file mode 100644 index d5dcb80670f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/Repository/CmsPage.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - test-%isolation% - test-%isolation% - - - default - - - - text content - - Test-%isolation% - 1 column - - - - page-compare-%isolation% - page-compare-%isolation% - - - default - - - - Test Content - - 3 columns - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php deleted file mode 100644 index 2ed6583a8dc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.php +++ /dev/null @@ -1,77 +0,0 @@ - Static Blocks. - * 3. Click "Add New Block" button. - * 4. Fill data according to dataset. - * 5. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7430 - */ -class CreateCmsBlockEntityTest extends Injectable -{ - /** - * Page CmsBlockIndex. - * - * @var CmsBlockIndex - */ - protected $cmsBlockIndex; - - /** - * Page CmsBlockNew. - * - * @var CmsBlockNew - */ - protected $cmsBlockNew; - - /** - * Injection data. - * - * @param CmsBlockIndex $cmsBlockIndex - * @param CmsBlockNew $cmsBlockNew - * @return void - */ - public function __inject(CmsBlockIndex $cmsBlockIndex, CmsBlockNew $cmsBlockNew) - { - $this->cmsBlockIndex = $cmsBlockIndex; - $this->cmsBlockNew = $cmsBlockNew; - } - - /** - * Create CMS Block. - * - * @param CmsBlock $cmsBlock - * @return void - */ - public function test(CmsBlock $cmsBlock) - { - // Steps - $this->cmsBlockIndex->open(); - $this->cmsBlockIndex->getGridPageActions()->addNew(); - $this->cmsBlockNew->getBlockForm()->fill($cmsBlock); - $this->cmsBlockNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml deleted file mode 100644 index f74212512ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsBlockEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - block_%isolation% - identifier_%isolation% - default - Enabled - description_%isolation% - - - - - - block_%isolation% - identifier_%isolation% - default - Disabled - description_%isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php deleted file mode 100644 index 7957ea68007..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.php +++ /dev/null @@ -1,148 +0,0 @@ - Pages > Manage Content. - * 3. Click "Add New Page" button. - * 4. Fill data according to data set. - * 5. Click "Save Page" button. - * 6. Perform all assertions. - * - * @group CMS Content (PS) - * @ZephyrId MPERF-6686 - */ -class CreateCmsPageEntityTest extends Injectable -{ - /** - * CmsIndex page. - * - * @var CmsPageIndex - */ - protected $cmsPageIndex; - - /** - * CmsNew page. - * - * @var CmsPageNew - */ - protected $cmsPageNew; - - /** - * Page StoreIndex. - * - * @var StoreIndex - */ - protected $storeIndex; - - /** - * Cms page fixture. - * - * @var CmsPage - */ - protected $cms; - - /** - * Page EditStore. - * - * @var EditStore - */ - protected $editStore; - - /** - * Page DeleteStore. - * - * @var DeleteStore - */ - protected $deleteStore; - - /** - * Inject data. - * - * @param CmsPageIndex $cmsPageIndex - * @param CmsPageNew $cmsPageNew - * @param StoreIndex $storeIndex - * @param EditStore $editStore - * @param DeleteStore $deleteStore - * @return void - */ - public function __inject( - CmsPageIndex $cmsPageIndex, - CmsPageNew $cmsPageNew, - StoreIndex $storeIndex, - EditStore $editStore, - DeleteStore $deleteStore - ) { - $this->cmsPageIndex = $cmsPageIndex; - $this->cmsPageNew = $cmsPageNew; - $this->storeIndex = $storeIndex; - $this->editStore = $editStore; - $this->deleteStore = $deleteStore; - } - - /** - * Creating Cms page. - * - * @param CmsPage $cms - * return void - */ - public function test(CmsPage $cms) - { - $this->cms = $cms; - - // Steps - $this->cmsPageIndex->open(); - $this->cmsPageIndex->getPageActionsBlock()->addNew(); - $this->cmsPageNew->getPageForm()->fill($cms); - $this->cmsPageNew->getPageMainActions()->save(); - } - - /** - * Delete store. - * - * @return void - */ - public function tearDown() - { - if (!$this->cms->hasData('store_id')) { - return; - } - $stores = $this->cms->getStoreId(); - if ($stores) { - $stores = $this->cms->getDataFieldConfig('store_id')['source']->getStore(); - foreach ($stores as $store) { - $this->storeIndex->open(); - $this->storeIndex->getStoreGrid()->openStore($store); - $this->editStore->getFormPageActions()->delete(); - $deleteStoreFormPageActions = $this->deleteStore->getFormPageActions(); - if ($deleteStoreFormPageActions->isVisible()) { - $this->deleteStore->getForm()->fillForm(); - $deleteStoreFormPageActions->delete(); - } - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml deleted file mode 100644 index 38064ecb75d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/CreateCmsPageEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - Disabled - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - custom - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - - - - - - - - NewCmsPage%isolation% - new_cms_page%isolation% - cms_page_text_content_heading%isolation% - cms_page_text_content%isolation% - default - General Contact Name - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php deleted file mode 100644 index cd8b5f0ab1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.php +++ /dev/null @@ -1,83 +0,0 @@ - Pages -> Manage Content. - * 3. Select CMS Page from precondition. - * 4. Click "Delete Page" button. - * 5. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7326 - */ -class DeleteCmsPageEntityTest extends Injectable -{ - /** - * CMS Index page. - * - * @var CmsPageIndex - */ - protected $cmsIndex; - - /** - * Edit CMS page. - * - * @var CmsPageEdit - */ - protected $cmsEdit; - - /** - * Inject pages. - * - * @param CmsPageIndex $cmsIndex - * @param CmsPageEdit $cmsEdit - * @return void - */ - public function __inject(CmsPageIndex $cmsIndex, CmsPageEdit $cmsEdit) - { - $this->cmsIndex = $cmsIndex; - $this->cmsEdit = $cmsEdit; - } - - /** - * Delete CMS Page. - * - * @param CmsPageMultiStore $cmsPage - * @return void - */ - public function test(CmsPageMultiStore $cmsPage) - { - // Preconditions - $cmsPage->persist(); - - // Steps - $this->cmsIndex->open(); - $this->cmsIndex->getCmsPageGridBlock()->searchAndOpen(['title' => $cmsPage->getTitle()]); - $this->cmsEdit->getPageMainActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml deleted file mode 100644 index 05da5e8387b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/DeleteCmsPageEntityTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - default - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php deleted file mode 100644 index 1a4c3326c14..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.php +++ /dev/null @@ -1,109 +0,0 @@ - Pages > Manage Content. - * 3. Select CMS Page from precondition. - * 4. Edit CMS Page according to data set. - * 5. Click 'Save Page'. - * 6. Perform all assertions. - * - * @group CMS_Content_(PS) - * @ZephyrId MPERF-7512 - */ -class UpdateCmsPageEntityTest extends Injectable -{ - /** - * CMS Index page. - * - * @var CmsPageIndex - */ - protected $cmsIndex; - - /** - * Edit CMS page. - * - * @var CmsPageEdit - */ - protected $cmsEdit; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $factory; - - /** - * Inject page. - * - * @param CmsPageIndex $cmsIndex - * @param CmsPageEdit $cmsEdit - * @param CmsPageMultiStore $cmsOriginal - * @param FixtureFactory $factory - * @return array - */ - public function __inject( - CmsPageIndex $cmsIndex, - CmsPageEdit $cmsEdit, - CmsPageMultiStore $cmsOriginal, - FixtureFactory $factory - ) { - $cmsOriginal->persist(); - $this->cmsIndex = $cmsIndex; - $this->cmsEdit = $cmsEdit; - $this->factory = $factory; - - return ['cmsOriginal' => $cmsOriginal]; - } - - /** - * Update CMS Page test. - * - * @param CmsPageMultiStore $cms - * @param CmsPageMultiStore $cmsOriginal - * @return array - */ - public function test(CmsPageMultiStore $cms, CmsPageMultiStore $cmsOriginal) - { - // Steps - $this->cmsIndex->open(); - $filter = ['title' => $cmsOriginal->getTitle()]; - $this->cmsIndex->getCmsPageGridBlock()->searchAndOpen($filter); - $this->cmsEdit->getPageForm()->fill($cms); - $this->cmsEdit->getPageMainActions()->save(); - - return [ - 'cms' => $this->factory->createByCode( - 'cmsPage', - ['data' => array_merge($cmsOriginal->getData(), $cms->getData())] - ) - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml deleted file mode 100644 index 3a8c507a808..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/TestCase/UpdateCmsPageEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - default - CmsPageEdited%isolation% - Disabled - cms_page_text_content_after_edit - - - - - default - CmsPageEdited%isolation% - cms_page_url_edited_%isolation% - Content Heading TexEdited - cms_page_text_content_after_edit - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml deleted file mode 100644 index c247af71e71..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml deleted file mode 100644 index b2b89b28f9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Cms/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - cms_page - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php b/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php deleted file mode 100644 index f98c1b97766..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Block/Messages.php +++ /dev/null @@ -1,176 +0,0 @@ -waitForElementVisible($this->successMessage); - } - - /** - * Wait for error message. - * - * @return bool - */ - public function waitErrorMessage() - { - return $this->waitForElementVisible($this->errorMessage); - } - - /** - * Get all success messages which are present on the page. - * - * @return string|array - */ - public function getSuccessMessages() - { - $this->waitForElementVisible($this->successMessage); - $elements = $this->_rootElement->getElements($this->successMessage); - - return $this->getTextFromElements($elements); - } - - /** - * Get all error messages which are present on the page. - * - * @return string|array - */ - public function getErrorMessages() - { - $this->waitForElementVisible($this->errorMessage); - $elements = $this->_rootElement->getElements($this->errorMessage); - - return $this->getTextFromElements($elements); - } - - /** - * Get text from specified elements. - * - * @param Element[] $elements - * @return string|array - */ - protected function getTextFromElements(array $elements) - { - $messages = []; - /** Element $element */ - foreach ($elements as $key => $element) { - $messages[$key] = $element->getText(); - } - - return count($messages) > 1 ? $messages : $messages[0]; - } - - /** - * Check is visible messages - * - * @param string $messageType - * @return bool - */ - public function isVisibleMessage($messageType) - { - return $this->_rootElement - ->find($this->{$messageType . 'Message'}, Locator::SELECTOR_CSS) - ->isVisible(); - } - - /** - * Get warning message which is present on the page - * - * @return string - */ - public function getWarningMessages() - { - $this->waitForElementVisible($this->warningMessage); - return $this->_rootElement->find($this->warningMessage)->getText(); - } - - /** - * Click on link in the messages which are present on the page. - * - * @param string $messageType - * @param string $linkText - * @return void - */ - public function clickLinkInMessages($messageType, $linkText) - { - if ($this->isVisibleMessage($messageType)) { - $this->_rootElement - ->find($this->{$messageType . 'Message'}, Locator::SELECTOR_CSS) - ->find(sprintf($this->messageLink, $linkText), Locator::SELECTOR_XPATH) - ->click(); - } - } - - /** - * Get notice message which is present on the page. - * - * @return string - */ - public function getNoticeMessages() - { - $this->waitForElementVisible($this->noticeMessage); - return $this->_rootElement->find($this->noticeMessage)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml deleted file mode 100644 index 16446f32753..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/ConfigData.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php b/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php deleted file mode 100644 index 09a648e6afe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Fixture/Date.php +++ /dev/null @@ -1,53 +0,0 @@ -params = $params; - if (isset($data['pattern']) && $data['pattern'] !== '-') { - $matches = []; - $delta = ''; - if (preg_match_all('/(\+|-)\d+.+/', $data['pattern'], $matches)) { - $delta = $matches[0][0]; - } - $timestamp = $delta === '' ? time() : strtotime($delta); - if (!$timestamp) { - throw new \Exception('Invalid date format for "' . $this->params['attribute_code'] . '" field'); - } - $date = date(str_replace($delta, '', $data['pattern']), $timestamp); - if (!$date) { - $date = date('m/d/Y'); - } - $this->data = trim($date); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php b/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php deleted file mode 100644 index d5ec953e126..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Handler/ConfigData/ConfigDataInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'Website' => 'website', - 'Store' => 'group', - 'Store View' => 'store', - ], - ]; - - /** - * Post request for setting configuration. - * - * @param FixtureInterface|null $fixture [optional] - * @return void - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - foreach ($data as $scope => $item) { - $this->applyConfigSettings($item, $scope); - } - } - - /** - * Prepare POST data for setting configuration. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $result = []; - $fields = $fixture->getData(); - if (isset($fields['section'])) { - foreach ($fields['section'] as $key => $itemSection) { - if (is_array($itemSection)) { - $itemSection['path'] = $key; - } - parse_str($this->prepareConfigPath($itemSection), $configPath); - $result = array_merge_recursive($result, $configPath); - } - } - return $result; - } - - /** - * Prepare config path. - * - * From payment/cashondelivery/active to ['payment']['groups']['cashondelivery']['fields']['active'] - * - * @param array $input - * @return string - */ - protected function prepareConfigPath(array $input) - { - $resultArray = ''; - $InputValue = isset($input['value']) ? $input['value'] : null; - $path = explode('/', $input['path']); - foreach ($path as $position => $subPath) { - if ($position === 0) { - $resultArray .= $subPath; - continue; - } elseif ($position === (count($path) - 1)) { - $resultArray .= '[fields]'; - } else { - $resultArray .= '[groups]'; - } - $resultArray .= '[' . $subPath . ']'; - } - $resultArray .= '[value]'; - if (is_array($InputValue)) { - $values = []; - foreach ($InputValue as $key => $value) { - $values[] = $resultArray . "[$key]=$value"; - } - $resultArray = implode('&', $values); - } elseif(!empty($InputValue)) { - $resultArray .= '=' . $InputValue; - } - return $resultArray; - } - - /** - * Apply config settings via curl. - * - * @param array $data - * @param string $section - * @throws \Exception - */ - protected function applyConfigSettings(array $data, $section) - { - $url = $this->getUrl($section); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (strpos($response, 'class="success-msg"') === false) { - throw new \Exception("Settings are not applied! Response: $response"); - } - } - - /** - * Retrieve URL for request. - * - * @param string $section - * @return string - */ - protected function getUrl($section) - { - return $_ENV['app_backend_url'] . 'system_config/save/section/' . $section; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml deleted file mode 100644 index 8fcd8ffed51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - default - 0 - general - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php b/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php deleted file mode 100644 index 2e8aaf6215d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/TestStep/SetupConfigurationStep.php +++ /dev/null @@ -1,87 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->configData = $configData; - $this->rollback = $rollback; - } - - /** - * Set config. - * - * @return array - */ - public function run() - { - if ($this->configData == '-' || $this->configData === null) { - return []; - } - $prefix = ($this->rollback == false) ? '' : '_rollback'; - - $configData = array_map('trim', explode(',', $this->configData)); - $result = []; - - foreach ($configData as $configdataset) { - $config = $this->fixtureFactory->createByCode('configData', ['dataset' => $configdataset . $prefix]); - if ($config->hasData('section')) { - $config->persist(); - $result[] = $config; - } - } - - return ['config' => $result]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml deleted file mode 100644 index 2d0b8eb4df3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml deleted file mode 100644 index 07a7dc06b04..00000000000 --- a/dev/tests/functional/tests/app/Mage/Core/Test/etc/fixture.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Mage_Core - flat - core_config_data - Mage\Core\Model\Resource\Config\Data\Collection - -
- section - virtual -
-
-
-
diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php deleted file mode 100644 index 87e7e3f0c9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnCatalogPage.php +++ /dev/null @@ -1,75 +0,0 @@ -getCategoryIds()[0]; - $cmsIndex->open(); - $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol); - $cmsIndex->getTopmenu()->selectCategory($categoryName); - $price = $catalogCategoryView->getListProductBlock()->getPrice($product->getId()); - preg_match('`(.*?)\d`', $price, $matches); - - $symbolOnPage = isset($matches[1]) ? $matches[1] : null; - \PHPUnit_Framework_Assert::assertEquals( - $currencySymbol->getCustomCurrencySymbol(), - $symbolOnPage, - 'Wrong Currency Symbol is displayed on Category page.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Currency Symbol has been changed on Catalog page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php deleted file mode 100644 index 6ee5e261f6e..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolOnProductPage.php +++ /dev/null @@ -1,85 +0,0 @@ -open(); - $adminCache->getPageActions()->flushCacheStorage(); - $adminCache->getMessagesBlock()->waitSuccessMessage(); - - $cmsIndex->open(); - $cmsIndex->getCurrencyBlock()->switchCurrency($currencySymbol); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $price = $catalogProductView->getViewBlock()->getPriceBlock()->getPrice(); - preg_match('`(.*?)\d`', $price, $matches); - - $symbolOnPage = isset($matches[1]) ? $matches[1] : null; - \PHPUnit_Framework_Assert::assertEquals( - $currencySymbol->getCustomCurrencySymbol(), - $symbolOnPage, - 'Wrong Currency Symbol is displayed on Product page.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Currency Symbol has been changed on Product Details page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php deleted file mode 100644 index ba3018b1c0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Constraint/AssertCurrencySymbolSuccessSaveMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Currency Symbol success save message is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml deleted file mode 100644 index 14b9b7ba2fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Fixture/CurrencySymbolEntity.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml deleted file mode 100644 index 22a753414d3..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml deleted file mode 100644 index 70113fcba53..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencySymbolIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml deleted file mode 100644 index dadb2eb140f..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - currency - 1 - - - USD - UAH - - - - - - currency - 1 - - - USD - - - - - - currency - 1 - - - - - currency - 1 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php deleted file mode 100644 index 92e625b86a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.php +++ /dev/null @@ -1,181 +0,0 @@ -Manage Currency->Rates and click to Import button. - * 3. Create simple product. - * - * Steps: - * 1. Login to backend. - * 2. Navigate to Stores->Manage Currency->Symbols. - * 3. Make changes according to dataset. - * 4. Click 'Save Currency Symbols' button. - * 5. Perform all asserts. - * - * @group Currency_(PS) - * @ZephyrId MPERF-6679 - */ -class EditCurrencySymbolEntityTest extends Injectable -{ - /** - * System Currency Symbol grid page. - * - * @var SystemCurrencySymbolIndex - */ - protected $currencySymbolIndex; - - /** - * System currency rates page. - * - * @var SystemCurrencyIndex - */ - protected $currencyRatesIndex; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Prepare data. - * - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Injection pages. - * - * @param SystemCurrencySymbolIndex $currencySymbolIndex - * @param SystemCurrencyIndex $currencyRatesIndex - * @return void - */ - public function __inject( - SystemCurrencySymbolIndex $currencySymbolIndex, - SystemCurrencyIndex $currencyRatesIndex - ) { - $this->currencySymbolIndex = $currencySymbolIndex; - $this->currencyRatesIndex = $currencyRatesIndex; - } - - /** - * Edit Currency Symbol Entity test. - * - * @param CurrencySymbolEntity $currencySymbol - * @return CatalogProductSimple[] - */ - public function test(CurrencySymbolEntity $currencySymbol) - { - // Preconditions: - $this->applyCurrencyInConfig(); - $this->applyCurrencyConverterCredentials(); - $this->importCurrencyRates(); - $product = $this->createSimpleProductWithCategory(); - - // Steps: - $this->currencySymbolIndex->open(); - $this->currencySymbolIndex->getCurrencySymbolForm()->fill($currencySymbol); - $this->currencySymbolIndex->getPageActions()->save(); - - return ['product' => $product]; - } - - /** - * Apply custom currency in Config. - * - * @return void - */ - protected function applyCurrencyInConfig() - { - $config = $this->fixtureFactory->createByCode( - 'configData', - ['dataset' => 'config_currency_symbols_usd_and_uah'] - ); - $config->persist(); - } - - /** - * Set currency converter credentials - * - * @return void - */ - protected function applyCurrencyConverterCredentials() - { - $config = $this->fixtureFactory->createByCode( - 'configData', - ['dataset' => 'config_currency_converters'] - ); - $config->persist(); - } - - /** - * Create simple product with category. - * - * @return CatalogProductSimple - */ - protected function createSimpleProductWithCategory() - { - /**@var CatalogProductSimple $catalogProductSimple */ - $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => 'product_with_category']); - $product->persist(); - return $product; - } - - /** - * Import currency rates for applied currencies. - * - * @return void - */ - protected function importCurrencyRates() - { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getGridPageActions()->clickImportButton(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - - /** - * Disabling currency which has been added. - * - * @return void - */ - public function tearDown() - { - $config = $this->fixtureFactory->createByCode('configData', ['dataset' => 'config_currency_symbols_usd']); - /** @var InjectableFixture $config */ - $config->persist(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml deleted file mode 100644 index e41b1b49d11..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestCase/EditCurrencySymbolEntityTest.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - UAH - No - custom - - - - - - UAH - No - & - - - - - - UAH - No - % - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php deleted file mode 100644 index 1ac50b3da70..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ApplyCurrencyInConfigStep.php +++ /dev/null @@ -1,80 +0,0 @@ - [ - 'scope' => 'currency', - 'scope_id' => '1' - ] - ]; - - /** - * Fixture Factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Currency symbols. - * - * @var string - */ - protected $currencySymbols; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param string $currencySymbols - */ - public function __construct(FixtureFactory $fixtureFactory, $currencySymbols) - { - $this->fixtureFactory = $fixtureFactory; - $this->currencySymbols = $currencySymbols; - } - - /** - * Apply currency in config step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $symbols = explode(',', $this->currencySymbols); - foreach ($symbols as &$symbol) { - $symbol = strtoupper(trim($symbol)); - } - $this->data['currency/options/allow']['value'] = $symbols; - $config = $this->fixtureFactory->createByCode('configData', ['data' => $this->data]); - $config->persist(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php deleted file mode 100644 index 8b6d4e0d474..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/ImportCurrencyRatesStep.php +++ /dev/null @@ -1,57 +0,0 @@ -currencyRatesIndex = $currencyRatesIndex; - $this->currencySymbols = $currencySymbols; - } - - /** - * Import currency rates step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getGridPageActions()->clickImportButton(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php deleted file mode 100644 index d8e77fb3e45..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/TestStep/SetupCurrencyRatesStep.php +++ /dev/null @@ -1,57 +0,0 @@ -currencyRatesIndex = $currencyRatesIndex; - $this->currencySymbols = $currencySymbols; - } - - /** - * Set up currency rate step. - * - * @return void - */ - public function run() - { - if ($this->currencySymbols !== '-') { - $this->currencyRatesIndex->open(); - $this->currencyRatesIndex->getCurrencyGrid()->setupGbpRate(); - $this->currencyRatesIndex->getGridPageActions()->saveCurrentRate(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml deleted file mode 100644 index 1f842866da6..00000000000 --- a/dev/tests/functional/tests/app/Mage/CurrencySymbol/Test/etc/fixture.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - flat - core_config_data - - - inherit_custom_currency_symbol - virtual - checkbox - - - custom_currency_symbol - virtual - - - code - virtual - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php deleted file mode 100644 index 6b8c7e4d94c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/AdditionalAddress.php +++ /dev/null @@ -1,71 +0,0 @@ -addressItem, $address->getStreet()); - $addressItem = $this->_rootElement->find($addressItemSelector, Locator::SELECTOR_XPATH); - $addressItem->find($this->deleteAddress)->click(); - $this->browser->acceptAlert(); - } - - /** - * Get block text. - * - * @return string - */ - public function getBlockText() - { - return $this->_rootElement->find($this->blockText)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php deleted file mode 100644 index 6da39a7c3b5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Address/Book.php +++ /dev/null @@ -1,44 +0,0 @@ -blockFactory->create( - 'Mage\Customer\Test\Block\Account\Address\AdditionalAddress', - ['element' => $this->_rootElement->find($this->additionalAddress)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php deleted file mode 100644 index c33d0445535..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Dashboard/Info.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->contactInfoChangePasswordLink)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php deleted file mode 100644 index 9fb10168de5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Account/Navigation.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->navigationItem, $link), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php deleted file mode 100644 index 67fd2de2bce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.php +++ /dev/null @@ -1,42 +0,0 @@ -_rootElement->find($this->save)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml deleted file mode 100644 index ac60f15aedf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Edit.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - #street_1 - - - - select - - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php deleted file mode 100644 index 9220f37a3df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Address/Renderer.php +++ /dev/null @@ -1,142 +0,0 @@ -address = $address; - $this->type = $type; - } - - /** - * Returns pattern according to address type. - * - * @return string - */ - protected function getPattern() - { - $region = $this->resolveRegion(); - switch ($this->type) { - case "html": - $outputPattern = "{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}" - . "{{lastname}}{{depend}} {{suffix}}{{/depend}}\n{{depend}}{{company}}\n{{/depend}}{{street}}\n" - . "{{city}}, {{{$region}}}, {{postcode}}\n{{country_id}}\n{{depend}}T: {{telephone}}{{/depend}}" - . "{{depend}}\nF: {{fax}}{{/depend}}{{depend}}\nVAT: {{vat_id}}{{/depend}}"; - break; - case "oneline": - default: - $outputPattern = "{{depend}}{{prefix}} {{/depend}}{{firstname}} {{depend}}{{middlename}} {{/depend}}" - . "{{lastname}}{{depend}} {{suffix}}{{/depend}}, {{street}}, " - . "{{city}}, {{{$region}}} {{postcode}}, {{country_id}}"; - break; - } - return $outputPattern; - } - - /** - * Render address according to format type. - * - * @return string - */ - public function render() - { - $outputPattern = $this->getPattern(); - $fields = $this->getFieldsArray($outputPattern); - $output = $this->preparePattern(); - $output = str_replace(['{{depend}}', '{{/depend}}', '{', '}'], '', $output); - - foreach ($fields as $field) { - $data = $this->address->getData($field); - $output = str_replace($field, $data, $output); - } - - return $output; - } - - /** - * Get an array of necessary fields from pattern. - * - * @param string $outputPattern - * @return mixed - */ - protected function getFieldsArray($outputPattern) - { - $fieldsArray = []; - preg_match_all('@\{\{(\w+)\}\}@', $outputPattern, $matches); - foreach ($matches[1] as $item) { - if ($item != 'depend') { - $fieldsArray[] = $item; - } - } - return $fieldsArray; - } - - /** - * Purge fields from pattern which are not present in fixture. - * - * @return string - */ - protected function preparePattern() - { - $outputPattern = $this->getPattern(); - preg_match_all('@\{\{depend\}\}(.*?)\{\{.depend\}\}@siu', $outputPattern, $matches); - foreach ($matches[1] as $key => $dependPart) { - preg_match_all('@\{\{(\w+)\}\}@', $dependPart, $depends); - foreach ($depends[1] as $depend) { - if ($this->address->getData(trim($depend)) === null) { - $outputPattern = str_replace($matches[0][$key], "", $outputPattern); - } - } - } - return $outputPattern; - } - - /** - * Check necessary field to retrieve according to address country. - * - * @return string - */ - protected function resolveRegion() - { - return $this->address->hasData('region') ? 'region' : 'region_id'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php deleted file mode 100644 index e59e868824b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.php +++ /dev/null @@ -1,77 +0,0 @@ -_rootElement->find($this->saveButton)->click(); - } - - /** - * Get all error validation messages for fields. - * - * @param Customer $customer - * @return array - */ - public function getValidationMessages(Customer $customer) - { - $messages = []; - foreach (array_keys($customer->getData()) as $field) { - $element = $this->_rootElement->find( - sprintf($this->validationText, 'advice-validate-c' . str_replace('_', '-', $field)) - ); - if ($element->isVisible()) { - $messages[$field] = $element->getText(); - } - } - return $messages; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml deleted file mode 100644 index 9927c024f41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/CustomerForm.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php deleted file mode 100644 index be3d27dcdea..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.php +++ /dev/null @@ -1,72 +0,0 @@ -fill($customer); - $this->submit(); - $this->waitForElementNotVisible($this->loginButton, Locator::SELECTOR_CSS); - } - - /** - * Submit login form. - */ - public function submit() - { - $this->_rootElement->find($this->loginButton, Locator::SELECTOR_CSS)->click(); - } - - /** - * Click on 'Create an Account' button. - * - * @return void - */ - public function createNewAccount() - { - $this->_rootElement->find($this->newAccount)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml deleted file mode 100644 index 51f28e75355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Login.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - login - - - [name='login[username]'] - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php deleted file mode 100644 index f5aaa2e45f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.php +++ /dev/null @@ -1,47 +0,0 @@ -dataMapping($fixture->getData()); - unset($mapping['id']); - $this->_fill($mapping); - $this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml deleted file mode 100644 index b170e4f3dc3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Block/Form/Register.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - checkbox - - - #confirmation - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php deleted file mode 100644 index 3d6cbc88b74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedBackend.php +++ /dev/null @@ -1,77 +0,0 @@ -open()->getPageActionsBlock()->addNew(); - $orderCreateIndex->getCustomerGrid()->selectCustomer($customer); - $orderCreateIndex->getStoreBlock()->selectStoreView(); - \PHPUnit_Framework_Assert::assertNotContains( - $this->prepareAddress($deletedAddress), - $orderCreateIndex->getCreateBlock()->getBillingAddressForm()->getExistingAddresses(), - 'Deleted address is present on backend during order creation' - ); - } - - /** - * Prepare address for assertion. - * - * @param Address $address - * @return string - */ - protected function prepareAddress(Address $address) - { - /** @var Renderer $renderer */ - $renderer = $this->objectManager->create('Mage\Customer\Test\Block\Address\Renderer', ['address' => $address]); - return $renderer->render(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Deleted address is absent on backend during order creation'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php deleted file mode 100644 index 0ca4a539b91..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php +++ /dev/null @@ -1,63 +0,0 @@ -open(); - $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('Address Book'); - \PHPUnit_Framework_Assert::assertEquals( - self::EXPECTED_MESSAGE, - $customerAddress->getBookBlock()->getAdditionalAddressBlock()->getBlockText(), - 'Expected text is absent in Additional Address block.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Deleted address is absent in "Additional Address Entries" block.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php deleted file mode 100644 index bbbf8c3a962..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertChangePasswordFailMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessages()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Fail message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php deleted file mode 100644 index 913ad22b07e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerFailRegisterMessage.php +++ /dev/null @@ -1,59 +0,0 @@ -getMessagesBlock()->getErrorMessages(), - "Actual error message doesn't match expected error message." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message is displayed after creation existing customer.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php deleted file mode 100644 index 7f64e8b26f4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerForm.php +++ /dev/null @@ -1,145 +0,0 @@ -prepareData($customer, $initialCustomer, $address); - $filter['email'] = $data['customer']['email']; - - $pageCustomerIndex->open(); - $pageCustomerIndex->getCustomerGridBlock()->searchAndOpen($filter); - $dataForm = $pageCustomerEdit->getCustomerForm()->getDataCustomer($customer, $address); - $dataDiff = $this->verify($data, $dataForm); - \PHPUnit_Framework_Assert::assertTrue( - empty($dataDiff), - 'Customer data on edit page(backend) not equals to passed from fixture.' - . "\nFailed values: " . implode(', ', $dataDiff) - ); - } - - /** - * Prepare data. - * - * @param Customer $customer - * @param Customer $initialCustomer [optional] - * @param Address $address [optional] - * @return array - */ - protected function prepareData(Customer $customer, Customer $initialCustomer = null, Address $address = null) - { - if ($initialCustomer) { - $data['customer'] = $customer->hasData() - ? array_merge($initialCustomer->getData(), $customer->getData()) - : $initialCustomer->getData(); - } else { - $data['customer'] = $customer->getData(); - } - if ($address) { - $data['addresses'][1] = $address->hasData() ? $address->getData() : []; - } else { - $data['addresses'] = []; - } - - return $data; - } - - /** - * Verify data in form equals to passed from fixture. - * - * @param array $dataFixture - * @param array $dataForm - * @return array - */ - protected function verify(array $dataFixture, array $dataForm) - { - $result = []; - - $customerDiff = array_diff_assoc($dataFixture['customer'], $dataForm['customer']); - foreach ($customerDiff as $name => $value) { - if (in_array($name, $this->customerSkippedFields)) { - continue; - } - $result[] = "\ncustomer {$name}: \"{$dataForm['customer'][$name]}\" instead of \"{$value}\""; - } - foreach ($dataFixture['addresses'] as $key => $address) { - $addressDiff = array_diff($address, $dataForm['addresses'][$key]); - foreach ($addressDiff as $name => $value) { - $result[] = "\naddress #{$key} {$name}: \"{$dataForm['addresses'][$key][$name]}" - . "\" instead of \"{$value}\""; - } - } - - return $result; - } - - /** - * Text success verify Customer form. - * - * @return string - */ - public function toString() - { - return 'Displayed customer data on edit page(backend) equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php deleted file mode 100644 index ab54cdd251a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupAlreadyExists.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group already exist error message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php deleted file mode 100644 index 9d440c7cd56..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -open(); - $customerGroupCode = $customerGroup->getCustomerGroupCode(); - \PHPUnit_Framework_Assert::assertTrue( - $customerGroupIndex->getCustomerGroupGrid()->isRowVisible(['code' => $customerGroupCode]), - "Group '{$customerGroupCode}' is absent in customer groups grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group is present in customer groups grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php deleted file mode 100644 index 2775dd66016..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupOnCustomerForm.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $formCustomerGroups = $customerNew->getCustomerForm()->getCustomerGroups(); - $customerGroupCode = $customerGroup->getCustomerGroupCode(); - \PHPUnit_Framework_Assert::assertTrue( - in_array($customerGroupCode, $formCustomerGroups), - "Customer group '{$customerGroupCode}' is absent on customer account information page" - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group find on customer account information page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php deleted file mode 100644 index 325ac6524c1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerGroupSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer group success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php deleted file mode 100644 index e02b0516960..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInGrid.php +++ /dev/null @@ -1,96 +0,0 @@ -prepareData($customer, $initialCustomer); - $filter = ['name' => $data[0], 'email' => $data[1]['email']]; - - $pageCustomerIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $pageCustomerIndex->getCustomerGridBlock()->isRowVisible($filter), - 'Customer with ' - . 'name \'' . $filter['name'] . '\', ' - . 'email \'' . $filter['email'] . '\' ' - . 'is absent in Customer grid.' - ); - } - - /** - * Prepare data. - * - * @param Customer $customer - * @param Customer $initialCustomer [optional] - * @return string - */ - protected function prepareData(Customer $customer, Customer $initialCustomer = null) - { - if ($initialCustomer) { - $customer = $customer->hasData() - ? array_merge($initialCustomer->getData(), $customer->getData()) - : $initialCustomer->getData(); - } else { - $customer = $customer->getData(); - } - $name = (isset($customer['prefix']) ? $customer['prefix'] . ' ' : '') - . $customer['firstname'] - . (isset($customer['middlename']) ? ' ' . $customer['middlename'] : '') - . ' ' . $customer['lastname'] - . (isset($customer['suffix']) ? ' ' . $customer['suffix'] : ''); - - return [$name, $customer]; - } - - /** - * Text success exist Customer in grid. - * - * @return string - */ - public function toString() - { - return 'Customer is present in Customer grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php deleted file mode 100644 index e9aafdd36a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInfoSuccessSavedMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns success message if equals to expected message. - * - * @return string - */ - public function toString() - { - return 'Success customer info save message on customer account index page is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php deleted file mode 100644 index afedf9940b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerInvalidEmail.php +++ /dev/null @@ -1,68 +0,0 @@ -getEmail(), self::ERROR_EMAIL_MESSAGE); - $message = $pageCustomerNew->getMessagesBlock()->getErrorMessages(); - $actualMessage = explode("\n", $message[0]); - - \PHPUnit_Framework_Assert::assertEquals( - $expectMessage, - $actualMessage[0], - 'Wrong error message is displayed.' - ); - } - - /** - * Text success display error message - * - * @return string - */ - public function toString() - { - return 'Assert that error message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php deleted file mode 100644 index 512de914fec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerPasswordChanged.php +++ /dev/null @@ -1,76 +0,0 @@ -createByCode( - 'customer', - [ - 'data' => [ - 'email' => $initialCustomer->getEmail(), - 'password' => $customer->getPassword(), - 'password_confirmation' => $customer->getPassword(), - ], - ] - ); - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - \PHPUnit_Framework_Assert::assertTrue( - $customerAccountIndex->getAccountNavigationBlock()->isVisible(), - 'Customer Account Dashboard is not visible.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Customer password was changed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php deleted file mode 100644 index 08133994807..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessRegisterMessage.php +++ /dev/null @@ -1,62 +0,0 @@ -getMessagesBlock()->getSuccessMessages(), - 'Wrong success message is displayed.' - ); - } - - /** - * Text of success register message is displayed. - * - * @return string - */ - public function toString() - { - return "Customer is successfully registered."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php deleted file mode 100644 index c7eaca3f405..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertCustomerSuccessSaveMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Text success save message is displayed. - * - * @return string - */ - public function toString() - { - return 'Assert that success message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php deleted file mode 100644 index d61af617a4f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertWrongPassConfirmationMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -getAccountInfoForm()->getValidationMessages($customer)['password_confirmation'], - 'Wrong password confirmation validation text message.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Password confirmation validation text message is displayed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php deleted file mode 100644 index 42a880d8cb6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/FrontendActionsForCustomer.php +++ /dev/null @@ -1,90 +0,0 @@ - 'Mage\Customer\Test\Page\CustomerAccountIndex' - ]; - - /** - * @constructor - */ - public function __construct() - { - foreach ($this->pages as $key => $page) { - $this->$key = $this->createPage($page); - } - } - - /** - * Create page. - * - * @param string $page - * @return PageInterface - */ - protected function createPage($page) - { - return ObjectManager::getInstance()->create($page); - } - - /** - * Login customer to frontend. - * - * @param Customer $customer - * @return void - */ - public function loginCustomer(Customer $customer) - { - $loginCustomerOnFrontendStep = ObjectManager::getInstance()->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - ); - $loginCustomerOnFrontendStep->run(); - } - - /** - * Open customer tab. - * - * @param string $tabName - * @return void - */ - public function openCustomerTab($tabName) - { - $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem($tabName); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml deleted file mode 100644 index b295d50c5ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Address.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml deleted file mode 100644 index a9296919724..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php deleted file mode 100644 index 406af6e5ead..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/Address.php +++ /dev/null @@ -1,70 +0,0 @@ -params = $params; - - if (isset($data['dataset'])) { - $data['dataset'] = explode(',', $data['dataset']); - foreach ($data['dataset'] as $value) { - /** @var AddressFixture $fixture */ - $addresses = $fixtureFactory->createByCode('address', ['dataset' => $value]); - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } elseif (empty($data['dataset']) && !empty($data['addresses'])) { - foreach ($data['addresses'] as $addresses) { - /** @var AddressFixture $addresses */ - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } - } - - /** - * Getting addresses fixture. - * - * @return array - */ - public function getAddresses() - { - return $this->addressesFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php deleted file mode 100644 index ed3c7ef8383..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/Customer/GroupId.php +++ /dev/null @@ -1,113 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - /** @var CustomerGroup $customerGroup */ - $customerGroup = $fixtureFactory->createByCode('customerGroup', ['dataset' => $data['dataset']]); - if (!$customerGroup->hasData('customer_group_id')) { - $customerGroup->persist(); - } - $this->data = $customerGroup->getCustomerGroupCode(); - $this->customerGroupFixture = $customerGroup; - } - if (isset($data['customerGroup']) && $data['customerGroup'] instanceof CustomerGroup) { - $this->data = $data['customerGroup']->getCustomerGroupCode(); - $this->customerGroupFixture = $data['customerGroup']; - } - } - - /** - * Persists prepared data into application. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param int|null $key [optional] - * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Getting customerGroup fixture. - * - * @return array - */ - public function getCustomerGroup() - { - return $this->customerGroupFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml deleted file mode 100644 index 39a99c0463e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php deleted file mode 100644 index e34bbd3bd4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Fixture/CustomerGroup/TaxClassIds.php +++ /dev/null @@ -1,106 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - /** @var TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $data['dataset']]); - if (!$taxClass->hasData('id')) { - $taxClass->persist(); - } - $this->data = $taxClass->getClassName(); - $this->taxClass = $taxClass; - } - } - - /** - * Persist Tax class. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return TaxClass fixture. - * - * @return TaxClass - */ - public function getTaxClass() - { - return $this->taxClass; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php deleted file mode 100644 index 68f2f85b69a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php +++ /dev/null @@ -1,257 +0,0 @@ - [ - 'United States' => 'US', - 'United Kingdom' => 'GB' - ], - 'region_id' => [ - 'California' => 12, - 'New York' => 43, - 'Texas' => 57, - ], - 'gender' => [ - 'Male' => 1, - 'Female' => 2 - ], - ]; - - /** - * Curl mapping data. - * - * @var array - */ - protected $curlMapping = [ - 'account' => [ - 'group_id', - 'firstname', - 'lastname', - 'email', - 'dob', - 'taxvat', - 'gender' - ], - 'customerbalance' => [ - 'amount_delta' - ], - ]; - - /** - * Array of fields are needing to be updated via updateCustomer() method. - * - * @var array - */ - protected $updatingFields = [ - 'address', - 'dob', - 'gender', - 'amount_delta' - ]; - - /** - * Post request for creating customer in frontend. - * - * @param FixtureInterface|null $customer - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $customer = null) - { - $result = []; - /** @var Customer $customer */ - $url = $_ENV['app_frontend_url'] . 'customer/account/createpost/?nocookie=true'; - $data = $customer->getData(); - $data['group_id'] = $this->getCustomerGroup($customer); - - if ($customer->hasData('address')) { - $data['address'] = http_build_query($data['address']); - } - - $curl = new CurlTransport(); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Customer entity creating by curl handler was not successful! Response: $response"); - } - - $result['id'] = $this->getCustomerId($customer->getEmail()); - $data['customer_id'] = $result['id']; - - if ($this->checkForUpdateData($data)) { - parse_str($data['address'], $data['address']); - $this->updateCustomer($data); - } - - return $result; - } - - /** - * Check if customer needs to update data during curl creation. - * - * @param array $data - * @return bool - */ - protected function checkForUpdateData(array $data) - { - foreach ($data as $key => $field) { - if (in_array($key, $this->updatingFields)) { - return true; - } - } - return false; - } - - /** - * Get customer id by email. - * - * @param string $email - * @return int|null - */ - protected function getCustomerId($email) - { - $url = $_ENV['app_backend_url'] . 'customer/index/grid/filter/' . $this->encodeFilter(['email' => $email]); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - preg_match('~a href=[^\s]*\/id\/(\d+)~', $response, $match); - return empty($match[1]) ? null : $match[1]; - } - - /** - * Prepare customer for curl. - * - * @param FixtureInterface $customer - * @return string - */ - protected function getCustomerGroup(FixtureInterface $customer) - { - return $customer->hasData('group_id') - ? $customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() - : self::GENERAL_GROUP; - } - - /** - * Update customer account. - * - * @param array $data - * @return void - * @throws \Exception - */ - protected function updateCustomer(array $data) - { - $curlData = []; - $url = $_ENV['app_backend_url'] . 'customer/save'; - foreach ($data as $key => $value) { - foreach ($this->curlMapping as $prefix => $prefixValues) { - if (in_array($key, $prefixValues)) { - $curlData[$prefix][$key] = $value; - unset($data[$key]); - } - } - } - unset($data['password'], $data['confirmation']); - - $curlData = $this->replaceMappingData(array_merge($curlData, $data)); - $curlData = $this->prepareAddressData($curlData); - - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $curlData); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception('Failed to assign an address to the customer!'); - } - } - - /** - * Preparing address data for curl. - * - * @param array $curlData - * @return array - */ - protected function prepareAddressData(array $curlData) - { - $address = []; - foreach (array_keys($curlData['address']) as $key) { - $curlData['address'][$key]['_deleted'] = ''; - $curlData['address'][$key]['region'] = ''; - if (!is_array($curlData['address'][$key]['street'])) { - $street = $curlData['address'][$key]['street']; - $curlData['address'][$key]['street'] = []; - $curlData['address'][$key]['street'][] = $street; - } - $newKey = '_item' . ($key); - if (isset($curlData['address'][$key]['default_billing'])) { - $value = $curlData['address'][$key]['default_billing'] === 'Yes' ? $newKey : ''; - $curlData['account']['default_billing'] = $value; - } - if (isset($curlData['address'][$key]['default_shipping'])) { - $value = $curlData['address'][$key]['default_shipping'] === 'Yes' ? $newKey : ''; - $curlData['account']['default_shipping'] = $value; - } - $address[$newKey] = $curlData['address'][$key]; - } - $curlData['address'] = $address; - - return $curlData; - } - - /** - * Encoded filter parameters. - * - * @param array $filter - * @return string - */ - protected function encodeFilter(array $filter) - { - $result = []; - foreach ($filter as $name => $value) { - $result[] = "{$name}={$value}"; - } - $result = implode('&', $result); - - return base64_encode($result); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php deleted file mode 100644 index d09c4810236..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/CustomerInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -prepareData($fixture); - $url = $_ENV['app_backend_url'] . $this->saveUrl . "?" . http_build_query($data); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception( - "Customer Group entity creating by curl handler was not successful! Response: $response" - ); - } - - return ['customer_group_id' => $this->getCustomerGroupId($data, $response)]; - } - - /** - * Get id after creating Customer Group. - * - * @param array $data - * @return string|null - */ - public function getCustomerGroupId(array $data) - { - $regExp = '/.*id\/(\d+)\/.*' . $data['code'] . '/siu'; - - $url = $_ENV['app_backend_url'] . 'customer_group/index/sort/time/dir/desc/'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, [], CurlInterface::GET); - $response = $curl->read(); - $curl->close(); - preg_match($regExp, $response, $matches); - - return empty($matches[1]) ? null : $matches[1]; - } - - /** - * Prepare fixture data. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - /** @var CustomerGroup $fixture */ - return [ - 'code' => $fixture->getCustomerGroupCode(), - 'tax_class' => $fixture->getDataFieldConfig('tax_class_id')['source']->getTaxClass()->getId() - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php b/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php deleted file mode 100644 index 8fed3b77ab3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Handler/CustomerGroup/CustomerGroupInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml deleted file mode 100644 index b6876860d42..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml deleted file mode 100644 index 2d1bac7825e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerGroupNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml deleted file mode 100644 index 4170ad77ddb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml deleted file mode 100644 index 5d3911ed23a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/Adminhtml/CustomerNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml deleted file mode 100644 index 054db62a7a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountCreate.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml deleted file mode 100644 index edc0a69d589..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml deleted file mode 100644 index 28e6dc0a277..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountIndex.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml deleted file mode 100644 index 6ce15e5e9da..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml deleted file mode 100644 index f0bd4b281cc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAccountLogout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml deleted file mode 100644 index 98364be9bca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Page/CustomerAddress.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml deleted file mode 100644 index 8d8824c8c9d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Address.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - John - Doe - JohnDoe_%isolation%@example.com - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - - John - Doe - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - - John - Doe - Magento %isolation% - 3222 Cliffside Drive - Binghamton - New York - 13901 - United States - 607-481-7802 - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 3222 Cliffside Drive - Binghamton - New York - 13901 - United States - 607-481-7802 - Yes - Yes - - - - New York - 13901 - United States - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 7700 W. Parmer Lane Bldg. D - Austin - Texas - 78729 - United States - 512-691-4400 - Yes - Yes - - - - Jane - Jansen - JaneJansen%isolation%@example.com - Magento %isolation% - Berlin - Augsburger Strabe 41 - 10789 - Germany - Berlin - 333-33-333-33 - - - - Jane - Doe - Magento %isolation% - London - 172, Westminster Bridge Rd - SE1 7RW - United Kingdom - 444-44-444-44 - - - - Jane - Doe - Magento %isolation% - London - 172, Westminster Bridge Rd - SE1 7RW - United Kingdom - 444-44-444-44 - 584451913 - Yes - - - - John - Doe - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - Yes - Yes - - - - John - Doe - John.Doe%isolation%@example.com - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - Magento %isolation% - 6161 West Centinela Avenue - Culver City - California - 90230 - United States - 555-55-555-55 - - - - John - Doe - Magento %isolation% - Culver City - 6161 West Centinela Avenue - 90230 - United States - California - 555-55-555-55 - 555-55-555-55 - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml deleted file mode 100644 index f71cbad6063..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - customer - 1 - Yes - 1 - - - customer - 1 - Billing Address - billing - - - customer - 1 - Yes - 1 - - - - - customer - 1 - No - 0 - - - customer - 1 - No - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml deleted file mode 100644 index e46788cb0e2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/Customer.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - - - John - Doe - JohnDoe_%isolation%@example.com - - - - John - Doe - JohnDoe_%isolation%@example.com - 123123q - 123123q - - - - John - Doe - JohnDoe_%isolation%@example.com - 123123q - 123123q - - customer_US_login_miltiship - - - - - John - Doe%isolation% - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY - - - - - John - Doe%isolation% - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_TX - - - - - John - Doe - - Retailer - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY - - 01/01/1990 - Male - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address_NY,US_address_TX - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - US_address - - - - - John - Doe - - General - - JohnDoe_%isolation%@example.com - 123123q - 123123q - - customer_UK_with_vat - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml deleted file mode 100644 index b8840f8bd36..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/Repository/CustomerGroup.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - 1 - General - - Retail Customer - - - - 3 - Retailer - - Retail Customer - - - - 2 - Wholesale - - Retail Customer - - - - 0 - All Customer Groups - - - 0 - NOT LOGGED IN - - Retail Customer - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php deleted file mode 100644 index 2541fae07f8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.php +++ /dev/null @@ -1,135 +0,0 @@ -cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountIndex = $customerAccountIndex; - $this->customerAccountEdit = $customerAccountEdit; - } - - /** - * Run Change customer password test. - * - * @param Customer $initialCustomer - * @param Customer $customer - * @return void - */ - public function test(Customer $initialCustomer, Customer $customer) - { - // Preconditions - $initialCustomer->persist(); - - // Steps - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $initialCustomer] - )->run(); - - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('My Account'); - $this->customerAccountIndex->getInfoBlock()->openChangePassword(); - $this->customerAccountEdit->getAccountInfoForm()->fill($customer); - $this->customerAccountEdit->getAccountInfoForm()->submit(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - if ( - !$this->customerAccountIndex->getMessagesBlock()->isVisibleMessage('success') - && $this->cmsIndex->getLinksBlock()->isLinkVisible('Log In') - ) { - $fixtureFactory = $this->objectManager->create('Magento\Mtf\Fixture\FixtureFactory'); - $customer = $fixtureFactory->createByCode( - 'customer', - [ - 'data' => [ - 'email' => $initialCustomer->getEmail(), - 'password' => $customer->getPassword(), - 'password_confirmation' => $customer->getPassword(), - ], - ] - ); - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml deleted file mode 100644 index 308e1d9bfa8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/ChangeCustomerPasswordTest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - default - 123123q - 123123a - 123123a - - - - default - 123123z - 123123a - 123123a - - - - default - 123123q - 123123a - 123123z - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php deleted file mode 100644 index 8e98b2d891c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.php +++ /dev/null @@ -1,83 +0,0 @@ - All Customers. - * 3. Press "Add New Customer" button. - * 4. Fill form. - * 5. Click "Save Customer" button. - * 6. Perform all assertions. - * - * @group ACL_(MX) - * @ZephyrId MPERF-6600 - */ -class CreateCustomerFromBackendTest extends Injectable -{ - /** - * Customer index page. - * - * @var CustomerIndex - */ - protected $pageCustomerIndex; - - /** - * Customer new page. - * - * @var CustomerNew - */ - protected $pageCustomerIndexNew; - - /** - * Injection pages. - * - * @param CustomerIndex $pageCustomerIndex - * @param CustomerNew $pageCustomerIndexNew - * @return void - */ - public function __inject(CustomerIndex $pageCustomerIndex, CustomerNew $pageCustomerIndexNew) - { - $this->pageCustomerIndex = $pageCustomerIndex; - $this->pageCustomerIndexNew = $pageCustomerIndexNew; - } - - /** - * Creation customer from backend. - * - * @param Customer $customer - * @param Address $address - * @return void - */ - public function test(Customer $customer, Address $address) - { - // Prepare data - $address = $address->hasData() ? $address : null; - - // Steps - $this->pageCustomerIndex->open(); - $this->pageCustomerIndex->getPageActionsBlock()->addNew(); - $this->pageCustomerIndexNew->getCustomerForm()->fillCustomer($customer, $address); - $this->pageCustomerIndexNew->getPageActionsBlock()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml deleted file mode 100644 index d3d67598106..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerFromBackendTest.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - Main Website - General - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.com - - - 123123q - - - - - - - - - - - - - - - - - main:ce - - - - - - Main Website - General - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.com - - - 123123q - Joe - Doe - 1 Main Street - Culver City - United States - California - 90230 - 3109450345 - - - - - - Main Website - Retailer - John%isolation% - Doe%isolation% - JohnDoe%isolation%@example.ccc - - - 123123q - - - - - - - - - - - - - - - - - - - - Main Website - General - Thomas%isolation% - Oster%isolation% - Thomas%isolation%@example.com - 5250008057 - 123123q - Thomas - Oster - Chmielna 113 - Bielsko-Biala - Poland - - - 43-310 - 799885616 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php deleted file mode 100644 index 54ddc39b192..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.php +++ /dev/null @@ -1,79 +0,0 @@ - Customer Groups. - * 3. Start to create new Customer Group. - * 4. Fill in all data according to data set. - * 5. Click "Save Customer Group" button. - * 6. Perform all assertions. - * - * @group Customer_Groups_(CS) - * @ZephyrId MPERF-7420 - */ -class CreateCustomerGroupEntityTest extends Injectable -{ - /** - * Customer group index page. - * - * @var CustomerGroupIndex - */ - protected $customerGroupIndex; - - /** - * New customer group page. - * - * @var CustomerGroupNew - */ - protected $customerGroupNew; - - /** - * Inject data. - * - * @param CustomerGroupIndex $customerGroupIndex - * @param CustomerGroupNew $customerGroupNew - */ - public function __inject( - CustomerGroupIndex $customerGroupIndex, - CustomerGroupNew $customerGroupNew - ) { - $this->customerGroupIndex = $customerGroupIndex; - $this->customerGroupNew = $customerGroupNew; - } - - /** - * Create customer group. - * - * @param CustomerGroup $customerGroup - * @return void - */ - public function test(CustomerGroup $customerGroup) - { - // Steps - $this->customerGroupIndex->open(); - $this->customerGroupIndex->getGridPageActions()->addNew(); - $this->customerGroupNew->getCustomerGroupForm()->fill($customerGroup); - $this->customerGroupNew->getPageActionsBlock()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml deleted file mode 100644 index bfa641eb00e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateCustomerGroupEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Retail Customer - GroupName%isolation% - - - - - - Retail Customer - General - - - - customer_tax_class - GroupName%isolation% - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php deleted file mode 100644 index 1d5f3177e0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.php +++ /dev/null @@ -1,118 +0,0 @@ - Register link. - * 3. Fill registry form. - * 4. Click "Register" button. - * 5. Perform assertions. - * - * @group Customer_Account_(CS) - * @ZephyrId MPERF-7554 - */ -class CreateExistingCustomerFrontendEntity extends Injectable -{ - /** - * Customer account create page. - * - * @var CustomerAccountCreate - */ - protected $customerAccountCreate; - - /** - * Customer account logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Prepare customer. - * - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory) - { - $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'default_frontend_new']); - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Injection data - * - * @param CustomerAccountCreate $customerAccountCreate - * @param CustomerAccountLogout $customerAccountLogout - * @param CmsIndex $cmsIndex - * @return void - */ - public function __inject( - CustomerAccountCreate $customerAccountCreate, - CustomerAccountLogout $customerAccountLogout, - CmsIndex $cmsIndex - ) { - $this->customerAccountLogout = $customerAccountLogout; - $this->customerAccountCreate = $customerAccountCreate; - $this->cmsIndex = $cmsIndex; - } - - /** - * Run create existing customer account on frontend test. - * - * @param Customer $customer - * @return void - */ - public function test(Customer $customer) - { - //Steps - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); - } - - /** - * Logout customer from frontend account. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml deleted file mode 100644 index 48058198e70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - main:ce - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php deleted file mode 100644 index 762a294b8ed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.php +++ /dev/null @@ -1,87 +0,0 @@ - Additional Address Entries. - * 3. Click 'Delete Address' button for second address. - * 4. Perform assertions. - * - * @group Customer_Account_(CS) - * @ZephyrId MPERF-7496 - */ -class DeleteCustomerAddressEntityTest extends Injectable -{ - /** - * CustomerAccountIndex page. - * - * @var CustomerAccountIndex - */ - protected $customerAccountIndex; - - /** - * Customer address page. - * - * @var CustomerAddress - */ - protected $customerAddress; - - /** - * Injection pages. - * - * @param CustomerAccountIndex $customerAccountIndex - * @param CustomerAddress $customerAddress - * @return void - */ - public function __inject(CustomerAccountIndex $customerAccountIndex, CustomerAddress $customerAddress) - { - $this->customerAccountIndex = $customerAccountIndex; - $this->customerAddress = $customerAddress; - } - - /** - * Run delete customer address entity test. - * - * @param Customer $customer - * @return array - */ - public function test(Customer $customer) - { - // Preconditions: - $customer->persist(); - $addressToDelete = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - - // Steps: - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - $this->customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('Address Book'); - $this->customerAddress->getBookBlock()->getAdditionalAddressBlock()->deleteAddress($addressToDelete); - - return ['deletedAddress' => $addressToDelete]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml deleted file mode 100644 index f0d76b524a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/DeleteCustomerAddressEntityTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - customer_with_two_addresses - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php deleted file mode 100644 index 668766f8e9a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.php +++ /dev/null @@ -1,100 +0,0 @@ -customerAccountCreate = $customerAccountCreate; - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create Customer account on frontend. - * - * @param Customer $customer - * @return void - */ - public function test(Customer $customer) - { - //Steps - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - $this->cmsIndex->getLinksBlock()->openLink('Register'); - $this->customerAccountCreate->getRegisterForm()->registerCustomer($customer); - } - - /** - * Logout customer from frontend account. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml deleted file mode 100644 index dee7ed5bb43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - john - doe - johndoe%isolation%@example.com - No - 123123q - 123123q - main:ce - - - - - john - doe - johndoe%isolation%@example.com - Yes - 123123q - 123123q - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php deleted file mode 100644 index e28861d884f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateCustomerStep.php +++ /dev/null @@ -1,64 +0,0 @@ -customer = $customer; - $this->persistCustomer = $customerPersist; - } - - /** - * Create customer. - * - * @return array - */ - public function run() - { - if ($this->persistCustomer == 'yes') { - $this->customer->persist(); - } - - return ['customer' => $this->customer]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php deleted file mode 100644 index b2f1c393836..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateNewAddressesFixturesStep.php +++ /dev/null @@ -1,70 +0,0 @@ -newAddresses = $newAddresses; - $this->fixtureFactory = $fixtureFactory; - } - - /** - * Create addresses. - * - * @return array - */ - public function run() - { - if ($this->newAddresses === null) { - return []; - } - $newAddressesFixtures = []; - $datasets = explode(',', $this->newAddresses); - foreach ($datasets as $dataset) { - $newAddressesFixtures[] = $this->fixtureFactory->createByCode('address', ['dataset' => $dataset]); - } - - return ['newAddresses' => $newAddressesFixtures]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php deleted file mode 100644 index 415d853d8b8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/CreateOrderFromCustomerAccountStep.php +++ /dev/null @@ -1,51 +0,0 @@ -customerIndexEdit = $customerIndexEdit; - } - - /** - * Create new order from customer. - * - * @return void - */ - public function run() - { - $this->customerIndexEdit->getPageActionsBlock()->createOrder(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php deleted file mode 100644 index 4fdd025cd39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php +++ /dev/null @@ -1,82 +0,0 @@ -cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customer = $customer; - } - - /** - * Login customer. - * - * @return void - */ - public function run() - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) { - $this->cmsIndex->getLinksBlock()->openLink("Log Out"); - $this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page'); - $this->cmsIndex->getTopLinksBlock()->openAccount(); - } - $this->cmsIndex->getLinksBlock()->openLink("Log In"); - $this->customerAccountLogin->getLoginBlock()->login($this->customer); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php deleted file mode 100644 index 82027216eba..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/LogoutCustomerStep.php +++ /dev/null @@ -1,51 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - } - - /** - * Logout customer. - * - * @return void - */ - public function run() - { - $this->customerAccountLogout->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php b/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php deleted file mode 100644 index 94feca12086..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/TestStep/OpenCustomerOnBackendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -customer = $customer; - $this->customerIndex = $customerIndex; - } - - /** - * Open customer account. - * - * @return void - */ - public function run() - { - $this->customerIndex->open(); - $this->customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $this->customer->getEmail()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml deleted file mode 100644 index 5c15c9992df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/curl/di.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml deleted file mode 100644 index 724dc29132f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Customer/Test/etc/fixture.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - eav - customer - Mage\Customer\Model\Resource\Customer\Collection - email - -
- address - virtual - Mage\Customer\Test\Fixture\Customer\Address - addresses -
- - is_subscribed - virtual - - - password - virtual - account_information - - - password_confirmation - virtual - - - id - virtual - - - current_password - virtual - -
-
-
- eav - customer_address - Mage\Customer\Model\Resource\Address\Collection - - - email - virtual - - -
- - flat - customer_group - Mage\Customer\Model\Resource\Group\Collection - - - customer_group_id - virtual - - - -
diff --git a/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php b/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php deleted file mode 100644 index 241e0d78894..00000000000 --- a/dev/tests/functional/tests/app/Mage/Directory/Test/Block/Currency/Switcher.php +++ /dev/null @@ -1,57 +0,0 @@ -waitForElementVisible($this->currencySwitch); - $customCurrencySwitch = explode(" - ", $this->_rootElement->find($this->currencySwitchSelected)->getText()); - $currencyCode = $currencySymbol->getCode(); - if ($customCurrencySwitch[1] !== $currencyCode) { - $this->_rootElement->find($this->currencySwitch, Locator::SELECTOR_CSS, 'select') - ->setValue($currencyCode); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php deleted file mode 100644 index ed01657ea38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ /dev/null @@ -1,101 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\\' . $type, - ['element' => $element->find($this->downloadableBlock)] - ); - } - - /** - * Get data to fields on downloadable tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $resultFields = []; - if (isset($fields['downloadable_sample']['value'])) { - $resultFields['downloadable_sample'] = $this->getDownloadableBlock('Samples')->getDataSamples( - $fields['downloadable_sample']['value'] - ); - } - if (isset($fields['downloadable_links']['value'])) { - $resultFields['downloadable_links'] = $this->getDownloadableBlock('Links')->getDataLinks( - $fields['downloadable_links']['value'] - ); - } - - return $resultFields; - } - - /** - * Fill downloadable information. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - if (isset($fields['downloadable_sample']['value'])) { - $this->getDownloadableBlock('Samples')->fillSamples($fields['downloadable_sample']['value']); - } - - if (isset($fields['downloadable_links']['value'])) { - $this->getDownloadableBlock('Links')->fillLinks($fields['downloadable_links']['value']); - } - - return $this; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php deleted file mode 100644 index 42d295bf90f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.php +++ /dev/null @@ -1,65 +0,0 @@ -dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Get data item link. - * - * @param array $fields - * @return array - */ - public function getDataLinkRow(array $fields) - { - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping); - } - - /** - * Click delete button. - * - * @return void - */ - public function clickDeleteButton() - { - $this->_rootElement->find($this->deleteButton)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml deleted file mode 100644 index 7d8180b85bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinkRow.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - <selector>[name$='[title]']</selector> - <strategy>css selector</strategy> - - - [name$='[price]'] - css selector - - - [name$='[number_of_downloads]'] - css selector - - - [name$='[is_unlimited]'] - css selector - checkbox - - - [name$='[is_shareable]'] - css selector - select - - - - [value='url'][name$='[sample][type]'] - css selector - checkbox - - - [value='file'][name$='[sample][type]'] - css selector - checkbox - - - [name$='[sample][url]'] - css selector - - - - [value='url'][name*='[type]']:not([name*='[sample]']) - css selector - checkbox - - - [value='file'][name*='[type]']:not([name*='[sample]']) - css selector - checkbox - - - [name$='[link_url]'] - css selector - - - [name$='[sort_order]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php deleted file mode 100644 index 6d39b82b0c7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ /dev/null @@ -1,137 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\LinkRow', - ['element' => $element->find(sprintf($this->rowBlock, ++$index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill links block. - * - * @param array $fields - * @param Element|null $element - * @return void - */ - public function fillLinks(array $fields, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->title)->isVisible()) { - $element->find($this->showLinks)->click(); - } - $mapping = $this->dataMapping( - ['title' => $fields['title'], 'links_purchased_separately' => $fields['links_purchased_separately']] - ); - $this->_fill($mapping); - foreach ($fields['downloadable']['link'] as $index => $link) { - $rowBlock = $this->getRowBlock($index, $element); - if (!$rowBlock->isVisible()) { - $element->find($this->addNewLinkRow)->click(); - } - $rowBlock->fillLinkRow($link); - } - } - - /** - * Get data links block. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataLinks(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->title)->isVisible()) { - $element->find($this->showLinks)->click(); - } - $mapping = $this->dataMapping( - ['title' => $fields['title'], 'links_purchased_separately' => $fields['links_purchased_separately']] - ); - $newFields = $this->_getData($mapping); - foreach ($fields['downloadable']['link'] as $index => $link) { - $newFields['downloadable']['link'][$index] = $this->getRowBlock($index, $element) - ->getDataLinkRow($link); - } - return $newFields; - } - - /** - * Delete all links and clear title. - * - * @return void - */ - public function clearDownloadableData() - { - $this->_rootElement->find($this->title)->setValue(''); - $index = 1; - while ($this->_rootElement->find(sprintf($this->rowBlock, $index), Locator::SELECTOR_XPATH)->isVisible()) { - $rowBlock = $this->getRowBlock($index - 1); - $rowBlock->clickDeleteButton(); - ++$index; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml deleted file mode 100644 index 6c3db271f6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - <selector>[name="product[links_title]"]</selector> - <strategy>css selector</strategy> - - - [name="product[links_purchased_separately]"] - css selector - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php deleted file mode 100644 index 90d116e64e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.php +++ /dev/null @@ -1,48 +0,0 @@ -dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Get data item sample. - * - * @param array $fields - * @return array - */ - public function getDataSampleRow(array $fields) - { - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml deleted file mode 100644 index af6504b0f73..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SampleRow.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - <selector>[name$='[title]']</selector> - <strategy>css selector</strategy> - - - [value='file'][name$='[type]'] - css selector - checkbox - - - [value='url'][name$='[type]'] - css selector - checkbox - - - [name$='[sample_url]'] - css selector - - - [name$='[sort_order]'] - css selector - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php deleted file mode 100644 index 69ae960b55b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ /dev/null @@ -1,114 +0,0 @@ -_rootElement; - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable\SampleRow', - ['element' => $element->find(sprintf($this->rowBlock, ++$index), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Fill samples block. - * - * @param array|null $fields - * @param Element|null $element - * @return void - */ - public function fillSamples(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->samplesTitle, Locator::SELECTOR_XPATH)->isVisible()) { - $element->find($this->showSample)->click(); - } - $mapping = $this->dataMapping(['title' => $fields['title']]); - $this->_fill($mapping); - foreach ($fields['downloadable']['sample'] as $index => $sample) { - $element->find($this->addNewSampleRow)->click(); - $this->getRowBlock($index, $element)->fillSampleRow($sample); - } - } - - /** - * Get data samples block. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataSamples(array $fields = null, Element $element = null) - { - $element = $element ?: $this->_rootElement; - if (!$element->find($this->samplesTitle, Locator::SELECTOR_XPATH)->isVisible()) { - $element->find($this->showSample)->click(); - } - $mapping = $this->dataMapping(['title' => $fields['title']]); - $result = $this->_getData($mapping); - foreach ($fields['downloadable']['sample'] as $index => $sample) { - $result['downloadable']['sample'][$index] = $this->getRowBlock($index, $element) - ->getDataSampleRow($sample); - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml deleted file mode 100644 index f168e08f0fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - <selector>[name="product[samples_title]"]</selector> - <strategy>css selector</strategy> - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml deleted file mode 100644 index 5c1a1e3ecb5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Adminhtml/Catalog/Product/ProductForm.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - \Mage\Downloadable\Test\Block\Adminhtml\Catalog\Product\Edit\Tab\Downloadable - #product_info_tabs_downloadable_items - css selector - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php deleted file mode 100644 index f60e7cb5948..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View.php +++ /dev/null @@ -1,135 +0,0 @@ -blockFactory->create( - 'Mage\Downloadable\Test\Block\Catalog\Product\View\Links', - ['element' => $this->_rootElement->find($this->blockDownloadableLinks)] - ); - } - - /** - * Get downloadable samples block. - * - * @return Samples - */ - public function getDownloadableSamplesBlock() - { - return $this->blockFactory->create( - 'Mage\Downloadable\Test\Block\Catalog\Product\View\Samples', - ['element' => $this->_rootElement->find($this->blockDownloadableSamples)] - ); - } - - /** - * Filling the options specified for the product. - * - * @param InjectableFixture $product - * @return void - * - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function fillOptions(InjectableFixture $product) - { - /** @var DownloadableProduct $product */ - $downloadableLinks = isset($product->getDownloadableLinks()['downloadable']['link']) - ? $product->getDownloadableLinks()['downloadable']['link'] - : []; - $checkoutData = $product->getCheckoutData(); - - if (isset($checkoutData['options'])) { - foreach ($checkoutData['options']['links'] as $key => $linkData) { - $linkKey = str_replace('link_', '', $linkData['label']); - $linkData['label'] = $downloadableLinks[$linkKey]['title']; - $checkoutData['options']['links'][$key] = $linkData; - } - $this->getDownloadableLinksBlock()->fill($checkoutData['options']['links']); - } - - parent::fillOptions($product); - } - - /** - * Return product options. - * - * @param InjectableFixture $product - * @return array - */ - public function getOptions(InjectableFixture $product) - { - $downloadableOptions = []; - - if ($this->_rootElement->find($this->blockDownloadableLinks)->isVisible()) { - $downloadableOptions['downloadable_links'] = [ - 'title' => $this->getDownloadableLinksBlock()->getTitle(), - 'downloadable' => [ - 'link' => $this->getDownloadableLinksBlock()->getLinks(), - ], - ]; - } - if ($this->_rootElement->find($this->blockDownloadableSamples)->isVisible()) { - $downloadableOptions['downloadable_sample'] = [ - 'title' => $this->getDownloadableSamplesBlock()->getTitle(), - 'downloadable' => [ - 'sample' => $this->getDownloadableSamplesBlock()->getLinks(), - ], - ]; - } - - return ['downloadable_options' => $downloadableOptions] + parent::getOptions($product); - } - - /** - * Get text of Stock Availability control. - * - * @return string - */ - public function getDownloadableStockAvailability() - { - return strtolower($this->_rootElement->find($this->stockAvailability)->getText()); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php deleted file mode 100644 index efed0b44cdc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Links.php +++ /dev/null @@ -1,152 +0,0 @@ -label:first-child'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $sampleLinkForChoice = 'li span>a'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $priceForChoice = '.price-notice'; - - /** - * Checkbox selector item links. - * - * @var string - */ - protected $priceAdjustmentsForChoice = '.price-adjustments .price'; - - /** - * Get title for links block. - * - * @return string - */ - public function getTitle() - { - return $this->_rootElement->find($this->title, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Fill links on product view page. - * - * @param array $data - * @return void - */ - public function fill(array $data) - { - foreach ($data as $linkData) { - $selector = sprintf($this->linkByLabel, $linkData['label']); - $this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue($linkData['value']); - } - } - - /** - * Return links data on product page view. - * - * @return array - */ - public function getLinks() - { - $linksData = []; - - $choiceLinks = $this->_rootElement->getElements($this->choiceLink, Locator::SELECTOR_XPATH); - foreach ($choiceLinks as $choiceLink) { - $link = $choiceLink->find($this->linkForChoice); - $sample = $choiceLink->find($this->sampleLinkForChoice); - $price = $choiceLink->find($this->priceForChoice); - $priceAdjustments = $choiceLink->find($this->priceAdjustmentsForChoice); - - $linkData = [ - 'links_purchased_separately' => $choiceLink->find($this->separatelyForChoice)->isVisible() - ? 'Yes' - : 'No', - 'title' => $link->isVisible() ? $link->getText() : null, - 'sample' => $sample->isVisible() ? $sample->getText() : null, - 'price' => $price->isVisible() ? $this->escapePrice($price->getText()) : null, - 'price_adjustments' => $priceAdjustments->isVisible() - ? $this->escapePrice($priceAdjustments->getText()) - : null, - ]; - - $linksData[] = array_filter($linkData); - } - - return $linksData; - } - - /** - * Escape currency for price. - * - * @param string $price - * @return string - */ - protected function escapePrice($price) - { - return preg_replace('/[^0-9\.,]/', '', $price); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php deleted file mode 100644 index ec5a8117c23..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Catalog/Product/View/Samples.php +++ /dev/null @@ -1,67 +0,0 @@ -_rootElement->find($this->titleBlock)->getText(); - } - - /** - * Get sample links. - * - * @return array - */ - public function getLinks() - { - $links = $this->_rootElement->getElements($this->linkTitle); - $linksData = []; - - foreach ($links as $link) { - $linksData[] = [ - 'title' => $link->getText(), - ]; - } - - return $linksData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php deleted file mode 100644 index 07c7fb4b9b3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Block/Checkout/Onepage/Review.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '//*[contains(@data-rwd-label,"Price")][1]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Price")][2]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_excl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Subtotal")][1]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '//*[contains(@data-rwd-label,"Subtotal")][2]//span[@class="price"]', - 'strategy' => Locator::SELECTOR_XPATH - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php deleted file mode 100644 index 03adf340aa3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableLinksData.php +++ /dev/null @@ -1,122 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $fixtureDownloadableLinks = $this->prepareFixtureData($product); - $pageOptions = $catalogProductView->getViewBlock()->getOptions($product); - $pageDownloadableLinks = $this->preparePageData($pageOptions['downloadable_options']['downloadable_links']); - $error = $this->verifyData($fixtureDownloadableLinks, $pageDownloadableLinks); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data for verify. - * - * @param DownloadableProduct $product - * @return array - */ - protected function prepareFixtureData(DownloadableProduct $product) - { - $data = $this->sortDataByPath($product->getDownloadableLinks(), 'downloadable/link::sort_order'); - - foreach ($data['downloadable']['link'] as $key => $link) { - $link['links_purchased_separately'] = $data['links_purchased_separately']; - $link = array_intersect_key($link, array_flip($this->linkField)); - - $data['downloadable']['link'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableLinksField)); - - return $data; - } - - /** - * Prepare page data for verify. - * - * @param array $data - * @return array - */ - protected function preparePageData(array $data) - { - foreach ($data['downloadable']['link'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['link'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableLinksField)); - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Links for downloadable product are present on product page'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php deleted file mode 100644 index 8b096206fe2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductDetailsInWishlist.php +++ /dev/null @@ -1,44 +0,0 @@ - 'LINKS', - 'value' => $itemData['value'] - ]; - } - - return $this->sortDataByPath($result, '::title'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php deleted file mode 100644 index ccfb39f41c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertDownloadableProductForm.php +++ /dev/null @@ -1,34 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - $fixtureSampleLinks = $this->prepareFixtureData($product); - $pageOptions = $productView->getViewBlock()->getOptions($product); - $pageSampleLinks = isset($pageOptions['downloadable_options']['downloadable_sample']) - ? $this->preparePageData($pageOptions['downloadable_options']['downloadable_sample']) - : []; - $error = $this->verifyData($fixtureSampleLinks, $pageSampleLinks); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data for verify. - * - * @param DownloadableProduct $product - * @return array - */ - protected function prepareFixtureData(DownloadableProduct $product) - { - $data = $this->sortDataByPath($product->getDownloadableSample(), 'downloadable/sample::sort_order'); - - foreach ($data['downloadable']['sample'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['sample'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableSampleField)); - - return $data; - } - - /** - * Prepare page data for verify. - * - * @param array $data - * @return array - */ - protected function preparePageData(array $data) - { - foreach ($data['downloadable']['sample'] as $key => $link) { - $link = array_intersect_key($link, array_flip($this->linkField)); - $data['downloadable']['sample'][$key] = $link; - } - $data = array_intersect_key($data, array_flip($this->downloadableSampleField)); - - return $data; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sample links for downloadable product are present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php deleted file mode 100644 index 5f648d3cbcd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Constraint/AssertOrderTaxOnBackendDownloadableExcludingIncludingTax.php +++ /dev/null @@ -1,38 +0,0 @@ -getCheckoutData(); - $downloadableOptions = $product->getDownloadableLinks(); - foreach ($checkoutData['options']['links'] as $link) { - $keyLink = str_replace('link_', '', $link['label']); - $checkoutDownloadableOptions[] = [ - 'title' => $downloadableOptions['title'], - 'value' => $downloadableOptions['downloadable']['link'][$keyLink]['title'], - ]; - } - $this->data['options'] += $checkoutDownloadableOptions; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml deleted file mode 100644 index 6d2b43ad0dd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Fixture/DownloadableProduct.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - downloadable - - downloadable - 4 - - product - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php deleted file mode 100644 index 23dc17fd073..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/Curl.php +++ /dev/null @@ -1,256 +0,0 @@ - [ - 'links_title', - 'links_purchased_separately' - ], - 'samples' => [ - 'samples_title' - ] - ]; - - /** - * Fields for link. - * - * @var array - */ - protected $linkFields = [ - 'title', - 'type', - 'link_url' => 'file_link_url', - 'price', - 'number_of_downloads', - 'is_shareable', - 'sort_order', - 'sample' => [ - 'type', - 'url' => 'sample_url' - ] - ]; - - /** - * Fields for sample. - * - * @var array - */ - protected $sampleFields = [ - 'title', - 'type', - 'sample_url', - 'sort_order' - ]; - - /** - * @constructor - * @param DataInterface $configuration - * @param EventManagerInterface $eventManager - */ - public function __construct(DataInterface $configuration, EventManagerInterface $eventManager) - { - parent::__construct($configuration, $eventManager); - - $this->mappingData += [ - 'links_purchased_separately' => [ - 'Yes' => 1, - 'No' => 0, - ], - 'is_shareable' => [ - 'Yes' => 1, - 'No' => 0, - 'Use config' => 2, - ], - ]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @param string|null $prefix [optional] - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $prefix = null) - { - $originalData = parent::prepareData($fixture, $prefix); - $downloadableData = []; - $data = ($prefix == null) ? $originalData : $originalData[$prefix]; - - foreach ($this->downloadableTypes as $type => $fields) { - if (!empty($data['downloadable_' . $type])) { - $downloadableTypeData = $this->{'prepare' . ucfirst($type) . 'Data'}($data['downloadable_' . $type]); - $data = array_merge_recursive($data, array_intersect_key($downloadableTypeData, array_flip($fields))); - $downloadableData = array_merge_recursive($downloadableData, $downloadableTypeData); - unset($downloadableTypeData['downloadable']); - if ($prefix == null) { - $originalData = array_merge($originalData, $downloadableTypeData); - } else { - $originalData[$prefix] = array_merge($originalData[$prefix], $downloadableTypeData); - } - } - } - - $data = array_merge_recursive($originalData, $downloadableData); - - return $this->replaceMappingData($data); - } - - /** - * Prepare links data. - * - * @param array $linksData - * @return array - */ - protected function prepareLinksData(array $linksData) - { - return [ - 'links_title' => $linksData['title'], - 'links_purchased_separately' => $linksData['links_purchased_separately'], - 'downloadable' => [ - 'link' => $this->prepareLinksItemsData($linksData['downloadable']['link']) - ] - ]; - } - - /** - * Prepare samples data. - * - * @param array $samplesData - * @return array - */ - protected function prepareSamplesData(array $samplesData) - { - return [ - 'samples_title' => $samplesData['title'], - 'downloadable' => [ - 'sample' => $this->prepareSamplesItemsData($samplesData['downloadable']['sample']) - ] - ]; - } - - /** - * Prepare samples items data. - * - * @param array $samples - * @return array - */ - protected function prepareSamplesItemsData(array $samples) - { - $resultSamples = []; - foreach ($samples as $key => $sample) { - $resultLinks[$key] = $this->prepareItem($sample, 'sample'); - } - - return $resultSamples; - } - - /** - * Prepare links items data. - * - * @param array $links - * @return array - */ - protected function prepareLinksItemsData(array $links) - { - $resultLinks = []; - foreach ($links as $key => $link) { - $resultLinks[$key] = $this->prepareItem($link, 'link'); - } - - return $resultLinks; - } - - /** - * Prepare item data. - * - * @param array $link - * @param string $type - * @param string|null $key - * @return array - */ - protected function prepareItem(array $link, $type, $key = null) - { - $result = []; - $fields = ($key == null) ? $this->{$type . 'Fields'} : $this->{$type . 'Fields'}[$key]; - foreach ($fields as $key => $value) { - if ($key === 'type' || $value === 'type') { - $result['type'] = 'url'; - } else { - if (is_string($key)) { - if (is_array($value)) { - $result[$key] = $this->prepareItem($link[$key], $type, $key); - } else { - $result[$key] = $link[$value]; - } - } else { - $result[$value] = $link[$value]; - } - } - } - - return $result; - } - - /** - * Create product via curl - * - * @param array $data - * @param array $config - * @return array - * @throws \Exception - */ - protected function createProduct(array $data, array $config) - { - $url = $this->getUrl($config); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Product creation by curl handler was not successful! Response: $response"); - } - $id = $this->parseResponse($response); - $checkoutData = isset($data['product']['checkout_data']) ? $data['product']['checkout_data'] : null; - foreach ($data['downloadable']['link'] as $key => $link) { - preg_match('`"link_id":"(\d*?)","title":"' . $link['title'] . '"`', $response, $linkId); - if (isset($checkoutData['options']['links'][$key]['label'])) { - $checkoutData['options']['links'][$key]['id'] = $linkId[1]; - } - } - - return ['id' => $id['id'], 'checkout_data' => $checkoutData]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php deleted file mode 100644 index b6490d40c18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Handler/DownloadableProductInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index e36067e5683..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml deleted file mode 100644 index 8933e94b25f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct.xml +++ /dev/null @@ -1,217 +0,0 @@ - - - - - - DownloadableProduct_%isolation% - DownloadableProduct_%isolation% - Catalog, Search - Enabled - downloadable-product-%isolation% - - 100.00 - - - Taxable Goods - - This is description for downloadable product. - This is short description for downloadable product. - - 1.0000 - In Stock - - Yes - - default - - - default - - - default_subcategory - - - - main_website - - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - Catalog, Search - Enabled - downloadable-product-%isolation% - - 20 - - - Taxable Goods - - This is description for downloadable product with two separately - links - - This is short description for downloadable product with - two separately links - - - 111 - In Stock - - Yes - - with_two_separately_links - - - default - - - with_two_separately_links - - - - main_website - - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 30 - - 20 - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with special - price - - This is short description for downloadable product with - special price - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - with_two_bought_links - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 30 - - - downloadable_with_tax - - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with group price - - This is short description for downloadable product with - group price - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - with_two_bought_links - - - - - Downloadable product %isolation% - downloadable_product_%isolation% - downloadable-product-%isolation% - - 20 - - - Taxable Goods - - - 1111 - In Stock - - This is description for downloadable product with custom - options - - This is short description for downloadable product with - custom options - - Enabled - - default_subcategory - - Catalog, Search - Yes - - - main_website - - - - with_two_separately_links - - - drop_down_with_one_option_percent_price - - - one_custom_option_and_downloadable_link - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml deleted file mode 100644 index e9b698c072f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/CheckoutData.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - link_0 - Yes - - - - - 22.43 - 22.43 - - 1 - - - - - - - link_0 - Yes - - - link_1 - Yes - - - - 23 - 23 - - - 1 - - - - - - - attribute_key_0 - option_key_0 - - - - - link_0 - Yes - - - - 1 - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml deleted file mode 100644 index 7b5737d406d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/GroupPriceOptions.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - 90 - NOT LOGGED IN - - - - - - 20 - General - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml deleted file mode 100644 index fab6e1b6385..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Links.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - - Yes - http://example.com - - Yes - http://example.com - No - 1 - - - link2%isolation% - 3 - 3 - - Yes - http://example.net - - Yes - http://example.net - Yes - 0 - - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - No - - Yes - http://example.com/sample - - Yes - http://example.com - 0 - - - link2%isolation% - 3 - 3 - Yes - - Yes - http://example.net/sample2 - - Yes - http://example.net/ - 1 - - - - - - - Links%isolation% - Yes - - - - link1%isolation% - 2.43 - 2 - - Yes - http://example.com - - Yes - http://example.com - No - 0 - - - link2%isolation% - 3 - 3 - - Yes - http://example.net - - Yes - http://example.net - Yes - 1 - - - link3%isolation% - 5.43 - 5 - - Yes - http://example.net - - Yes - http://example.net - Yes - 2 - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml deleted file mode 100644 index 86bfa7c2fc2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Price.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - 94 - - - 91 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml deleted file mode 100644 index 6f0e600518e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/Repository/DownloadableProduct/Samples.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - Samples%isolation% - - - - sample1%isolation% - Yes - http://example.com - 0 - - - sample2%isolation% - Yes - http://example2.com - 1 - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index 6eaaf19c366..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Add Downloadable product to Wishlist - downloadableProduct::with_two_separately_links - false - main:ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index c9fe247f30e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 11e4380100c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php deleted file mode 100644 index f5da619e422..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Manage Products. - * 3. Start to create new Downloadable product. - * 4. Fill in data according to data set. - * 5. Save product. - * 6. Perform all assertions. - * - * @group Downloadable_Product_(CS) - * @ZephyrId MPERF-6884 - */ -class CreateDownloadableProductEntityTest extends Injectable -{ - /** - * Product page with a grid. - * - * @var CatalogProduct - */ - protected $catalogProductIndex; - - /** - * New product page on backend. - * - * @var CatalogProductNew - */ - protected $catalogProductNew; - - /** - * Persist category. - * - * @param CatalogCategory $category - * @return array - */ - public function __prepare(CatalogCategory $category) - { - $category->persist(); - - return ['category' => $category]; - } - - /** - * Filling objects of the class. - * - * @param CatalogProduct $catalogProductIndexNewPage - * @param CatalogProductNew $catalogProductNewPage - * @return void - */ - public function __inject(CatalogProduct $catalogProductIndexNewPage, CatalogProductNew $catalogProductNewPage) - { - $this->catalogProductIndex = $catalogProductIndexNewPage; - $this->catalogProductNew = $catalogProductNewPage; - } - - /** - * Test create downloadable product. - * - * @param DownloadableProduct $product - * @param CatalogCategory $category - * @return void - */ - public function test(DownloadableProduct $product, CatalogCategory $category) - { - // Steps - $this->catalogProductIndex->open(); - $this->catalogProductIndex->getGridPageActionBlock()->addNew(); - $this->catalogProductNew->getProductForm()->fill($product, null, $category); - $this->catalogProductNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml deleted file mode 100644 index 9ca1419914a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/CreateDownloadableProductEntityTest.xml +++ /dev/null @@ -1,370 +0,0 @@ - - - - - - Create downloadable product with downloadable samples - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 1 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - default - default - - - - - - - - - - - - - - - Create downloadable product with two downloadable links, downloadable samples and custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 65 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 11 - In Stock - Yes - - - - - default - with_two_separately_links - default - - - - - - - - - - - - - - Create downloadable product with downloadable links without tax class - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - None - 98 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 5 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 33 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - - - default - default - - - - - - - - - - - - - Create downloadable product with downloadable links and tax class - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 1 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - - - Create downloadable product with stock data min qty - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 9999 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - - - - - Yes - No - 123 - - - default - - - - - - - - - - - - - Create downloadable product with downloadable links - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 50 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with three downloadable links, downloadable samples and custom options - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 65 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 11 - In Stock - Yes - - - - - default - with_three_links - default - - - - - - - - - - - - - Create downloadable product out of stock - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 100 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 50 - Out of Stock - Yes - - - - - - - default - - - - - - - - - - - - - Create downloadable product with special price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 10 - - - 5 - Enabled - This is description for downloadable product - This is short description for downloadable product - 10 - In Stock - Yes - - - - - - - default - - - - - - - - - - - - - - Create downloadable product with group price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 365 - - - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 23 - In Stock - Yes - - - - - - - default - - - for_not_logged_users - - - - - - - - - - Create downloadable product with tier price - DownloadableProduct_%isolation% - downloadable-product-%isolation% - Catalog, Search - DownloadableProduct_%isolation% - Taxable Goods - 250 - with_tier_price - - - Enabled - This is description for downloadable product - This is short description for downloadable product - 65 - In Stock - Yes - - - - - - - default - - - - - for_all_groups - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml deleted file mode 100644 index 4b115a79aef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/DeleteDownloadableProductEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 39ee30ad48c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - downloadableProduct::with_two_separately_links - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php deleted file mode 100644 index 95f51fa272a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.php +++ /dev/null @@ -1,41 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign default rates to rule. - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new downloadable product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-7057 - */ -class TaxCalculationForDownloadableProductTest extends TaxCalculationTest -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml deleted file mode 100644 index b396794ff6a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/TestCase/TaxCalculationForDownloadableProductTest.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - Downloadable product with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_excluding_including_tax - downloadableProduct::with_two_separately_links_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_equals_store_rate - johndoe_unique - 20.00 - 21.65 - 25.43 - 27.53 - 25.43 - 27.53 - 25.43 - 27.53 - 25.43 - 27.53 - 13.77 - 0.96 - 11.66 - 12.62 - checkmo - - - - - - Downloadable product with catalog rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_including_tax - downloadableProduct::with_two_separately_links_special_price_and_category - - - default - customer_greater_store_rate - johndoe_unique - 2.13 - 25.43 - 27.56 - 21.68 - 27.56 - 27.56 - 27.56 - 27.56 - checkmo - - - - - - Downloadable product with sales rule, customer tax less than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl - downloadableProduct::with_two_separately_links_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_less_store_rate - johndoe_unique - 13.77 - 0.96 - 20.00 - 25.43 - 25.43 - 25.43 - 25.43 - 12.62 - checkmo - - - - - - Downloadable product with catalog rule, customer tax greater than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_excluding_including_tax - downloadableProduct::with_two_separately_links_custom_options_and_category - - - default - customer_greater_store_rate - johndoe_unique - 18.47 - 20.02 - 28.11 - 30.47 - 28.12 - 30.47 - 28.12 - 30.47 - 28.12 - 30.47 - 2.35 - 28.12 - 30.47 - checkmo - - - - - - Downloadable product with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_including_tax - downloadableProduct::with_two_separately_links_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - - - customer_less_store_rate - johndoe_unique - 11.73 - 1.94 - 11.73 - 13.67 - 19.98 - 25.40 - 25.40 - 25.40 - 25.40 - checkmo - - - - - - Downloadable product with catalog rule, customer tax equals store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl - downloadableProduct::with_two_separately_links_custom_options_and_category - - - default - customer_equals_store_rate - johndoe_unique - 2.32 - 30.43 - 18.48 - 28.11 - 28.11 - 28.11 - 28.11 - checkmo - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml deleted file mode 100644 index 607a3f3c40c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml deleted file mode 100644 index 5c3e5d4fb58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/fixture.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - eav - catalog_product - downloadable - Mage\Catalog\Model\Resource\Product\Collection - sku - - - custom_options - virtual - Mage\Catalog\Test\Fixture\CatalogProductSimple\CustomOptions - custom-options - - - id - virtual - - - website_ids - virtual - Main Website - websites - Mage\Catalog\Test\Fixture\CatalogProductSimple\WebsiteIds - - - downloadable_items - virtual - downloadable_information - Mage\Downloadable\Test\Fixture\DownloadableProduct\Links - - - downloadable_sample - virtual - downloadable_information - Mage\Downloadable\Test\Fixture\DownloadableProduct\Samples - - - checkout_data - virtual - Mage\Downloadable\Test\Repository\DownloadableProduct\CheckoutData - - - stock_data - virtual - inventory - - - - diff --git a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml deleted file mode 100644 index 78639514896..00000000000 --- a/dev/tests/functional/tests/app/Mage/Downloadable/Test/etc/testcase.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php deleted file mode 100644 index e5a6e702880..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.php +++ /dev/null @@ -1,187 +0,0 @@ -waitForElementVisible($this->giftOptionsForm); - $this->addGiftMessage($giftMessage); - - if ($giftMessage->getAllowGiftMessagesForOrder() === 'Yes') { - $this->fillGiftMessageForOrder($giftMessage); - } - - if ($giftMessage->getAllowGiftOptionsForItems() === 'Yes') { - $this->fillGiftGiftOptionsForItems($giftMessage, $products); - } - } - - /** - * @param $giftMessage - * @throws \Exception - */ - protected function addGiftMessage($giftMessage) - { - $giftMessageData = $giftMessage->getData(); - unset( - $giftMessageData['sender'], - $giftMessageData['recipient'], - $giftMessageData['message'], - $giftMessageData['items'] - ); - $mapping = $this->dataMapping($giftMessageData); - $this->_fill($mapping); - } - - /** - * Fill gift gift options for items. - * - * @param GiftMessage $giftMessage - * @param array $products - * @return void - */ - protected function fillGiftGiftOptionsForItems(GiftMessage $giftMessage, array $products) - { - $giftMessageItems = $giftMessage->getItems(); - foreach ($giftMessageItems as $key => $itemGiftMessage) { - $this->clickGiftMassageItem($products[$key]); - $this->getGiftMessageItemForm($products[$key])->fill($itemGiftMessage); - } - } - - /** - * Fill gift message for order. - * - * @param GiftMessage $giftMessage - * @return void - */ - protected function fillGiftMessageForOrder(GiftMessage $giftMessage) - { - if ($this->_rootElement->find($this->giftMessageOrderButton)->isVisible()) { - $this->_rootElement->find($this->giftMessageOrderButton)->click(); - } else { - $this->_rootElement->find($this->allowGiftMessagesForItems)->click(); - } - $messageData = $giftMessage->getData(); - unset($messageData['allow_gift_options'], $messageData['allow_gift_messages_for_order']); - $mapping = $this->getGiftMessageOrderForm()->dataMapping($messageData); - $this->getGiftMessageOrderForm()->_fill($mapping); - } - - /** - * Click gift message item block. - * - * @param InjectableFixture $product - * @return void - */ - protected function clickGiftMassageItem(InjectableFixture $product) - { - $giftMessageItemSelector = sprintf($this->giftMessageItemButton, $product->getName()); - if ($this->_rootElement->find($giftMessageItemSelector, Locator::SELECTOR_XPATH)->isVisible()) { - $this->_rootElement->find($giftMessageItemSelector, Locator::SELECTOR_XPATH)->click(); - } - } - - /** - * Get gift message order form. - * - * @return GiftMessageForm - */ - protected function getGiftMessageOrderForm() - { - return $this->blockFactory->create( - 'Mage\GiftMessage\Test\Block\Message\Inline\GiftMessageForm', - ['element' => $this->_rootElement->find($this->giftMessageOrderForm)] - ); - } - - /** - * Get gift message item form. - * - * @param InjectableFixture $product - * @return GiftMessageForm - */ - protected function getGiftMessageItemForm(InjectableFixture $product) - { - $selector = sprintf($this->giftMessageItemForm, $product->getName()); - $this->waitForElementVisible($selector, Locator::SELECTOR_XPATH); - - return $this->blockFactory->create( - 'Mage\GiftMessage\Test\Block\Message\Inline\GiftMessageForm', - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml deleted file mode 100644 index 08190788e7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - .//*/input[@id = 'allow_gift_messages']|.//*/input[@id= 'allow_gift_options'] - xpath - checkbox - - - .//*/input[@id = 'allow_gift_messages_for_order']|.//*/input[@id= 'allow_gift_options_for_order'] - xpath - checkbox - - - .//*/input[@id = 'allow_gift_messages_for_items']|.//*/input[@id= 'allow_gift_options_for_items'] - xpath - checkbox - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php deleted file mode 100644 index 4ba929c3548..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Inline/GiftMessageForm.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [id^='gift-message'][name$='[from]'] - - - [id^='gift-message'][name$='[to]'] - - - [id^='gift-message'][name$='[message]'] - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php deleted file mode 100644 index e5e6a545185..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/Items/View.php +++ /dev/null @@ -1,77 +0,0 @@ -getGiftMessageElement($giftItem); - return $this->getGiftMessage($giftMessageElement); - } - - /** - * Get gift message element. - * - * @param InjectableFixture $giftItem - * @return Element - */ - protected function getGiftMessageElement(InjectableFixture $giftItem) - { - $itemName = $giftItem->getName(); - $this->showGiftMessageElement($itemName); - - return $this->_rootElement->find(sprintf($this->giftMessageForItem, $itemName), Locator::SELECTOR_XPATH); - } - - /** - * Click "Gift Message" for special item. - * - * @param string $itemName - * @return void - */ - protected function showGiftMessageElement($itemName) - { - $this->_rootElement->find(sprintf($this->giftMessageButton, $itemName), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php deleted file mode 100644 index 82de2536915..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Block/Message/Order/View.php +++ /dev/null @@ -1,55 +0,0 @@ - './/dt[1]', - 'recipient' => './/dt[2]', - 'message' => './/dd' - ]; - - /** - * Get gift message. - * - * @param SimpleElement|null $giftMessageElement - * @return array - */ - public function getGiftMessage(SimpleElement $giftMessageElement = null) - { - $message = []; - $element = ($giftMessageElement !== null) ? $giftMessageElement : $this->_rootElement; - foreach ($this->giftMessageFields as $key => $field) { - $value = $element->find($field, Locator::SELECTOR_XPATH)->getText(); - $value = preg_match('`\w+: (.*)`', $value, $matches) ? $matches[1] : $value; - $message[$key] = $value; - } - - return $message; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php deleted file mode 100644 index afed93a1e2a..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AbstractAssertGiftMessageOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - } - - /** - * Prepare expected data. - * - * @param GiftMessage $giftMessage - * @return array - */ - protected function prepareExpectedData(GiftMessage $giftMessage) - { - return [ - 'sender' => $giftMessage->getSender(), - 'recipient' => $giftMessage->getRecipient(), - 'message' => $giftMessage->getMessage(), - ]; - } - - /** - * Login customer on frontend. - * - * @param Customer $customer - * @return void - */ - protected function loginOnFrontend(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php deleted file mode 100644 index 00627c98411..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrder.php +++ /dev/null @@ -1,72 +0,0 @@ -loginOnFrontend($customer); - $this->openOrderPage($orderHistory, $orderId); - $expectedData = $this->prepareExpectedData($giftMessage); - - \PHPUnit_Framework_Assert::assertEquals( - $expectedData, - $orderView->getGiftMessageForOrderBlock()->getGiftMessage() - ); - $customerAccountLogout->open(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Gift message is displayed on order view page on frontend correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php deleted file mode 100644 index f67d6f4e064..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php +++ /dev/null @@ -1,111 +0,0 @@ -loginOnFrontend($customer); - $this->openOrderPage($orderHistory, $orderId); - $expectedData = $this->prepareExpectedData($giftMessage); - $actualData = $this->prepareActualData($orderView, $products); - - \PHPUnit_Framework_Assert::assertEquals($expectedData, $actualData); - - $customerAccountLogout->open(); - } - - /** - * Prepare actual data. - * - * @param OrderView $orderView - * @param array $products - * @return array - */ - protected function prepareActualData(OrderView $orderView, array $products) - { - $result = []; - foreach ($products as $key => $product) { - $result[$key] = $orderView->getGiftMessageForItemBlock()->getItemGiftMessage($product); - } - - return $result; - } - - /** - * Prepare expected data. - * - * @param GiftMessage $giftMessage - * @return array - */ - protected function prepareExpectedData(GiftMessage $giftMessage) - { - $result = []; - if ($giftMessage->hasData('items')) { - $giftMessageItems = $giftMessage->getItems(); - foreach ($giftMessageItems as $key => $itemGiftMessage) { - $result[$key] = parent::prepareExpectedData($itemGiftMessage); - } - } else { - $result = parent::prepareExpectedData($giftMessage); - } - - return $result; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Gift message is displayed for each items on order view page on frontend correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml deleted file mode 100644 index fda9014a43c..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php deleted file mode 100644 index 7edc7c79a29..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Fixture/GiftMessage/Items.php +++ /dev/null @@ -1,44 +0,0 @@ -params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - $this->data[] = $fixtureFactory->createByCode('giftMessage', ['dataset' => trim($dataset)]); - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml deleted file mode 100644 index 577ed2c8990..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/CheckoutOnepage.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml deleted file mode 100644 index 7ab48add37e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Page/OrderView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml deleted file mode 100644 index b18aa05aa31..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/Repository/GiftMessage.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - John Doe - Jane Doe - text_%isolation% - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php deleted file mode 100644 index 7b66f6a886a..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.php +++ /dev/null @@ -1,59 +0,0 @@ -executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml deleted file mode 100644 index 5a37515712e..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestCase/CheckoutWithGiftMessagesTest.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - cashondelivery, enableGiftMessages - Create gift message for items - catalogProductSimple::default, catalogProductSimple::default - default - customer_US_login - login - Flat Rate - Fixed - cashondelivery - Yes - Yes - default,default - - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php deleted file mode 100644 index 4409788fb36..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/TestStep/AddGiftMessageStep.php +++ /dev/null @@ -1,72 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->giftMessage = $giftMessage; - $this->products = $products; - } - - /** - * Add gift message to order. - * - * @return array - */ - public function run() - { - $this->checkoutOnepage->getGiftMessagesBlock()->fillGiftMessage($this->giftMessage, $this->products); - - return ['giftMessage' => $this->giftMessage]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml deleted file mode 100644 index 11fa94045f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/fixture.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - flat - gift_message - Mage\GiftMessage\Model\Resource\Message\Collection - gift_message_id - - - allow_gift_options - virtual - - - allow_gift_messages_for_order - virtual - - - allow_gift_options_for_items - virtual - - - items - virtual - Mage\GiftMessage\Test\Fixture\GiftMessage\Items - - - - diff --git a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml deleted file mode 100644 index 343530e9e85..00000000000 --- a/dev/tests/functional/tests/app/Mage/GiftMessage/Test/etc/testcase.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php deleted file mode 100644 index 94c31e12a38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Configuration.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name="config[db_model]"] - select - - - [name="connection[mysql4][db_host]"] - - - [name="connection[mysql4][db_name]"] - - - [name="connection[mysql4][db_user]"] - - - [name="connection[mysql4][db_pass]"] - - - [name="connection[mysql4][db_prefix]"] - - - [name="config[unsecure_base_url]"] - - - [name="config[admin_frontname]"] - - - [name="config[enable_charts]"] - checkbox - - - [name="skip_base_url_validation"] - checkbox - - - [name="config[use_rewrites]"] - checkbox - - - [name="config[use_secure]"] - checkbox - - - [name="config[secure_base_url]"] - - - [name="config[use_secure_admin]"] - checkbox - - - [name="skip_url_validation"] - checkbox - - - [name="config[session_save]"] - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php deleted file mode 100644 index 3db3fccd4c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/ContinueBlock.php +++ /dev/null @@ -1,41 +0,0 @@ -_rootElement->find($this->continue)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php deleted file mode 100644 index b051afee4e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/License.php +++ /dev/null @@ -1,59 +0,0 @@ -_rootElement->find($this->license)->getText(); - } - - /** - * Accept license agreements. - * - * @return void - */ - public function acceptLicenseAgreement() - { - $this->_rootElement->find($this->agree, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php deleted file mode 100644 index fe87c76cf96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Localization.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - config - - - select - - - select - - - select - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php deleted file mode 100644 index 1f093c00a19..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Main.php +++ /dev/null @@ -1,58 +0,0 @@ -_rootElement->find($this->title)->getText(); - } - - /** - * Get license text. - * - * @return string - */ - public function getDeployStatus() - { - return $this->_rootElement->find($this->deployStatus)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php deleted file mode 100644 index b902069ee10..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/PersonalInformation.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name="admin[firstname]"] - - - [name="admin[lastname]"] - - - [name="admin[email]"] - - - [name="admin[username]"] - - - [name="admin[new_password]"] - - - [name="admin[password_confirmation]"] - - - [name="admin[password_confirmation]"] - - - [name="encryption_key"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php b/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php deleted file mode 100644 index a759303ef41..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Block/Welcome.php +++ /dev/null @@ -1,42 +0,0 @@ -h3'; - - /** - * Get wizard text. - * - * @return string - */ - public function getWizardTitle() - { - return $this->_rootElement->find($this->wizardTitle)->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php deleted file mode 100644 index 1b7b4b37551..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertAgreementTextPresent.php +++ /dev/null @@ -1,55 +0,0 @@ -getLicenseBlock()->getLicense(), - 'License agreement text is absent.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "License agreement text is present on Terms & Agreement page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php deleted file mode 100644 index 395a18d7151..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertCurrencySelected.php +++ /dev/null @@ -1,51 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($dashboard->getMainBlock()->getRevenuePrice(), $currencySymbol), - 'Selected currency symbol not displays on dashboard.' - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Selected language currently displays on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php deleted file mode 100644 index f6de5d75adf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertLanguageSelected.php +++ /dev/null @@ -1,55 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertEquals( - strtolower($cmsIndex->getTopLinksBlock()->getAccountLabelText()), - self::EXPECTED_TEXT - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return 'Selected language currently displays on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php deleted file mode 100644 index 5c2250317d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertRewritesEnabled.php +++ /dev/null @@ -1,55 +0,0 @@ -persist(); - $homePage->open(); - $homePage->getTopmenu()->selectCategory($category->getName()); - \PHPUnit_Framework_Assert::assertTrue( - !str_contains($browser->getUrl(), 'index.php'), - 'Apache redirect for category does not work.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Apache redirect works correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php deleted file mode 100644 index 220bda8bb96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSecureUrlEnabled.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertTrue( - str_contains($browser->getUrl(), 'https://'), - 'Secure Url is not displayed on backend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Secure Urls are displayed successful.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php b/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php deleted file mode 100644 index 6d52d59042c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Constraint/AssertSuccessInstall.php +++ /dev/null @@ -1,55 +0,0 @@ -getMainBlock()->getTitle()); - - // Check if header block on CmsIndex page is visible. - $cmsIndex->open(); - \PHPUnit_Framework_Assert::assertTrue($cmsIndex->getHeaderBlock()->isVisible()); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Install successfully finished."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml deleted file mode 100644 index cef615bda62..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/Install.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml deleted file mode 100644 index 81a5592a266..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Fixture/InstallLocale.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml deleted file mode 100644 index 7c1dba776d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/Install.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml deleted file mode 100644 index f2caea26607..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardAdministrator.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml deleted file mode 100644 index 14832c15abe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardConfig.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml deleted file mode 100644 index 32f117f3021..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardEnd.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml b/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml deleted file mode 100644 index a3b3daa52c3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/Page/InstallWizardLocale.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php deleted file mode 100644 index 9b8878c8297..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.php +++ /dev/null @@ -1,197 +0,0 @@ -fixtureFactory = $fixtureFactory; - $config = ObjectManagerFactory::getObjectManager()->get('Magento\Mtf\Config\DataInterface'); - // Prepare config data - $configData['db_host'] = $config->get('install/0/host/0/value'); - $configData['db_user'] = $config->get('install/0/user/0/value'); - $configData['db_pass'] = $config->get('install/0/password/0/value'); - $configData['db_name'] = $config->get('install/0/dbName/0/value'); - $configData['unsecure_base_url'] = $config->get('install/0/baseUrl/0/value'); - - return ['configData' => $configData]; - } - - /** - * Injection data. - * - * @param InstallPage $installPage - * @param InstallWizardLocale $installWizardLocale - * @param InstallWizardConfig $installWizardConfig - * @param InstallWizardAdministrator $installWizardAdministrator - * @return void - */ - public function __inject( - InstallPage $installPage, - InstallWizardLocale $installWizardLocale, - InstallWizardConfig $installWizardConfig, - InstallWizardAdministrator $installWizardAdministrator - ) { - $this->installPage = $installPage; - $this->installWizardLocale = $installWizardLocale; - $this->installWizardConfig = $installWizardConfig; - $this->installWizardAdministrator = $installWizardAdministrator; - } - - /** - * Install Magento via web interface. - * - * @param AssertAgreementTextPresent $assertLicense - * @param array $configData - * @param array $install [optional] - * @param array $installLocale [optional] - * @return array - */ - public function test( - AssertAgreementTextPresent $assertLicense, - array $configData, - array $install = [], - array $installLocale = [] - ) - { - // Preconditions: - $installConfig = $this->prepareInstallFixture($configData, $install); - if (isset($install['use_rewrites'])) { - $user = $this->fixtureFactory->createByCode('user', ['dataset' => 'admin_install_admin']); - } else { - $user = $this->fixtureFactory->createByCode('user', ['dataset' => 'admin_for_installation']); - } - // Steps: - $this->installPage->open(); - $this->installPage->getLicenseBlock()->acceptLicenseAgreement(); - // Verify license agreement. - $assertLicense->processAssert($this->installPage); - $this->installPage->getContinueBlock()->continueInstallation(); - if (!empty($installLocale)) { - $locale = $this->prepareInstallLocaleFixture($installLocale); - $this->installWizardLocale->getLocalizationForm()->fill($locale); - } - $this->installWizardLocale->getContinueBlock()->continueInstallation(); - $this->installWizardConfig->getConfigurationForm()->fill($installConfig); - $this->installWizardConfig->getContinueBlock()->continueInstallation(); - $this->installWizardAdministrator->getPersonalInformationForm()->fill($user); - $this->installWizardAdministrator->getContinueBlock()->continueInstallation(); - - return ['user' => $user]; - } - - /** - * Prepare install locale fixture for test. - * - * @param array $install - * @return Install - */ - protected function prepareInstallLocaleFixture(array $install) - { - return $this->fixtureFactory->createByCode('installLocale', ['data' => $install]); - } - - /** - * Prepare install fixture for test. - * - * @param array $configData - * @return Install - */ - protected function prepareInstallFixture(array $configData, array $install) - { - $dataConfig = array_merge($install, $configData); - $dataConfig['unsecure_base_url'] = str_replace('index.php/', '', $dataConfig['unsecure_base_url']); - $dataConfig['unsecure_base_url'] = isset($dataConfig['use_secure']) - ? str_replace('http', 'https', $dataConfig['unsecure_base_url']) - : $dataConfig['unsecure_base_url']; - return $this->fixtureFactory->createByCode('install', ['data' => $dataConfig]); - } - -} diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml deleted file mode 100644 index 81206bed1ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - Install with default values - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php deleted file mode 100644 index 530998877c7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest2.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with custom admin path - custom - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php deleted file mode 100644 index 7a65035da5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest3.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with custom encryption key and changed currency. - Euro - - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php deleted file mode 100644 index 29fd72f9e0d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest4.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with table prefix. - prefix1_ - You're All Set! - test_type:install_ce - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php deleted file mode 100644 index 4685bfa15d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest5.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with apache url rewrites. - Yes - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php b/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php deleted file mode 100644 index 308d80c95c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Install/Test/TestCase/InstallTest6.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Install with enabled secure urls. - Yes - Yes - You're All Set! - test_type:install_ce - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php b/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php deleted file mode 100644 index 5cd983d60ec..00000000000 --- a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Constraint/AssertCustomerIsSubscribedToNewsletter.php +++ /dev/null @@ -1,66 +0,0 @@ - $customer->getEmail(), - 'firstname' => $customer->getFirstname(), - 'lastname' => $customer->getLastname(), - 'status' => 'Subscribed' - ]; - - $subscriberIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $subscriberIndex->getSubscriberGrid()->isRowVisible($filter), - "Customer with email " . $customer->getEmail() . " is absent in Newsletter Subscribers grid." - ); - } - - /** - * Text of successful customer's subscription to newsletter. - * - * @return string - */ - public function toString() - { - return "Customer is subscribed to newsletter."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml b/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml deleted file mode 100644 index e42c8d695de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Newsletter/Test/Page/Adminhtml/SubscriberIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php deleted file mode 100644 index 7d0f244386c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Footer.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement->find($this->storeGroupSwitch)->getText()); - $storeGroupName = explode('/', $store->getGroupId())[1]; - - return in_array($storeGroupName, $availableGroups); - } - - /** - * Check if store group switcher is visible. - * - * @return bool - */ - public function isStoreGroupSwitcherVisible() - { - return $this->_rootElement->find($this->storeGroupSwitch)->isVisible(); - } - - /** - * Select store group. - * - * @param Store $store - * @return void - */ - public function selectStoreGroup(Store $store) - { - $storeGroupName = explode("/", $store->getGroupId())[1]; - $this->_rootElement->find($this->storeGroupSwitch, Locator::SELECTOR_CSS, 'select')->setValue($storeGroupName); - } - - /** - * Click on link by name. - * - * @param string $linkName - * @return void - * @throws \Exception - */ - public function clickLink($linkName) - { - $link = $this->_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH); - if (!$link->isVisible()) { - throw new \Exception(sprintf('"%s" link is not visible', $linkName)); - } - $link->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php deleted file mode 100644 index 990eb555235..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Header.php +++ /dev/null @@ -1,80 +0,0 @@ -_rootElement->find($this->storeSwitcher)->getText()); - - return in_array(strtoupper($store->getName()), $availableStores); - } - - /** - * Check if StoreView dropdown is visible. - * - * @return bool - */ - public function isStoreViewDropdownVisible() - { - return $this->_rootElement->find($this->storeSwitcher)->isVisible(); - } - - /** - * Select store. - * - * @param string $store - * @param SimpleElement|null $element - * @return void - */ - public function selectStore($store, SimpleElement $element = null) - { - $element = ($element === null) ? $this->_rootElement : $element; - $storeSwitcher = $element->find($this->storeSwitcher, Locator::SELECTOR_CSS, 'select'); - if ($storeSwitcher->isVisible()) { - $storeSwitcher->setValue($store); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php deleted file mode 100644 index bc0751507e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Title.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php b/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php deleted file mode 100644 index 83391fdd5d5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Page/Test/Block/Html/Topmenu.php +++ /dev/null @@ -1,54 +0,0 @@ -_rootElement->find(sprintf($this->category, $categoryName), Locator::SELECTOR_XPATH)->click(); - } - - /** - * Check is visible category in top menu by name. - * - * @param string $categoryName - * @return bool - */ - public function isCategoryVisible($categoryName) - { - return $this->_rootElement->find(sprintf($this->category, $categoryName), Locator::SELECTOR_XPATH)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php b/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php deleted file mode 100644 index ccea21aa703..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Block/Form/Cc.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - payment - - - select - - - - select - - - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php b/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php deleted file mode 100644 index 16cee6c7208..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Constraint/Assert3DSecureVerificationFailed.php +++ /dev/null @@ -1,58 +0,0 @@ -getReviewBlock()->getVerificationResponseText() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return '3D secure verification failed.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml deleted file mode 100644 index dc1f384fee5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/Cc.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml deleted file mode 100644 index d901ca47fdb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Fixture/ValidationPassword.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml deleted file mode 100644 index 26e100aef74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/Cc.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - Visa - %CC_VISA_1% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_3% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_3% - 01 - January - 2022 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - 123 - - - Visa - %CC_VISA_4% - 01 - January - 2022 - - - Visa - %CC_VISA_1% - 01 - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - 2022 - 123 - - - Visa - %CC_VISA_2% - 01 - 2022 - 123 - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml deleted file mode 100644 index 18aea40600e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - 0 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - United Kingdom - GB - - - - - payment - 1 - No - 0 - - - - - payment_services - 1 - - - - - payment_services - 1 - - - - - payment_services - 1 - - - - - payment_services - 1 - Yes - 1 - - - payment_services - 1 - Yes - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml b/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml deleted file mode 100644 index 67023d3eac0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/Repository/ValidationPassword.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - %VALIDATION_PASSWORD% - - - %VALIDATION_PASSWORD% - - - %VALIDATION_PASSWORD% - - - diff --git a/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php b/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php deleted file mode 100644 index 2a1d3b46ae8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Payment/Test/TestStep/Fill3DSecureCreditCardValidationStep.php +++ /dev/null @@ -1,64 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->validationPassword = $validationPassword; - } - - /** - * Fill 3D secure credit card validation. - * - * @return void - */ - public function run() - { - $centinelForm = $this->checkoutOnepage->getReviewBlock()->getCentinelForm(); - $centinelForm->fillPass($this->validationPassword); - $centinelForm->submitCode(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php deleted file mode 100644 index 353b77fb1c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/AbstractReview.php +++ /dev/null @@ -1,155 +0,0 @@ -_rootElement->find($this->continue)->click(); - } - - /** - * Log out from Pay Pal account. - * - * @return void - */ - public function logOut() - { - $this->waitLoader(); - $logoutButton = $this->_rootElement->find($this->logoutButton); - if ($logoutButton->isVisible()) { - $logoutButton->click(); - $this->waitLoader(); - } - } - - /** - * Check change shipping button. - * - * @return bool - */ - public function checkChangeShippingButton() - { - return $this->_rootElement->find($this->changeShipping)->isVisible(); - } - - /** - * Check for shipping notification. - * - * @return bool - */ - protected function checkShippingNotification() - { - return $this->_rootElement->find($this->shipNotification)->isVisible(); - } - - /** - * Click change shipping button. - * - * @return void - */ - public function clickChangeShippingButton() - { - $this->_rootElement->find($this->changeShipping)->click(); - } - - /** - * Wait loader. - * - * @return void - */ - public function waitLoader() - { - $this->waitForElementNotVisible($this->loader); - } - - /** - * Check change address ability. - * - * @return bool - */ - public function checkChangeAddressAbility() - { - $this->waitLoader(); - if ($this->checkChangeShippingButton()) { - $this->clickChangeShippingButton(); - $this->waitLoader(); - return !$this->checkShippingNotification(); - } else { - return false; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php deleted file mode 100644 index 53556ca14aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Addresses.php +++ /dev/null @@ -1,51 +0,0 @@ -hasData($criteria)) { - $addressSelector = sprintf($this->addressSelector, $address->getData($criteria)); - $this->_rootElement->find($addressSelector, Locator::SELECTOR_XPATH)->click(); - } else { - throw new \Exception("$criteria field is absent in provided address fixture."); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php deleted file mode 100644 index fd76bc99379..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Review.php +++ /dev/null @@ -1,72 +0,0 @@ -waitForElementNotVisible($this->loaderForButton); - $this->_rootElement->find($this->placeOrder)->click(); - $this->waitForElementNotVisible($this->loaderForButton); - } - - /** - * Select shipping method. - * - * @param string $shippingMethod - * @return void - */ - public function selectShippingMethod($shippingMethod) - { - $this->waitForElementVisible($this->shippingMethod); - list($service, $method) = explode('/', $shippingMethod); - $this->_rootElement->find($this->shippingMethod, Locator::SELECTOR_CSS, 'optgroupselect') - ->setValue($service . "/" . $method); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php deleted file mode 100644 index f9d91d0e60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Express/Shortcut.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php deleted file mode 100644 index cf3b211241d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.php +++ /dev/null @@ -1,88 +0,0 @@ -browser->find($this->sentinelSubmit)->click(); - try { - $this->browser->acceptAlert(); - } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { - } - $this->waitForElementNotVisible($this->centinel); - $this->browser->switchToFrame(); - } - - /** - * Fill credit card. - * - * @param ValidationPassword $pass - */ - public function fillPass(ValidationPassword $pass) - { - $this->waitForElementVisible($this->centinel); - $this->browser->switchToFrame(new Locator($this->centinel)); - $element = $this->getRootElement(); - parent::fill($pass, $element); - } - - /** - * Get root element. - * - * @return ElementInterface - */ - protected function getRootElement() - { - return $this->browser->find($this->body); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml deleted file mode 100644 index 8fc6189aa7e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Form/Centinel.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [name="external.field.password"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php deleted file mode 100644 index 5ca4ab5aec4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Hosted/Pro/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - select - #credit_card_type - - - #credit_card_number - - - [name="expiryMonth"] - - - [name="expiryYear"] - - - #cvv2 - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php deleted file mode 100644 index f3e8fbeb46b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.php +++ /dev/null @@ -1,129 +0,0 @@ -findRootElement(); - $rootElement->find($this->submitButton)->click(); - } - - /** - * Find root element for "Log In" button. - * - * @return \Magento\Mtf\Client\ElementInterface - */ - public function findRootElement() - { - return $rootElement = ($this->browser->find($this->frameBody)->isVisible()) - ? $this->browser->find($this->frameBody) - : $this->_rootElement; - } - - /** - * Select window of PayPal Express checkout iFrame, if need. - * - * @param null $element - * @return \Magento\Mtf\Client\ElementInterface|null - */ - public function switchOnPayPalFrame($element = null) - { - if ($this->browser->find($this->iFrame)->isVisible()) { - $this->browser->switchToFrame(new Locator($this->iFrame)); - $element = $this->browser->find($this->frameBody); - } - - return $element; - } - - /** - * Select window of PayPal Express checkout, if iFrame had been selected - */ - public function switchOffPayPalFrame() - { - $this->browser->switchToFrame(); - } - - /** - * Fill the root form. - * - * @param FixtureInterface $customer - * @param Element|null $element - * @return $this - */ - public function fill(FixtureInterface $customer, Element $element = null) - { - $this->waitForElementNotVisible($this->loader); - return parent::fill($customer, $this->switchOnPayPalFrame($element)); - } - - /** - * Check is block active - * - * @return bool - */ - public function isBlockActive() - { - if ($this->browser->find($this->mapping['password']['selector'])->isVisible()) { - return true; - } - - return false; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml deleted file mode 100644 index e2954900098..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Login.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [type="email"] - - - [type="password"] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php deleted file mode 100644 index 3030342d0c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.php +++ /dev/null @@ -1,117 +0,0 @@ -mapping; - - $this->waitForElementNotVisible($this->loader); - $this->_rootElement = $this->browser->find('.main'); - - $this->overrideMapping($this->getFormSplitMapping('email')); - parent::fill($customer, $this->switchOnPayPalFrame($element)); - - if (!$this->browser->find($fullMapping['password']['selector'])->isVisible()) { - $this->clickToElement($this->nextButton); - } - $this->overrideMapping($this->getFormSplitMapping('password')); - parent::fill($customer, $this->switchOnPayPalFrame($element)); - - return $this; - } - - public function clickToElement($selector) - { - $rootElement = $this->findRootElement(); - $rootElement->find($selector)->click(); - } - - /** - * Check is block active - * - * @return bool - */ - public function isBlockActive() - { - if (!$this->browser->find($this->mapping['password']['selector'])->isVisible()) { - return true; - } - - return false; - } - - /** - * Override mapping to the form - * - * @param array $mapping - * @return void - */ - protected function overrideMapping(array $mapping) - { - $this->mapping = $mapping; - } - - /** - * Get mapping to the form by key - * - * @return array - */ - protected function getFormSplitMapping($key) - { - $mapping = $this->getFormMapping(); - if (empty($mapping)) { - return []; - } - - return isset($mapping['fields'][$key]) ? [$key => $mapping['fields'][$key]] : []; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml deleted file mode 100644 index 5fedd52a083..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLogin.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - [name='login_email'] - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml deleted file mode 100644 index 5d5b5097534..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/NewLoginPassword.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php deleted file mode 100644 index 10a04851736..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldAddresses.php +++ /dev/null @@ -1,59 +0,0 @@ -hasData($criteria)) { - $addressSelector = sprintf($this->addressSelector, $address->getData($criteria)); - $this->_rootElement->find($addressSelector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes'); - $this->_rootElement->find($this->saveButton)->click(); - } else { - throw new \Exception("$criteria field is absent in provided address fixture."); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php deleted file mode 100644 index 836b1b3faac..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldLogin.php +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - [name='login_email'] - - - [name='login_password'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php deleted file mode 100644 index 364810e8fe2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/OldReview.php +++ /dev/null @@ -1,56 +0,0 @@ -blockFactory->create( - 'Mage\Paypal\Test\Block\OldAddresses', - ['element' => $this->_rootElement->find($this->addresses)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php deleted file mode 100644 index cbfd4fa8552..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.php +++ /dev/null @@ -1,50 +0,0 @@ -find($this->continue)->click(); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml deleted file mode 100644 index e013f3916fe..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Advanced/Form.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - #cc_number - - - #expdate_month - - - #expdate_year - - - #cvv2_number - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php deleted file mode 100644 index 9ee6221bc19..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Payflow/Link/Form.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - #cc_number - - - #expdate_month - - - #expdate_year - - - #cvv2_number - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php deleted file mode 100644 index 63f75858b4b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Product/View.php +++ /dev/null @@ -1,51 +0,0 @@ -getCheckoutData(); - if (isset($checkoutData['options'])) { - $this->fillOptions($product); - } - if (isset($checkoutData['qty'])) { - $this->setQty($checkoutData['qty']); - } - $this->_rootElement->find($this->paypalCheckout)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php deleted file mode 100644 index 129d5c093b7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Block/Review.php +++ /dev/null @@ -1,77 +0,0 @@ -blockFactory->create( - 'Mage\Paypal\Test\Block\Addresses', - ['element' => $this->_rootElement->find($this->addresses)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php deleted file mode 100644 index 13e4f722a51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Constraint/AssertTransaction.php +++ /dev/null @@ -1,105 +0,0 @@ - $orderId, 'transaction_type' => $transactionType]; - - $salesOrderIndex->open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $orderForm = $salesOrderView->getOrderForm(); - - /** Check if transaction present in comments block. */ - /** @var Info $informationTab */ - $informationTab = $orderForm->getTabElement('information'); - $text = $this->prepareSearchedText($grandTotal); - \PHPUnit_Framework_Assert::assertTrue( - $informationTab->getCommentsBlock()->isCommentPresent($text), - 'Searched text is not present in order comments.' - ); - - \PHPUnit_Framework_Assert::assertTrue( - $informationTab->getCommentsBlock()->isCommentPresent($paymentAction), - 'Order has a wrong payment action.' - ); - - /** Check if transaction present in transactions Grid. */ - $orderForm->openTab('transactions'); - /** @var Transactions $transactionsTab */ - $transactionsTab = $orderForm->getTabElement('transactions'); - \PHPUnit_Framework_Assert::assertTrue( - $transactionsTab->getGrid()->isRowVisible($filter), - 'Searched transaction is not present in transaction grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Transaction is present in transaction grid and order's comments."; - } - - /** - * Prepare text for search. - * - * @param string $grandTotal - * @param string $currency - * @return string - */ - protected function prepareSearchedText($grandTotal, $currency = '$') - { - $amount = number_format(is_array($grandTotal) ? array_sum($grandTotal) : $grandTotal, 2); - return "amount of " . $currency . $amount; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml deleted file mode 100644 index ea85c4f1dca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalAddress.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml deleted file mode 100644 index 9b835d0eab2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php deleted file mode 100644 index d204df73b0f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Fixture/PaypalCustomer/Address.php +++ /dev/null @@ -1,118 +0,0 @@ -params = $params; - - if (isset($data['presets'])) { - $data['presets'] = explode(',', $data['presets']); - foreach ($data['presets'] as $value) { - /** @var AddressFixture $fixture */ - $addresses = $fixtureFactory->create( - 'Mage\Paypal\Test\Fixture\PaypalAddress', - ['dataset' => $value] - ); - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } elseif (empty($data['presets']) && !empty($data['addresses'])) { - foreach ($data['addresses'] as $addresses) { - /** @var AddressFixture $addresses */ - $this->data[] = $addresses->getData(); - $this->addressesFixture[] = $addresses; - } - } - } - - /** - * Persists prepared data into application. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param int|null $key [optional] - * @return array - */ - public function getData($key = null) - { - return isset($this->data[$key]) ? $this->data[$key] : $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Getting addresses fixture. - * - * @return array - */ - public function getAddresses() - { - return $this->addressesFixture; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php deleted file mode 100644 index 27afc1d5afc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Paypal.php +++ /dev/null @@ -1,117 +0,0 @@ - [ - 'class' => 'Mage\Paypal\Test\Block\Login', - 'locator' => '#login', // previous locator = #contents - 'strategy' => 'css selector', - ], - 'oldLoginBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\OldLogin', - 'locator' => '#loginModule', - 'strategy' => 'css selector', - ], - 'reviewBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\Review', - 'locator' => '.outerWrapper', - 'strategy' => 'css selector', - ], - 'oldReviewBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\OldReview', - 'locator' => '#content', - 'strategy' => 'css selector', - ], - 'newLoginBlock' => [ - 'class' => 'Mage\Paypal\Test\Block\NewLogin', - 'locator' => '#login', - 'strategy' => 'css selector', - ], - ]; - - /** - * Custom initialization. - * - * @return void - */ - protected function _init() - { - $this->_url = 'https://www.sandbox.paypal.com/cgi-bin/'; - } - - /** - * @return Login - */ - public function getLoginBlock() - { - return $this->getBlockInstance('loginBlock'); - } - - /** - * @return Review - */ - public function getReviewBlock() - { - return $this->getBlockInstance('reviewBlock'); - } - - /** - * @return OldLogin - */ - public function getOldLoginBlock() - { - return $this->getBlockInstance('oldLoginBlock'); - } - - /** - * @return OldReview - */ - public function getOldReviewBlock() - { - return $this->getBlockInstance('oldReviewBlock'); - } - - /** - * @return NewLogin - */ - public function getNewLoginBlock() - { - return $this->getBlockInstance('newLoginBlock'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml deleted file mode 100644 index f9e21b714df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/PaypalExpressReview.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index 771a2f3ba2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml deleted file mode 100644 index 8b9edeef097..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,1842 +0,0 @@ - - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - 0 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - All Allowed Countries - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - All Allowed Countries - - - - - - payment - 1 - - - - - payment - 1 - API Signature - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Specific Countries - 1 - - - payment - 1 - - - US - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - Mark - - - payment - 1 - No - - - - - - payment - 1 - Yes - 1 - - - payment - 1 - All Allowed Countries - - - - payment - 1 - No - - - - payment - 1 - No - Mark - - - - - payment - 1 - - - - - payment - 1 - API Signature - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - No - 0 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - Yes - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - All Allowed Countries - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - Credit Card (PayPal Advanced) - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - - Credit Card (PayPal Advanced) - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - - - payment - 1 - United Kingdom - GB - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - United States - US - - - payment - 1 - No - - - - - - payment - 1 - United Kingdom - GB - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Sale - Sale - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - United States - US - - - payment - 1 - No - - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - - - payment - 1 - - - - - payment - 1 - - PayPal - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - payment - 1 - Authorization - Authorization - - - payment - 1 - All Allowed Countries - - - - payment - 1 - Yes - 1 - - - payment - 1 - No - - - - payment - 1 - Yes - 1 - - - payment - 1 - Yes - 1 - - - - - payment - 1 - No - - - - payment - 1 - No - - - - payment - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml deleted file mode 100644 index dd747231050..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalAddress.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Dmytro - Aponasenko - 1 Main St - Culver City - California - 90230 - United States - T: 408-618-6006 - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml deleted file mode 100644 index 5ed199d09e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/Repository/PaypalCustomer.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Dmytro - Aponasenko - %PAYPAL_EMAIL% - %PAYPAL_PASSWORD% - - customer_US - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php deleted file mode 100644 index 2ca9dfdc925..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForOnlinePaymentMethodsTest.php +++ /dev/null @@ -1,64 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $magentoCustomer = $fixtureFactory->create('Mage\Customer\Test\Fixture\Customer', ['dataset' => 'default']); - $magentoCustomer->persist(); - - return ['customer' => $magentoCustomer]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable including config and delete all tax rules after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php deleted file mode 100644 index 0e85956424b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/AbstractCreateSalesEntityForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,39 +0,0 @@ -create('Mage\Paypal\Test\Fixture\PaypalCustomer', ['dataset' => 'default']); - - return ['paypalCustomer' => $paypalCustomer, 'customer' => $magentoCustomer['customer']]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php deleted file mode 100644 index 4735860a57b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,44 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Invoice' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Invoice' button. - * 11. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7201 - */ -class CreateInvoiceForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml deleted file mode 100644 index 6981212f97b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateInvoiceForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,332 +0,0 @@ - - - - - - Create full online invoice with shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal - - - - - - - - - - Create partial online invoice for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for invoice - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full online invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create online full invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice with 2 products and taxes for payflow express authorization line items - catalogProductSimple::default,catalogProductSimple::default - default - payflow_express_authorization_line_items, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for invoice - 679.50 - 679.50 - 100.00 - 300.00 - 24.75 - 324.75 - 100.00 - 300.00 - 24.75 - 324.75 - Processing - payment_method:paypal - - - - - - - - - - Create full online invoice with configurable product for payflow express authorization line items - configurableProduct::default - payflow_express_authorization_line_items - Flat Rate/Fixed - comments for invoice - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice with shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal - - - - - - - - - - Create partial offline invoice for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for invoice - Capture Offline - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full offline invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - Create full offline invoice for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index a0dc04cb7d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7231 - */ -class CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create offline invoice with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index a60aa1a9477..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - Yes - comments for invoice - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payflow_link - - - - - - - - - - Create partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for invoice - 1 - Capture Offline - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal, paypal:advanced - - - - - - - - - Create full invoice for paypal advanced action sale - paypal_advanced_action_sale - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - false - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal, paypal:advanced - - - - - - - - - Create full invoice for paypal hosted solution - paypal_hosted_solution - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:hosted_solution - - - - - - - - - - Create full invoice for paypal hosted solution action sale - paypal_hosted_solution_action_sale - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - false - comments for invoice - Capture Offline - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal, paypal:hosted_solution - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index c52e7a19b8a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7211 - */ -class CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Create offline invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 04c2083f75d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOfflineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payments_pro - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for invoice - Yes - Capture Offline - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payflow_pro - catalogProductSimple::5_dollar_product_for_payments - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for invoice - Yes - Capture Offline - 30.00 - 30.00 - Shipped - 5.00 - 15.00 - 15.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index 7b93e54c60d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7231 - */ -class CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index 0b2bc0bd429..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - Create partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for invoice - 1 - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - Create full invoice for paypal hosted solution - paypal_hosted_solution - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - comments for invoice - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Processing - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index c9e5c26127b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,93 +0,0 @@ - Orders. - * 10. Select created order in the grid and open it. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Perform assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7211 - */ -class CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 9a7742b076c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineInvoiceForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payments_pro - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for invoice - Yes - 315.00 - 315.00 - Shipped - 100.00 - 300.00 - 300.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full invoice with shipment for paypal payments pro. - paypal_payflow_pro - catalogProductSimple::5_dollar_product_for_payments - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for invoice - Yes - 30.00 - 30.00 - Shipped - 5.00 - 15.00 - 15.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index ef62a8f68f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,95 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Ship' button. - * 9. Click 'Invoice' button. - * 10. Fill data according to dataset. - * 11. Click 'Submit Invoice' button. - * 12. Click 'Credit memo' button. - * 13. Fill data according to dataset. - * 14. Click 'Submit credit memo' button. - * 15. Perform asserts. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7277 - */ -class CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods with i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config, delete all tax rules and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml deleted file mode 100644 index 5f7d847c4ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithIFrameTest.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - Create full refund with two products for paypal advanced - paypal_advanced - catalogProductSimple::default, catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for credit memo - 630.00 - 630.00 - 100.00 - 300.00 - 300.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - Create partial refund with partial invoice for paypal advanced - paypal_advanced - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for credit memo - 2 - 1 - 1 - 115.00 - 115.00 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - Create full refund with partial invoice for paypal payflow link - paypal_payflow_link - catalogProductSimple::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for credit memo - 2 - 2 - 2 - 215.00 - 215.00 - 100.00 - 200.00 - 200.00 - Processing - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full refund with taxes for paypal payflow link action sale - paypal_payflow_link_action_sale - catalogProductSimple::default - default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for credit memo - false - 339.75 - 339.75 - 100.00 - 300.00 - 24.75 - 324.75 - Closed - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full refund with two products for paypal advanced action sale - paypal_advanced_action_sale - configurableProduct::default - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - false - comments for credit memo - 2 - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Closed - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index f7870bdb58f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,94 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Ship' button. - * 9. Click 'Invoice' button. - * 10. Fill data according to dataset. - * 11. Click 'Submit Invoice' button. - * 12. Click 'Credit memo' button. - * 13. Fill data according to dataset. - * 14. Click 'Submit credit memo' button. - * 15. Perform asserts. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7239 - */ -class CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online refund with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config and logout after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index bda4c52fbaf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - Create full refund for paypal payments pro - catalogProductSimple::default - paypal_payments_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create partial credit memo for paypal payments pro action sale - catalogProductSimple::default - paypal_payments_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - false - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - Create full credit memo with partial invoice for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - 2 - 25.00 - 25.00 - 2 - 5.00 - 10.00 - 10.00 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create partial credit memo with partial invoice for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - 2 - 1 - 20.00 - 20.00 - 1 - 5.00 - 5.00 - 5.00 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create partial credit memo for paypal payflow pro action sale - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for credit memo - false - 1 - 20.00 - 20.00 - 1 - 5.00 - 5.00 - 5.00 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php deleted file mode 100644 index 74772b53512..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,50 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Ship' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Ship' button. - * 11. Click 'Invoice' button. - * 12. Fill data according to dataset. - * 13. Click 'Submit Invoice' button. - * 14. Click 'Credit memo' button. - * 15. Fill data according to dataset. - * 16. Click 'Submit credit memo' button. - * 17. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7216 - */ -class CreateOnlineRefundForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml deleted file mode 100644 index dbcc91dcda5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOnlineRefundForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - Create full refund for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for credit memo - 315.00 - 315.00 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create partial credit memo for payflow express authorization line items - catalogProductSimple::default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for credit memo - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Complete - payment_method:paypal - - - - - - - - - Create full credit memo with partial invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for credit memo - 2 - 215.00 - 215.00 - 2 - 100.00 - 200.00 - 200.00 - Processing - payment_method:paypal - - - - - - - - - - Create partial credit memo with partial invoice for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for credit memo - 2 - 1 - 115.00 - 115.00 - 1 - 100.00 - 100.00 - 100.00 - Processing - payment_method:paypal - - - - - - - - - Create full credit memo for payflow express sale - catalogProductSimple::default - payflow_express_sale - Flat Rate/Fixed - comments for credit memo - 5 - false - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for credit memo - 5 - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for credit memo - 5 - 315.00 - 315.00 - 3 - 100.00 - 300.00 - 300.00 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark with two products and taxes - catalogProductSimple::default,catalogProductSimple::default - default - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for credit memo - 6 - 679.50 - 679.50 - 100.00 - 300.00 - 24.75 - 324.75 - 100.00 - 300.00 - 24.75 - 324.75 - Closed - payment_method:paypal - - - - - - - - - - Create full credit memo for paypal express sale specific country us shipping options mark with configurable product - configurableProduct::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for credit memo - 2 - 330.00 - 330.00 - 160.00 - 320.00 - 320.00 - Closed - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php deleted file mode 100644 index 063ad5c20b4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.php +++ /dev/null @@ -1,87 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Runs one page checkout with online payments methods with 3D secure test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml deleted file mode 100644 index 501c9276b9b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWith3DSecureTest.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - paypal_payflow_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - visa_3d_secure_positive - visa_3d_secure_positive - 105.00 - true - payment_method:paypal, paypal:payflow_pro - - - - - - paypal_payflow_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - visa_3d_secure_negative - visa_3d_secure_positive - 105.00 - false - payment_method:paypal, paypal:payflow_pro - - - - paypal_payments_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - visa_3d_secure_positive_without_pass - visa_3d_secure_positive - 105.00 - true - payment_method:paypal, paypal:payments_pro - - - - - - paypal_payments_pro_3d_secure, enable_3d_secure - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - visa_3d_secure_negative_without_pass - visa_3d_secure_positive - 105.00 - false - payment_method:paypal, paypal:payments_pro - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php deleted file mode 100644 index 56b5ee23b71..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithIFrameTest.php +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - paypal_payflow_link - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - payflow_link - for_iframe - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:payflow_link - - - - - - - paypal_payflow_link_action_sale - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:payflow_link - - - - - - - paypal_advanced - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:advanced - - - - - - - paypal_advanced_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:advanced - - - - - - - paypal_hosted_solution - catalogProductSimple::order_default - default_frontend_new - login - customer_UK - Flat Rate - Fixed - hosted_pro - hosted_pro - yes - Authorization - Authorized - 105 - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - paypal_hosted_solution_action_sale - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - hosted_pro - hosted_pro_action_sale - yes - Capture - captured - 105 - payment_method:paypal_direct, paypal:hosted_solution - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php deleted file mode 100644 index a2cc00062c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,89 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create order with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml deleted file mode 100644 index 52c0ce9aba8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithOnlinePaymentsMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - paypal_payments_pro - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - paypal_direct - payments_pro - Authorization - Authorized - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payments_pro - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - Authorization - Authorized - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payments_pro_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - paypal_direct - payments_pro - Capture - Captured - 105 - payment_method:paypal, paypal:payments_pro - - - - - - - paypal_payflow_pro - catalogProductSimple::order_default - default_frontend - guest - no - customer_US - Flat Rate - Fixed - verisign - default - Authorization - Authoriz - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - paypal_payflow_pro - catalogProductSimple::order_default - default_frontend_new - login - customer_US_login - Flat Rate - Fixed - verisign - default - Authorization - Authoriz - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - paypal_payflow_pro_action_sale - catalogProductSimple::order_default - default_frontend_new - register - no - customer_US - Flat Rate - Fixed - verisign - default - Capture - Captur - 105 - payment_method:paypal, paypal:payflow_pro - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php deleted file mode 100644 index 87ea55a7556..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.php +++ /dev/null @@ -1,95 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - - // Create US tax rule - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'us_tax_rule']); - $taxRule->persist(); - } - - /** - * Create order with PayPal standard test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - // Rollback configuration. - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } - - /** - * Delete all tax rules after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - ObjectManager::getInstance()->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml deleted file mode 100644 index 3f7488d6d6c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateOrderWithPayPalStandardTest.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - Simple product one page checkout within Pay Pal standard payment method - catalogProductSimple::order_default - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 113.25 - payment_method:paypal - paypal:standard - - - - - Bundle product one page checkout within Pay Pal standard payment method - bundleProduct::bundle_fixed_product - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 836.36 - payment_method:paypal, paypal:standard - - - - - Grouped product one page checkout within Pay Pal standard payment method - groupedProduct::three_simple_products_without_category - paypal_standard - guest - customer_US - default_frontend - no - Flat Rate - Fixed - paypal_express - 663.00 - payment_method:paypal, paypal:standard - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php deleted file mode 100644 index 01e748df1cf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Shipment' button. - * 9. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7200 - */ -class CreateShipmentForOnlinePaymentMethodsWithIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable included config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml deleted file mode 100644 index 435faccedc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithIFrameTest.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - Create full shipment for paypal payflow link - catalogProductSimple::default - paypal_payflow_link - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_link - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:paypal_direct, paypal:payflow_link - - - - - - - - - - Create full shipment for paypal advanced - catalogProductSimple::default - paypal_advanced - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - payflow_advanced - for_iframe - yes - comments for shipment - 3 - 3 - Processing - payment_method:paypal_direct, paypal:advanced - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php deleted file mode 100644 index 0094e94ead9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 5. Select created order in the grid and open it. - * 6. Click 'Ship' button. - * 7. Fill data according to dataset. - * 8. Click 'Submit Shipment' button. - * 9. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7200 - */ -class CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest extends Scenario -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ - - /** - * Customer logout page. - * - * @var CustomerAccountLogout - */ - protected $customerAccountLogout; - - /** - * Prepare environment for test. - * - * @param CustomerAccountLogout $customerAccountLogout - * @return void - */ - public function __prepare(CustomerAccountLogout $customerAccountLogout) - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->customerAccountLogout = $customerAccountLogout; - } - - /** - * Create online invoice with online payments methods without i-frame. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config after test. - * - * @return void - */ - public function tearDown() - { - $this->customerAccountLogout->open(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml deleted file mode 100644 index 5974aed7bfc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForOnlinePaymentMethodsWithoutIFrameTest.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Create full shipment for paypal payments pro - catalogProductSimple::default - paypal_payments_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for shipment - 3 - 3 - Processing - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full shipment for paypal payments pro action sale - catalogProductSimple::default - paypal_payments_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - paypal_direct - payments_pro - comments for shipment - 3 - 3 - Complete - payment_method:paypal, paypal:payments_pro - - - - - - - - - - Create full shipment for paypal payflow pro - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for shipment - 3 - 3 - Processing - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - Create full shipment for paypal payflow pro action sale - catalogProductSimple::5_dollar_product_for_payments - paypal_payflow_pro_action_sale - default_frontend_new - login - yes - customer_US_login - Flat Rate - Fixed - verisign - default - comments for shipment - 3 - 3 - Complete - payment_method:paypal, paypal:payflow_pro - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php deleted file mode 100644 index 5fa67850d26..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.php +++ /dev/null @@ -1,44 +0,0 @@ - Orders. - * 7. Select created order in the grid and open it. - * 8. Click 'Ship' button. - * 9. Fill data according to dataset. - * 10. Click 'Submit Shipment' button. - * 11. Perform asserts. - * - * @group Payment_Methods_(CS), PayPal_(CS) - * @ZephyrId MPERF-7154 - */ -class CreateShipmentForPaypalExpressCheckoutTest extends AbstractCreateSalesEntityForPaypalExpressCheckoutTest -{ - /* tags */ - const TEST_TYPE = '3rd_party_test'; - /* end tags */ -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml deleted file mode 100644 index 0942a3155ce..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/CreateShipmentForPaypalExpressCheckoutTest.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - Create full shipment for paypal express checkout with line items mark require billing address - catalogProductSimple::default - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - comments for shipment - Custom Value - title - 199 - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create partial shipment for payflow express authorization line items - catalogProductSimple::order_default - payflow_express_authorization_line_items - Flat Rate/Fixed - 1 - comments for shipment - 1 - 1 - 1 - Processing - payment_method:paypal - - - - - - - - - Create full shipment for payflow express authorization specific country us - catalogProductSimple::default - payflow_express_authorization_specificcountry_us - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for payflow express sale - catalogProductSimple::default - payflow_express_sale - Flat Rate/Fixed - comments for shipment - 3 - 3 - Complete - payment_method:paypal - - - - - - - - - - Create full shipment for payflow express sale specific country gb line items - catalogProductSimple::default - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark - catalogProductSimple::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 3 - 3 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark with taxes and two products - catalogProductSimple::default,catalogProductSimple::default - default - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - comments for shipment - 6 - 6 - Processing - payment_method:paypal - - - - - - - - - - Create full shipment for paypal express sale specific country us shipping options mark with configurable product - configurableProduct::default - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - comments for shipment - 2 - 2 - Processing - payment_method:paypal - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php deleted file mode 100644 index be5a72e8578..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest.php +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Paypal express order line items mark require billing address - catalogProductSimple::default - active_sales_rule_for_all_groups - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - 315 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Payflow express authorization line items - catalogProductVirtual::order_default - active_sales_rule_for_all_groups - payflow_express_authorization_line_items - - - 100 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - Payflow express authorization specificcountry us - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - payflow_express_authorization_specificcountry_us - - - 1000 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - Payflow express sale - catalogProductSimple::order_default - - - payflow_express_sale - Flat Rate/Fixed - 105 - Processing - Capture - Completed - Back, Edit, Send Email, Hold, Ship - Captured - 105 - 105 - payment_method:paypal - - - - - - - - - - Payflow express sale specificcountry gb line items - catalogProductSimple::order_default - - - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - 105 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Paypal express sale specificcountry us shipping options mark for simple product and without sales rule - catalogProductSimple::default - - - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - 315 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - Paypal express sale specificcountry us shipping options mark for virtual product and with sales rule - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - paypal_express_sale_specificcountry_us_shipping_options_mark - - - 1000 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php deleted file mode 100644 index 015f0d3003b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.php +++ /dev/null @@ -1,82 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $paypalCustomer = $fixtureFactory->create('Mage\Paypal\Test\Fixture\PaypalCustomer', ['dataset' => 'default']); - - return ['paypalCustomer' => $paypalCustomer]; - } - - /** - * Runs one page checkout test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Disable enabled config and delete all sales, tax and catalog rules after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('\Mage\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); - $this->objectManager->create('\Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => $this->currentVariation['arguments']['configData'], 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml deleted file mode 100644 index 6894f3d0069..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestCase/TestCreationForExpressCheckoutWithinPayPalButtonTest.xml +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - catalogProductVirtual::order_default,catalogProductSimple::default - active_sales_rule_for_all_groups - paypal_express_order_line_items_mark_require_billing_address - Flat Rate/Fixed - 215 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default,catalogProductSimple::order_default - active_sales_rule_for_all_groups - payflow_express_authorization_line_items - Flat Rate/Fixed - 105 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - payflow_express_authorization_specificcountry_us - - - 500 - Processing - Authorization - - - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - catalogProductSimple::order_default - - - payflow_express_sale - Flat Rate/Fixed - 105 - Processing - Capture - Completed - Back, Edit, Send Email, Hold, Ship - Captured - 105 - 105 - payment_method:paypal - - - - - - - - - - catalogProductVirtual::order_default,catalogProductSimple::order_default - - - payflow_express_sale_specificcountry_gb_line_items - Flat Rate/Fixed - 205 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductSimple::default - - - paypal_express_sale_specificcountry_us_shipping_options_mark - Flat Rate/Fixed - 315 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - catalogProductVirtual::order_default_expensive - active_sales_rule_for_all_groups - paypal_express_sale_specificcountry_us_shipping_options_mark - - - 500 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice - Authorized - payment_method:paypal - - - - - - - - With two product and taxes - catalogProductSimple::default,configurableProduct::default - for_all_states - paypal_express_sale_specificcountry_us_shipping_options_mark, tax_calculation_base_on_shipping_origin - Flat Rate/Fixed - 696.15 - Processing - Authorization - Completed - Back, Edit, Cancel, Send Email, Void, Hold, Invoice, Ship - Authorized - payment_method:paypal - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php deleted file mode 100644 index bef9276767e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalFromProductPageStep.php +++ /dev/null @@ -1,71 +0,0 @@ -catalogProductView = $catalogProductView; - $this->products = $products; - $this->browser = $browser; - } - - /** - * Pay Pal checkout from product page. - * - * @return void - */ - public function run() - { - $this->browser->open($_ENV['app_frontend_url'] . $this->products[0]->getUrlKey() . '.html'); - $this->catalogProductView->getPaypalViewBlock()->paypalCheckout($this->products[0]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php deleted file mode 100644 index a4344382e08..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/CheckoutWithPayPalStep.php +++ /dev/null @@ -1,51 +0,0 @@ -checkoutCart = $checkoutCart; - } - - /** - * Checkout with Pay Pal. - * - * @return void - */ - public function run() - { - $this->checkoutCart->getCartBlock()->getExpressShortcutBlock()->checkoutWithPayPal(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php deleted file mode 100644 index 80a59d5dc85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/ContinuePayPalCheckoutStep.php +++ /dev/null @@ -1,112 +0,0 @@ -paypalPage = $paypalPage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->customer = $paypalCustomer; - } - - /** - * Continue Pay Pal checkout. - * - * @return array|null - */ - public function run() - { - $reviewBlockIsPresent = false; - $sleepingTime = 0; - while (!$reviewBlockIsPresent and $sleepingTime <= 60) { - sleep(1); - $reviewBlockIsPresent = $this->paypalPage->getReviewBlock()->isVisible() - || $this->paypalPage->getOldReviewBlock()->isVisible(); - $sleepingTime++; - } - $this->reviewBlock = $this->paypalPage->getReviewBlock()->isVisible() - ? $this->paypalPage->getReviewBlock() - : $this->paypalPage->getOldReviewBlock(); - $this->selectCustomerAddress($this->customer); - $this->reviewBlock->continueCheckout(); - $successBlock = $this->checkoutOnepageSuccess->getSuccessBlock(); - - return ['orderId' => $successBlock->isVisible() ? $successBlock->getGuestOrderId() : null]; - } - - /** - * Select customer address. - * - * @param PaypalCustomer $customer - * @return void - */ - protected function selectCustomerAddress(PaypalCustomer $customer) - { - if ($this->reviewBlock->checkChangeAddressAbility()) { - $address = $customer->getDataFieldConfig('address')['source']->getAddresses()[0]; - $this->reviewBlock->getAddressesBlock()->selectAddress($address); - $this->reviewBlock->waitLoader(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php deleted file mode 100644 index 796070a49a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/FillCreditCardInIFrameStep.php +++ /dev/null @@ -1,108 +0,0 @@ -checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->browser = $browser; - if (isset($payment['cc']) && !($payment['cc'] instanceof Cc)) { - $payment['cc'] = $fixtureFactory->create('Mage\Payment\Test\Fixture\Cc', ['dataset' => $payment['cc']]); - } - $this->payment = $payment; - } - - /** - * Fill credit card in i-frame step. - * - * @return array - */ - public function run() - { - $this->checkoutOnepage->getReviewBlock()->clickContinue(); - $this->browser->switchToFrame(new Locator($this->iFrameSelector)); - $methodName = 'get' . str_replace(' ', '', ucwords(str_replace('_', ' ', $this->payment['method']))) . 'Form'; - $form = $this->checkoutOnepage->$methodName(); - $element = $this->browser->find('body'); - $form->fill($this->payment['cc'], $element); - $form->clickPayNow($element); - $this->browser->switchToFrame(); - - return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php deleted file mode 100644 index e846a25a8cd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/LoginToPayPalStep.php +++ /dev/null @@ -1,115 +0,0 @@ -browser = $browser; - $this->paypalPage = $paypalPage; - $this->customer = $paypalCustomer; - } - - /** - * Login to Pay Pal. - * - * @return void - */ - public function run() - { - $reviewBlockIsPresent = false; - $sleepingTime = 0; - while (!$reviewBlockIsPresent and $sleepingTime <= 60) - { - sleep(1); - $reviewBlockIsPresent = $this->paypalPage->getReviewBlock()->isVisible() - || $this->paypalPage->getOldReviewBlock()->isVisible(); - $sleepingTime++; - } - /** Log out from previous session. */ - $reviewBlock = $this->paypalPage->getReviewBlock()->isVisible() - ? $this->paypalPage->getReviewBlock() - : $this->paypalPage->getOldReviewBlock(); - $reviewBlock->logOut(); - - $reviewBlock->waitLoader(); - $payPalLoginBlock = $this->getActualBlock(); - $payPalLoginBlock->fill($this->customer); - $payPalLoginBlock->submit(); - $payPalLoginBlock->switchOffPayPalFrame(); - $reviewBlock->waitLoader(); - } - - /** - * Returns actual login block by selector - * - * @return \Mage\Paypal\Test\Block\NewLogin|\Mage\Paypal\Test\Block\Login|\Mage\Paypal\Test\Block\OldLogin - */ - protected function getActualBlock() - { - if ($this->paypalPage->getNewLoginBlock()->isBlockActive()) { - $returnBlock = $this->paypalPage->getNewLoginBlock(); - } elseif ($this->paypalPage->getLoginBlock()->isBlockActive()) { - $returnBlock = $this->paypalPage->getLoginBlock(); - } else { - $returnBlock = $this->paypalPage->getOldLoginBlock(); - } - return $returnBlock; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php b/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php deleted file mode 100644 index aba78df2e63..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/TestStep/PlaceOrderStep.php +++ /dev/null @@ -1,78 +0,0 @@ -paypalExpressReview = $paypalExpressReview; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->shippingMethod = $shippingMethod; - } - - /** - * Place order after checking order totals on review step. - * - * @return array - */ - public function run() - { - $orderReviewBlock = $this->paypalExpressReview->getReviewBlock(); - if ('-' !== $this->shippingMethod) { - $orderReviewBlock->selectShippingMethod($this->shippingMethod); - } - $orderReviewBlock->placeOrder(); - return ['orderId' => $this->checkoutOnepageSuccess->getSuccessBlock()->getGuestOrderId()]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml deleted file mode 100644 index 09523f332d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Paypal/Test/etc/testcase.xml +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php deleted file mode 100644 index 68c384f2972..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingInProductPage.php +++ /dev/null @@ -1,73 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $catalogProductView->getReviewsBlock()->clickAddReviewLink(); - $reviewForm = $reviewProductList->getReviewFormBlock(); - $ratings = $review->getDataFieldConfig('ratings')['source']->getRatings(); - foreach($ratings as $rating){ - \PHPUnit_Framework_Assert::assertTrue( - $reviewForm->isVisibleRating($rating), - 'Product rating "' . $rating->getRatingCode() . '" is not displayed on review product page.' - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product rating is displayed on review product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php deleted file mode 100644 index 26fbf0a6e43..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Constraint/AssertProductRatingOnReviewPage.php +++ /dev/null @@ -1,63 +0,0 @@ -open(); - $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $ratingReview = $this->sortDataByPath($review->getRatings(), '::title'); - $ratingForm = $this->sortDataByPath($reviewEdit->getReviewForm()->getData()['ratings'], '::title'); - $error = $this->verifyData($ratingReview, $ratingForm); - - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product rating is displayed on edit review page(backend).'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml deleted file mode 100644 index 7dce3dcafda..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php deleted file mode 100644 index 3bf16c0e42e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Fixture/Rating/Stores.php +++ /dev/null @@ -1,112 +0,0 @@ - 'Main Website/Main Website Store/Default Store View'] - * - * @var array - */ - protected $data = []; - - /** - * The created stores. - * - * @var Store[] - */ - protected $stores = []; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['datasets'])) { - $datasets = explode(',', $data['datasets']); - foreach ($datasets as $dataset) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $dataset]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getGroupId() . '/' . $store->getName(); - } - } - } - - /** - * Persist data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return id of the created entity. - * - * @param string|null $key [optional] - * @return int - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get stores. - * - * @return array - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php deleted file mode 100644 index 5758832f6a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/Curl.php +++ /dev/null @@ -1,110 +0,0 @@ - 1, - ]; - - /** - * Rating options. - * - * @var array - */ - protected $options = [ - 'add_1' => 1, - 'add_2' => 2, - 'add_3' => 3, - 'add_4' => 4, - 'add_5' => 5, - ]; - - /** - * Post request for creating product Rating in backend. - * - * @param FixtureInterface|null $rating - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $rating = null) - { - $url = $_ENV['app_backend_url'] . 'rating/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $data = $this->replaceMappingData($this->prepareData($rating->getData())); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception( - 'Product Rating entity creating by curl handler was not successful! Response:' . $response - ); - } - - return ['rating_id' => $this->getProductRatingId()]; - } - - /** - * Prepare POST data for creating rating request. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - if (isset($data['stores'])) { - foreach ($data['stores'] as $key => $store) { - if (isset($this->mappingStores[$store])) { - $data['stores'][$key] = $this->mappingStores[$store]; - } - } - } - $data['option_title'] = $this->options; - - return $data; - } - - /** - * Get product Rating id. - * - * @return mixed - */ - protected function getProductRatingId() - { - $url = 'rating/index/sort/rating_id/dir/desc/'; - $regex = '`rating\/edit\/id\/(\d+)`'; - $extractor = new Extractor($url, $regex); - $match = $extractor->getData(); - - return empty($match[1]) ? null : $match[1]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php b/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php deleted file mode 100644 index e2de80ef206..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Handler/RatingInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml deleted file mode 100644 index c126eaee418..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Page/Adminhtml/RatingIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml deleted file mode 100644 index 119c88db479..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/Repository/Rating.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - rating_%isolation% - - default - - Yes - - - diff --git a/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml deleted file mode 100644 index c1fea638c83..00000000000 --- a/dev/tests/functional/tests/app/Mage/Rating/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php deleted file mode 100644 index edcedb508bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View.php +++ /dev/null @@ -1,58 +0,0 @@ -_rootElement->find($this->viewReviewLinkSelector); - } - - /** - * Get 'add review link'. - * - * @return ElementInterface - */ - public function getAddReviewLink() - { - return $this->_rootElement->find($this->addReviewLinkSelector); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php deleted file mode 100644 index 5675e89054e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.php +++ /dev/null @@ -1,124 +0,0 @@ -_rootElement->find($this->submit)->click(); - } - - /** - * Fill the root form. - * - * @param FixtureInterface $review - * @param SimpleElement|null $element - * @return $this - */ - public function fill(FixtureInterface $review, SimpleElement $element = null) - { - if ($review->hasData('ratings')) { - $this->fillRatings($review); - } - return parent::fill($review, $element); - } - - /** - * Fill ratings on the review form. - * - * @param ReviewFixture $review - * @return void - */ - protected function fillRatings(ReviewFixture $review) - { - $ratingsData = $review->getRatings(); - $ratingsFixture = $review->getDataFieldConfig('ratings')['source']->getRatings(); - foreach ($ratingsData as $key => $value) { - $this->setRating($ratingsFixture[$key], $value['rating']); - } - } - - /** - * Set rating vote by rating code. - * - * @param Rating $rating - * @param int $ratingVote - * @return void - */ - protected function setRating(Rating $rating, $ratingVote) - { - $ratingValueSelector = sprintf($this->ratingVoteLabel, $rating->getRatingCode(), $ratingVote); - $this->getRating($rating)->find($ratingValueSelector, Locator::SELECTOR_CSS, 'checkbox')->setValue('Yes'); - } - - /** - * Check rating element is visible. - * - * @param Rating $rating - * @return bool - */ - public function isVisibleRating(Rating $rating) - { - return $this->getRating($rating)->isVisible(); - } - - /** - * Get single product rating. - * - * @param Rating $rating - * @return SimpleElement - */ - protected function getRating(Rating $rating) - { - return $this->_rootElement->find(sprintf($this->rating, $rating->getRatingCode()), Locator::SELECTOR_XPATH); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml deleted file mode 100644 index 7a92c769959..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Form.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - #review_field - - - <selector>#summary_field</selector> - - - #nickname_field - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php b/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php deleted file mode 100644 index f83f498981a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Block/Product/View/Review.php +++ /dev/null @@ -1,246 +0,0 @@ -getAddReviewLink()->click(); - } - - /** - * Is visible review items. - * - * @return bool - */ - public function isVisibleReviewItems() - { - return $this->_rootElement->find($this->itemsSelector)->isVisible(); - } - - /** - * Get add review link. - * - * @return ElementInterface - */ - public function getAddReviewLink() - { - return $this->_rootElement->find($this->addReviewLink); - } - - /** - * Get all reviews. - * - * @return array - */ - public function getItems() - { - $items = []; - if (!$this->_rootElement->find($this->itemsSelector)->isVisible()) { - return []; - } - $reviewsTitles = $this->_rootElement->getElements($this->itemsSelector); - foreach ($reviewsTitles as $title) { - $reviewTitle = $this->getReviewTitle($title);; - $items[] = [ - 'title' => $reviewTitle, - 'detail' => $this->getReviewText($reviewTitle), - 'nickname' => $this->getReviewAuthor($reviewTitle), - 'ratings' => $this->getReviewRatings($reviewTitle) - ]; - } - - return $items; - } - - /** - * Get review ratings. - * - * @param string $reviewTitle - * @return array|null - */ - protected function getReviewRatings($reviewTitle) - { - $ratings = []; - $ratingsSelector = $this->getRatingsSelector($reviewTitle); - if (!$this->_rootElement->find($ratingsSelector, Locator::SELECTOR_XPATH)->isVisible()) { - return null; - } - $ratingsElements = $this->_rootElement->getElements($ratingsSelector, Locator::SELECTOR_XPATH); - foreach ($ratingsElements as $itemRating) { - $ratings[] = [ - 'title' => strtolower($itemRating->getText()), - 'rating' => $this->getRatingValue($itemRating) - ]; - } - - return $ratings; - } - - /** - * Get ratings selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getRatingsSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Ratings'); - } - - /** - * Get rating value. - * - * @param ElementInterface $itemRating - * @return string - */ - protected function getRatingValue(ElementInterface $itemRating) - { - $ratingValue = $itemRating->find($this->ratingValue)->getAttribute('style'); - preg_match('`(\d+)%`', $ratingValue, $matches); - return isset($matches[1]) ? $matches[1] / 20 : null; - } - - /** - * Get review's title. - * - * @param ElementInterface $titleElement - * @return string - */ - protected function getReviewTitle(ElementInterface $titleElement) - { - return strtolower($titleElement->getText()); - } - - /** - * Get review's author. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewAuthor($reviewTitle) - { - $reviewAuthor = $this->_rootElement->find($this->getReviewAuthorSelector($reviewTitle), Locator::SELECTOR_XPATH) - ->getText(); - - return strtolower(trim(str_replace('REVIEW BY', '', explode('/', $reviewAuthor)[0]))); - } - - /** - * Get review's text. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewText($reviewTitle) - { - $reviewText = $this->_rootElement->find($this->getReviewTextSelector($reviewTitle), Locator::SELECTOR_XPATH) - ->getText(); - return explode("\n", $reviewText)[0]; - } - - /** - * Get review text selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewTextSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Text'); - } - - /** - * Get review author selector. - * - * @param string $reviewTitle - * @return string - */ - protected function getReviewAuthorSelector($reviewTitle) - { - return $this->getReviewSelector($reviewTitle, 'Author'); - } - - /** - * Get review entity selector. - * - * @param string $reviewTitle - * @param string $type - * @return string - */ - protected function getReviewSelector($reviewTitle, $type) - { - $property = 'item' . $type; - $specifySelector = property_exists($this, $property) ? $this->$property : ''; - return sprintf($this->itemRowSelector . $specifySelector, $reviewTitle); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php deleted file mode 100644 index a6b4c83bc22..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewForm.php +++ /dev/null @@ -1,91 +0,0 @@ -open(); - $reviewIndex->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $fixtureData = $this->prepareFixtureData($review, $status); - $formData = $reviewEdit->getReviewForm()->getData(); - $error = $this->verifyData($fixtureData, $formData); - - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Prepare fixture data. - * - * @param Review $review - * @param string $status - * @return array - */ - protected function prepareFixtureData(Review $review, $status) - { - $reviewData = $review->getData(); - if ($status !== '') { - $reviewData['status_id'] = $status; - } - - return $reviewData; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review data equals passed from fixture on edit page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php deleted file mode 100644 index 047b19fef9f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewInGrid.php +++ /dev/null @@ -1,111 +0,0 @@ -open(); - $filter = $this->prepareFilter($product, $review->getData(), $gridStatus); - \PHPUnit_Framework_Assert::assertTrue( - $reviewIndex->getReviewGrid()->isRowVisible($filter), - 'Review is absent in Review grid.' - ); - } - - /** - * Prepare filter for assert - * - * @param InjectableFixture $product - * @param array $review - * @param string $gridStatus [optional] - * @return array - */ - public function prepareFilter(InjectableFixture $product, array $review, $gridStatus = '') - { - $filter = []; - foreach ($this->filter as $field) { - switch ($field) { - case 'name': - case 'sku': - $value = $product->getData($field); - break; - case 'status_id': - $value = $gridStatus !== '' ? $gridStatus : (isset($review[$field]) ? $review[$field] : null); - break; - default: - $value = isset($review[$field]) ? $review[$field] : null; - break; - } - if ($value !== null) { - $filter += [$field => $value]; - } - } - return $filter; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review is present in grid on product reviews tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php deleted file mode 100644 index a02d5fdb177..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewIsAbsentOnProductPage.php +++ /dev/null @@ -1,85 +0,0 @@ -catalogProductView = $catalogProductView; - } - - /** - * Assert that product doesn't have a review on product page. - * - * @return void - */ - public function processAssert() - { - $this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - - \PHPUnit_Framework_Assert::assertFalse( - $this->catalogProductView->getReviewsBlock()->isVisibleReviewItems(), - 'No reviews below the form required.' - ); - \PHPUnit_Framework_Assert::assertEquals( - self::NO_REVIEW_LINK_TEXT, - trim($this->catalogProductView->getReviewsBlock()->getAddReviewLink()->getText()), - sprintf('"%s" link is not available', self::NO_REVIEW_LINK_TEXT) - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product do not have a review on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php deleted file mode 100644 index 8335fce4bb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertProductReviewOnProductPage.php +++ /dev/null @@ -1,79 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $reviewBlock = $catalogProductView->getReviewsBlock(); - $catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $formReview = $reviewBlock->getItems()[0]; - $fixtureReview = $this->prepareReview($review); - $errors = $this->verifyData($fixtureReview, $formReview); - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepare fixture review data. - * - * @param Review $review - * @return array - */ - protected function prepareReview(Review $review) - { - return [ - 'title' => $review->getTitle(), - 'detail' => $review->getDetail(), - 'nickname' => $review->getNickname(), - 'ratings' => $review->getRatings() - ]; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product review is displayed correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php deleted file mode 100644 index 359657df0db..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewCreationSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php deleted file mode 100644 index 2c876bf639c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewLinksIsPresentOnProductPage.php +++ /dev/null @@ -1,81 +0,0 @@ -open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - - // Verify add review link - \PHPUnit_Framework_Assert::assertTrue( - $catalogProductView->getReviewViewBlock()->getAddReviewLink()->isVisible(), - 'Add review link is not visible on product page.' - ); - - // Verify view review link - $viewReviewLink = $catalogProductView->getReviewViewBlock()->getViewReviewLink($review); - \PHPUnit_Framework_Assert::assertTrue( - $viewReviewLink->isVisible(), - 'View review link is not visible on product page.' - ); - \PHPUnit_Framework_Assert::assertContains( - '1', - $viewReviewLink->getText(), - 'There is more than 1 approved review.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Add and view review links are present on product page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php deleted file mode 100644 index cc39dcb7d45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertReviewSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php b/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php deleted file mode 100644 index be7bcf5442a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Constraint/AssertSetApprovedProductReview.php +++ /dev/null @@ -1,69 +0,0 @@ -open()->getReviewGrid()->searchAndOpen(['title' => $review->getTitle()]); - $reviewEdit->getReviewForm()->setApproveReview(); - $reviewEdit->getFormPageActions()->save(); - $assertReviewSuccessSaveMessage->processAssert($reviewIndex); - $cachePage->open()->getPageActions()->flushCacheStorage(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Review status is change to approve.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml deleted file mode 100644 index 23fa5efca90..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php deleted file mode 100644 index 109ac49e8cb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/EntityId.php +++ /dev/null @@ -1,108 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - list($typeFixture, $dataset) = explode('::', $data['dataset']); - $fixture = $fixtureFactory->createByCode($typeFixture, ['dataset' => $dataset]); - if (!$fixture->hasData('id')) { - $fixture->persist(); - } - $this->entity = $fixture; - $this->data = $fixture->getId(); - } - } - - /** - * Persist data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return id of the created entity. - * - * @param string|null $key [optional] - * @return int - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get entity. - * - * @return FixtureInterface|null - */ - public function getEntity() - { - return $this->entity; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php b/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php deleted file mode 100644 index 8b296eab89a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Fixture/Review/Ratings.php +++ /dev/null @@ -1,73 +0,0 @@ -params = $params; - /** @var Rating $fixtureRating */ - $fixtureRating = null; - foreach ($data as $rating) { - if (isset($rating['dataset'])) { - $fixtureRating = $fixtureFactory->createByCode('rating', ['dataset' => $rating['dataset']]); - if (!$fixtureRating->hasData('rating_id')) { - $fixtureRating->persist(); - } - } elseif (isset($rating['fixtureRating']) && $rating['fixtureRating'] instanceof Rating) { - $fixtureRating = $rating['fixtureRating']; - } - if ($fixtureRating != null) { - $this->ratings[] = $fixtureRating; - $this->data[] = [ - 'title' => $fixtureRating->getRatingCode(), - 'rating' => $rating['rating'] - ]; - } - } - } - - /** - * Get ratings. - * - * @return array - */ - public function getRatings() - { - return $this->ratings; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml deleted file mode 100644 index bb25089eb0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReview.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml deleted file mode 100644 index 7d0809d068a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Adminhtml/CatalogProductReviewEdit.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index dd7880c7b47..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml b/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml deleted file mode 100644 index 0720aa78a5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/Page/Product/ReviewProductList.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php deleted file mode 100644 index 9548536c3d9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.php +++ /dev/null @@ -1,56 +0,0 @@ -executeScenario(); - } - - /** - * Delete all ratings after test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Review\Test\TestStep\DeleteAllRatingsStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml b/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml deleted file mode 100644 index fde9c87667e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestCase/CreateProductReviewFrontendEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Create product review with rating - Guest - name_%isolation% - title_%isolation% - review_%isolation% - visibleOnDefaultWebsite - 4 - catalogProductSimple::default - true - Pending - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php deleted file mode 100644 index 2b97dd452e0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/AddFrontendReviewStep.php +++ /dev/null @@ -1,117 +0,0 @@ -catalogProductView = $catalogProductView; - $this->reviewProductList = $reviewProductList; - $this->review = $review; - $this->browser = $browser; - $this->assertProductReviewIsAbsentOnProductPage = $assertProductReviewIsAbsentOnProductPage; - $this->isFirstReview = $isFirstReview; - } - - /** - * Add review to product via frontend. - * - * @return array - */ - public function run() - { - $product = $this->review->getDataFieldConfig('entity_id')['source']->getEntity(); - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - if ($this->isFirstReview) { - $this->assertProductReviewIsAbsentOnProductPage->processAssert(); - } - $this->catalogProductView->getViewBlock()->openCustomInformationTab('Reviews'); - $this->catalogProductView->getReviewsBlock()->clickAddReviewLink(); - $reviewForm = $this->reviewProductList->getReviewFormBlock(); - $reviewForm->fill($this->review); - $reviewForm->submit(); - - return ['product' => $product, 'review' => $this->review]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php b/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php deleted file mode 100644 index a4b939fc824..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/TestStep/DeleteAllRatingsStep.php +++ /dev/null @@ -1,65 +0,0 @@ -ratingEdit = $ratingEdit; - $this->ratingIndex = $ratingIndex; - } - - /** - * Delete all ratings. - * - * @return void - */ - public function run() - { - $this->ratingIndex->open(); - while ($this->ratingIndex->getRatingGrid()->isFirstRowVisible()) { - $this->ratingIndex->getRatingGrid()->openFirstRow(); - $this->ratingEdit->getPageActions()->deleteAndAcceptAlert(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml deleted file mode 100644 index 5bee5e66019..00000000000 --- a/dev/tests/functional/tests/app/Mage/Review/Test/etc/testcase.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php deleted file mode 100644 index 616005755f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractProductView.php +++ /dev/null @@ -1,26 +0,0 @@ -blockFactory->create( - $this->itemEntityClass, - ['element' => $this->_rootElement, 'config' => ['id' => $this->prepareSalesEntityId($id)]] - ); - } - - /** - * Set store view id. - * - * @param int $storeViewId - * @return void - */ - public function setStoreViewId($storeViewId) - { - $this->storeViewId = $storeViewId; - } - - /** - * Prepare sales entity id. - * - * @param string $entityId - * @return int - */ - protected function prepareSalesEntityId($entityId) - { - return $entityId - sprintf($this->idFormat, $this->storeViewId); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php deleted file mode 100644 index 764d105efff..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity.php +++ /dev/null @@ -1,51 +0,0 @@ -blockFactory->create( - $this->salesEntityItemsBlockClass, - ['element' => $this->_rootElement->find(sprintf($this->itemsSelector, $this->config['id']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php deleted file mode 100644 index 605d4f2c2d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/AbstractSalesEntities/SalesEntity/Items/Product.php +++ /dev/null @@ -1,38 +0,0 @@ - [ - 'selector' => '.product-name' - ], - 'options' => [ - 'selector' => '.item-options' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php deleted file mode 100644 index 12d3279a37e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos.php +++ /dev/null @@ -1,29 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php deleted file mode 100644 index aeb18d6a6a4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/CreditMemos/CreditMemo/Items/Product.php +++ /dev/null @@ -1,37 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_price' => ['col_name' => 'Price'], - 'item_qty' => ['col_name' => 'Qty'], - 'item_subtotal' => ['col_name' => 'Subtotal'], - 'item_discount' => ['col_name' => 'Discount Amount'], - 'item_row_total' => ['col_name' => 'Row Total'], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php deleted file mode 100644 index 03d0d9603c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/History.php +++ /dev/null @@ -1,75 +0,0 @@ -_rootElement->find(sprintf($this->itemOrder, $id), Locator::SELECTOR_XPATH); - } - - /** - * Open item order. - * - * @param string $id - * @return void - */ - public function openOrderById($id) - { - $this->searchOrderById($id)->find($this->viewButton)->click(); - } - - /** - * Check if order is visible. - * - * @param Order|string $order - * @return bool - */ - public function isOrderVisible($order) - { - $orderId = $order instanceof Order ? $order->getId() : $order; - return $this->searchOrderById($orderId)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php deleted file mode 100644 index e7229a59b7b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices.php +++ /dev/null @@ -1,29 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php deleted file mode 100644 index 8624dca28c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/Invoices/Invoice/Items/Product.php +++ /dev/null @@ -1,35 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_price' => ['col_name' => 'Price'], - 'item_qty' => ['col_name' => 'Qty Invoiced', 'replace' => ['Invoiced:']], - 'item_subtotal' => ['col_name' => 'Subtotal'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php deleted file mode 100644 index 9851ef783fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/OrderPrint/View.php +++ /dev/null @@ -1,128 +0,0 @@ -_rootElement->find($this->billingAddress, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get order grand total. - * - * @return string - */ - public function getGrandTotal() - { - return $this->escapeCurrency($this->_rootElement->find($this->grandTotal)->getText()); - } - - /** - * Method that escapes currency symbols. - * - * @param string $price - * @return string|null - */ - protected function escapeCurrency($price) - { - preg_match("/^\\D*\\s*([\\d,\\.]+)\\s*\\D*$/", $price, $matches); - return (isset($matches[1])) ? $matches[1] : null; - } - - /** - * Get order payment method. - * - * @return string - */ - public function getPaymentMethod() - { - return $this->_rootElement->find($this->paymentMethod, Locator::SELECTOR_XPATH)->getText(); - } - - /** - * Get order shipping method. - * - * @param array $shipping - * @return bool - */ - public function isShippingMethodVisible(array $shipping) - { - return strpos( - $this->_rootElement->find($this->shippingMethod, Locator::SELECTOR_XPATH)->getText(), - sprintf("%s - %s",$shipping['shipping_service'], $shipping['shipping_method'])) != false; - } - - /** - * Is item product visible. - * - * @param InjectableFixture $product - * @return bool - */ - public function isItemVisible(InjectableFixture $product) - { - $productName = strtolower($product->getName()); - return $this->_rootElement->find(sprintf($this->itemProduct, $productName))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php deleted file mode 100644 index 566c9e875b2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View.php +++ /dev/null @@ -1,43 +0,0 @@ -_rootElement->find(sprintf($this->link, $name), Locator::SELECTOR_XPATH)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php deleted file mode 100644 index 2dd9d065415..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/ActionsToolbar.php +++ /dev/null @@ -1,48 +0,0 @@ -_rootElement->find(sprintf($this->linkSelector, $linkName), Locator::SELECTOR_XPATH); - if (!$link->isVisible()) { - throw new \Exception(sprintf('"%s" link is not visible', $linkName)); - } - $link->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php deleted file mode 100644 index 0be5f539162..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Order/View/Items.php +++ /dev/null @@ -1,31 +0,0 @@ -prepareData($fixture, $isSearchByEmail); - - $fields = isset($data['fields']) ? $data['fields'] : $data; - $mapping = $this->dataMapping($fields); - $this->_fill($mapping, $element); - - return $this; - } - - /** - * Prepare data. - * - * @param FixtureInterface $fixture - * @param $isSearchByEmail - * @return array - */ - protected function prepareData(FixtureInterface $fixture, $isSearchByEmail) - { - /** @var Order $fixture */ - /** @var Customer $customer */ - $customer = $fixture->getDataFieldConfig('customer_id')['source']->getCustomer(); - $data = [ - 'order_id' => $fixture->getId(), - 'billing_last_name' => $customer->getLastname(), - ]; - if ($isSearchByEmail) { - $data['find_order_by'] = 'Email'; - $data['email_address'] = $customer->getEmail(); - } else { - $data['find_order_by'] = 'ZIP Code'; - $data['billing_zip_code'] = $fixture->getDataFieldConfig('billing_address_id')['source']->getPostcode(); - } - - return $data; - } - - /** - * Submit search form. - * - * @return void - */ - public function submit() - { - $this->_rootElement->find($this->searchButtonSelector)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml deleted file mode 100644 index 67a3182276b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Block/Widget/Guest/Form.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - [name='oar_order_id'] - - - [name='oar_billing_lastname'] - - - [name='oar_type'] - select - - - [name='oar_email'] - - - [name='oar_zip'] - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php deleted file mode 100644 index 9d38f1b2e25..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertItems.php +++ /dev/null @@ -1,259 +0,0 @@ -setFields($order, $orderId, $products, $verifyData); - $this->openPage(); - $this->assert($ids); - } - - /** - * Set fields for assert. - * - * @param Order|null $order - * @param string|null $orderId - * @param array|null $products - * @param array|null $verifyData - */ - protected function setFields(Order $order = null, $orderId = null, array $products = null, array $verifyData = null) - { - $this->orderId = ($orderId == null) ? $order->getId() : $orderId; - $this->products = ($products == null) ? $order->getEntityId()['products'] : $products; - $this->verifyData = $verifyData; - $this->productHandlerClass = $this->getProductHandlerClass(); - } - - /** - * Open verify page. - * - * @return void - */ - protected function openPage() - { - $this->salesTypePage->open(); - } - - /** - * Process assert. - * - * @param array $ids - */ - protected function assert(array $ids) - { - $productsData = $this->prepareItemsData($this->products, $this->verifyData); - foreach ($ids[$this->entityType . 'Ids'] as $entityId) { - $itemsData = $this->getItemsBlock($entityId)->getData(); - $error = $this->verifyData($productsData, $itemsData); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - } - - /** - * Get items block. - * - * @param string|null $entityId - * @return Items - */ - protected function getItemsBlock($entityId) - { - $this->openItemEntity($entityId); - return $this->salesTypeViewPage->getItemsBlock(); - } - - /** - * Open item entity. - * - * @param string $entityId - * @return void - */ - protected function openItemEntity($entityId) - { - $this->salesTypePage->getGrid()->searchAndOpen(['order_id' => $this->orderId, 'id' => $entityId,]); - } - - /** - * Prepare items data. - * - * @param array $products - * @param array|null $data - * @return array - */ - protected function prepareItemsData(array $products, array $data = null) - { - $productsData = []; - foreach ($products as $key => $product) { - $verifyData = isset($data['items_data'][$key]) ? $data['items_data'][$key] : null; - $productsData[] = array_merge( - $this->getDefaultItemData($product, $verifyData), - $this->getSpecialItemData($verifyData) - ); - } - - return $productsData; - } - - /** - * Prepare special item data. - * - * @param array|null $verifyData - * @return array - */ - protected function getSpecialItemData($verifyData = null) - { - $result = []; - if ($verifyData == null) { - return $result; - } - foreach ($this->specialFields as $field) { - if (isset($verifyData[$field])) { - $result[$field] = $verifyData[$field]; - } - } - - return $result; - } - - /** - * Get default item data. - * - * @param InjectableFixture $product - * @param array|null $verifyData - * @return array - */ - protected function getDefaultItemData(InjectableFixture $product, array $verifyData = null) - { - /** @var CatalogProductSimple $product */ - $checkoutData = $product->getCheckoutData(); - $defaultData['item_qty'] = (isset($verifyData['qty'])) ? $verifyData['qty'] : $checkoutData['qty']; - $defaultData = array_merge($defaultData, $this->getProductData($product)); - - return $defaultData; - } - - /** - * Get product data. - * - * @param InjectableFixture $product - * @return array - */ - protected function getProductData(InjectableFixture $product) - { - $productData['product'] = [ - 'name' => $this->getProductName($product), - 'sku' => $this->productHandlerClass->getProductSku($product) - ]; - $productOptions = $this->productHandlerClass->getProductOptions($product); - if ($productOptions != null) { - $productData['product']['options'] = $productOptions; - } - - return $productData; - } - - /** - * Get product name. - * - * @param InjectableFixture $product - * @return string - */ - protected function getProductName(InjectableFixture $product) - { - return $product->getName(); - } - - /** - * Get product handler class. - * - * @return ProductHandler - */ - protected function getProductHandlerClass() - { - return $this->objectManager->create($this->productHandlerPath); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php deleted file mode 100644 index 0698efe2865..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertNoButtonOnOrderPage.php +++ /dev/null @@ -1,58 +0,0 @@ -open(); - $orderId = ($orderId == null) ? $order->getId() : $orderId; - $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - \PHPUnit_Framework_Assert::assertFalse( - $salesOrderView->getPageActions()->isActionButtonVisible($this->buttonName), - "'$this->buttonName' button is present on order view page." - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php deleted file mode 100644 index d69cc3fcc93..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertOrdersAddress.php +++ /dev/null @@ -1,70 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - \PHPUnit_Framework_Assert::assertEquals($addressData, $this->getFormAddress($salesOrderView)); - } - - /** - * Prepare address data. - * - * @param Address $address - * @return string - */ - protected function prepareAddressData(Address $address) - { - $result = $address->getFirstname() . " ". $address->getLastname() . "\n" - . $address->getCompany() . "\n" - . $address->getStreet() . "\n" - . $address->getCity() . ", " . $address->getRegionId() . ", " . $address->getPostcode() . "\n" - . $address->getCountryId() . "\n" - . "T: " . $address->getTelephone(); - if ($address->hasData('fax')) { - $result .= "\nF: " . $address->getFax(); - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php deleted file mode 100644 index 76499968b74..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSales.php +++ /dev/null @@ -1,60 +0,0 @@ -order = $order; - $this->ids = $ids; - $this->verifyData = $verifyData; - $this->orderId = ($orderId == null) ? $order->getId() : $orderId; - - // Process assert - $this->openPage(); - $grid = $this->getGrid(); - $filters = $this->prepareFilters(); - $this->assert($filters, $grid); - } - - /** - * Process assert. - * - * @param array $filters - * @param Grid $grid - */ - protected function assert(array $filters, $grid) - { - foreach ($filters as $filter) { - \PHPUnit_Framework_Assert::assertTrue( - $this->isItemInGridVisible($grid, $filter), - $this->errorMessage - ); - } - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter); - } - - /** - * Prepare filters for assert. - * - * @return array - */ - protected function prepareFilters() - { - $filters = []; - if (!empty($this->ids)) { - foreach ($this->ids[$this->entityType . 'Ids'] as $key => $entityId) { - $filters[] = array_merge($this->getDefaultFilter($entityId), $this->getSpecialFilter($key)); - } - } else { - $filters[] = $this->getSpecialFilter(); - } - - return $filters; - } - - /** - * Get special filter. - * - * @param int $key [optional] - * @param Order|null $order - * @return array - */ - protected function getSpecialFilter($key = 0, Order $order = null) - { - $result = []; - foreach ($this->specialFilterFields as $fieldKey => $fields) { - foreach ($fields as $field) { - $result[$field] = isset($this->verifyData[$fieldKey][$this->entityType . 's'][$key][$field]) - ? $this->verifyData[$fieldKey][$this->entityType . 's'][$key][$field] - : $order->{'get' . ucfirst($fieldKey)}()[$this->entityType . 's'][$key][$field]; - } - } - - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php deleted file mode 100644 index fe3623c8693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityGrid.php +++ /dev/null @@ -1,64 +0,0 @@ -salesEntityIndexPage->open(); - } - - /** - * Get grid for assert. - * - * @return Grid - */ - protected function getGrid() - { - return $this->salesEntityIndexPage->getGrid(); - } - - /** - * Get default filter. - * - * @param string $entityId - * @return array - */ - protected function getDefaultFilter($entityId) - { - return ['id' => $entityId, 'order_id' => $this->orderId]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php deleted file mode 100644 index 2ed8ee1026c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityInSalesEntityTab.php +++ /dev/null @@ -1,94 +0,0 @@ -salesOrderView = $salesOrderView; - $this->orderIndex = $orderIndex; - } - - /** - * Open page for assert. - * - * @return void - */ - protected function openPage() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->orderId]); - $this->salesOrderView->getOrderForm()->openTab($this->entityType . 's'); - } - - /** - * Get grid for assert. - * - * @return Grid - */ - protected function getGrid() - { - return $this->salesOrderView->getOrderForm()->getTabElement($this->entityType . 's')->getGrid(); - } - - /** - * Get default filter. - * - * @param string $entityId - * @return array - */ - protected function getDefaultFilter($entityId) - { - return ['id' => $entityId]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php deleted file mode 100644 index abe2df0630f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AbstractAssertSalesEntityItemsOnFrontend.php +++ /dev/null @@ -1,134 +0,0 @@ -setFields($order, $orderId, $products, $verifyData, $customer); - $this->openPage(); - $this->assert($ids); - } - - /** - * Get items block. - * - * @param string $entityId - * @return AbstractItem - */ - protected function getItemsBlock($entityId) - { - return $this->salesTypeViewPage->getEntitiesBlock()->getBlock($entityId)->getItemsBlock(); - } - - /** - * Set fields for assert. - * - * @param Order|null $order - * @param string|null $orderId - * @param array|null $products - * @param array|null $verifyData - * @param Customer|null $customer - */ - protected function setFields( - Order $order = null, - $orderId = null, - array $products = null, - array $verifyData = null, - Customer $customer = null - ) { - parent::setFields($order, $orderId, $products, $verifyData); - $this->customer = ($customer == null) - ? $order->getDataFieldConfig('customer_id')['source']->getCustomer() - : $customer; - } - - /** - * Open verify page. - * - * @return void - */ - protected function openPage() - { - $frontendAction = new FrontendActionsForSalesAssert(); - $frontendAction->loginCustomerAndOpenOrderPage($this->customer); - $frontendAction->openEntityTab($this->orderId, $this->entityType); - } - - /** - * Get product name. - * - * @param InjectableFixture $product - * @return string - */ - protected function getProductName(InjectableFixture $product) - { - return strtoupper($product->getName()); - } - - /** - * Get product data. - * - * @param InjectableFixture $product - * @return array - */ - protected function getProductData(InjectableFixture $product) - { - $productData = parent::getProductData($product); - $productData['product_sku'] = $productData['product']['sku']; - unset($productData['product']['sku']); - - return $productData; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php deleted file mode 100644 index e01ea985397..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertConfigurableProductInItemsOrderedGrid.php +++ /dev/null @@ -1,52 +0,0 @@ -getPrice(); - if (!$this->productsIsConfigured) { - return $price; - } - $checkoutData = $product->getCheckoutData(); - if ($checkoutData === null) { - return 0; - } - $attributesData = $product->getConfigurableOptions()['attributes_data']; - foreach ($checkoutData['options']['configurable_options'] as $option) { - $itemOption = $attributesData[$option['title']]['options'][$option['value']]; - $price += $itemOption['price_type'] == 'Fixed' - ? $itemOption['price'] - : $product->getPrice() / 100 * $itemOption['price']; - } - - return $price; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php deleted file mode 100644 index 6addf5916fd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoConfigurableItems.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesCreditMemo $salesCreditMemo - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesCreditMemo $salesCreditMemo - ) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesCreditMemo; - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo is present in the credit memo grid with correct total qty on credit memo index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php deleted file mode 100644 index d427b7b8cf0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoInCreditMemosTab.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo is present on credit memos tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php deleted file mode 100644 index d83c93a5ca7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItems.php +++ /dev/null @@ -1,79 +0,0 @@ -salesTypePage = $creditMemoIndex; - $this->salesTypeViewPage = $orderCreditMemoView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All credit memo products are present in credit memo page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php deleted file mode 100644 index 2f3d638423e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoItemsOnFrontend.php +++ /dev/null @@ -1,76 +0,0 @@ -salesTypeViewPage = $creditMemoView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Credit memo items quantity is equal to data from fixture on "My Account" page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php deleted file mode 100644 index 28404bce839..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertCreditMemoSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success credit memo create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php deleted file mode 100644 index 72ba2113469..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceConfigurableItems.php +++ /dev/null @@ -1,33 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesInvoice $salesInvoice - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesInvoice $salesInvoice) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesInvoice; - } - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice is present in the invoice grid with correct total qty on invoice index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php deleted file mode 100644 index f3903c31938..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceInInvoicesTab.php +++ /dev/null @@ -1,76 +0,0 @@ - [ - 'from', - 'to' - ] - ]; - - /** - * Check visible item in grid. - * - * @param Grid $grid - * @param array $filter - * @return bool - */ - protected function isItemInGridVisible($grid, array $filter) - { - return $grid->isRowVisible($filter, true, false); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice is present on invoices tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php deleted file mode 100644 index 4a2b912adca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItems.php +++ /dev/null @@ -1,79 +0,0 @@ -salesTypePage = $invoiceIndex; - $this->salesTypeViewPage = $orderInvoiceView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All invoices products are present in invoice page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php deleted file mode 100644 index a2ba90dda39..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceItemsOnFrontend.php +++ /dev/null @@ -1,73 +0,0 @@ -salesTypeViewPage = $invoiceView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Invoice items quantity is equal to data from fixture on "My Account" page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php deleted file mode 100644 index 64b4c4738d2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object - * - * @return string - */ - public function toString() - { - return 'Success invoice create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php deleted file mode 100644 index 3c13f2e291c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertInvoiceWithShipmentSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success invoice and shipment create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php deleted file mode 100644 index c180e9ea1de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertItemsOrderedBlockIsEmpty.php +++ /dev/null @@ -1,53 +0,0 @@ -getCreateBlock()->getItemsBlock()->isEmptyBlockVisible(), - "Items ordered block is not empty" - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Items ordered block is empty'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php deleted file mode 100644 index 5b479915a4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertNoCreditMemoButton.php +++ /dev/null @@ -1,43 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $absentButtons = $this->getAbsentButtons($salesOrderView, $orderButtonsAvailable); - - \PHPUnit_Framework_Assert::assertEmpty( - $absentButtons, - "Next buttons was not found on page: \n" . implode(";\n", $absentButtons) - ); - } - - /** - * Get absent buttons. - * - * @param SalesOrderView $salesOrderView - * @param string $orderButtonsAvailable - * @return array - */ - protected function getAbsentButtons(SalesOrderView $salesOrderView, $orderButtonsAvailable) - { - $buttons = explode(',', $orderButtonsAvailable); - $absentButtons = []; - $actionsBlock = $salesOrderView->getPageActions(); - foreach ($buttons as $button) { - if (!$actionsBlock->isActionButtonVisible(trim($button))) { - $absentButtons[] = $button; - } - } - return $absentButtons; - } - - /** - * Returns string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "All buttons are available on order page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php deleted file mode 100644 index a5007ca6c51..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCancelSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order success cancel message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php deleted file mode 100644 index 661674ae435..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderCreateSuccessMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order success created message is present on sales order view page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php deleted file mode 100644 index 0d6c204e711..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderGrandTotal.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - $expected = number_format(is_array($grandTotal) ? array_sum($grandTotal) : $grandTotal, 2); - $actual = $salesOrderView->getOrderForm()->getTabElement('information')->getOrderTotalsBlock() - ->getData('grand_total'); - - \PHPUnit_Framework_Assert::assertEquals($expected, $actual, "Expected: $expected; Actual: $actual"); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand Total price equals to price from data set.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php deleted file mode 100644 index 748a4bdd546..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGrid.php +++ /dev/null @@ -1,54 +0,0 @@ -open()->getSalesOrderGrid()->isRowVisible(['id' => $orderId]), - "Order with id $orderId is absent in orders grid on backend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order is present in orders grid on backend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php deleted file mode 100644 index 6a23cd94cf6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderInOrdersGridOnFrontend.php +++ /dev/null @@ -1,68 +0,0 @@ -objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - $customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('My Orders'); - \PHPUnit_Framework_Assert::assertTrue( - $orderHistory->getOrderHistoryBlock()->isOrderVisible($order), - "Order with following id {$order->getId()} is absent in Orders block on frontend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales order is present in orders grid on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php deleted file mode 100644 index 8fb680ccd5a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrderStatusIsCorrect.php +++ /dev/null @@ -1,59 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]); - - \PHPUnit_Framework_Assert::assertEquals( - $status, - $salesOrderView->getOrderForm()->getTabElement('information')->getOrderInfoBlock()->getOrderStatus() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order status is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php deleted file mode 100644 index e51542e33c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersBillingAddress.php +++ /dev/null @@ -1,72 +0,0 @@ -prepareAddressData($billingAddress); - foreach ($ordersIds as $orderId) { - $this->assert($salesOrder, $salesOrderView, $orderId, $addressData); - } - } - - /** - * Get shipping address data from order form. - * - * @param SalesOrderView $salesOrderView - * @return string - */ - protected function getFormAddress(SalesOrderView $salesOrderView) - { - return $salesOrderView->getOrderForm()->getTabElement('information')->getBillingAddressBlock()->getAddress(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Orders were created with a right billing addresses.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php deleted file mode 100644 index 5f6efbafa86..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersCount.php +++ /dev/null @@ -1,50 +0,0 @@ - $orderId) { - $assertOrderGrandTotal->processAssert($salesOrder, $salesOrderView, $grandTotal[$key], $orderId); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Grand Total prices equals to prices from data set for orders.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php deleted file mode 100644 index 01f928652f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertOrdersShippingAddress.php +++ /dev/null @@ -1,71 +0,0 @@ - $orderId) { - $addressData = $this->prepareAddressData($addresses[$key]); - $this->assert($salesOrder, $salesOrderView, $orderId, $addressData); - } - } - - /** - * Get shipping address data from order form. - * - * @param SalesOrderView $salesOrderView - * @return string - */ - protected function getFormAddress(SalesOrderView $salesOrderView) - { - return $salesOrderView->getOrderForm()->getTabElement('information')->getShippingAddressBlock()->getAddress(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Orders were created with a right shipping addresses.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php deleted file mode 100644 index 00da134d5e4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductInItemsOrderedGrid.php +++ /dev/null @@ -1,133 +0,0 @@ - '', 'price' => '', 'checkout_data' => ['qty' => '']]; - - /** - * Check configured products. - * - * @var bool - */ - protected $productsIsConfigured; - - /** - * Assert product was added to Items Ordered grid in customer account on Order creation page backend. - * - * @param SalesOrderCreateIndex $orderCreatePage - * @param array $products - * @param bool $productsIsConfigured - * @return void - */ - public function processAssert(SalesOrderCreateIndex $orderCreatePage, array $products, $productsIsConfigured = true) - { - $this->productsIsConfigured = $productsIsConfigured; - $data = $this->prepareData($products, $orderCreatePage->getCreateBlock()->getItemsBlock()); - - \PHPUnit_Framework_Assert::assertEquals( - $data['fixtureData'], - $data['pageData'], - 'Product data on order create page not equals to passed from fixture.' - ); - } - - /** - * Prepare data. - * - * @param array $data - * @param Items $itemsBlock - * @return array - */ - protected function prepareData(array $data, Items $itemsBlock) - { - $fixtureData = []; - foreach ($data as $product) { - $checkoutData = $product->getCheckoutData(); - $fixtureData[] = [ - 'name' => $product->getName(), - 'price' => number_format($this->getProductPrice($product), 2), - 'checkout_data' => [ - 'qty' => $this->productsIsConfigured && isset($checkoutData['qty']) ? $checkoutData['qty'] : 1, - ], - ]; - } - $pageData = $itemsBlock->getProductsDataByFields($this->fields); - $preparePageData = $this->arraySort($fixtureData, $pageData); - - return ['fixtureData' => $fixtureData, 'pageData' => $preparePageData]; - } - - /** - * Sort of array. - * - * @param array $fixtureData - * @param array $pageData - * @return array - */ - protected function arraySort(array $fixtureData, array $pageData) - { - $result = []; - foreach ($fixtureData as $key => $value) { - foreach ($pageData as $pageDataKey => $pageDataValue) { - if ($value['name'] == $pageDataValue['name']) { - $result[$key] = $pageDataValue; - unset($pageData[$pageDataKey]); - break; - } - } - } - - return array_merge($result, $pageData); - } - - /** - * Get product price. - * - * @param InjectableFixture $product - * @return int - */ - protected function getProductPrice(InjectableFixture $product) - { - return isset($product->getCheckoutData()['cartItem']['price']) - ? $product->getCheckoutData()['cartItem']['price'] - : $product->getPrice(); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is added to Items Ordered grid from "Last Ordered Items" section on Order creation page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php deleted file mode 100644 index 664a1b89f06..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertProductsVisibilityInItemsOrderedBlock.php +++ /dev/null @@ -1,58 +0,0 @@ -getName(); - if (!$orderCreatePage->getCreateBlock()->getItemsBlock()->getItemProduct($productName)->isVisible()) { - $productsVisibility[] = "'{$productName}' is not visible in items order block."; - } - } - \PHPUnit_Framework_Assert::assertEmpty($productsVisibility, $productsVisibility); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Products are visible in items order block.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php deleted file mode 100644 index dec6c6bf6d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertReorderedOrderStatusIsCorrect.php +++ /dev/null @@ -1,65 +0,0 @@ -open()->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - - \PHPUnit_Framework_Assert::assertEquals( - $previousOrderStatus, - $salesOrderView->getOrderForm()->getTabElement('information')->getOrderInfoBlock()->getOrderStatus(), - 'Order status is incorrect on order page in backend.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Order status is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php deleted file mode 100644 index f960bef52b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderBillingAddress.php +++ /dev/null @@ -1,57 +0,0 @@ -objectManager->create( - 'Mage\Customer\Test\Block\Address\Renderer', - ['address' => $billingAddress, 'type' => 'html'] - ); - $expectedBillingAddress = $addressRenderer->render(); - \PHPUnit_Framework_Assert::assertEquals( - $expectedBillingAddress, - $salesGuestPrint->getViewBlock()->getBillingAddress(), - "Billing address was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Billing address printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php deleted file mode 100644 index 43fe71c2c18..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderGrandTotal.php +++ /dev/null @@ -1,51 +0,0 @@ -getViewBlock()->getGrandTotal(), - "Grand total was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Grand total was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php deleted file mode 100644 index 57896e25ec5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderPaymentMethod.php +++ /dev/null @@ -1,51 +0,0 @@ -getViewBlock()->getPaymentMethod(), - "Payment method was printed incorrect on sales guest print page." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Payment method was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php deleted file mode 100644 index dff51ab68df..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/AssertSalesPrintOrderProducts.php +++ /dev/null @@ -1,60 +0,0 @@ -getViewBlock()->isItemVisible($product)) { - $errors .= sprintf(self::ERROR_MESSAGE, $product->getName()); - } - } - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Products were printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php deleted file mode 100644 index 7328f82a4ee..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Constraint/FrontendActionsForSalesAssert.php +++ /dev/null @@ -1,87 +0,0 @@ - 'Mage\Customer\Test\Page\CustomerAccountIndex', - 'orderHistory' => 'Mage\Sales\Test\Page\OrderHistory', - 'customerOrderView' => 'Mage\Sales\Test\Page\OrderView' - ]; - - /** - * @constructor - */ - public function __construct() - { - foreach ($this->pages as $key => $page) { - $this->$key = $this->createPage($page); - } - } - - /** - * Login customer and open Order page. - * - * @param Customer $customer - * @return void - */ - public function loginCustomerAndOpenOrderPage(Customer $customer) - { - $this->loginCustomer($customer); - $this->customerAccountIndex->open()->getAccountNavigationBlock()->openNavigationItem('My Orders'); - } - - /** - * Open entity tab. - * - * @param string $orderId - * @param string $entityType - * @return void - */ - public function openEntityTab($orderId, $entityType) - { - $this->orderHistory->getOrderHistoryBlock()->openOrderById($orderId); - $this->customerOrderView->getOrderViewBlock()->openLinkByName(ucfirst($entityType) . 's'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml deleted file mode 100644 index 39afa31a23e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php deleted file mode 100644 index ad8cfbfb85d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/BillingAddressId.php +++ /dev/null @@ -1,92 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - $addresses = $fixtureFactory->createByCode('address', ['dataset' => $data['dataset']]); - $this->data = $addresses->getData(); - $this->data['street'] = [$this->data['street']]; - } - if (isset($data['billingAddress']) && $data['billingAddress'] instanceof Address) { - $this->data = $data['billingAddress']->getData(); - $this->data['street'] = [$this->data['street']]; - } - } - - /** - * Persist order billing address. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php deleted file mode 100644 index cdbd01d5446..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/CustomerId.php +++ /dev/null @@ -1,105 +0,0 @@ -params = $params; - if (isset($data['customer']) && $data['customer'] instanceof Customer) { - $this->data = $data['customer']; - return; - } - if (isset($data['dataset'])) { - $customer = $fixtureFactory->createByCode('customer', ['dataset' => $data['dataset']]); - if ($customer->hasData('id') === false) { - $customer->persist(); - } - $this->data = $customer; - } - } - - /** - * Persist order customer. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return Customer - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Get customer fixture. - * - * @return Customer - */ - public function getCustomer() - { - return $this->data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php deleted file mode 100644 index d78137d89c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/EntityId.php +++ /dev/null @@ -1,97 +0,0 @@ -params = $params; - if (!isset($data['products'])) { - return; - } - if (is_string($data['products'])) { - $products = explode(',', $data['products']); - foreach ($products as $product) { - list($fixture, $dataset) = explode('::', $product); - $product = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]); - $product->persist(); - $this->data['products'][] = $product; - } - } elseif (is_array($data['products'])) { - $this->data['products'] = $data['products']; - } - } - - /** - * Persist order products. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return string - */ - public function getDataConfig() - { - return $this->params; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php deleted file mode 100644 index 2c05aab7740..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Fixture/Order/StoreId.php +++ /dev/null @@ -1,114 +0,0 @@ -params = $params; - $storeData = isset($data['dataset']) ? ['dataset' => $data['dataset']] : []; - if (isset($data['data'])) { - $storeData = array_merge($storeData, $data); - } - if ($storeData) { - $store = $fixtureFactory->createByCode('store', $storeData); - /** @var Store $store */ - if (!$store->getStoreId()) { - $store->persist(); - } - $this->store = $store; - $this->data = $store->getStoreId(); - } - } - - /** - * Persists prepared data. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data set. - * - * @param string|null $key [optional] - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return Store fixture. - * - * @return Store - */ - public function getStore() - { - return $this->store; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php deleted file mode 100644 index 75dc44aef8e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/Curl.php +++ /dev/null @@ -1,346 +0,0 @@ - [ - 'California' => '12', - ], - 'country_id' => [ - 'United States' => 'US', - ], - ]; - - /** - * Steps for create order on backend. - * - * @var array - */ - protected $steps = [ - 'customer_choice' => 'header,data', - 'products_choice' => 'search,items,shipping_method,totals,giftmessage,billing_method', - 'apply_coupon_code' => 'items,shipping_method,totals,billing_method', - 'shipping_data_address' => 'shipping_method,billing_method,shipping_address,totals,giftmessage', - 'shipping_data_method_get' => 'shipping_method,totals', - 'shipping_data_method_set' => 'shipping_method,totals,billing_method', - ]; - - /** - * Post request for creating order. - * - * @param FixtureInterface|null $fixture [optional] - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $this->order = $fixture; - $this->customer = $fixture->getDataFieldConfig('customer_id')['source']->getCustomer(); - $data = $this->replaceMappingData($this->prepareData($fixture)); - return ['id' => $this->createOrder($data)]; - } - - /** - * Prepare POST data for creating product request. - * - * @param FixtureInterface $fixture - * @return array - */ - protected function prepareData(FixtureInterface $fixture) - { - $result = []; - $data = $fixture->getData(); - $result['customer_choice'] = $this->prepareCustomerData($data); - $result['products_choice'] = $this->prepareProductsData($data['entity_id']); - $result['order_data'] = $this->prepareOrderData($data); - $result['shipping_data_address'] = $this->prepareShippingData($result['order_data']); - $result['shipping_data_method_get'] = [ - 'payment' => $data['payment_auth_expiration'], - 'collect_shipping_rates' => 1, - ]; - $result['shipping_data_method_set'] = [ - 'order' => ['shipping_method' => $data['shipping_method']], - 'payment' => $data['payment_auth_expiration'], - ]; - - return $result; - } - - /** - * Prepare shipping data. - * - * @param array $data - * @return array - */ - protected function prepareShippingData(array $data) - { - $result = [ - 'order' => [ - 'billing_address' => $data['billing_address'], - ], - 'payment' => $this->order->getPaymentAuthExpiration(), - 'reset_shipping' => 1, - 'shipping_as_billing' => 1, - ]; - return $result; - } - - /** - * Prepare products data. - * - * @param array $data - * @return array - */ - protected function prepareProductsData(array $data) - { - $result['item'] = []; - foreach ($data['products'] as $value) { - if (!$value->hasData('checkout_data')) { - continue; - } - $methodName = 'prepare' . ucfirst($value->getDataConfig()['type_id']) . 'Data'; - if (!method_exists($this, $methodName)) { - $methodName = 'prepareSimpleData'; - } - $result['item'][$value->getId()] = $this->$methodName($value); - } - return $result; - } - - /** - * Prepare data for configurable product. - * - * @param ConfigurableProduct $product - * @return array - */ - protected function prepareConfigurableData(ConfigurableProduct $product) - { - $result = []; - $checkoutData = $product->getCheckoutData(); - $result['qty'] = $checkoutData['qty']; - $attributesData = $product->hasData('configurable_options') - ? $product->getDataFieldConfig('configurable_options')['source']->getAttributesData() - : null; - if ($attributesData == null) { - return $result; - } - - foreach ($checkoutData['options']['configurable_options'] as $key => $option) { - $attributeId = $attributesData[$key]->getAttributeId(); - $optionId = $attributesData[$key]->getOptions()[substr($option['value'], -1)]['id']; - $result['super_attribute'][$attributeId] = $optionId; - } - - return $result; - } - - /** - * Prepare data for bundle product. - * - * @param BundleProduct $product - * @return array - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function prepareBundleData(BundleProduct $product) - { - $result = []; - $checkoutData = $product->getCheckoutData(); - $bundleOptions = isset($checkoutData['options']['bundle_options']) - ? $checkoutData['options']['bundle_options'] - : []; - $bundleSelections = $product->getBundleSelections(); - $bundleSelectionsData = []; - $result['qty'] = $checkoutData['qty']; - - foreach ($bundleSelections as $option) { - foreach ($option['assigned_products'] as $productData) { - $bundleSelectionsData[] = [ - 'selection_id' => $productData['selection_id'], - 'option_id' => $productData['option_id'], - ]; - } - } - - foreach ($bundleOptions as $option) { - $key = substr($option['value']['name'], -1); - if (isset($bundleSelectionsData[$key])) { - $optionId = $bundleSelectionsData[$key]['option_id']; - $selectionId = $bundleSelectionsData[$key]['selection_id']; - $result['bundle_option'][$optionId] = $selectionId; - } - } - - return $result; - } - - /** - * Prepare data for simple product. - * - * @param FixtureInterface $product - * @return array - */ - protected function prepareSimpleData(FixtureInterface $product) - { - return ['qty' => $product->getCheckoutData()['qty']]; - } - - /** - * Prepare order data. - * - * @param array $data - * @return array - */ - protected function prepareOrderData(array $data) - { - $customerGroupId = $this->customer->hasData('group_id') - ? $this->customer->getDataFieldConfig('group_id')['source']->getCustomerGroup()->getCustomerGroupId() - : 1; - $result = [ - 'name' => $this->customer->getFirstname(), - 'order' => [ - 'currency' => $data['order_currency_code'], - 'account' => [ - 'group_id' => $customerGroupId, - 'email' => $this->customer->getEmail(), - ], - 'shipping_method' => $data['shipping_method'], - ], - 'item' => $this->prepareOrderProductsData($data['entity_id']), - 'billing_address' => $this->prepareBillingAddress($data['billing_address_id']), - 'shipping_same_as_billing' => 'on', - 'payment' => $data['payment_auth_expiration'], - - ]; - - return $result; - } - - /** - * Prepare customer data. - * - * @param array $data - * @return array - */ - protected function prepareCustomerData(array $data) - { - return [ - 'currency_id' => $data['base_currency_code'], - 'customer_id' => $this->customer->getData('id'), - 'payment' => $data['payment_authorization_amount'], - 'store_id' => $this->order->getDataFieldConfig('store_id')['source']->store->getStoreId() - ]; - } - - /** - * Prepare order products data. - * - * @param array $data - * @return array - */ - protected function prepareOrderProductsData(array $data) - { - $result = []; - foreach ($data['products'] as $value) { - if (isset($value->getCheckoutData()['qty'])) { - $result[$value->getId()] = ['qty' => ['qty' => $value->getCheckoutData()['qty']]]; - } - } - - return $result; - } - - /** - * Prepare billing address data. - * - * @param array $data - * @return array - */ - protected function prepareBillingAddress(array $data) - { - $result = $data; - $result['firstname'] = $this->customer->getFirstname(); - $result['lastname'] = $this->customer->getLastname(); - - return $result; - } - - /** - * Create order via curl. - * - * @param array $data - * @return int|null - * @throws \Exception - */ - protected function createOrder(array $data) - { - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - foreach ($this->steps as $key => $step) { - if (!isset($data[$key])) { - continue; - } - $url = $_ENV['app_backend_url'] . 'sales_order_create/loadBlock/block/' . $step . '?isAjax=true'; - $curl->write($url, $data[$key]); - $curl->read(); - } - $url = $_ENV['app_backend_url'] . 'sales_order_create/save'; - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data['order_data']); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Order creation by curl handler was not successful! Response: $response"); - } - preg_match("@Order\s#\s(\d+)@", $response, $matches); - - return isset($matches[1]) ? $matches[1] : null; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php b/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php deleted file mode 100644 index 34ac4f539db..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Handler/Order/OrderInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml deleted file mode 100644 index 674f0147900..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesCreditMemoView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml deleted file mode 100644 index 5cb200f8ec1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoice.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml deleted file mode 100644 index 55136dea532..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesInvoiceView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml deleted file mode 100644 index 8d12519f2c4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreateIndex.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml deleted file mode 100644 index 70a2849610e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderCreditMemoNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml deleted file mode 100644 index 466aa65a6e6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml deleted file mode 100644 index ded05c1139b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderInvoiceNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml deleted file mode 100644 index e82fc5c4704..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/Adminhtml/SalesOrderView.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml deleted file mode 100644 index fc4239a0199..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/CreditMemoView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml deleted file mode 100644 index a9ab5e9bd5e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/InvoiceView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml deleted file mode 100644 index a38097adc01..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderHistory.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml deleted file mode 100644 index 14dfc01629a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/OrderView.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml deleted file mode 100644 index a8e5a2c34a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestForm.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml deleted file mode 100644 index fb8b9a3ee63..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestPrint.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml deleted file mode 100644 index 7e43cc90031..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Page/SalesGuestView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml deleted file mode 100644 index 03577546127..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - On Gesture - 1 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - In Cart - 2 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - sales - 1 - Before Order Confirmation - 3 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - - sales - 1 - Yes - 1 - - - sales - 1 - Yes - 1 - - - - - sales - 1 - No - - - - sales - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml deleted file mode 100644 index 1b479dc7aa5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/Repository/Order.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - catalogProductSimple::default - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - configurableProduct::default - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - bundleProduct::bundle_fixed_product - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - catalogProductSimple::wit_qty_3 - - - - - default - - false - - default - - USD - flatrate_flatrate - - checkmo - - - free - - - US_address - - - bundleProduct::bundle_fixed_product,configurableProduct::default - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php deleted file mode 100644 index 65c1a3d6265..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.php +++ /dev/null @@ -1,88 +0,0 @@ - Orders. - * 3. Open the created order. - * 4. Do cancel Order. - * 5. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7350 - */ -class CancelCreatedOrderTest extends Injectable -{ - /** - * Orders index page. - * - * @var SalesOrderIndex - */ - protected $orderIndex; - - /** - * Order view page. - * - * @var SalesOrderView - */ - protected $salesOrderView; - - /** - * Injection data. - * - * @param SalesOrderIndex $orderIndex - * @param SalesOrderView $salesOrderView - * @return void - */ - public function __inject(SalesOrderIndex $orderIndex, SalesOrderView $salesOrderView) - { - $this->orderIndex = $orderIndex; - $this->salesOrderView = $salesOrderView; - } - - /** - * Cancel created order. - * - * @param Order $order - * @return array - */ - public function test(Order $order) - { - // Preconditions - $order->persist(); - - // Steps - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]); - $this->salesOrderView->getPageActions()->cancel(); - - return [ - 'customer' => $order->getDataFieldConfig('customer_id')['source']->getCustomer(), - 'orderId' => $order->getId(), - 'product' => $order->getEntityId()['products'][0] - ]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml deleted file mode 100644 index e82b21d4745..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CancelCreatedOrderTest.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - Cancel order and check status on the frontend. - with_simple_qty_3 - Canceled - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php deleted file mode 100644 index 7444deb04ca..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.php +++ /dev/null @@ -1,43 +0,0 @@ - Manage Customers. - * 3. Select customer created in preconditions. - * 4. Click Create Order button. - * 5. Add Products according to dataset. - * 6. Fill data according dataset. - * 7. Click Update Product qty. - * 8. Fill data according dataset. - * 9. Click Get Shipping Method and rates. - * 10. Fill data according dataset. - * 11. Submit Order. - * 12. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7419 - */ -class CreateOrderFromBackendCustomerPageTest extends CreateOrderFromBackendWithinOfflinePaymentMethodsTest -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml deleted file mode 100644 index f45829d354f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendCustomerPageTest.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - Create backend order with simple product for existing customer. - default_tax_configuration - catalogProductSimple::default - default - customer_US_login - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php deleted file mode 100644 index 4a19938d933..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.php +++ /dev/null @@ -1,64 +0,0 @@ - Orders. - * 3. Click Create New Order. - * 4. Select Customer created in preconditions. - * 5. Add Products according to dataset. - * 6. Fill data according dataset. - * 7. Click Update Product qty. - * 8. Fill data according dataset. - * 9. Click Get Shipping Method and rates. - * 10. Fill data according dataset. - * 11. Submit Order. - * 12. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7098 - */ -class CreateOrderFromBackendWithinOfflinePaymentMethodsTest extends Scenario -{ - /** - * Prepare environment for test. - * - * @return void - */ - public function __prepare() - { - // Delete existing tax rules. - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Run Create order from backend within offline payment methods test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml deleted file mode 100644 index 5b2f17c4608..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/CreateOrderFromBackendWithinOfflinePaymentMethodsTest.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - Create backend order with simple product for existing customer. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - johndoe_unique - - - - - - - - - - Create backend order with simple product for existing customer. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 315.00 - checkmo - Pending - - - johndoe_unique - - - - - - - - - - Create backend order with simple product for existing customer and discount coupon. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 165.00 - checkmo - Pending - - - johndoe_unique - active_sales_rule_for_all_groups - - - - - - - - Create backend order with simple product for existing customer and apply discount coupon. - catalogProductSimple::default - default - US_address_without_email - Flat Rate - Fixed - 165.00 - checkmo - Pending - - - johndoe_unique - active_sales_rule_for_all_groups - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php deleted file mode 100644 index 8a80f61f234..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.php +++ /dev/null @@ -1,48 +0,0 @@ - All Customers. - * 2. Search and open customer from preconditions. - * 3. Click Create Order. - * 4. Check product in Shopping Cart section. - * 5. Click Update Changes. - * 6. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7553 - */ -class MoveShoppingCartProductsOnOrderPageTest extends Scenario -{ - /** - * Create order from customer page(cartActions). - * - * @return array - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml deleted file mode 100644 index 2dd9c14fcab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/MoveShoppingCartProductsOnOrderPageTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - catalogProductSimple::default - johndoe_unique - 100.00 - - - - configurableProduct::default - johndoe_unique - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php deleted file mode 100644 index 0c63fb5a42f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.php +++ /dev/null @@ -1,57 +0,0 @@ - Orders. - * 3. Open the created order. - * 4. Do 'Reorder' for placed order. - * 5. Perform all assertions. - * - * @group Order_Management_(CS) - * @ZephyrId MPERF-7655 - */ -class ReorderOrderEntityTest extends Scenario -{ - /** - * Delete all tax rules. - * - * @return void - */ - public function __prepare() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Reorder created order. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml deleted file mode 100644 index f201b462dd6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestCase/ReorderOrderEntityTest.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - Reorder placed order (update products, billing address). - default_tax_configuration - default - customer_US - customer_US_login - Flat Rate - Fixed - 315.00 - checkmo - Pending - Pending - Back, Reorder, Cancel, Hold, Invoice, Ship, Edit - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php deleted file mode 100644 index eb1879e030f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateRefundStep.php +++ /dev/null @@ -1,85 +0,0 @@ -objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesOrderCreditMemoNew'); - } - - /** - * Create offline refund. - * - * @return void - */ - protected function salesEntityAction() - { - $orderForm = $this->salesOrderView->getOrderForm(); - $orderForm->openTab('invoices'); - $this->invoiceViewPage = $this->objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesInvoiceView'); - $orderForm->getTabElement('invoices')->getGrid()->searchAndOpen(['id' => $this->currentInvoiceId]); - $this->invoiceViewPage->getPageActions()->creditMemo(); - } - - /** - * Process offline credit memo step. - * - * @param int $index [optional] - * @return void - */ - protected function processStep($index = 0) - { - $invoiceIds = $this->getEntityIds('invoice'); - foreach ($invoiceIds as $key => $id){ - $this->currentInvoiceId = $id; - parent::processStep($key); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php deleted file mode 100644 index 7e5c2963d59..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AbstractCreateSalesEntityStep.php +++ /dev/null @@ -1,216 +0,0 @@ -objectManager = $objectManager; - $this->orderIndex = $orderIndex; - $this->salesOrderView = $salesOrderView; - $this->orderSalesEntityNew = $this->getSalesEntityNewPage(); - $this->order = $order; - $this->data = $data; - $this->action = $action; - $this->orderId = ($orderId == null) ? $this->order->getId() : $orderId; - $this->products = ($products == null) ? $this->order->getEntityId()['products'] : $products; - } - - /** - * Create sales entity for order on backend. - * - * @return array - */ - public function run() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->orderId]); - $this->processStep(); - - return ['ids' => [$this->entityType . 'Ids' => $this->getEntityIds($this->entityType)]]; - } - - /** - * Process step. - * - * @param int $index [optional] - * @return void - */ - protected function processStep($index = 0) - { - if (isset($this->action[$this->entityType][$index]) && $this->action[$this->entityType][$index] == false) { - return; - } - $this->salesEntityAction(); - $this->fillData($index); - $this->salesEntitySubmit(); - } - - /** - * Fill data for step. - * - * @param int $index - * @return void - */ - protected function fillData($index) - { - if (!empty($this->data[$this->entityType][$index])) { - $data = $this->data[$this->entityType][$index]; - $this->orderSalesEntityNew->getFormBlock()->fillData($data, $this->products); - } - } - - /** - * Sales entity submit. - * - * @return void - */ - protected function salesEntitySubmit() - { - $this->orderSalesEntityNew->getFormBlock()->submit(); - } - - /** - * Sales entity action. - * - * @return void - */ - protected function salesEntityAction() - { - $this->salesOrderView->getPageActions()->{$this->entityType}(); - } - - /** - * Get sales entity id. - * - * @param string $entity - * @return array - */ - public function getEntityIds($entity) - { - $this->salesOrderView->getOrderForm()->openTab($entity . 's'); - return $this->salesOrderView->getOrderForm()->getTabElement($entity . 's')->getGrid()->getIds(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php deleted file mode 100644 index 61e02851a38..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/AddProductsStep.php +++ /dev/null @@ -1,68 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->products = $products; - } - - /** - * Add products to order during creating backend order. - * - * @return void - */ - public function run() - { - $createBlock = $this->salesOrderCreateIndex->getCreateBlock(); - $createBlock->getItemsBlock()->clickAddProducts(); - $productsGrid = $createBlock->getSearchBlock()->getSearchGrid(); - foreach ($this->products as $product) { - $productsGrid->searchAndSelect(['sku' => $product->getSku()]); - } - $createBlock->getSearchBlock()->addSelectedProductsToOrder(); - $createBlock->getTemplateBlock()->waitLoader(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php deleted file mode 100644 index 16a545b6b7d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateInvoiceStep.php +++ /dev/null @@ -1,41 +0,0 @@ -objectManager->create('Mage\Sales\Test\Page\Adminhtml\SalesOrderInvoiceNew'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php deleted file mode 100644 index 1309d19d214..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderStep.php +++ /dev/null @@ -1,51 +0,0 @@ -orderIndex = $orderIndex; - } - - /** - * Create new order. - * - * @return void - */ - public function run() - { - $this->orderIndex->getPageActionsBlock()->addNew(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php deleted file mode 100644 index 5fb044f991d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateNewOrderViaCurlStep.php +++ /dev/null @@ -1,65 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->dataset = $orderdataset; - } - - /** - * Create new order via curl. - * - * @return array - */ - public function run() - { - /** @var Order $order */ - $order = $this->fixtureFactory->createByCode('order', ['dataset' => $this->orderdataset]); - $order->persist(); - - return ['order' => $order]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php deleted file mode 100644 index 3bcbcb12d70..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOfflineRefundStep.php +++ /dev/null @@ -1,32 +0,0 @@ -orderSalesEntityNew->getFormBlock()->offlineRefund(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php deleted file mode 100644 index 24de170d83c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/CreateOnlineRefundStep.php +++ /dev/null @@ -1,32 +0,0 @@ -orderSalesEntityNew->getFormBlock()->onlineRefund(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php deleted file mode 100644 index 489a1290d3b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/FillBillingAddressStep.php +++ /dev/null @@ -1,63 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->billingAddress = $billingAddress; - } - - /** - * Fill Billing address. - * - * @return Address - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getBillingAddressForm()->fill($this->billingAddress); - - return ['billingAddress' => $this->billingAddress]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php deleted file mode 100644 index 1d785bd4be4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/MoveProductsFromShoppingCartSidebarStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->products = $products; - } - - /** - * Move products from shopping cart sidebar on create order page. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getCustomerActivitiesBlock()->getShoppingCartItemsBlock()->addToOrder($this->products); - $this->orderCreateIndex->getCustomerActivitiesBlock()->updateChanges(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php deleted file mode 100644 index c4d77c6b6ae..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenOrderStep.php +++ /dev/null @@ -1,62 +0,0 @@ -orderIndex = $orderIndex; - $this->order = $order; - } - - /** - * Open order. - * - * @return void - */ - public function run() - { - $this->orderIndex->open(); - $this->orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $this->order->getId()]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php deleted file mode 100644 index 34cc1f4a844..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrderOnFrontendForGuestStep.php +++ /dev/null @@ -1,88 +0,0 @@ -customerAccountLogout = $customerAccountLogout; - $this->cmsIndex = $cmsIndex; - $this->salesGuestForm = $salesGuestForm; - $this->order = $order; - } - - /** - * Run step. - * - * @return void - */ - public function run() - { - $this->customerAccountLogout->open(); - $this->cmsIndex->getFooterBlock()->clickLink('Orders and Returns'); - $this->salesGuestForm->getSearchForm()->fill($this->order); - $this->salesGuestForm->getSearchForm()->submit(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php deleted file mode 100644 index 066bd30b248..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/OpenSalesOrdersStep.php +++ /dev/null @@ -1,51 +0,0 @@ -orderIndex = $orderIndex; - } - - /** - * Open Sales order. - * - * @return void - */ - public function run() - { - $this->orderIndex->open(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php deleted file mode 100644 index 05d82806698..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/PrintOrderOnFrontendStep.php +++ /dev/null @@ -1,62 +0,0 @@ -salesGuestView = $salesGuestView; - $this->browser = $browser; - } - - /** - * Click on "Print Order" button. - * - * @return void - */ - public function run() - { - $this->salesGuestView->getActionsToolbar()->clickLink('Print Order'); - $this->browser->selectWindow(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php deleted file mode 100644 index 0a0d409180e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/ReorderOrderStep.php +++ /dev/null @@ -1,51 +0,0 @@ -salesOrderView = $salesOrderView; - } - - /** - * Click reorder. - * - * @return void - */ - public function run() - { - $this->salesOrderView->getPageActions()->reorder(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php deleted file mode 100644 index 265d94a9d58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectCustomerOrderStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->customer = $customer; - } - - /** - * Select Customer for Order. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getCustomerGrid()->selectCustomer($this->customer); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php deleted file mode 100644 index f0e519e0acf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectPaymentMethodForOrderStep.php +++ /dev/null @@ -1,60 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->payment = $payment; - } - - /** - * Fill Payment data. - * - * @return void - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getPaymentBlock()->selectPaymentMethod($this->payment); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php deleted file mode 100644 index 80af637390a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectShippingMethodForOrderStep.php +++ /dev/null @@ -1,62 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->shipping = $shipping; - } - - /** - * Fill Shipping Data. - * - * @return array - */ - public function run() - { - if ($this->shipping['shipping_service'] != '-') { - $this->salesOrderCreateIndex->getCreateBlock()->getShippingBlock()->selectShippingMethod($this->shipping); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php deleted file mode 100644 index b5aa3f1e7f3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SelectStoreOnCreateOrderStep.php +++ /dev/null @@ -1,61 +0,0 @@ -orderCreateIndex = $orderCreateIndex; - $this->store = $store; - } - - /** - * Select Store on create order page. - * - * @return void - */ - public function run() - { - $this->orderCreateIndex->getStoreBlock()->selectStoreView($this->store); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php deleted file mode 100644 index b00067e6695..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/SubmitOrderStep.php +++ /dev/null @@ -1,125 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->salesOrderView = $salesOrderView; - $this->fixtureFactory = $fixtureFactory; - $this->customer = $customer; - $this->billingAddress = $billingAddress; - $this->products = $products; - $this->order = $order; - } - - /** - * Fill Sales Data. - * - * @return array - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->submitOrder(); - $this->salesOrderView->getMessagesBlock()->waitSuccessMessage(); - $orderId = $this->salesOrderView->getTitleBlock()->getOrderId(); - $order = $this->createOrderFixture($orderId); - - return ['orderId' => $orderId, 'order' => $order]; - } - - /** - * Create order fixture. - * - * @param string $orderId - * @return Order - */ - protected function createOrderFixture($orderId) - { - return ($this->order !== null) - ? $this->order - : $this->fixtureFactory->createByCode( - 'order', - [ - 'data' => [ - 'id' => $orderId, - 'customer_id' => ['customer' => $this->customer], - 'entity_id' => ['products' => $this->products], - 'billing_address_id' => ['billingAddress' => $this->billingAddress], - ] - ] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php b/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php deleted file mode 100644 index 7064917f373..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/TestStep/UpdateProductsDataStep.php +++ /dev/null @@ -1,60 +0,0 @@ -salesOrderCreateIndex = $salesOrderCreateIndex; - $this->products = $products; - } - - /** - * Fill product data. - * - * @return void - */ - public function run() - { - $this->salesOrderCreateIndex->getCreateBlock()->getItemsBlock()->updateProductsData($this->products); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml deleted file mode 100644 index 5dddb56ee95..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml deleted file mode 100644 index 14fcc28778a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - sales_order - - diff --git a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml deleted file mode 100644 index 346581b72d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sales/Test/etc/testcase.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php deleted file mode 100644 index 24799cb4cc0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AbstractCartPriceRuleApplying.php +++ /dev/null @@ -1,242 +0,0 @@ -checkoutCart = $checkoutCart; - $this->cmsIndex = $cmsIndex; - $this->customerAccountLogin = $customerAccountLogin; - $this->customerAccountLogout = $customerAccountLogout; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->customer = $customer; - $this->browser = $browser; - $this->productForSalesRule1 = $productForSalesRule1; - $this->productForSalesRule2 = $productForSalesRule2; - $isLoggedIn ? $this->login() : $this->customerAccountLogout->open(); - $this->checkoutCart->open()->getCartBlock()->clearShoppingCart(); - $this->addProductsToCart($productQuantity); - if ($address->hasData('country_id')) { - $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address); - if (!empty($shipping)) { - $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping); - } - } - if ($salesRule->getCouponCode()) { - $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($salesRule->getCouponCode()); - } - $this->assert(); - } - - /** - * Log in customer. - * - * @return void - */ - protected function login() - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $this->customer] - )->run(); - } - - /** - * Add products to cart. - * - * @param array $productQuantity - * @return void - */ - protected function addProductsToCart(array $productQuantity) - { - foreach ($productQuantity as $product => $quantity) { - if ($quantity > 0) { - $this->browser->open($_ENV['app_frontend_url'] . $this->$product->getUrlKey() . '.html'); - $this->catalogProductView->getViewBlock()->setQty($quantity); - $this->catalogProductView->getViewBlock()->clickAddToCart(); - } - } - } - - /** - * Get totals from total block in shopping cart. - * - * @return array - */ - protected function getTotals() - { - $totals = []; - $totals['subtotal'] = $this->checkoutCart->getTotalsBlock()->getData('subtotal'); - $totals['grandTotal'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total'); - if ($this->checkoutCart->getTotalsBlock()->isVisibleShippingPriceBlock()) { - $shippingPrice = $this->checkoutCart->getTotalsBlock()->getData('shipping_price'); - $totals['grandTotal'] = number_format(($totals['grandTotal'] - $shippingPrice), 2); - } - - return $totals; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php deleted file mode 100644 index 5e43dbd2b15..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsApplied.php +++ /dev/null @@ -1,52 +0,0 @@ -getTotals(); - \PHPUnit_Framework_Assert::assertNotEquals( - $totals['subtotal'], - $totals['grandTotal'], - "Shopping cart subtotal: " . $totals['subtotal'] . " equals with grand total: " . $totals['grandTotal'] - . ".\nPrice rule hasn't been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Shopping cart subtotal doesn't equal to grand total - price rule has been applied."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php deleted file mode 100644 index b06f0a6e3f0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleConditionIsNotApplied.php +++ /dev/null @@ -1,52 +0,0 @@ -getTotals(); - \PHPUnit_Framework_Assert::assertEquals( - $totals['subtotal'], - $totals['grandTotal'], - "Shopping cart subtotal: " . $totals['subtotal'] . " not equals with grand total: " . $totals['grandTotal'] - . ".\nPrice rule has been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Shopping cart subtotal equals with grand total - price rule hasn't been applied."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php deleted file mode 100644 index d9ab692b698..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleForm.php +++ /dev/null @@ -1,68 +0,0 @@ -open(); - $promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $salesRule->getName()]); - $formData = $promoQuoteEdit->getSalesRuleForm()->getData($salesRule); - $errors = $this->verifyData($salesRule->getData(), $formData); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Displayed sales rule data on edit page equals to passed from fixture.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php deleted file mode 100644 index 2dbf092d8f2..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleFreeShippingIsApplied.php +++ /dev/null @@ -1,55 +0,0 @@ -checkoutCart->getTotalsBlock()->getData('shipping_price'), - self::FREE_SHIPPING_PRICE, - "Free shipping hasn't been applied." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Free shipping is applied.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php deleted file mode 100644 index b7cf0cc3b15..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsAppliedToShipping.php +++ /dev/null @@ -1,56 +0,0 @@ -checkoutCart->getTotalsBlock()->getData('subtotal'); - $grandTotal = $this->checkoutCart->getTotalsBlock()->getData('grand_total'); - $shippingPrice = $this->checkoutCart->getTotalsBlock()->getData('shipping_price'); - $discount = $this->checkoutCart->getTotalsBlock()->getData('discount'); - $calculatedGrandTotal = number_format(((float)$subTotal + (float)$shippingPrice - (float)$discount), 2); - \PHPUnit_Framework_Assert::assertEquals( - $calculatedGrandTotal, - $grandTotal, - "Calculated grand total: '$calculatedGrandTotal' not equals with grand total: '$grandTotal' \n" - . "Price rule hasn't been applied to shipping amount." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Price rule is applied to shipping amount."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php deleted file mode 100644 index 1e9caf86c01..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleIsNotPresentedInGrid.php +++ /dev/null @@ -1,52 +0,0 @@ -open(); - \PHPUnit_Framework_Assert::assertFalse( - $promoQuoteIndex->getPromoQuoteGrid()->isRowVisible(['name' => $salesRule->getName()]), - "Sales rule {$salesRule->getName()} is present in cart price rules grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule is not present in cart price rules grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php deleted file mode 100644 index 2b2b6a6709b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php deleted file mode 100644 index ede63299be8..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Constraint/AssertCartPriceRuleSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sales rule success save message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml deleted file mode 100644 index 716e596c195..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php deleted file mode 100644 index f1e8d851857..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Fixture/SalesRule/WebsiteIds.php +++ /dev/null @@ -1,64 +0,0 @@ -params = $params; - foreach ($data as $dataset) { - $website = $fixtureFactory->createByCode('website', ['dataset' => trim($dataset)]); - /** @var Website $website */ - if (!$website->hasData('website_id')) { - $website->persist(); - } - $this->websites[] = $website; - $this->data[] = $website->getName(); - } - } - - /** - * Return Websites array. - * - * @return Website[] - */ - public function getWebsites() - { - return $this->websites; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php deleted file mode 100644 index 795f80f266e..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/Curl.php +++ /dev/null @@ -1,184 +0,0 @@ - [ - 'Active' => 1, - 'Inactive' => 0, - ], - 'coupon_type' => [ - 'No Coupon' => 1, - 'Specific Coupon' => 2, - 'Auto' => 3, - ], - 'is_rss' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'simple_action' => [ - 'Percent of product price discount' => 'by_percent', - 'Fixed amount discount' => 'by_fixed', - 'Fixed amount discount for whole cart' => 'cart_fixed', - 'Buy X get Y free (discount amount is Y)' => 'buy_x_get_y', - ], - 'apply_to_shipping' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'stop_rules_processing' => [ - 'Yes' => 1, - 'No' => 2, - ], - 'simple_free_shipping' => [ - 'No' => 0, - 'For matching items only' => 1, - 'For shipment with matching items' => 2, - ], - 'website_ids' => [ - 'Main Website' => 1 - ] - ]; - - /** - * Map of type parameter. - * - * @var array - */ - protected $mapTypeParams = [ - 'Conditions combination' => [ - 'type' => 'salesrule/rule_condition_combine', - 'aggregator' => 'all', - 'value' => '1', - ], - 'Category' => [ - 'type' => 'salesrule/rule_condition_product', - 'attribute' => 'category_ids', - ] - ]; - - /** - * Mapping values for customer group. - * - * @var array - */ - protected $customerIds = [ - 'NOT LOGGED IN' => 0, - 'General' => 1, - 'Wholesale' => 2, - 'Retailer' => 3, - ]; - - /** - * Post request for creating sales rule. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $url = $_ENV['app_backend_url'] . 'promo_quote/save/'; - $data = $this->replaceMappingData($fixture->getData()); - $data['customer_group_ids'] = $this->prepareCustomerGroup($data); - $data['website_ids'] = $this->prepareWebsiteIds($fixture); - if (isset($data['conditions_serialized'])) { - $data['rule']['conditions'] = $this->prepareCondition($data['conditions_serialized']); - unset($data['conditions_serialized']); - } - - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - if (!strpos($response, 'class="messages"')) { - throw new \Exception("Sales rule entity creating by curl handler was not successful! Response: $response"); - } - $id = $this->getSalesRuleId($response); - - return ['rule_id' => $id]; - } - - /** - * Prepare website ids for curl. - * - * @param SalesRule $fixture - * @return array - */ - protected function prepareWebsiteIds(SalesRule $fixture) - { - $websites = $fixture->getDataFieldConfig('website_ids')['source']->getWebsites(); - $data = []; - /** @var Website $website */ - foreach ($websites as $website) { - $data[] = $website->getWebsiteId(); - } - return $data; - } - - /** - * Prepare customer group data for curl. - * - * @param array $data - * @return array - */ - protected function prepareCustomerGroup(array $data) - { - $groupIds = []; - if (!empty($data['customer_group_ids'])) { - foreach ($data['customer_group_ids'] as $name) { - $groupIds[] = isset($this->customerIds[$name]) ? $this->customerIds[$name] : $name; - } - } - - return $groupIds; - } - - /** - * Return saved sales rule id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getSalesRuleId($response) - { - preg_match_all('~promo_quote/edit[^\s]*\/id\/(\d+)~', $response, $matches); - if (empty($matches)) { - throw new \Exception('Cannot find Sales Rule id'); - } - - return max(empty($matches[1]) ? null : $matches[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php deleted file mode 100644 index dc927400c81..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Handler/SalesRule/SalesRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml deleted file mode 100644 index de0530714e1..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml deleted file mode 100644 index 2958e525e79..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Page/Adminhtml/PromoQuoteNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml deleted file mode 100644 index a2153df4b5d..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/Repository/SalesRule.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Shopping Cart Price Rule %isolation% - Active - - NOT LOGGED IN - General - Wholesale - Retailer - - - main_website - - No Coupon - Percent of product price discount - 50 - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - - Specific Coupon - 123-abc-ABC-987-%isolation% - Percent of product price discount - 50 - - Shopping Cart price Rule with Specific Coupon - Shopping Cart price Rule with Specific Coupon - - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - Specific Coupon - 123-abc-ABC-987-%isolation% - Percent of product price discount - 50 - - Shopping Cart price Rule with Specific Coupon - Shopping Cart price Rule with Specific Coupon - - - - - Shopping Cart Price Rule with Specific Coupon %isolation% - Description for Cart Price Rule - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - No Coupon - Percent of product price discount - 50 - - - - Shopping Cart Price Rule with with conditions %isolation% - Shopping Cart Price Rule with conditions - Active - - main_website - - - NOT LOGGED IN - General - Wholesale - Retailer - - Specific Coupon - 123-abc-ABC-987-%isolation% - 13 - 63 - - 3/25/2014 - - - 6/29/2024 - - 1 - Yes - [Category|is|2] - Percent of product price discount - 50 - 0 - Yes - Yes - For matching items only - - Shopping Cart Price Rule with conditions - Shopping Cart Price Rule with conditions - - - - Inactive Cart Price Rule %isolation% - Inactive - - main_website - - - NOT LOGGED IN - - No Coupon - Percent of product price discount - 50 - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php deleted file mode 100644 index d8c39983427..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.php +++ /dev/null @@ -1,166 +0,0 @@ - Shopping Cart Price Rules. - * 3. Click "Add new rule" button. - * 4. Fill form according to data set. - * 5. Click "Save" button. - * 6. Perform asserts. - * - * @group Shopping_Cart_Price_Rules_(CS) - * @ZephyrId MPERF-6748 - */ -class CreateSalesRuleEntityTest extends Injectable -{ - /** - * Page PromoQuoteNew. - * - * @var PromoQuoteNew - */ - protected $promoQuoteNew; - - /** - * Page PromoQuoteEdit. - * - * @var PromoQuoteEdit - */ - protected $promoQuoteEdit; - - /** - * Page PromoQuoteIndex. - * - * @var PromoQuoteIndex - */ - protected $promoQuoteIndex; - - /** - * Sales rule name. - * - * @var string - */ - protected $salesRuleName; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Create customer and 2 simple products with categories before run test. - * - * @param FixtureFactory $fixtureFactory - * @param Customer $customer - * @return array - */ - public function __prepare(FixtureFactory $fixtureFactory, Customer $customer) - { - $this->fixtureFactory = $fixtureFactory; - $customer->persist(); - $products = $this->createProducts(['simple_for_salesrule_1', 'simple_for_salesrule_2']); - - return [ - 'customer' => $customer, - 'productForSalesRule1' => $products[0], - 'productForSalesRule2' => $products[1] - ]; - } - - /** - * Inject data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteNew $promoQuoteNew - * @param PromoQuoteEdit $promoQuoteEdit - * @return void - */ - public function __inject( - PromoQuoteIndex $promoQuoteIndex, - PromoQuoteNew $promoQuoteNew, - PromoQuoteEdit $promoQuoteEdit - ) { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteNew = $promoQuoteNew; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Create Sales Rule. - * - * @param SalesRule $salesRule - * @return void - */ - public function test(SalesRule $salesRule) - { - // Prepare data for tearDown - $this->salesRuleName = $salesRule->getName(); - - // Steps - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getGridPageActions()->addNew(); - $this->promoQuoteNew->getSalesRuleForm()->fill($salesRule); - $this->promoQuoteNew->getFormPageActions()->save(); - } - - /** - * Create products. - * - * @param array $productsdatasets - * @return array - */ - protected function createProducts(array $productsdatasets) - { - $products = []; - foreach ($productsdatasets as $dataset){ - $product = $this->fixtureFactory->createByCode('catalogProductSimple', ['dataset' => $dataset]); - $product->persist(); - $products[] = $product; - } - return $products; - } - - /** - * Delete sales rule. - * - * @return void - */ - public function tearDown() - { - if ($this->salesRuleName !== null) { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $this->salesRuleName]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - $this->salesRuleName = null; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml deleted file mode 100644 index 32eb69c7e25..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/CreateSalesRuleEntityTest.xml +++ /dev/null @@ -1,293 +0,0 @@ - - - - - - Sales rule with discount 50%. - 0 - 1 - 0 - Shopping Cart Price Rule1 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - No - No - Sales Cart Rule labels - - - - - - Sales rule with coupon code and fixed amount discount. - 0 - 2 - 0 - Shopping Cart Price Rule2 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - 1A2B3C-456-zxc-%isolation% - Fixed amount discount - 35 - No - No - Coupon code+fixed amount discount - - - - - - Sales rule with coupon code and fixed amount discount for whole cart. - 0 - 3 - 0 - Shopping Cart Price Rule3 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - Lorem ipsum dolor sit amet, consectetur adipiscing elit - %isolation% - Fixed amount discount for whole cart - 60 - No - No - Coupon code+Fixed amount discount for whole cart - - - - - - Sales rule with buy X get Y free. - 0 - 4 - 0 - Shopping Cart Price Rule4 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - Specific Coupon - 1A2B3C-456-zxc-%isolation% - Buy X get Y free (discount amount is Y) - 1 - 3 - No - No - Buy X get Y free - - - - - - Sales rule with discount quantity and logged user. - 1 - 3 - 0 - Shopping Cart Price Rule5 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - General - No Coupon - Percent of product price discount - 50 - 2 - No - No - - - - - - Sales rule with applying discount to shipping amount. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule6 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - Yes - No - Apply discount to Shipping Amount - - - - - - Sales rule with free shipping. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule7 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - Percent of product price discount - 50 - No - For matching items only - Free Shipping in conditions - - - - - - - Sales rule with condition: [Subtotal|is|150]. - 0 - 1 - 1 - Shopping Cart Price Rule8 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Subtotal|is|150] - Percent of product price discount - 50 - No - No - Sales Cart Rule labels - - - - - - Sales rule with wrong condition. - 0 - 2 - 0 - Shopping Cart Price Rule9 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Subtotal|is|150] - Percent of product price discount - 50 - No - No - Subtotal Action-Condition test - - - - - - Sales rule with condition: [Total Items Quantity|is|2]. - 0 - 2 - 0 - Shopping Cart Price Rule10 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Total Items Quantity|is|2] - Percent of product price discount - 50 - No - No - Total Items Quantity is 2 - - - - - - Sales rule with condition: [Total Weight|is|150]. - 0 - 1 - 1 - Shopping Cart Price Rule11 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - [Total Weight|is|150] - Percent of product price discount - 50 - No - No - Total Weight is 150 - - - - - - Sales rule with conditions combination. - United States - California - 95814 - Flat Rate - Fixed - 0 - 1 - 1 - Shopping Cart Price Rule12 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - {Conditions combination:[[Shipping Postcode|is|95814][Shipping State/Province|is|California][Shipping Country|is|United States]]} - Percent of product price discount - 50 - No - No - Rule applied conditions combination - - - - - - Sales rule with condition: {Product attribute combination:[Attribute Set|is|Default]}. - 0 - 1 - 0 - Shopping Cart Price Rule13 %isolation% - Shopping Cart Price Rule Description %isolation% - Active - NOT LOGGED IN - No Coupon - {Product attribute combination:[Attribute Set|is|Default]} - Percent of product price discount - 50 - No - No - Product attribute discount - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php deleted file mode 100644 index b54e6e3538d..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.php +++ /dev/null @@ -1,81 +0,0 @@ - Shopping Cart Price Rules. - * 3. Open shopping cart price rule from preconditions. - * 4. Click 'Delete' button. - * 5. Perform asserts. - * - * @group Shopping_Cart_Price_Rules_(MX) - * @ZephyrId MPERF-7632 - */ -class DeleteSalesRuleEntityTest extends Injectable -{ - /** - * Page PromoQuoteEdit. - * - * @var PromoQuoteEdit - */ - protected $promoQuoteEdit; - - /** - * Page PromoQuoteIndex. - * - * @var PromoQuoteIndex - */ - protected $promoQuoteIndex; - - /** - * Inject data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteEdit $promoQuoteEdit - * @return void - */ - public function __inject(PromoQuoteIndex $promoQuoteIndex, PromoQuoteEdit $promoQuoteEdit) - { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Delete Sales Rule Entity test. - * - * @param SalesRule $salesRule - * @return void - */ - public function test(SalesRule $salesRule) - { - // Preconditions: - $salesRule->persist(); - // Steps: - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $salesRule->getName()]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml deleted file mode 100644 index 7116703f546..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/DeleteSalesRuleEntityTest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - active_sales_rule_for_all_groups - - - - - active_sales_rule_with_conditions - - - - - inactive_sales_rule - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml deleted file mode 100644 index 663b3daec8b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestCase/ReorderOrderEntityTest.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - active_sales_rule_for_all_groups - -150.00 - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php deleted file mode 100644 index b9ef5861d60..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnBackendStep.php +++ /dev/null @@ -1,65 +0,0 @@ -salesRule = $salesRule; - $this->orderCreateIndex = $orderCreateIndex; - } - - /** - * Apply sales rule during backend order creation. - * - * @return void - */ - public function run() - { - if ($this->salesRule !== null) { - if ($this->salesRule->hasData('coupon_code')) { - $this->orderCreateIndex->getCreateBlock()->getCouponsBlock()->applyCouponsCode($this->salesRule); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php deleted file mode 100644 index 73235fcf532..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/ApplySalesRuleOnFrontendStep.php +++ /dev/null @@ -1,63 +0,0 @@ -checkoutCart = $checkoutCart; - $this->salesRule = $salesRule; - } - - /** - * Apply sales rule before one page checkout. - * - * @return void - */ - public function run() - { - if ($this->salesRule !== null) { - $this->checkoutCart->getDiscountCodesBlock()->applyCouponCode($this->salesRule->getCouponCode()); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php deleted file mode 100644 index 219416219eb..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/CreateSalesRuleStep.php +++ /dev/null @@ -1,73 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->salesRule = $salesRule; - } - - /** - * Run create sales rule step. - * - * @return array - */ - public function run() - { - return ['salesRule' => $this->salesRule != '-' ? $this->createSalesRule() : null]; - } - - /** - * Create sales rule. - * - * @return SalesRule - */ - protected function createSalesRule() - { - $salesRule = $this->fixtureFactory->createByCode('salesRule', ['dataset' => $this->salesRule]); - $salesRule->persist(); - return $salesRule; - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php b/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php deleted file mode 100644 index 8adb95e9a53..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/TestStep/DeleteAllSalesRuleStep.php +++ /dev/null @@ -1,66 +0,0 @@ -promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - } - - /** - * Delete all sales rules on backend. - * - * @return array - */ - public function run() - { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->resetFilter(); - while ($this->promoQuoteIndex->getPromoQuoteGrid()->isFirstRowVisible()) { - $this->promoQuoteIndex->getPromoQuoteGrid()->openFirstRow(); - $this->promoQuoteEdit->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml deleted file mode 100644 index 41087351f3b..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml deleted file mode 100644 index 829ea216ea0..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/fixture.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - flat - salesrule - Mage\SalesRule\Model\Resource\Rule\Collection - - - customer_group_ids - virtual - rule_information - - - store_labels - virtual - labels - - - coupon_code - virtual - rule_information - - - website_ids - virtual - rule_information - Mage\SalesRule\Test\Fixture\SalesRule\WebsiteIds - - - - diff --git a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml deleted file mode 100644 index 225fcc37216..00000000000 --- a/dev/tests/functional/tests/app/Mage/SalesRule/Test/etc/testcase.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php deleted file mode 100644 index 31b89db6271..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments.php +++ /dev/null @@ -1,31 +0,0 @@ -blockFactory->create( - 'Mage\Shipping\Test\Block\Sales\Order\Shipments\Shipment\Items', - ['element' => $this->_rootElement->find(sprintf($this->itemsSelector, $this->config['id']))] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php deleted file mode 100644 index 3441126a781..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items.php +++ /dev/null @@ -1,38 +0,0 @@ -tr'; -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php deleted file mode 100644 index f05a310bc84..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Block/Sales/Order/Shipments/Shipment/Items/Product.php +++ /dev/null @@ -1,33 +0,0 @@ - ['col_name' => 'Product Name'], - 'product_sku' => ['col_name' => 'SKU'], - 'item_qty' => ['col_name' => 'Qty Shipped'] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php deleted file mode 100644 index 17c3b680a58..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertNoShipButton.php +++ /dev/null @@ -1,45 +0,0 @@ - [ - 'total_qty_from', - 'total_qty_to' - ] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param SalesShipment $salesShipment - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesShipment $salesShipment - ) - { - parent::__construct($objectManager, $eventManager); - $this->salesEntityIndexPage = $salesShipment; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment is present in the shipment grid with correct total qty on shipment index page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php deleted file mode 100644 index b455b6f5100..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentInShipmentsTab.php +++ /dev/null @@ -1,65 +0,0 @@ - [ - 'total_qty_from', - 'total_qty_to' - ] - ]; - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment is present on shipments tab.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php deleted file mode 100644 index 92f21ade108..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItems.php +++ /dev/null @@ -1,67 +0,0 @@ -salesTypePage = $shipmentIndex; - $this->salesTypeViewPage = $orderShipmentView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'All shipment products are present in shipment page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php deleted file mode 100644 index 93d4b08d838..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentItemsOnFrontend.php +++ /dev/null @@ -1,64 +0,0 @@ -salesTypeViewPage = $shipmentView; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipped items quantity is equal to data from fixture on My Account page.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php deleted file mode 100644 index 8c70da84eef..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShipmentSuccessCreateMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Shipment success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php deleted file mode 100644 index a433d10094d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Constraint/AssertShippingMethodOnPrintOrder.php +++ /dev/null @@ -1,50 +0,0 @@ -getViewBlock()->isShippingMethodVisible($shipping), - "Shipping method was printed incorrectly." - ); - } - - /** - * Returns a string representation of successful assertion. - * - * @return string - */ - public function toString() - { - return "Shipping method was printed correctly."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml deleted file mode 100644 index d9950921c4a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesOrderShipmentNew.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml deleted file mode 100644 index 4c9325cb659..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipment.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml deleted file mode 100644 index 4ff0be64bf3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/Adminhtml/SalesShipmentView.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml deleted file mode 100644 index 6303a281f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Page/ShipmentView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml deleted file mode 100644 index b5912ff07d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,513 +0,0 @@ - - - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - United Parcel Service XML - UPS_XML - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Development - 0 - - - carriers - 1 - - https://wwwcie.ups.com/ups.app/xml/Rate - - - carriers - 1 - - Shipments Originating in United States - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Customer Packaging - CP - - - carriers - 1 - Residential - RES - - - carriers - 1 - - https://wwwcie.ups.com/ups.app/xml/Track - - - carriers - 1 - LBS - LBS - - - carriers - 1 - - - 11 - 12 - 14 - 54 - 59 - 65 - 01 - 02 - 03 - 07 - 08 - - - - carriers - 1 - All Allowed Countries - 0 - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - - - carriers - 1 - No - 0 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - http://production.shippingapis.com/ShippingAPI.dll - - - carriers - 1 - - https://secure.shippingapis.com/ShippingAPI.dll - - - carriers - 1 - - - - - carriers - 1 - - - - - - - carriers - 1 - No - 0 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - - 1 - - - carriers - 1 - LB - LB - - - carriers - 1 - - - EUROPE_FIRST_INTERNATIONAL_PRIORITY - FEDEX_1_DAY_FREIGHT - FEDEX_2_DAY_FREIGHT - FEDEX_2_DAY - FEDEX_2_DAY_AM - FEDEX_3_DAY_FREIGHT - FEDEX_EXPRESS_SAVER - FEDEX_GROUND - FIRST_OVERNIGHT - GROUND_HOME_DELIVERY - INTERNATIONAL_ECONOMY - INTERNATIONAL_ECONOMY_FREIGHT - INTERNATIONAL_FIRST - INTERNATIONAL_GROUND - INTERNATIONAL_PRIORITY - INTERNATIONAL_PRIORITY_FREIGHT - PRIORITY_OVERNIGHT - SMART_POST - STANDARD_OVERNIGHT - FEDEX_FREIGHT - FEDEX_NATIONAL_FREIGHT - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - - - carriers - 1 - No - 0 - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90232 - - - shipping - 1 - - Culver City - - - shipping - 1 - - 10441 Jefferson Blvd - - - shipping - 1 - - Suite 200 - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90034 - - - shipping - 1 - - - - - shipping - 1 - - - - - shipping - 1 - - - - - - - shipping - 1 - United Kingdom - GB - - - shipping - 1 - - SE1 7RW - - - shipping - 1 - - London - - - shipping - 1 - - 172, WestminsterBridge Rd - - - shipping - 1 - - - - - - - shipping - 1 - United States - US - - - shipping - 1 - California - 12 - - - shipping - 1 - - 90034 - - - shipping - 1 - - - - - shipping - 1 - - - - - shipping - 1 - - - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - https://xmlpi-ea.dhl.com/XMLShippingServlet - - - carriers - 1 - - - - - carriers - 1 - - - - - carriers - 1 - Documents - D - - - carriers - 1 - - - - - carriers - 1 - Yes - 1 - - - carriers - 1 - Yes - 1 - - - carriers - 1 - - - 2 - 5 - 6 - 7 - 9 - B - C - D - U - K - L - G - W - I - N - O - R - S - T - X - - - - - - carriers - 1 - No - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php b/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php deleted file mode 100644 index b10e801082f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Shipping/Test/TestStep/CreateShipmentStep.php +++ /dev/null @@ -1,42 +0,0 @@ -objectManager->create('Mage\Shipping\Test\Page\Adminhtml\SalesOrderShipmentNew'); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php deleted file mode 100644 index 4adfcb3accd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapContent.php +++ /dev/null @@ -1,99 +0,0 @@ -open()->getSitemapGrid()->sortGridByField('sitemap_id'); - $filter = [ - 'sitemap_filename' => $sitemap->getSitemapFilename(), - 'sitemap_path' => $sitemap->getSitemapPath(), - ]; - $sitemapIndex->getSitemapGrid()->search($filter); - $content = file_get_contents($sitemapIndex->getSitemapGrid()->getLinkForGoogle()); - $frontendUrl = str_replace('index.php/', '', $_ENV['app_frontend_url']); - $urls = [ - $frontendUrl . $product->getUrlKey() . '.html', - $frontendUrl . $category->getUrlKey() . '.html', - $frontendUrl . $cmsPage->getIdentifier(), - ]; - \PHPUnit_Framework_Assert::assertTrue( - $this->checkContent($content, $urls), - "File '{$sitemap->getSitemapFilename()}' does not contains correct content." - ); - } - - /** - * Check content for the presence urls. - * - * @param string $content - * @param array $urls - * @return bool - */ - protected function checkContent($content, $urls) - { - foreach ($urls as $url) { - if (!str_contains($content, $url)) { - return false; - } - } - return true; - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'File sitemap contains correct content.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php deleted file mode 100644 index e5872ef2480..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailFolderSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getSitemapPath()), - $sitemapIndex->getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message after creating sitemap with wrong folder is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php deleted file mode 100644 index 8a1aad35f96..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapFailPathSaveMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -getSitemapFilename()), - $sitemapIndex->getMessagesBlock()->getErrorMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Error message after creating sitemap with wrong path is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php deleted file mode 100644 index f02cd2bf69b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapInGrid.php +++ /dev/null @@ -1,60 +0,0 @@ -open()->getSitemapGrid()->sortGridByField('sitemap_id'); - $filter = [ - 'sitemap_filename' => $sitemap->getSitemapFilename(), - 'sitemap_path' => $sitemap->getSitemapPath(), - ]; - \PHPUnit_Framework_Assert::assertTrue( - $sitemapIndex->getSitemapGrid()->isRowVisible($filter), - 'Sitemap is absent in grid.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php deleted file mode 100644 index f7360d94be5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveAndGenerateMessages.php +++ /dev/null @@ -1,67 +0,0 @@ -getMessagesBlock()->getSuccessMessages(); - \PHPUnit_Framework_Assert::assertTrue( - in_array(self::SUCCESS_SAVE_MESSAGE, $actualMessages) && - in_array(sprintf(self::SUCCESS_GENERATE_MESSAGE, $sitemap->getSitemapFilename()), $actualMessages), - "The messages about the successful sitemap creation and generation are not present." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap success generate and save messages are present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php deleted file mode 100644 index 307069b53d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Constraint/AssertSitemapSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Sitemap success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml deleted file mode 100644 index f747c3a64c0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Fixture/Sitemap.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml deleted file mode 100644 index 58bc3aab598..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml deleted file mode 100644 index a0e6c32089f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Page/Adminhtml/SitemapNew.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml deleted file mode 100644 index eafb23daf73..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/Repository/Sitemap.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - sitemap.xml - / - - 0 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php deleted file mode 100644 index c2f315cb5f1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Google Sitemap. - * 3. Click "Add Sitemap" button. - * 4. Fill out all data according to data set. - * 5. Click "Save" button. - * 6. Perform all assertions. - * - * @group XML_Sitemap_(PS) - * @ZephyrId MPERF-7060 - */ -class CreateSitemapEntityTest extends Injectable -{ - /** - * Sitemap index page. - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Sitemap new page. - * - * @var SitemapNew - */ - protected $sitemapNew; - - /** - * Injection pages. - * - * @param SitemapIndex $sitemapIndex - * @param SitemapNew $sitemapNew - * @return void - */ - public function __inject(SitemapIndex $sitemapIndex, SitemapNew $sitemapNew) - { - $this->sitemapIndex = $sitemapIndex; - $this->sitemapNew = $sitemapNew; - } - - /** - * Create sitemap. - * - * @param Sitemap $sitemap - * @return void - */ - public function test(Sitemap $sitemap) - { - // Steps - $this->sitemapIndex->open(); - $this->sitemapIndex->getGridPageActions()->addNew(); - $this->sitemapNew->getSitemapForm()->fill($sitemap); - $this->sitemapNew->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml deleted file mode 100644 index ff0ea3b8f4d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/CreateSitemapEntityTest.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - Create default sitemap. - sitemap.xml - / - - - - - Create sitemap with wrong path. - %isolation% - / - - - - Create sitemap with wrong folder. - sitemap.xml - /%isolation% - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php deleted file mode 100644 index 86d4f968658..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.php +++ /dev/null @@ -1,94 +0,0 @@ - Google Sitemap. - * 3. Click "Add Sitemap" button. - * 4. Fill out all data according to data set. - * 5. Click "Save & Generate" button. - * 6. Perform all assertions. - * - * @group XML_Sitemap_(PS) - * @ZephyrId MPERF-7491 - */ -class GenerateSitemapEntityTest extends Injectable -{ - /** - * Sitemap index page. - * - * @var SitemapIndex - */ - protected $sitemapIndex; - - /** - * Sitemap new page. - * - * @var SitemapNew - */ - protected $sitemapNew; - - /** - * Inject data. - * - * @param SitemapIndex $sitemapIndex - * @param SitemapNew $sitemapNew - * @return void - */ - public function __inject(SitemapIndex $sitemapIndex, SitemapNew $sitemapNew) - { - $this->sitemapIndex = $sitemapIndex; - $this->sitemapNew = $sitemapNew; - } - - /** - * Generate sitemap test. - * - * @param Sitemap $sitemap - * @param CatalogProductSimple $product - * @param CatalogCategory $category - * @param CmsPage $cmsPage - * @return void - */ - public function test(Sitemap $sitemap, CatalogProductSimple $product, CatalogCategory $category, CmsPage $cmsPage) - { - // Preconditions - $product->persist(); - $category->persist(); - $cmsPage->persist(); - - // Steps - $this->sitemapIndex->open(); - $this->sitemapIndex->getGridPageActions()->addNew(); - $this->sitemapNew->getSitemapForm()->fill($sitemap); - $this->sitemapNew->getFormPageActions()->saveAndGenerate(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml deleted file mode 100644 index ea7f5788674..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/TestCase/GenerateSitemapEntityTest.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - sitemap.xml - / - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml deleted file mode 100644 index fab3103d0a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Sitemap/Test/etc/fixture.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - flat - sitemap - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php deleted file mode 100644 index 3c7cc46f9a6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertOrderTaxOnBackend.php +++ /dev/null @@ -1,205 +0,0 @@ - 'Order', - 'invoice_prices' => 'InvoiceNew', - 'credit_memo_prices' => 'CreditMemoNew' - ]; - - /** - * Order view page. - * - * @var SalesOrderInvoiceNew - */ - protected $orderInvoiceNew; - - /** - * Order view page. - * - * @var SalesOrderCreditMemoNew - */ - protected $orderCreditMemoNew; - - /** - * Order index page. - * - * @var SalesOrderIndex - */ - protected $salesOrder; - - /** - * Implementation for get invoice creation page total prices function. - * - * @return array - */ - abstract protected function getInvoiceNewTotals(); - - /** - * Implementation for get credit memo creation page total prices function. - * - * @return array - */ - abstract protected function getCreditMemoNewTotals(); - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param \Mage\Sales\Test\Page\Adminhtml\SalesOrderView $salesOrderView - * @param SalesOrderIndex $orderIndex - * @param SalesOrderInvoiceNew $orderInvoiceNew - * @param SalesOrderCreditMemoNew $orderCreditMemoNew - * @param CheckoutOnepage $checkoutOnepage - * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - SalesOrderView $salesOrderView, - SalesOrderIndex $orderIndex, - SalesOrderInvoiceNew $orderInvoiceNew, - SalesOrderCreditMemoNew $orderCreditMemoNew, - CheckoutOnepage $checkoutOnepage, - CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView - ) { - parent::__construct($objectManager, $eventManager, $checkoutOnepage, $checkoutOnepageSuccess, $orderView); - $this->orderView = $salesOrderView; - $this->orderInvoiceNew = $orderInvoiceNew; - $this->orderCreditMemoNew = $orderCreditMemoNew; - $this->orderIndex = $orderIndex; - } - - /** - * Assert that specified prices are actual on order, invoice and refund pages. - * - * @param InjectableFixture $product - * @param array $prices - * @param array $arguments [optional] - * @return void - */ - public function processAssert(InjectableFixture $product, array $prices, array $arguments = null) - { - $prices = $this->prepareVerifyFields($prices); - - $this->orderIndex->open()->getSalesOrderGrid()->openFirstRow(); - $this->assertOrderPrices($product, $prices); - - $this->assertInvoicePrices($product, $prices); - - //Check prices after invoice on order page - $this->orderInvoiceNew->getFormBlock()->submit(); - $this->assertOrderPrices($product, $prices); - - $this->assertCreditMemoPrices($product, $prices); - - //Check prices after refund on order page - $this->orderCreditMemoNew->getFormBlock()->submit(); - $this->assertOrderPrices($product, $prices); - } - - /** - * Assert credit memo prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertCreditMemoPrices(InjectableFixture $product, array $prices) - { - $this->orderView->getPageActions()->refund(); - $error = $this->verifyData( - $this->preparePricesCreditMemo($prices), - $this->getActualPrices($product, 'credit_memo_prices') - ); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Assert invoice prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertInvoicePrices(InjectableFixture $product, array $prices) - { - $this->orderView->getPageActions()->invoice(); - $error = $this->verifyData($prices, $this->getActualPrices($product, 'invoice_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Prepare prices for credit memo. - * - * @param array $prices - * @return array - */ - protected function preparePricesCreditMemo(array $prices) - { - unset($prices['shipping_excl_tax']); - unset($prices['shipping_incl_tax']); - return $prices; - } - - /** - * Get invoice new product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getInvoiceNewPrices(InjectableFixture $product) - { - $productBlock = $this->orderInvoiceNew->getFormBlock()->getItemsBlock()->getItemProductBlock($product); - return $this->getTypePrices($productBlock); - } - - /** - * Get Credit Memo new product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getCreditMemoNewPrices(InjectableFixture $product) - { - $productBlock = $this->orderCreditMemoNew->getFormBlock()->getItemsBlock()->getItemProductBlock($product); - return $this->getTypePrices($productBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php deleted file mode 100644 index 6891b274282..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTax.php +++ /dev/null @@ -1,186 +0,0 @@ - 'Order']; - - /** - * Order view page on backend. - * - * @var SalesOrderView - */ - protected $orderView; - - /** - * Assert order prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertOrderPrices(InjectableFixture $product, array $prices) - { - $error = $this->verifyData($prices, $this->getActualPrices($product, 'order_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Get actual prices. - * - * @param InjectableFixture $product - * @param string $pricesType - * @return array - */ - protected function getActualPrices(InjectableFixture $product, $pricesType) - { - return array_merge( - $this->{'get' . $this->priceTypes[$pricesType] . 'Prices'}($product), - $this->{'get' . $this->priceTypes[$pricesType] . 'Totals'}() - ); - } - - /** - * Unset category and product page expected prices. - * - * @param array $prices - * @return array - */ - protected function preparePrices(array $prices) - { - $resultTotalPrices = array_intersect_key($prices, array_flip($this->verifyFields)); - $resultItemPrices = array_intersect_key($prices, array_flip($this->cartItemVerifiableFields)); - - return array_merge($resultTotalPrices, $resultItemPrices); - } - - /** - * Get order product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getOrderPrices(InjectableFixture $product) - { - $viewBlock = $this->orderView->getItemsOrderedBlock()->getItemProductBlock($product); - return $this->getTypePrices($viewBlock); - } - - /** - * Get order totals. - * - * @return array - */ - public function getOrderTotals() - { - $totalsBlock = $this->orderView->getOrderTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Get type prices. - * - * @param AbstractItem $block - * @return array - */ - protected function getTypePrices(AbstractItem $block) - { - $result = []; - foreach ($this->cartItemVerifiableFields as $field) { - $result[$field] = $block->getCartItemTypePrice($field); - } - - return $result; - } - - /** - * Get data from block. - * - * @param Totals $block - * @return array - */ - protected function getTypeBlockData(Totals $block) - { - $result = []; - foreach ($this->verifyFields as $field) { - $result[$field] = $block->getData($field); - } - - return $result; - } - - /** - * Prepare verify fields for assert. - * - * @param array $prices - * @return array - */ - protected function prepareVerifyFields(array $prices) - { - $prices = $this->preparePrices($prices); - foreach ($this->verifyFields as $field) { - if(!isset($prices[$field])) { - $this->verifyFields = array_diff($this->verifyFields, [$field]); - } - } - - return $prices; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php deleted file mode 100644 index 09c7bf94e3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxCalculationAfterCheckout.php +++ /dev/null @@ -1,191 +0,0 @@ - ['class' => 'ProceedToCheckout'], - 'billing_information' => ['class' => 'FillBillingInformation'], - 'shipping_method' => ['class' => 'FillShippingMethod', 'arguments' => ['shipping']], - 'payment_method' => ['class' => 'SelectPaymentMethod', 'arguments' => ['payment']], - 'place_order' => ['class' => 'PlaceOrder'] - ]; - - /** - * @constructor - * @param ObjectManager $objectManager - * @param EventManagerInterface $eventManager - * @param CheckoutOnepage $checkoutOnepage - * @param CheckoutOnepageSuccess $checkoutOnepageSuccess - * @param OrderView $orderView - */ - public function __construct( - ObjectManager $objectManager, - EventManagerInterface $eventManager, - CheckoutOnepage $checkoutOnepage, - CheckoutOnepageSuccess $checkoutOnepageSuccess, - OrderView $orderView - ) { - parent::__construct($objectManager, $eventManager); - $this->checkoutOnepage = $checkoutOnepage; - $this->checkoutOnepageSuccess = $checkoutOnepageSuccess; - $this->orderView = $orderView; - } - - /** - * Assert that prices on order review and customer order pages are equal to specified in dataset. - * - * @param InjectableFixture $product - * @param array $prices - * @param array $arguments [optional] - * @return void - */ - public function processAssert(InjectableFixture $product, array $prices, array $arguments = null) - { - $this->priceTypes['review_prices'] = 'Review'; - $prices = $this->prepareVerifyFields($prices); - - $this->checkoutStep('proceed_to_checkout'); - $this->checkoutStep('billing_information'); - if (isset($arguments['shipping'])) { - $this->checkoutStep('shipping_method', $arguments); - } - $this->checkoutStep('payment_method', $arguments); - - $this->assertReviewPrices($product, $prices); - - $this->checkoutStep('place_order'); - $this->checkoutOnepageSuccess->getSuccessBlock()->openOrder(); - - $this->assertOrderPrices($product, $prices); - } - - /** - * Assert order prices. - * - * @param InjectableFixture $product - * @param array $prices - * @return void - */ - protected function assertReviewPrices(InjectableFixture $product, array $prices) - { - $error = $this->verifyData($prices, $this->getActualPrices($product, 'review_prices')); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Run checkout step. - * - * @param string $type - * @param array $arguments [optional] - * @return array - */ - protected function checkoutStep($type, array $arguments = null) - { - $className = "Mage\\Checkout\\Test\\TestStep\\{$this->steps[$type]['class']}Step"; - $arguments = isset($this->steps[$type]['arguments']) - ? $this->prepareArgumentsForStep($this->steps[$type]['arguments'], $arguments) - : []; - - return $this->objectManager->create($className, $arguments)->run(); - } - - /** - * Prepare arguments for step. - * - * @param array $arguments - * @param array $argumentsData - * @return array - */ - protected function prepareArgumentsForStep(array $arguments, array $argumentsData) - { - $result = []; - foreach ($arguments as $argument) { - $result[$argument] = $argumentsData[$argument]; - } - - return $result; - } - - /** - * Get review product prices. - * - * @param InjectableFixture $product - * @return array - */ - public function getReviewPrices(InjectableFixture $product) - { - $reviewBlock = $this->checkoutOnepage->getReviewBlock()->getItemsBlock($this->productType) - ->getItemProductBlock($product); - return $this->getTypePrices($reviewBlock); - } - - /** - * Get review totals. - * - * @return array - */ - public function getReviewTotals() - { - $totalBlock = $this->checkoutOnepage->getReviewBlock()->getTotalBlock(); - return $this->getTypeBlockData($totalBlock); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php deleted file mode 100644 index dc72aa2c63b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxRuleIsAppliedToAllPrices.php +++ /dev/null @@ -1,241 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $this->cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $prices = $this->prepareVerifyFields($prices); - - //Assertion steps - $productName = $product->getName(); - $this->cmsIndex->open()->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - $actualPrices = $this->getCategoryPrices($product); - $catalogCategoryView->getListProductBlock()->openProductViewPage($productName); - $this->fillCheckoutData($product); - $actualPrices = array_merge($actualPrices, $this->getProductPagePrices()); - $catalogProductView->getViewBlock()->clickAddToCart(); - if (isset($arguments['shipping'])) { - $this->fillEstimateBlock($address, $arguments['shipping']); - } - $actualPrices = array_merge($actualPrices, $this->getCartPrices($product), $this->getTotals($actualPrices)); - - //Prices verification - $error = $this->verifyData($prices, $actualPrices); - \PHPUnit_Framework_Assert::assertTrue(empty($error), $error); - } - - /** - * Unset category and product page expected prices. - * - * @param array $prices - * @return array - */ - protected function preparePrices(array $prices) - { - $generalPrices = parent::preparePrices($prices); - $categoryPrices = array_intersect_key($prices, array_flip($this->categoryPrices)); - $productPrices = array_intersect_key($prices, array_flip($this->productPrices)); - - return array_merge($generalPrices, $categoryPrices, $productPrices); - } - - /** - * Get prices on category page. - * - * @param InjectableFixture $product - * @return array - */ - protected function getCategoryPrices(InjectableFixture $product) - { - $result = []; - $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductPriceBlock($product->getName()); - foreach ($this->categoryPrices as $item) { - $result[$item] = $this->getPrice($priceBlock, $item); - } - - return $result; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - $result = []; - $viewBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); - foreach ($this->productPrices as $item) { - $result[$item] = (count($this->categoryPrices) == 1) - ? $this->getPrice($viewBlock, 'special_price') - : $this->getPrice($viewBlock, $item); - } - return $result; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - protected function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Get totals. - * - * @return array - */ - protected function getTotals() - { - $totalsBlock = $this->checkoutCart->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Fill checkout data. - * - * @param InjectableFixture $product - * @return void - */ - protected function fillCheckoutData(InjectableFixture $product) - { - $qty = $product->getCheckoutData()['qty']; - $this->catalogProductView->getViewBlock()->fillOptions($product); - $this->catalogProductView->getViewBlock()->setQty($qty); - } - - /** - * Get cart prices. - * - * @param InjectableFixture $product - * @return array - */ - protected function getCartPrices(InjectableFixture $product) - { - $cartItemData = $this->checkoutCart->getCartBlock()->getCartItem($product); - return $this->getTypePrices($cartItemData); - } - - /** - * Fill estimate block. - * - * @param Address $address - * @param array $shipping - * @return void - */ - protected function fillEstimateBlock(Address $address, array $shipping) - { - $this->checkoutCart->getShippingBlock()->fillEstimateShippingAndTax($address); - $this->checkoutCart->getShippingBlock()->selectShippingMethod($shipping); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php deleted file mode 100644 index 94aa3dd3728..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php +++ /dev/null @@ -1,221 +0,0 @@ -cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $actualPrices = $this->getPricesForCustomers($product, $customers, $browser); - $this->assert($actualPrices); - } - - /** - * Login with each provided customer and get product prices. - * - * @param CatalogProductSimple $product - * @param array $customers - * @param Browser $browser - * @return array - */ - protected function getPricesForCustomers(CatalogProductSimple $product, array $customers, Browser $browser) - { - $prices = []; - foreach ($customers as $customer) { - $this->loginCustomer($customer); - $this->openCategory($product); - $actualPrices = []; - $actualPrices = $this->getCategoryPrice($product->getName(), $actualPrices); - $browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $actualPrices = $this->addToCart($product, $actualPrices); - $actualPrices = $this->getCartPrice($product, $actualPrices); - $prices[] = $actualPrices; - $this->clearShoppingCart(); - } - return $prices; - } - - /** - * Open product category. - * - * @param CatalogProductSimple $product - * @return void - */ - protected function openCategory(CatalogProductSimple $product) - { - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategory($product->getCategoryIds()[0]); - } - - /** - * Get prices on category page. - * - * @param string $productName - * @param array $actualPrices - * @return array - */ - protected function getCategoryPrice($productName, array $actualPrices) - { - $priceBlock = $this->catalogCategoryView->getListProductBlock()->getProductPriceBlock($productName); - $actualPrices['category_price_incl_tax'] = $this->getPrice($priceBlock, 'category_price_incl_tax'); - return $actualPrices; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - public function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Get price after fill product options, and add product to cart. - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function addToCart(CatalogProductSimple $product, array $actualPrices) - { - $this->catalogProductView->getViewBlock()->fillOptions($product); - $priceBlock = $this->catalogProductView->getViewBlock()->getPriceBlock(); - $actualPrices['product_view_price_incl_tax'] = $this->getPrice($priceBlock, 'product_view_price_incl_tax'); - $this->catalogProductView->getViewBlock()->clickAddToCart(); - return $actualPrices; - } - - /** - * Get cart prices. - * - * @param CatalogProductSimple $product - * @param array $actualPrices - * @return array - */ - protected function getCartPrice(CatalogProductSimple $product, array $actualPrices) - { - $actualPrices['cart_item_price_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product) - ->getCartItemTypePrice('cart_item_price_incl_tax'); - $actualPrices['cart_item_subtotal_incl_tax'] = $this->checkoutCart->getCartBlock()->getCartItem($product) - ->getCartItemTypePrice('cart_item_subtotal_incl_tax'); - $actualPrices['grand_total'] = $this->checkoutCart->getTotalsBlock()->getData('grand_total_incl_tax'); - return $actualPrices; - } - - /** - * Login customer. - * - * @param Customer $customer - * @return void - */ - protected function loginCustomer(Customer $customer) - { - $this->objectManager->create( - '\Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php deleted file mode 100644 index acb67d0dae7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingIncludingTax.php +++ /dev/null @@ -1,58 +0,0 @@ -orderInvoiceNew->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Get Credit Memo new totals. - * - * @return array - */ - public function getCreditMemoNewTotals() - { - $totalsBlock = $this->orderCreditMemoNew->getTotalsBlock(); - return $this->getTypeBlockData($totalsBlock); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices on backend after order creation is correct.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php deleted file mode 100644 index c206b5b71c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertOrderTaxOnBackendExcludingTax.php +++ /dev/null @@ -1,67 +0,0 @@ -prepareData($taxRate->getData()); - - $taxRateIndex->open()->getTaxRatesGrid()->searchAndOpen(['code' => $data['code']]); - $formData = $taxRateNew->getTaxRateForm()->getData($taxRate); - $errors = $this->verifyData($data, $formData); - - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Preparing data for verification. - * - * @param array $data - * @return array - */ - protected function prepareData(array $data) - { - if ($data['zip_is_range'] === 'Yes') { - unset($data['tax_postcode']); - } else { - unset($data['zip_from'], $data['zip_to']); - } - $data['rate'] = number_format($data['rate'], 4); - - return $data; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax Rate form was filled correctly.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php deleted file mode 100644 index c724f0b4615..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInGrid.php +++ /dev/null @@ -1,66 +0,0 @@ -getData(); - $filter = [ - 'code' => $data['code'], - 'tax_country_id' => $data['tax_country_id'], - 'tax_postcode' => $data['zip_is_range'] === 'No' - ? $data['tax_postcode'] - : $data['zip_from'] . '-' . $data['zip_to'] - ]; - - $taxRateIndexPage->open(); - - \PHPUnit_Framework_Assert::assertTrue( - $taxRateIndexPage->getTaxRatesGrid()->isRowVisible($filter), - "Tax Rate {$filter['code']} is absent in Tax Rate grid." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php deleted file mode 100644 index 5157fb3e965..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateInTaxRule.php +++ /dev/null @@ -1,60 +0,0 @@ -getCode(); - $taxRuleIndex->open()->getPageActionsBlock()->addNew(); - - \PHPUnit_Framework_Assert::assertTrue( - $taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxRateCode), - "$taxRateCode is not present in Tax Rates multiselect on TaxRuleEdit page." - ); - } - - /** - * Returns string representation of object. - * - * @return string - */ - public function toString() - { - return "Necessary tax rate is present in Tax Rule Information on TaxRuleEdit page."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php deleted file mode 100644 index 874d55532ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateIsInCorrectRange.php +++ /dev/null @@ -1,61 +0,0 @@ -getCode(); - $taxRateIndex->open()->getTaxRatesGrid()->searchAndOpen(['code' => $taxRateCode]); - $ratePercentage = $taxRateEdit->getTaxRateForm()->getTaxRatePercentage(); - - \PHPUnit_Framework_Assert::assertTrue( - $ratePercentage >= 0 && $ratePercentage <= 100, - "$taxRateCode rate percent $ratePercentage is not in correct range between 0 and 100." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Necessary tax rate percent is in correct range between 0 and 100.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php deleted file mode 100644 index 0dc116410f6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInGrid.php +++ /dev/null @@ -1,56 +0,0 @@ - $taxRate->getCode()]; - $taxRateIndex->open(); - \PHPUnit_Framework_Assert::assertFalse( - $taxRateIndex->getTaxRatesGrid()->isRowVisible($filter), - 'Tax Rate \'' . $filter['code'] . '\' is present in Tax Rate grid.' - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is absent in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php deleted file mode 100644 index aeedad424d4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateNotInTaxRule.php +++ /dev/null @@ -1,56 +0,0 @@ -open(); - $taxCode = $taxRate->getCode(); - \PHPUnit_Framework_Assert::assertFalse( - $taxRuleNew->getTaxRuleForm()->isTaxRateAvailable($taxCode), - "Tax Rate '$taxCode' is present in Tax Rule form." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate is absent in tax rule from.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php deleted file mode 100644 index 1432838d5ea..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessDeleteMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate success delete message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php deleted file mode 100644 index 93d93ff74ab..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRateSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rate success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php deleted file mode 100644 index 525cc0b8013..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleForm.php +++ /dev/null @@ -1,93 +0,0 @@ -getData(); - $taxRuleIndex->open(); - $taxRuleIndex->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]); - $formData = $taxRuleNew->getTaxRuleForm()->getData($taxRule); - $dataDiff = $this->verifyForm($formData, $fixtureData); - - \PHPUnit_Framework_Assert::assertEmpty($dataDiff, implode($dataDiff)); - } - - /** - * Verifying that form is filled right. - * - * @param array $formData - * @param array $fixtureData - * @return array $errorMessage - */ - protected function verifyForm(array $formData, array $fixtureData) - { - $errorMessage = []; - - foreach ($fixtureData as $key => $value) { - if (is_array($value)) { - $diff = array_diff($value, $formData[$key]); - $diff = array_merge($diff, array_diff($formData[$key], $value)); - if (!empty($diff)) { - $errorMessage[] = "Data in " . $key . " field not equal." - . "\nExpected: " . implode(", ", $value) - . "\nActual: " . implode(", ", $formData[$key]); - } - } else { - if ($value !== $formData[$key]) { - $errorMessage[] = "Data in " . $key . " field not equal." - . "\nExpected: " . $value - . "\nActual: " . $formData[$key]; - } - } - } - - return $errorMessage; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax Rule form has been filled right.'; - } -} - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php deleted file mode 100644 index 0f083a829d7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleInGrid.php +++ /dev/null @@ -1,58 +0,0 @@ - $taxRule->getCode()]; - - $taxRuleIndex->open(); - \PHPUnit_Framework_Assert::assertTrue( - $taxRuleIndex->getTaxRuleGrid()->isRowVisible($filter), - "Tax Rule '{$filter['code']}' is absent in Tax Rule grid." - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rule is present in grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php deleted file mode 100644 index 21d1b39e37f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesExcludingIncludingTax.php +++ /dev/null @@ -1,36 +0,0 @@ - $this->catalogCategoryView - ->getListProductBlock() - ->getProductPriceBlock($product->getName()) - ->getResultPrice() - ]; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - return ['product_view_price' => $this->catalogProductView->getViewBlock()->getPriceBlock()->getResultPrice()]; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices excl tax on category, product and cart pages are equal to specified in dataset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php deleted file mode 100644 index 87855ccd7aa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleIsAppliedToAllPricesIncludingTax.php +++ /dev/null @@ -1,102 +0,0 @@ - $this->catalogCategoryView - ->getListProductBlock() - ->getProductPriceBlock($product->getName()) - ->getResultPrice() - ]; - } - - /** - * Get product view prices. - * - * @return array - */ - protected function getProductPagePrices() - { - return ['product_view_price' => $this->catalogProductView->getViewBlock()->getPriceBlock()->getResultPrice()]; - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Prices incl tax on category, product and cart pages are equal to specified in dataset.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php deleted file mode 100644 index 32e5ca8fa3a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxRuleSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Tax rule success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php deleted file mode 100644 index 6aee1b07b54..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Constraint/AssertTaxWithCrossBorderApplied.php +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml deleted file mode 100644 index 59e08c0743b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRate.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml deleted file mode 100644 index fdac0987828..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php deleted file mode 100644 index 6a2c351a788..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxClass.php +++ /dev/null @@ -1,69 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - if ($dataset !== '-') { - /** @var \Mage\Tax\Test\Fixture\TaxClass $taxClass */ - $taxClass = $fixtureFactory->createByCode('taxClass', ['dataset' => $dataset]); - if (!$taxClass->hasData('id')) { - $taxClass->persist(); - } - $this->fixtures[] = $taxClass; - $this->data[] = $taxClass->getClassName(); - } - } - } - } - - /** - * Return tax class fixtures - * - * @return array - */ - public function getFixtures() - { - return $this->fixtures; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php deleted file mode 100644 index 22016acbc2c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Fixture/TaxRule/TaxRate.php +++ /dev/null @@ -1,70 +0,0 @@ -params = $params; - if (isset($data['dataset'])) { - foreach ($data['dataset'] as $dataset) { - if ($dataset !== '-') { - /** @var \Mage\Tax\Test\Fixture\TaxRate $taxRate */ - $taxRate = $fixtureFactory->createByCode('taxRate', ['dataset' => $dataset]); - if (!$taxRate->hasData('id')) { - $taxRate->persist(); - } - $this->fixtures[] = $taxRate; - $this->data[] = $taxRate->getCode(); - } - } - } - } - - /** - * Return tax rate fixtures. - * - * @return array - */ - public function getFixtures() - { - return $this->fixtures; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php deleted file mode 100644 index 66c879ddd61..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/Curl.php +++ /dev/null @@ -1,66 +0,0 @@ -getData(); - - $url = $_ENV['app_backend_url'] . 'tax_class/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'id="messages"')) { - throw new \Exception('Tax rate creation by curl handler was not successful!'); - } - - $id = $this->getClassId($response); - return ['id' => $id]; - } - - /** - * Return saved class id if saved. - * - * @param $response - * @return int|null - */ - protected function getClassId($response) - { - preg_match_all('~tax_class[^\s]*\/id\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php deleted file mode 100644 index 5f949820534..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxClass/TaxClassInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - 'Australia', - 'US' => 'United States', - 'GB' => 'United Kingdom', - ]; - - /** - * Mapping for regions. - * - * @var array - */ - protected $regionId = [ - '0' => '*', - '12' => 'California', - '43' => 'New York', - '57' => 'Texas', - ]; - - /** - * Post request for creating tax rate. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $fixture->getData(); - $data['tax_country_id'] = array_search($data['tax_country_id'], $this->countryId); - if (isset($data['tax_region_id'])) { - $data['tax_region_id'] = array_search($data['tax_region_id'], $this->regionId); - } - - $url = $_ENV['app_backend_url'] . 'tax_rate/save'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'success-msg')) { - throw new \Exception('Tax rate creation by curl handler was not successful!'); - } - - $url = $_ENV['app_backend_url'] . 'tax_rate/index/limit/200'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - $id = $this->getTaxRateId($response); - return ['id' => $id]; - } - - /** - * Return saved tax rate id. - * - * @param $response - * @return int|null - */ - protected function getTaxRateId($response) - { - preg_match_all('~tax_rate/edit[^\s]*\/rate\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php deleted file mode 100644 index 8460a8e14fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRate/TaxRateInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - 3, // Retail Customer - 'tax_product_class' => 2, // Taxable Goods - ]; - - /** - * Post request for creating tax rule. - * - * @param FixtureInterface $fixture [optional] - * @return array - * @throws \Exception - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - - $url = $_ENV['app_backend_url'] . 'tax_rule/save/?back=1'; - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->addOption(CURLOPT_HEADER, 1); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'success-msg')) { - throw new \Exception("Tax rule creation by curl handler was not successful!\nResponse:\n$response"); - } - $id = $this->getTaxRuleId($response); - - return ['id' => $id]; - } - - /** - * Returns data for curl POST params. - * - * @param FixtureInterface $fixture - * @return mixed - * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) - */ - protected function prepareData(FixtureInterface $fixture) - { - $data = $fixture->getData(); - $fields = [ - 'tax_rate', - 'tax_customer_class', - 'tax_product_class', - ]; - - foreach ($fields as $field) { - if (!array_key_exists($field, $data)) { - $data[$field][] = $this->defaultTaxClasses[$field]; - continue; - } - $fieldFixture = $fixture->getDataFieldConfig($field); - $fieldFixture = $fieldFixture['source']->getFixtures(); - foreach ($data[$field] as $key => $value) { - $id = $fieldFixture[$key]->getId(); - if ($id === null) { - $fieldFixture[$key]->persist(); - $id = $fieldFixture[$key]->getId(); - } - $data[$field][$key] = $id; - } - } - - return $data; - } - - /** - * Return saved tax rule id. - * - * @param string $response - * @return int|null - */ - protected function getTaxRuleId($response) - { - preg_match_all('~tax_rule/edit[^\s]*\/rule\/(\d+)~', $response, $match); - - return max(empty($match[1]) ? null : $match[1]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php b/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php deleted file mode 100644 index 4b004b2eeed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Handler/TaxRule/TaxRuleInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml deleted file mode 100644 index 12d363695f9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml deleted file mode 100644 index 45e81c1ebb3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRateNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml deleted file mode 100644 index 1acd761f3c9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml deleted file mode 100644 index 9955a27be4c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Page/Adminhtml/TaxRuleNew.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml deleted file mode 100644 index ef1729fec3d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,970 +0,0 @@ - - - - - - - tax - 1 - Taxable Goods - 2 - - - - - - tax - 1 - None - - - - - - - tax - 1 - Shipping Origin - origin - - - - - - tax - 1 - Shipping Address - shipping - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - Excluding Tax - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Not Taxed - - - - tax - 1 - No - - - - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Including Tax - 2 - - - tax - 1 - Yes - 1 - - - - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Yes - 1 - - - tax - 1 - No - - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Including and Excluding Tax - 3 - - - tax - 1 - Yes - 1 - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Row Total - ROW_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - - UNIT_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Before Discount - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Unit Price - UNIT_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - Before Discount - - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - - - - tax - 1 - Unit Price - UNIT_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml deleted file mode 100644 index 457df2bc86f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxClass.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - 2 - Taxable Goods - PRODUCT - 2 - Taxable Goods - - - - None - PRODUCT - 0 - - - - 3 - Retail Customer - CUSTOMER - 3 - Retail Customer - - - - Customer Tax Class %isolation% - CUSTOMER - - - - Product Tax Class %isolation% - PRODUCT - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml deleted file mode 100644 index 277b5dee5c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRate.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Tax Rate %isolation% - 10 - United States - * - California - - - - TaxIdentifier%isolation% - * - Australia - 20 - - - - TaxIdentifier%isolation% - United States - * - * - 8.2500 - - - - 1 - United States - 12 - * - US-CA-*-Rate 1 - 8.2500 - 1 - US-CA-*-Rate 1 - - - - 2 - United States - 43 - * - US-NY-*-Rate 1 - 8.3750 - 2 - US-NY-*-Rate 1 - - - - TaxIdentifier%isolation% - Yes - 90001 - 96162 - United States - California - 15.5 - - - - TaxIdentifierTexas%isolation% - * - United States - Texas - 10 - - - - TaxIdentifierNewYork%isolation% - * - United States - New York - 20 - - - - TaxIdentifierCalifornia%isolation% - * - United States - California - 30 - - - - Tax Rate %isolation% - 8.25 - United States - 90230 - California - - - - Tax Rate %isolation% - 8.25 - United States - * - California - - - - Tax Rate %isolation% - 8.375 - United States - * - California - - - - Tax Rate %isolation% - 8.375 - United States - New York - * - - - - Tax Rate %isolation% - 8.25 - United States - New York - * - - - - 1 - United States - California - * - US-CA-*-Rate 1 - 8.2500 - US-CA-*-Rate 1 - 1 - - - - UK full tax %isolation% - 20 - United Kingdom - * - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml deleted file mode 100644 index ba680a00355..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/Repository/TaxRule.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - DefaultTaxRule%isolation% - - - US-CA-*-Rate 1 - US-NY-*-Rate 1 - - - - - - TaxIdentifier%isolation% - - - for_all_states - - - 0 - - - - TaxIdentifier%isolation% - - - tx_rate_10 - ny_rate_20 - ca_rate_30 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25_no_zip - us_ny_rate_8_25 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25_no_zip - us_ny_rate_8_375 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_375 - us_ny_rate_8_25 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - us_ca_rate_8_25 - us_ny_rate_8_375 - - - 0 - 0 - - - - TaxIdentifier%isolation% - - - US-CA-Rate_1 - - - - - Retail Customer - - - - - Taxable Goods - - - 1 - 1 - - - - TaxIdentifier%isolation% - - - uk-full-tax - - - 0 - 0 - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php deleted file mode 100644 index 30aa73674a7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.php +++ /dev/null @@ -1,64 +0,0 @@ -executeScenario(); - } - - /** - * Delete all tax rules after test and rollback configuration. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'enable_vat_rollback'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml deleted file mode 100644 index 1338ad395a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/AutomaticTaxApplyingBasedOnVatIdTest.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - enable_vat - uk_with_vat - uk_tax_rule - catalogProductSimple::order_default - Flat Rate - Fixed - checkmo - 125.00 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php deleted file mode 100644 index a11e906ffc5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.php +++ /dev/null @@ -1,78 +0,0 @@ - Tax > Manage Tax Zones and Rates. - * 3. Click 'Add New Tax Rate' button. - * 4. Fill in data according to dataset - * 5. Save Tax Rate. - * 6. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6757 - */ -class CreateTaxRateEntityTest extends Injectable -{ - /** - * Tax Rate grid page. - * - * @var TaxRateIndex - */ - protected $taxRateIndexPage; - - /** - * Tax Rate new/edit page. - * - * @var TaxRateNew - */ - protected $taxRateNewPage; - - /** - * Injection data. - * - * @param TaxRateIndex $taxRateIndexPage - * @param TaxRateNew $taxRateNewPage - * @return void - */ - public function __inject(TaxRateIndex $taxRateIndexPage, TaxRateNew $taxRateNewPage) - { - $this->taxRateIndexPage = $taxRateIndexPage; - $this->taxRateNewPage = $taxRateNewPage; - } - - /** - * Create Tax Rate Entity test. - * - * @param TaxRate $taxRate - * @return void - */ - public function test(TaxRate $taxRate) - { - // Steps: - $this->taxRateIndexPage->open(); - $this->taxRateIndexPage->getPageActionsBlock()->addNew(); - $this->taxRateNewPage->getTaxRateForm()->fill($taxRate); - $this->taxRateNewPage->getFormPageActions()->save(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml deleted file mode 100644 index 95c08d4b5de..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRateEntityTest.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - TaxIdentifier%isolation% - No - - - - - * - Australia - 20 - - - - - - - TaxIdentifier%isolation% - Yes - 90001 - 96162 - - - United States - California - 15.5 - - - - - - - TaxIdentifier%isolation% - No - - - - - 180 - Canada - * - 25 - - - - - - - TaxIdentifier%isolation% - Yes - 0 - 7800935 - - - United Kingdom - 7.75 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php deleted file mode 100644 index d821a653e8f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.php +++ /dev/null @@ -1,89 +0,0 @@ - Tax -> Manage Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Fill in data according to dataset. - * 5. Save Tax Rule. - * 6. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6767 - */ -class CreateTaxRuleEntityTest extends Injectable -{ - /** - * Tax rule index page. - * - * @var TaxRuleIndex - */ - protected $taxRuleIndexPage; - - /** - * Tax rule form page. - * - * @var TaxRuleNew - */ - protected $taxRuleNewPage; - - /** - * Injection data. - * - * @param TaxRuleIndex $taxRuleIndexPage - * @param TaxRuleNew $taxRuleNewPage - * @return void - */ - public function __inject(TaxRuleIndex $taxRuleIndexPage, TaxRuleNew $taxRuleNewPage) - { - $this->taxRuleIndexPage = $taxRuleIndexPage; - $this->taxRuleNewPage = $taxRuleNewPage; - } - - /** - * Test create tax rule. - * - * @param TaxRule $taxRule - * @return void - */ - public function test(TaxRule $taxRule) - { - // Steps - $this->taxRuleIndexPage->open(); - $this->taxRuleIndexPage->getPageActionsBlock()->addNew(); - $this->taxRuleNewPage->getTaxRuleForm()->fill($taxRule); - $this->taxRuleNewPage->getFormPageActions()->save(); - } - - /** - * Delete all tax rules. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml deleted file mode 100644 index 2fbddc13c85..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - TaxIdentifier%isolation% - US-CA-*-Rate 1 - US-NY-*-Rate 1 - - - customer_tax_class - - - product_tax_class - - - 1 - 1 - - - - - - TaxIdentifier%isolation% - default - - - - - Retail Customer - customer_tax_class - Taxable Goods - - - - - 1 - - - - - - TaxIdentifier%isolation% - withZipRange - default - - - Retail Customer - customer_tax_class - Taxable Goods - product_tax_class - 1 - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php deleted file mode 100644 index 7f80a002309..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.php +++ /dev/null @@ -1,82 +0,0 @@ - Tax -> Manage Tax Zones and Rates. - * 3. Open created tax rate. - * 4. Click "Delete Rate" button. - * 5. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-7656 - */ -class DeleteTaxRateEntityTest extends Injectable -{ - /** - * Tax Rate grid page. - * - * @var TaxRateIndex - */ - protected $taxRateIndex; - - /** - * Tax Rate edit page. - * - * @var TaxRateEdit - */ - protected $taxRateEdit; - - /** - * Injection data. - * - * @param TaxRateIndex $taxRateIndex - * @param TaxRateEdit $taxRateEdit - * @return void - */ - public function __inject(TaxRateIndex $taxRateIndex, TaxRateEdit $taxRateEdit) - { - $this->taxRateIndex = $taxRateIndex; - $this->taxRateEdit = $taxRateEdit; - } - - /** - * Delete Tax Rate Entity test. - * - * @param TaxRate $taxRate - * @return void - */ - public function testDeleteTaxRate(TaxRate $taxRate) - { - // Precondition - $taxRate->persist(); - - // Steps - $this->taxRateIndex->open(); - $this->taxRateIndex->getTaxRatesGrid()->searchAndOpen(['code' => $taxRate->getCode()]); - $this->taxRateEdit->getFormPageActions()->deleteAndAcceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml deleted file mode 100644 index 4618b3bc1ad..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/DeleteTaxRateEntityTest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - default - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php deleted file mode 100644 index 974e3c49aed..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.php +++ /dev/null @@ -1,99 +0,0 @@ - Taxes > Tax Rules. - * 3. Click 'Add New Tax Rule' button. - * 4. Assign default rates to rule. - * 5. Save Tax Rate. - * 6. Go to Products > Catalog. - * 7. Add new product. - * 8. Fill data according to dataset. - * 9. Save product. - * 10. Go to Stores > Configuration. - * 11. Fill Tax configuration according to data set. - * 12. Save tax configuration. - * 13. Perform all assertions. - * - * @group Tax_(CS) - * @ZephyrId MPERF-6987 - */ -class TaxCalculationTest extends Scenario -{ - /** - * Delete all tax rules. - * - * @return void - */ - public function __prepare() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } - - /** - * Runs tax calculation test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Tear down after each test. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('\Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create('\Mage\SalesRule\Test\TestStep\DeleteAllSalesRuleStep')->run(); - $this->objectManager->create('\Mage\CatalogRule\Test\TestStep\DeleteAllCatalogRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - } - - /** - * Setup default configuration after test. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'shipping_tax_class_taxable_goods', 'rollback' => true] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml deleted file mode 100644 index 540bcafa693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxCalculationTest.xml +++ /dev/null @@ -1,330 +0,0 @@ - - - - - - Simple product tier price with sales rule, customer tax equals store tax and catalog price including tax - shipping_tax_class_taxable_goods, row_cat_incl_ship_excl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 277.14 - 300.00 - 277.14 - 300.00 - 13.86 - 15.00 - 41.57 - 45.00 - 41.57 - 45.00 - 20.79 - 15.00 - 16.24 - 3.09 - 37.36 - 40.45 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, row_cat_excl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 90.99 - 98.61 - 90.99 - 98.61 - 90.99 - 98.61 - 272.97 - 295.83 - 272.97 - 295.83 - 147.92 - 13.86 - 15.02 - 24.02 - 138.91 - 162.93 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax less than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 90.99 - 98.50 - 90.99 - 98.50 - 90.99 - 98.50 - 272.97 - 295.49 - 272.97 - 295.49 - 136.49 - 13.84 - 14.98 - 12.40 - 150.32 - 162.72 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, row_cat_incl_ship_excl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 83.05 - 89.90 - 83.05 - 89.90 - 83.05 - 89.90 - 249.15 - 269.70 - 249.15 - 269.70 - 134.85 - 15.00 - 16.24 - 21.79 - 129.30 - 151.09 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product tier price with sales rule, customer tax less than store tax and catalog price including tax - shipping_tax_class_taxable_goods, unit_cat_incl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_less_store_rate - johndoe_unique - 276.81 - 299.65 - 276.81 - 299.65 - 13.84 - 14.98 - 41.52 - 44.94 - 41.52 - 44.94 - 22.47 - 13.84 - 14.98 - 4.56 - 32.89 - 37.45 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_before_disc_on_incl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 90.00 - 97.43 - 90.00 - 97.43 - 90.00 - 97.43 - 270.00 - 292.28 - 270.00 - 292.28 - 146.14 - 13.86 - 15.00 - 23.42 - 137.72 - 161.14 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product group price with sales rule, customer tax equals store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, unit_cat_excl_ship_excl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_equals_store_rate - johndoe_unique - 90.99 - 98.50 - 90.99 - 98.50 - 90.99 - 98.50 - 272.97 - 295.50 - 272.97 - 295.50 - 136.49 - 15.00 - 16.24 - 12.49 - 151.48 - 163.97 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax greater than store tax and catalog price including tax - shipping_tax_class_taxable_goods, total_cat_incl_ship_excl_before_disc_on_excl, display_excluding_including_tax - catalogProductSimple::simple_with_group_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 84.06 - 91.10 - 84.06 - 91.10 - 84.06 - 91.10 - 252.18 - 273.30 - 252.18 - 273.30 - 126.09 - 15.00 - 16.26 - 22.38 - 141.09 - 163.47 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product tier price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, total_cat_excl_ship_incl_after_disc_on_incl, display_excluding_including_tax - catalogProductSimple::simple_with_tier_price - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 300.00 - 325.13 - 300.00 - 325.13 - 15.00 - 16.26 - 45.00 - 48.77 - 45.00 - 48.77 - 24.39 - 13.86 - 15.02 - 2.89 - 34.47 - 37.36 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - Simple product special price with sales rule, customer tax greater than store tax and catalog price excluding tax - shipping_tax_class_taxable_goods, unit_cat_excl_ship_incl_after_disc_on_excl, display_excluding_including_tax - catalogProductSimple::product_with_special_price_and_category - active_sales_rule_for_all_groups_no_coupon - customer_greater_store_rate - johndoe_unique - 90.00 - 97.54 - 90.00 - 97.54 - 90.00 - 97.54 - 270.00 - 292.62 - 270.00 - 292.62 - 135.00 - 13.86 - 15.02 - 12.47 - 148.86 - 161.33 - Flat Rate - Fixed - checkmo - Estimate_US_address_NY - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php deleted file mode 100644 index 02dff819096..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.php +++ /dev/null @@ -1,214 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Injection data. - * - * @param PromoQuoteIndex $promoQuoteIndex - * @param PromoQuoteEdit $promoQuoteEdit - * @param CatalogRuleIndex $catalogRuleIndex - * @param CatalogRuleEdit $catalogRuleEdit - * @param FixtureFactory $fixtureFactory - * @return array - */ - public function __inject( - PromoQuoteIndex $promoQuoteIndex, - PromoQuoteEdit $promoQuoteEdit, - CatalogRuleIndex $catalogRuleIndex, - CatalogRuleEdit $catalogRuleEdit, - FixtureFactory $fixtureFactory - ) { - $this->promoQuoteIndex = $promoQuoteIndex; - $this->promoQuoteEdit = $promoQuoteEdit; - $this->catalogRuleIndex = $catalogRuleIndex; - $this->catalogRuleEdit = $catalogRuleEdit; - $this->fixtureFactory = $fixtureFactory; - - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'cross_border_tax_rule']); - $taxRule->persist(); - - return ['customers' => $this->createCustomers()]; - } - - /** - * Create customers. - * - * @return array - */ - protected function createCustomers() - { - $customersData = ['johndoe_unique_TX', 'johndoe_unique']; - $customers = []; - foreach ($customersData as $customerData) { - $customer = $this->fixtureFactory->createByCode('customer', ['dataset' => $customerData]); - $customer->persist(); - $customers[] = $customer; - } - - return $customers; - } - - /** - * Test product prices with tax. - * - * @param CatalogProductSimple $product - * @param string $config - * @param string $salesRule - * @param string $catalogRule - * @return void - */ - public function test(CatalogProductSimple $product, $config, $salesRule, $catalogRule) - { - // Steps: - if ($salesRule !== "-") { - $salesRule = $this->fixtureFactory->createByCode('salesRule', ['dataset' => $salesRule]); - $salesRule->persist(); - $this->salesRule = $salesRule; - } - if ($catalogRule !== "-") { - $catalogRule = $this->fixtureFactory->createByCode('catalogRule', ['dataset' => $catalogRule]); - $catalogRule->persist(); - $this->catalogRule = $catalogRule; - } - $this->objectManager->create('Mage\Core\Test\TestStep\SetupConfigurationStep', ['configData' => $config]) - ->run(); - $product->persist(); - } - - /** - * Delete sales rule, catalog rule, all tax rules and setup default tax configuration. - * - * @return void - */ - public function tearDown() - { - if (isset($this->salesRule)) { - $this->promoQuoteIndex->open(); - $this->promoQuoteIndex->getPromoQuoteGrid()->searchAndOpen(['name' => $this->salesRule->getName()]); - $this->promoQuoteEdit->getFormPageActions()->delete(); - $this->salesRule = null; - } - if (isset($this->catalogRule)) { - $this->catalogRuleIndex->open(); - $this->catalogRuleIndex->getCatalogRuleGrid()->searchAndOpen(['name' => $this->catalogRule->getName()]); - $this->catalogRuleEdit->getFormPageActions()->delete(); - $this->catalogRule = null; - } - $this->objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - } - - /** - * Rollback default configuration. - * - * @return void - */ - public static function tearDownAfterClass() - { - $objectManager = ObjectManager::getInstance(); - $objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $objectManager->create('\Mage\Tax\Test\TestStep\CreateTaxRuleStep', ['taxRule' => 'default'])->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml deleted file mode 100644 index 77f1152c29c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestCase/TaxWithCrossBorderTest.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - Cross border include tax - product_with_special_price_and_category - - - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border include tax and with Catalog rule - product_with_category - catalog_price_rule_priority_0 - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - - Cross border include tax and with Sales rule - product_with_category - - - cart_rule - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border include tax and product with custom options - with_one_custom_option_and_category - - - - - cross_border_enabled_price_incl_tax, display_excluding_including_tax - - - - Cross border exclude tax - product_with_category - - - - - cross_border_enabled_price_excl_tax, display_excluding_including_tax - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php deleted file mode 100644 index 47fd1da7abd..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/CreateTaxRuleStep.php +++ /dev/null @@ -1,66 +0,0 @@ -fixtureFactory = $fixtureFactory; - $this->taxRule = $taxRule; - } - - /** - * Create tax rule. - * - * @return array - */ - public function run() - { - $result['taxRule'] = null; - if ($this->taxRule != '-') { - $taxRule = $this->fixtureFactory->createByCode('taxRule', ['dataset' => $this->taxRule]); - $taxRule->persist(); - $result['taxRule'] = $taxRule; - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php b/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php deleted file mode 100644 index 67609b6e68b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/TestStep/DeleteAllTaxRulesStep.php +++ /dev/null @@ -1,66 +0,0 @@ -taxRuleIndexPage = $taxRuleIndexPage; - $this->taxRuleNewPage = $taxRuleNewPage; - } - - /** - * Delete all Tax Rules on backend. - * - * @return array - */ - public function run() - { - $this->taxRuleIndexPage->open(); - $this->taxRuleIndexPage->getTaxRuleGrid()->resetFilter(); - while ($this->taxRuleIndexPage->getTaxRuleGrid()->isFirstRowVisible()) { - $this->taxRuleIndexPage->getTaxRuleGrid()->openFirstRow(); - $this->taxRuleNewPage->getFormPageActions()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml deleted file mode 100644 index ecf91e67e6d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/curl/di.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml deleted file mode 100644 index ba3e5118592..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/fixture.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - flat - tax_class - Mage\Tax\Model\Resource\Class\Collection - - - id - virtual - - - - - flat - tax_calculation_rate - Mage\Tax\Model\Resource\Calculation\Rate\Collection - code - - - id - virtual - - - - - flat - tax_calculation_rule - Mage\Tax\Model\Resource\Calculation\Rule\Collection - code - - - tax_rate - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxRate - - - tax_customer_class - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxClass - - - tax_product_class - virtual - Mage\Tax\Test\Fixture\TaxRule\TaxClass - - - - diff --git a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml deleted file mode 100644 index bd202d845a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Tax/Test/etc/testcase.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php deleted file mode 100644 index 33de5f02a08..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Links.php +++ /dev/null @@ -1,53 +0,0 @@ -_rootElement->find(sprintf($this->linkSelector, $linkTitle))->click(); - } - - /** - * Check is link is visible. - * - * @param string $linkTitle - * @return bool - */ - public function isLinkVisible($linkTitle) - { - return $this->_rootElement->find(sprintf($this->linkSelector, $linkTitle))->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php deleted file mode 100644 index 4bb2bf177bb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/Title.php +++ /dev/null @@ -1,34 +0,0 @@ -_rootElement->getText(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php b/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php deleted file mode 100644 index c322f3223b9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Theme/Test/Block/TopLinks.php +++ /dev/null @@ -1,117 +0,0 @@ -_rootElement->find($this->cartContent)->isVisible()) { - $this->_rootElement->find($this->cartLink)->click(); - } - } - - /** - * Open Account Link. - * - * @return void - */ - public function openAccount() - { - $this->_rootElement->find($this->accountLink)->click(); - } - - /** - * Get account label text. - * - * @return string - */ - public function getAccountLabelText() - { - return $this->_rootElement->find($this->accountLabel)->getText(); - } - - /** - * Open account's links. - * - * @param string $linkTitle - * @return void - */ - public function openAccountLink($linkTitle) - { - $this->openAccount(); - $this->getAccountLinksBlock()->openLink($linkTitle); - } - - /** - * Get accounts link block. - * - * @return Links - */ - protected function getAccountLinksBlock() - { - return $this->blockFactory->create( - 'Mage\Theme\Test\Block\Links', - ['element' => $this->_rootElement->find($this->accountLinksBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php deleted file mode 100644 index 053d7a638b0..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Cart.php +++ /dev/null @@ -1,31 +0,0 @@ - [ - 'selector' => '.product-cart-price .cart-price .price' - ], - 'subtotal' => [ - 'selector' => '.product-cart-total .cart-price .price' - ], - 'cart_item_price' => [ - 'selector' => '.product-cart-price .cart-price .price' - ], - 'cart_item_subtotal' => [ - 'selector' => '.product-cart-total .cart-price .price' - ], - 'price_fpt' => [ - 'selector' => '.product-cart-price .weee .price' - ], - 'price_fpt_total' => [ - 'selector' => '.product-cart-price .cart-tax-total .weee .price' - ], - 'subtotal_fpt' => [ - 'selector' => '.product-cart-total .weee .price' - ], - 'subtotal_fpt_total' => [ - 'selector' => '.product-cart-total .cart-tax-total .weee .price' - ], - 'cart_item_subtotal_incl_tax' => [ - 'selector' => '.product-cart-total .cart-tax-total .price' - ], - 'cart_item_price_incl_tax' => [ - 'selector' => '.product-cart-price[data-rwd-tax-label="Incl. Tax"] .cart-tax-total .price' - ] - ]; - - /** - * Open fpt blocks. - * - * @return void - */ - public function openFpt() - { - $fptBlocks = $this->_rootElement->getElements($this->fpt); - $fptPricesBlocks = $this->_rootElement->getElements($this->price); - foreach ($fptBlocks as $key => $fptBlock) { - if (!$fptBlock->isVisible()) { - $fptPricesBlocks[$key]->click(); - } - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php deleted file mode 100644 index f59f555bcd6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ListProduct.php +++ /dev/null @@ -1,48 +0,0 @@ -productItem, $product->getName()); - return $this->blockFactory->create( - 'Mage\Weee\Test\Block\Product\ProductList\ProductItem', - ['element' => $this->_rootElement->find($locator, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php deleted file mode 100644 index 5a750c60490..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/Price.php +++ /dev/null @@ -1,54 +0,0 @@ - [ - 'selector' => '.regular-price .price' - ], - 'special_price' => [ - 'selector' => '.special-price .price' - ], - 'category_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'category_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_incl_tax' => [ - 'selector' => '.price-including-tax span.price' - ], - 'product_view_price_excl_tax' => [ - 'selector' => '.price-excluding-tax span.price' - ], - 'fpt_price' => [ - 'selector' => '.weee .price' - ], - 'final_price' => [ - 'selector' => '[id^="product-price-weee"] .price' - ] - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php deleted file mode 100644 index 4bb91fbca12..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/ProductList/ProductItem.php +++ /dev/null @@ -1,45 +0,0 @@ -blockFactory->create( - 'Mage\Weee\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBlockClass)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php deleted file mode 100644 index d9cb75510a6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Block/Product/View.php +++ /dev/null @@ -1,42 +0,0 @@ -blockFactory->create( - 'Mage\Weee\Test\Block\Product\Price', - ['element' => $this->_rootElement->find($this->priceBox)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php b/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php deleted file mode 100644 index c1b61df6d23..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php +++ /dev/null @@ -1,248 +0,0 @@ -open()->getPageActions()->flushCacheStorage(); - $this->product = $product; - $this->expectedPrices = $prices; - $this->cmsIndex = $cmsIndex; - $this->catalogCategoryView = $catalogCategoryView; - $this->catalogProductView = $catalogProductView; - $this->checkoutCart = $checkoutCart; - $this->fptLabel = $this->getFptLabel($product); - $this->clearShoppingCart(); - - $error = $this->verifyData($prices, $this->getPrices()); - \PHPUnit_Framework_Assert::assertEmpty($error, $error); - } - - /** - * Get fpt label. - * - * @param InjectableFixture $product - * @return string - */ - protected function getFptLabel(InjectableFixture $product) - { - return $product->getDataFieldConfig('attribute_set_id')['source'] - ->getAttributeSet()->getDataFieldConfig('assigned_attributes')['source'] - ->getAttributes()[0]->getFrontendLabel(); - } - - /** - * Clear shopping cart. - * - * @return void - */ - protected function clearShoppingCart() - { - $this->checkoutCart->open(); - $this->checkoutCart->getCartBlock()->clearShoppingCart(); - } - - /** - * Get prices with fpt on category, product and cart pages. - * - * @return array - */ - protected function getPrices() - { - $actualPrices = []; - foreach ($this->expectedPrices as $priceType => $prices) { - $actualPrices[$priceType] = $this->{'get' . ucfirst($priceType) . 'Price'}(); - } - - return $actualPrices; - } - - /** - * Get prices on category page. - * - * @return array - */ - protected function getCategoryPrice() - { - $prices = []; - $this->cmsIndex->open(); - $this->cmsIndex->getTopmenu()->selectCategory($this->product->getCategoryIds()[0]); - $priceBlock = $this->catalogCategoryView->getWeeeListProductBlock()->getProductItem($this->product) - ->getPriceBlock(); - foreach ($this->expectedPrices['category'] as $key => $type) { - $prices[$key] = $this->getPrice($priceBlock, $key); - } - - return $prices; - } - - /** - * Get price. - * - * @param Price $block - * @param string $type - * @param string $currency - * @return string|null - */ - protected function getPrice(Price $block, $type, $currency = '$') - { - $price = $block->getTypePriceElement($type); - return $price->isVisible() ? trim($price->getText(), $currency) : null; - } - - /** - * Fill options, get price and add to cart. - * - * @return array - */ - protected function getProductPrice() - { - $prices = []; - $this->catalogCategoryView->getListProductBlock()->openProductViewPage($this->product->getName()); - $priceBlock = $this->catalogProductView->getWeeeViewBlock()->getPriceBlock(); - $this->catalogProductView->getViewBlock()->fillOptions($this->product); - foreach ($this->expectedPrices['product'] as $key => $type) { - $prices[$key] = $this->getPrice($priceBlock, $key); - } - - return $prices; - } - - /** - * Get cart prices. - * - * @return array - */ - protected function getCartItemPrice() - { - $prices = []; - $this->catalogProductView->getViewBlock()->clickAddToCart(); - $productWeeeItem = $this->checkoutCart->getWeeeCartBlock()->getCartItem($this->product); - $productWeeeItem->openFpt(); - foreach ($this->expectedPrices['cartItem'] as $key => $type) { - $prices[$key] = $productWeeeItem->getCartItemTypePrice($key); - } - - return $prices; - } - - /** - * Get grand total. - * - * @return array - */ - protected function getTotalPrice() - { - $prices = []; - foreach ($this->expectedPrices['total'] as $key => $type) { - $prices[$key] = $this->checkoutCart->getTotalsBlock()->getData($key); - } - - return $prices; - } - - /** - * Text of fpt is applied. - * - * @return string - */ - public function toString() - { - return 'FPT is applied to product.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml deleted file mode 100644 index 670a80a554d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Category/CatalogCategoryView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml deleted file mode 100644 index 3f8cb3ab3a8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/CheckoutCart.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml deleted file mode 100644 index a531ffb454b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Page/Product/CatalogProductView.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml deleted file mode 100644 index 31280cee68f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/Repository/ConfigData.xml +++ /dev/null @@ -1,650 +0,0 @@ - - - - - - - tax - 1 - No - - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - No - - - - tax - 1 - No - - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Yes - 1 - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Excluding Tax - - - - tax - 1 - Excluding Tax - - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - After Discount - 1 - - - tax - 1 - Excluding Tax - - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - Excluding FPT, FPT description, final price - 2 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - - tax - 1 - Total - TOTAL_BASE_CALCULATION - - - tax - 1 - Including Tax - 1 - - - tax - 1 - Including Tax - 1 - - - tax - 1 - - - - - tax - 1 - Including Tax - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - Including FPT and FPT description - 1 - - - tax - 1 - No - - - - tax - 1 - Yes - 1 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php b/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php deleted file mode 100644 index a39c43d513b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.php +++ /dev/null @@ -1,90 +0,0 @@ -objectManager->create('Mage\Tax\Test\TestStep\DeleteAllTaxRulesStep')->run(); - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration'] - )->run(); - $customer = $fixtureFactory->createByCode('customer', ['dataset' => 'johndoe_with_addresses']); - $customer->persist(); - $taxRule = $fixtureFactory->createByCode('taxRule', ['dataset' => 'tax_rule_default']); - $taxRule->persist(); - $productTemplate = $fixtureFactory->createByCode( - 'catalogAttributeSet', - ['dataset' => 'custom_attribute_set_with_fpt'] - ); - $productTemplate->persist(); - - return [ - 'customer' => $customer, - 'data' => ['attribute_set_id' => ['attribute_set' => $productTemplate]] - ]; - } - - /** - * Run create tax with Fpt test. - * - * @return void - */ - public function test() - { - $this->executeScenario(); - } - - /** - * Revert configuration to default. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create( - 'Mage\Core\Test\TestStep\SetupConfigurationStep', - ['configData' => 'default_tax_configuration,shipping_tax_class_taxable_goods_rollback'] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml deleted file mode 100644 index 545db9c6f1b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/TestCase/CreateTaxWithFptTest.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - Check with next configuration "not taxed FPT display set to Excluding, Description and Including FPT on product with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 70.00 - 10.00 - 80.00 - 70.00 - 10.00 - 100.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 118.25 - - - - Check with next configuration "not taxed FPT display set to Including FPT and Description on product with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_custom_option_and_fpt - 75.78 - 10.00 - 85.78 - 75.78 - 10.00 - 118.25 - 108.25 - 118.25 - 10.00 - 108.25 - 118.25 - 10.00 - 118.25 - 110 - - - - Check with next configuration "not taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 118.25 - 108.25 - 10.00 - 118.25 - 108.25 - 10.00 - 108.25 - 118.25 - 10.00 - 108.25 - 118.25 - 10.00 - 118.25 - - - - Check with next configuration "not taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_cat_excl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110 - 100 - 10.00 - 110 - 100 - 10.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 118.25 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 70.00 - 10.00 - 80.00 - 70.00 - 10.00 - 100.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 119.08 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with with custom option catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_custom_option_and_fpt - 86.61 - 10.83 - 119.08 - 10.83 - 119.08 - 10.83 - 119.08 - 10.83 - 110 - 119.08 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 119.08 - 10 - 119.08 - 10 - 119.08 - 10.83 - 119.08 - 10.83 - 110 - 119.08 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with special price catalog price Excluding Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_excl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110.83 - 100 - 10.00 - 110.83 - 100 - 10.00 - 100 - 110 - 10.00 - 100 - 110 - 10.00 - 119.08 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with special price and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_excl - catalogProductSimple::with_special_price_and_fpt - 110.83 - 92.38 - 10.00 - 110.83 - 92.38 - 10.00 - 92.38 - 102.38 - 10.00 - 92.38 - 102.38 - 10.00 - 110.83 - - - - Check with next configuration "taxed FPT display set to Including FPT and Description on product with with special price and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_incl, display_including_tax - catalogProductSimple::with_special_price_and_fpt - 110.83 - 10 - 110.83 - 10 - 110.83 - 10.83 - 110.83 - 10.83 - 102.38 - 110.83 - - - - Check with next configuration "taxed FPT display set to Excluding, Description and Including FPT on product with with custom option and catalog price Including Tax" - shipping_tax_class_taxable_goods,tax_with_fpt_taxed_cat_incl_disc_on_excl - catalogProductSimple::with_custom_option_and_fpt - 64.67 - 10.00 - 74.67 - 64.67 - 10.00 - 92.38 - 92.38 - 102.38 - 10.00 - 92.38 - 102.38 - 10.00 - 110.83 - - - - diff --git a/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml deleted file mode 100644 index e1da97258d6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Weee/Test/etc/testcase.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php deleted file mode 100644 index afe5b174f68..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/FormPageActions.php +++ /dev/null @@ -1,33 +0,0 @@ -_rootElement->find($this->deleteButton)->click(); - $this->browser->acceptAlert(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php deleted file mode 100644 index aa0634d62d1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php +++ /dev/null @@ -1,87 +0,0 @@ - '\Mage\Adminhtml\Test\Block\Cms\Page\Widget\Chooser', - ]; - - /** - * Select widget options. - * - * @param array $value - * @return void - */ - public function setValue($value) - { - $this->clickSelectButton(); - if (isset($value['filter_url_key'])) { - $grid = $this->getClassBlock($this->chooserClasses['page']); - $grid->searchAndOpen(['chooser_identifier' => $value['filter_url_key']]); - } - } - - /** - * Clicking to select button. - * - * @return void - */ - protected function clickSelectButton() - { - $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click(); - } - - /** - * Get block by class. - * - * @param string $class - * @return mixed - */ - protected function getClassBlock($class) - { - return \Magento\Mtf\ObjectManager::getInstance()->create( - $class, - ['element' => $this->driver->find($this->selectBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php deleted file mode 100644 index c1d08962693..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdates.php +++ /dev/null @@ -1,128 +0,0 @@ - $field) { - $this->addLayoutUpdates(); - /** @var LayoutForm $layoutForm */ - $layoutForm = $this->getLayoutForm($field['page_group'], $key); - $layoutForm->fillForm($field); - } - return $this; - } - - /** - * Get layout form. - * - * @param string $field - * @param string $key - * - * @return BlockInterface - */ - protected function getLayoutForm($field, $key) - { - $path = 'Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdatesType\\'; - $pageGroup = explode('/', $field); - /** @var LayoutForm $layoutForm */ - return $this->blockFactory->create( - $path . str_replace(" ", "", $pageGroup[0]), - ['element' => $this->_rootElement->find(sprintf($this->formSelector, $key), Locator::SELECTOR_XPATH)] - ); - } - - /** - * Click Add Layout Updates button. - * - * @return void - */ - protected function addLayoutUpdates() - { - $this->_rootElement->find($this->addLayoutUpdates)->click(); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Get data of content tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array|null - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $data = []; - foreach ($fields['layout'] as $key => $layout) { - $layoutForm = $this->getLayoutForm($layout['page_group'], $key); - $data['layout'][] = $layoutForm->getDataFormTab($layout, $element); - } - - return $data; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php deleted file mode 100644 index a63a598129c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.php +++ /dev/null @@ -1,38 +0,0 @@ -dataMapping($fields); - - return $this->_getData($dataMapping, $element); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml deleted file mode 100644 index 348122ada0d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/GenericPages.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - .page_group_select - optgroupselect - - - .block_reference select - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php deleted file mode 100644 index 6d7d0e5fe75..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/LayoutForm.php +++ /dev/null @@ -1,92 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($layoutFields); - foreach ($mapping as $key => $values) { - $this->_fill([$key => $values], $element); - $this->getTemplateBlock()->waitLoader(); - } - } - - /** - * Getting options data form on the product form. - * - * @param array $fields [optional] - * @param Element $element [optional] - * @return array - */ - public function getDataOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php deleted file mode 100644 index 73a03727d5b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Product/Grid.php +++ /dev/null @@ -1,51 +0,0 @@ - [ - 'selector' => 'input[name="chooser_name"]', - ], - 'sku' => [ - 'selector' => 'input[name="chooser_sku"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php deleted file mode 100644 index 6994463b545..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.php +++ /dev/null @@ -1,126 +0,0 @@ -dataMapping($widgetOptionsFields); - $fields = array_diff_key($mapping, ['entities' => '']); - foreach ($fields as $key => $field) { - $this->_fill([$key => $field], $this->_rootElement); - $this->getTemplateBlock()->waitLoader(); - } - if (isset($mapping['entities'])) { - $this->selectEntitiesInGrid($mapping['entities']); - } - } - - /** - * Select entities in grid on layout tab. - * - * @param array $entities - * @return void - */ - protected function selectEntitiesInGrid(array $entities) - { - foreach($entities['value'] as $entity) { - $this->_rootElement->find($this->chooser, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - /** @var Grid $productGrid */ - $productGrid = $this->getProductGrid(); - $productGrid->searchAndSelect(['name' => $entity['name']]); - $this->getTemplateBlock()->waitLoader(); - $this->_rootElement->find($this->apply, Locator::SELECTOR_XPATH)->click(); - } - } - - /** - * Get product grid. - * - * @return BlockInterface - */ - protected function getProductGrid() - { - return $this->blockFactory->create( - 'Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdatesType\Product\Grid', - [ - 'element' => $this->_rootElement->find($this->productGrid, Locator::SELECTOR_XPATH) - ] - ); - } - - /** - * Get data of tab. - * - * @param array|null $fields - * @param Element|null $element - * @return array - */ - public function getDataFormTab($fields = null, Element $element = null) - { - $dataMapping = $this->dataMapping($fields); - $data = $this->_getData($dataMapping, $element); - if (isset($dataMapping['entities'])) { - $data['entities'] = $this->getProducts($dataMapping['entities']['value']); - } - return $data; - } - - /** - * Get products. - * - * @param array $products - * @return array - */ - protected function getProducts(array $products) - { - $result = []; - /** @var Grid $productGrid */ - $productGrid = $this->getProductGrid(); - foreach ($products as $key => $product) { - $this->_rootElement->find($this->chooser, Locator::SELECTOR_XPATH)->click(); - $this->getTemplateBlock()->waitLoader(); - if ($productGrid->isSelect(['sku' => $product['sku']])) { - $result[$key]['name'] = $product['name']; - } - } - return $result; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml deleted file mode 100644 index 453abf5cc4e..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/LayoutUpdatesType/Products.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - .page_group_select - optgroupselect - - - //div[@class="products group_container"]//*[@class="radio for_specific"] - xpath - checkbox - - - .chooser - - - .block_reference select - select - - - - diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php deleted file mode 100644 index ac8c445ced4..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ /dev/null @@ -1,55 +0,0 @@ -_rootElement->find($this->continueButton)->click(); - } - - /** - * Fill data to fields on tab. - * - * @param array $fields - * @param Element|null $element - * @return $this - */ - public function fillFormTab(array $fields, Element $element = null) - { - parent::fillFormTab($fields, $element); - $this->clickContinue(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php deleted file mode 100644 index 60f670adb61..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptions.php +++ /dev/null @@ -1,74 +0,0 @@ -path . ucfirst($fields['widgetOptions']['value']['type_id']); - unset($fields['widgetOptions']['value']['type_id']); - foreach ($fields['widgetOptions']['value'] as $field) { - /** @var WidgetOptionsForm $widgetOptionsForm */ - $widgetOptionsForm = $this->getWidgetOptionsForm($path); - $widgetOptionsForm->fillForm($field); - } - return $this; - } - - /** - * Get widget options form. - * - * @param string $path - * @return BlockInterface - */ - protected function getWidgetOptionsForm($path) - { - return $this->blockFactory->create( - $path, - ['element' => $this->_rootElement->find($this->formSelector)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php deleted file mode 100644 index be87acc56c8..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/Tab/WidgetOptionsType/WidgetOptionsForm.php +++ /dev/null @@ -1,150 +0,0 @@ -_rootElement : $element; - $mapping = $this->dataMapping($widgetOptionsFields); - $fields = array_diff_key($mapping, ['entities' => '']); - $this->_fill($fields, $element); - if (isset($mapping['entities'])) { - $this->selectEntities($mapping['entities']); - } - } - - /** - * Getting options data form on the widget options form. - * - * @param array $fields - * @param Element $element [optional] - * @return $this - */ - public function getDataOptions(array $fields = null, Element $element = null) - { - $element = $element === null ? $this->_rootElement : $element; - $mapping = $this->dataMapping($fields); - return $this->_getData($mapping, $element); - } - - /** - * Select entities on widget options tab. - * - * @param array $entities - * @return void - */ - protected function selectEntities(array $entities) - { - foreach ($entities['value'] as $entity) { - $this->_rootElement->find($this->selectBlock)->click(); - $this->getTemplateBlock()->waitLoader(); - $grid = $this->getGridBlock(); - $filter = $this->prepareFilter($entity); - $grid->searchAndSelect($filter); - } - } - - /** - * Get grid block. - * - * @return BlockInterface - */ - protected function getGridBlock() - { - return $this->blockFactory->create( - $this->pathToGrid, - ['element' => $this->_rootElement->find($this->gridBlock, Locator::SELECTOR_XPATH)] - ); - } - - /** - * Prepare filter for grid. - * - * @param InjectableFixture $entity - * @return array - */ - protected function prepareFilter(InjectableFixture $entity) - { - return ['title' => $entity->getTitle()]; - } - - /** - * Get template block. - * - * @return Template - */ - public function getTemplateBlock() - { - return $this->blockFactory->create( - 'Magento\Backend\Test\Block\Template', - ['element' => $this->_rootElement->find($this->template, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php deleted file mode 100644 index ab7f7e275fc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.php +++ /dev/null @@ -1,87 +0,0 @@ -getFieldsByTabs($widget); - $this->fillTabs(['settings' => $tabs['settings']]); - unset($tabs['settings']); - $this->fillStoreView($widget); - return $this->fillTabs($tabs, $element); - } - - /** - * Fill store view. - * - * @param Widget $widget - * @return void - */ - protected function fillStoreView(Widget $widget) - { - $this->openTab('frontend_properties'); - $storeViewField = $this->_rootElement->find($this->storeView, Locator::SELECTOR_CSS, 'multiselectgrouplist'); - if($storeViewField->isVisible() && !$widget->hasData('store_ids')) { - $storeViewField->setValue('All Store Views'); - } - } - - /** - * Get data of the tabs. - * - * @param FixtureInterface|null $fixture - * @param Element|null $element - * @return array - */ - public function getData(FixtureInterface $fixture = null, Element $element = null) - { - $widgetType = $fixture->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType) && $widgetType != 'bannerRotator') { - return $this->callRender($widgetType, 'getData', ['InjectableFixture' => $fixture, 'Element' => $element]); - } elseif ($widgetType == 'bannerRotator') { - $fixtureData = $fixture->getData(); - unset($fixtureData['widgetOptions'][0]['entities']); - return $fixtureData; - } else { - return parent::getData($fixture, $element); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml deleted file mode 100644 index 0aecc6f17a5..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/Instance/Edit/WidgetForm.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - \Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\Settings - #widget_instace_tabs_settings_section - css selector - - - select - - - select - - - - - \Mage\Adminhtml\Test\Block\Widget\Tab - #widget_instace_tabs_main_section - css selector - - - <store_ids> - <input>multiselectgrouplist</input> - <selector>[id="store_ids"]</selector> - </store_ids> - </fields> - </frontend_properties> - <widget_options> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\WidgetOptions</class> - <selector>#widget_instace_tabs_properties_section</selector> - <strategy>css selector</strategy> - </widget_options> - <layout_updates> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\Tab\LayoutUpdates</class> - <selector>#widget_instace_tabs_main_section</selector> - <strategy>css selector</strategy> - </layout_updates> -</tabs> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php deleted file mode 100644 index 80abf9e1fc1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block\Adminhtml\Widget; - -/** - * Widget grid on the Widget Instance Index page. - */ -class WidgetGrid extends \Mage\Adminhtml\Test\Block\Widget\Grid -{ - /** - * Locator value for link in action column. - * - * @var string - */ - protected $editLink = 'td.last'; - - /** - * Filters array mapping. - * - * @var array - */ - protected $filters = [ - 'title' => [ - 'selector' => 'input[name="title"]', - ], - ]; -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php deleted file mode 100644 index e6f584d084c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block\Adminhtml; - -use Magento\Mtf\Block\Form; -use Magento\Mtf\Client\Locator; -use Mage\Adminhtml\Test\Block\Template; - -/** - * Backend add widget form. - */ -class WidgetForm extends Form -{ - /** - * Widget type selector. - * - * @var string - */ - protected $widgetType = '[name="widget_type"]'; - - /** - * Insert widget button selector. - * - * @var string - */ - protected $insertButton = '#insert_button'; - - /** - * Template block. - * - * @var string - */ - protected $templateBlock = './ancestor::body'; - - /** - * Add widgets. - * - * @param array $widget - * @return void - */ - public function addWidget(array $widget) - { - $this->selectWidgetType($widget['widget_type']); - $mapping = $this->dataMapping($widget); - $this->_fill($mapping); - $this->insertWidget(); - } - - /** - * Select widget type. - * - * @param string $type - * @return void - */ - protected function selectWidgetType($type) - { - $this->_rootElement->find($this->widgetType, Locator::SELECTOR_CSS, 'select')->setValue($type); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Click Insert Widget button. - * - * @return void - */ - protected function insertWidget() - { - $this->_rootElement->find($this->insertButton)->click(); - $this->getTemplateBlock()->waitLoader(); - } - - /** - * Get template block. - * - * @return Template - */ - protected function getTemplateBlock() - { - return $this->blockFactory->create( - 'Mage\Adminhtml\Test\Block\Template', - ['element' => $this->_rootElement->find($this->templateBlock, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml deleted file mode 100644 index d5370242737..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/Adminhtml/WidgetForm.xml +++ /dev/null @@ -1,43 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <wrapper>parameters</wrapper> - <fields> - <widget_type> - <selector>#select_widget_type</selector> - <input>select</input> - </widget_type> - <anchor_text /> - <title /> - <template> - <input>select</input> - </template> - <chosen_option> - <selector>.btn-chooser</selector> - <class>\Mage\Widget\Test\Block\Adminhtml\Widget\ChosenOption</class> - </chosen_option> - <display_type> - <input>select</input> - </display_type> - <show_pager> - <input>select</input> - </show_pager> - <products_count /> - <cache_lifetime /> - <page_size /> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php deleted file mode 100644 index 52ce160bcd1..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Block/WidgetView.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Block; - -use Mage\Widget\Test\Fixture\Widget; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; - -/** - * Widget block on the frontend. - */ -class WidgetView extends Block -{ - /** - * Widgets selectors. - * - * @var array - */ - protected $widgetSelectors = []; - - /** - * Check widget. - * - * @param Widget $widget - * @param string $pageName - * @return array - * @throws \Exception - */ - public function checkWidget(Widget $widget, $pageName) - { - $error = []; - $widgetType = $widget->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType)) { - return $this->callRender($widgetType, 'checkWidget', ['widget' => $widget, 'pageName' => $pageName]); - } elseif (isset($this->widgetSelectors[$widgetType])) { - $widgetOptions = $widget->getWidgetOptions(); - unset($widgetOptions['type_id']); - foreach ($widgetOptions as $widgetOption) { - $error[] = array_filter($this->checkEntities($widget, $widgetOption, $pageName, $widgetType)); - } - return array_filter($error); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } - - /** - * Check widget entities. - * - * @param Widget $widget - * @param array $widgetOption - * @param string $pageName - * @param string $widgetType - * @return array - */ - protected function checkEntities(Widget $widget, $widgetOption, $pageName, $widgetType) - { - $error = []; - if (isset($widgetOption['entities'])) { - foreach ($widgetOption['entities'] as $entity) { - $widgetText = $entity->getStoreContents()['store_content']; - $visibility = $this->isWidgetVisible($widget, $pageName, $widgetType, $widgetText); - if ($visibility !== null) { - $error[] = $visibility; - } - } - } else { - $error[] = $this->isWidgetVisible($widget, $pageName, $widgetType, $pageName); - } - - return $error; - } - - /** - * Check is visible widget selector. - * - * @param Widget $widget - * @param string $pageName - * @param string $widgetType - * @param string $widgetText - * @return string|null - */ - protected function isWidgetVisible(Widget $widget, $pageName, $widgetType, $widgetText) - { - $widgetSelector = sprintf($this->widgetSelectors[$widgetType], $widgetText); - return $this->_rootElement->find($widgetSelector, Locator::SELECTOR_XPATH)->isVisible() - ? null - : "Widget with title {$widget->getTitle()} is absent on {$pageName} page."; - } - - /** - * Click to widget selector. - * - * @param Widget $widget - * @param string $widgetText - * @return void - * @throws \Exception - */ - public function clickToWidget(Widget $widget, $widgetText) - { - $widgetType = $widget->getWidgetOptions()['type_id']; - if ($this->hasRender($widgetType)) { - $this->callRender($widgetType, 'clickToWidget', ['widget' => $widget, 'widgetText' => $widgetText]); - } elseif (isset($this->widgetSelectors[$widgetType])) { - $this->_rootElement->find( - sprintf($this->widgetSelectors[$widgetType], $widgetText), - Locator::SELECTOR_XPATH - )->click(); - } else { - throw new \Exception('Determine how to find the widget on the page.'); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php deleted file mode 100644 index 434c3db558d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetInGrid.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Constraint; - -use Mage\Widget\Test\Fixture\Widget; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert widget availability in widget grid. - */ -class AssertWidgetInGrid extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'high'; - /* end tags */ - - /** - * Assert widget availability in widget grid. - * - * @param Widget $widget - * @param WidgetInstanceIndex $widgetInstanceIndex - * @return void - */ - public function processAssert(Widget $widget, WidgetInstanceIndex $widgetInstanceIndex) - { - $widgetInstanceIndex->open(); - $widgetTitle = $widget->getTitle(); - \PHPUnit_Framework_Assert::assertTrue( - $widgetInstanceIndex->getWidgetGrid()->isRowVisible(['title' => $widgetTitle]), - "Widget with title $widgetTitle is absent in Widget grid." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Widget is present in widget grid.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php deleted file mode 100644 index abbf4bd219a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Constraint/AssertWidgetSuccessSaveMessage.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Constraint; - -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Check that success message is displayed after widget saved. - */ -class AssertWidgetSuccessSaveMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Text value to be checked. - */ - const SUCCESS_MESSAGE = 'The widget instance has been saved.'; - - /** - * Assert that success message is displayed after widget saved. - * - * @param WidgetInstanceIndex $widgetInstanceIndex - * @return void - */ - public function processAssert(WidgetInstanceIndex $widgetInstanceIndex) - { - \PHPUnit_Framework_Assert::assertEquals( - self::SUCCESS_MESSAGE, - $widgetInstanceIndex->getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Widget success create message is present.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml deleted file mode 100644 index 4828a2ebe45..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> - <fixture name="widget" module="Mage_Widget" type="flat" entity_type="widget_instance" - collection="Mage\Widget\Model\Resource\Widget\Instance\Collection" identifier="parameters" - repository_class="Mage\Widget\Test\Repository\Widget" - handler_interface="Mage\Widget\Test\Handler\Widget\WidgetInterface" - class="Mage\Widget\Test\Fixture\Widget"> - <field name="instance_id" is_required="1"/> - <field name="instance_type" is_required="0"/> - <field name="package_theme" is_required="0" group="settings"/> - <field name="title" is_required="0" group="frontend_properties"/> - <field name="store_ids" source="Mage\Widget\Test\Fixture\Widget\StoreIds"/> - <field name="parameters" is_required="0"/> - <field name="sort_order" is_required="0"/> - <field name="type" group="settings"/> - <field name="widget_instance"/> - <field name="id"/> - <field name="page_id"/> - <field name="layout" group="layout_updates" source="Mage\Widget\Test\Fixture\Widget\LayoutUpdates" repository="Mage\Widget\Test\Repository\Widget\LayoutUpdates"/> - <field name="widgetOptions" group="widget_options" source="Mage\Widget\Test\Fixture\Widget\WidgetOptions" repository="Mage\Widget\Test\Repository\Widget"/> - </fixture> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php deleted file mode 100644 index d5f25013c0a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/LayoutUpdates.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Magento\Mtf\Fixture\DataSource; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Repository\RepositoryFactory; - -/** - * Prepare Layout Updates for widget. - */ -class LayoutUpdates extends DataSource -{ - /** - * @constructor - * @param RepositoryFactory $repositoryFactory - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(RepositoryFactory $repositoryFactory, FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - foreach ($this->data as $index => $layouts) { - if (isset($layouts['entities'])) { - foreach ($layouts['entities'] as $key => $layout) { - $explodeValue = explode('::', $layout); - $fixture = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - $fixture->persist(); - $this->data[$index]['entities'][$key] = $fixture->getData(); - } - } - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php deleted file mode 100644 index 2e346a78948..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/StoreIds.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Mage\Adminhtml\Test\Fixture\Store; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Prepare Store. - */ -class StoreIds implements FixtureInterface -{ - /** - * Data set configuration settings. - * - * @var array - */ - protected $params = []; - - /** - * Resource data. - * - * @var array - */ - protected $data = []; - - /** - * Return stores. - * - * @var Store - */ - protected $stores = []; - - /** - * @constructor - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset'])) { - $dataset = explode(',', $data['dataset']); - foreach ($dataset as $store) { - /** @var Store $store */ - $store = $fixtureFactory->createByCode('store', ['dataset' => $store]); - if (!$store->hasData('store_id')) { - $store->persist(); - } - $this->stores[] = $store; - $this->data[] = $store->getName(); - } - } else { - $this->data[] = null; - } - } - - /** - * Persist Store. - * - * @return void - */ - public function persist() - { - // - } - - /** - * Return prepared data. - * - * @param string|null $key - * @return string - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function getData($key = null) - { - return $this->data; - } - - /** - * Return data set configuration settings. - * - * @return array - */ - public function getDataConfig() - { - return $this->params; - } - - /** - * Return stores. - * - * @return Store - */ - public function getStores() - { - return $this->stores; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php deleted file mode 100644 index 46d1f14a0fb..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Fixture/Widget/WidgetOptions.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Fixture\Widget; - -use Magento\Mtf\Fixture\DataSource; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Repository\RepositoryFactory; - -/** - * Prepare Widget options for widget. - */ -class WidgetOptions extends DataSource -{ - /** - * @constructor - * @param RepositoryFactory $repositoryFactory - * @param FixtureFactory $fixtureFactory - * @param array $params - * @param array $data [optional] - */ - public function __construct(RepositoryFactory $repositoryFactory, FixtureFactory $fixtureFactory, array $params, array $data = []) - { - $this->params = $params; - if (isset($data['dataset']) && isset($this->params['repository'])) { - $this->data = $repositoryFactory->get($this->params['repository'])->get($data['dataset']); - foreach ($this->data as $key => $value) { - $this->data['type_id'] = $data['dataset']; - if (isset($value['entities'])) { - foreach ($value['entities'] as $index => $entity) { - $explodeValue = explode('::', $entity); - $fixture = $fixtureFactory->createByCode($explodeValue[0], ['dataset' => $explodeValue[1]]); - $fixture->persist(); - $this->data[$key]['entities'][$index] = $fixture; - } - } - } - } else { - $this->data = $data; - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php deleted file mode 100644 index af008220442..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/Curl.php +++ /dev/null @@ -1,219 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Handler\Widget; - -use Magento\Mtf\Fixture\FixtureInterface; -use Magento\Mtf\Handler\Curl as AbstractCurl; -use Magento\Mtf\Util\Protocol\CurlInterface; -use Magento\Mtf\Util\Protocol\CurlTransport; -use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator; - -/** - * Curl handler for creating widgetInstance/frontendApp. - */ -class Curl extends AbstractCurl -{ - /** - * Mapping values for data. - * - * @var array - */ - protected $mappingData = [ - 'package_theme' => [ - 'Magento Blank' => 2, - ], - 'type' => [ - 'CMS Page Link' => 'cms_page_link', - ], - 'block' => [ - 'Main Content Area' => 'content', - 'Sidebar Additional' => 'sidebar.additional', - 'Sidebar Main' => 'sidebar.main', - ], - 'page_group' => [ - 'All Pages' => 'all_pages', - 'Specified Page' => 'pages', - 'Page Layouts' => 'page_layouts', - 'Non-Anchor Categories' => 'notanchor_categories', - ], - 'template' => [ - 'CMS Page Link Block Template' => 'widget/link/link_block.phtml', - ], - 'layout_handle' => [ - 'Shopping Cart' => 'checkout_cart_index', - ], - ]; - - /** - * Widget Instance Template. - * - * @var string - */ - protected $widgetInstanceTemplate = ''; - - /** - * Post request for creating widget instance. - * - * @param FixtureInterface $fixture [optional] - * @throws \Exception - * @return array - */ - public function persist(FixtureInterface $fixture = null) - { - $data = $this->prepareData($fixture); - $url = $_ENV['app_backend_url'] . 'widget_instance/save/type/' - . $data['type'] . '/package/' . $this->prepareTheme($data['package_theme']); - - if (isset($data['page_id'])) { - $data['parameters']['page_id'] = $data['page_id'][0]; - unset($data['page_id']); - } - if ($fixture->hasData('store_ids')) { - $stores = $fixture->getDataFieldConfig('store_ids')['source']->getStores(); - foreach ($stores as $store) { - $data['store_ids'][] = $store->getStoreId(); - } - } - $data['parameters']['unique_id'] = isset($data['parameters']['unique_id']) ? uniqid() : ''; - unset($data['type']); - unset($data['package_theme']); - $curl = new BackendDecorator(new CurlTransport(), $this->_configuration); - $curl->write($url, $data); - $response = $curl->read(); - $curl->close(); - - if (!strpos($response, 'class="success-msg"')) { - throw new \Exception("Widget instance creation by curl handler was not successful! Response: $response"); - } - $id = $this->getWidgetId($response); - - return ['id' => $id]; - } - - /** - * Return saved widget id. - * - * @param string $response - * @return int|null - * @throws \Exception - */ - protected function getWidgetId($response) - { - preg_match_all('~tr title=[^\s]*\/instance_id\/(\d+)~', $response, $matches); - if (empty($matches[1])) { - throw new \Exception('Cannot find Widget id'); - } - - return max($matches[1]); - } - - /** - * Prepare theme. - * - * @param string $theme - * @return string - */ - protected function prepareTheme($theme) - { - $data = explode('/', $theme); - - return $data[0] . '/theme/' . $data[1]; - } - - /** - * Prepare data for create widget. - * - * @param FixtureInterface $widget - * @return array - */ - protected function prepareData(FixtureInterface $widget) - { - $data = $this->replaceMappingData($widget->getData()); - - return $this->prepareWidgetInstance($data); - } - - /** - * Prepare Widget Instance data. - * - * @param array $data - * @throws \Exception - * @return array - */ - protected function prepareWidgetInstance($data) - { - foreach ($data['widget_instance'] as $key => $widgetInstance) { - $pageGroup = $widgetInstance['page_group']; - - if (!isset($widgetInstance[$pageGroup]['page_id'])) { - $widgetInstance[$pageGroup]['page_id'] = 0; - } - $method = 'prepare' . str_replace(' ', '', ucwords(str_replace('_', ' ', $pageGroup))) . 'Group'; - if (!method_exists(__CLASS__, $method)) { - throw new \Exception('Method for prepare page group "' . $method . '" is not exist.'); - } - $widgetInstance[$pageGroup] = $this->$method($widgetInstance[$pageGroup]); - $data['widget_instance'][$key] = $widgetInstance; - } - - return $data; - } - - /** - * Prepare All Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function prepareAllPagesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['layout_handle'] = 'default'; - $widgetInstancePageGroup['for'] = 'all'; - if (!isset($widgetInstancePageGroup['template'])) { - $widgetInstancePageGroup['template'] = $this->widgetInstanceTemplate; - } - - return $widgetInstancePageGroup; - } - - /** - * Prepare Non-Anchor Categories Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function prepareNotanchorCategoriesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['is_anchor_only'] = 0; - $widgetInstancePageGroup['for'] = 'all'; - $widgetInstancePageGroup['layout_handle'] = 'catalog_category_view_type_default'; - - return $widgetInstancePageGroup; - } - - /** - * Prepare Specified Page Group. - * - * @param array $widgetInstancePageGroup - * @return array - */ - protected function preparePagesGroup(array $widgetInstancePageGroup) - { - $widgetInstancePageGroup['for'] = 'all'; - - return $widgetInstancePageGroup; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php b/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php deleted file mode 100644 index 4268257e1e3..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Handler/Widget/WidgetInterface.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\Handler\Widget; - -use Magento\Mtf\Handler\HandlerInterface; - -/** - * Widget Interface. - */ -interface WidgetInterface extends HandlerInterface -{ - // -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml deleted file mode 100644 index 94c76e7e3c6..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceEdit.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceEdit" area="Adminhtml" mca="widget_instance/edit" module="Mage_Widget"> - <block name="widgetForm" class="Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\WidgetForm" locator="[id='page:main-container']" strategy="css selector"/> - <block name="pageActionsBlock" class="Mage\Widget\Test\Block\Adminhtml\FormPageActions" locator=".form-buttons" strategy="css selector"/> - <block name="templateBlock" class="Mage\Adminhtml\Test\Block\Template" locator="body" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml deleted file mode 100644 index 537832ce25a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceIndex" area="Adminhtml" mca="widget_instance/index" module="Mage_Widget"> - <block name="pageActionsBlock" class="Mage\Adminhtml\Test\Block\GridPageActions" locator=".form-buttons" strategy="css selector"/> - <block name="widgetGrid" class="Mage\Widget\Test\Block\Adminhtml\Widget\WidgetGrid" locator="#widgetInstanceGrid" strategy="css selector"/> - <block name="messagesBlock" class="Mage\Core\Test\Block\Messages" locator="#messages" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml deleted file mode 100644 index c83813d9d4f..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/Adminhtml/WidgetInstanceNew.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WidgetInstanceNew" area="Adminhtml" mca="widget_instance/new" module="Mage_Widget"> - <block name="widgetForm" class="Mage\Widget\Test\Block\Adminhtml\Widget\Instance\Edit\WidgetForm" locator="[id='page:main-container']" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml deleted file mode 100644 index 3ae327f117a..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Page/CmsIndex.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="CmsIndex" mca="cms/index"> - <block name="widgetView" class="Mage\Widget\Test\Block\WidgetView" locator=".widget" strategy="css selector" /> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml deleted file mode 100644 index 25887876eaa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Mage\Widget\Test\Repository\Widget"> - <dataset name="default"> - <field name="title" xsi:type="string">Test Frontend App</field> - <field name="store_ids" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="widget_instance" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">all_pages</item> - <item name="all_pages" xsi:type="array"> - <item name="layout_handle" xsi:type="string">default</item> - <item name="for" xsi:type="string">all</item> - <item name="block" xsi:type="string">content</item> - <item name="template" xsi:type="string">widget/block.phtml</item> - </item> - </item> - </field> - <field name="parameters" xsi:type="array"> - <item name="display_mode" xsi:type="string">catalogrule</item> - </field> - <field name="theme_id" xsi:type="string">2</field> - </dataset> - - <dataset name="cms_page_link"> - <field name="code" xsi:type="string">CMS Page Link</field> - <field name="title" xsi:type="string">Cms Page Link %isolation%</field> - <field name="store_ids" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="widget_instance" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">All Pages</item> - <item name="all_pages" xsi:type="array"> - <item name="block" xsi:type="string">Main Content Area</item> - <item name="template" xsi:type="string">CMS Page Link Block Template</item> - </item> - </item> - </field> - <field name="parameters" xsi:type="array"> - <item name="display_mode" xsi:type="string">fixed</item> - <item name="anchor_text" xsi:type="string">text</item> - <item name="title" xsi:type="string">anchor title</item> - </field> - <field name="page_id" xsi:type="array"> - <item name="dataset" xsi:type="string">default</item> - </field> - <field name="theme_id" xsi:type="string">Magento Blank</field> - <field name="widgetOptions" xsi:type="array"> - <item name="0" xsi:type="array"> - <item name="type_id" xsi:type="string">cmsPageLink</item> - </item> - </field> - </dataset> - </repository> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml deleted file mode 100644 index 1131979d37b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/Repository/Widget/LayoutUpdates.xml +++ /dev/null @@ -1,27 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd"> - <repository class="Mage\Widget\Test\Repository\Widget\LayoutUpdates"> - <dataset name="all_pages"> - <field name="0" xsi:type="array"> - <item name="page_group" xsi:type="string">Generic Pages/All Pages</item> - <item name="block" xsi:type="string">Main Content Area</item> - </field> - </dataset> - </repository> -</config> \ No newline at end of file diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php b/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php deleted file mode 100644 index a17bcf04d52..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/TestCase/AbstractCreateWidgetEntityTest.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\TestCase; - -use Mage\Widget\Test\Fixture\Widget; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceEdit; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceNew; -use Magento\Mtf\TestCase\Injectable; - -/** - * Test Creation for New Instance of WidgetEntity. - */ -abstract class AbstractCreateWidgetEntityTest extends Injectable -{ - /** - * WidgetInstanceIndex page. - * - * @var WidgetInstanceIndex - */ - protected $widgetInstanceIndex; - - /** - * WidgetInstanceNew page. - * - * @var WidgetInstanceNew - */ - protected $widgetInstanceNew; - - /** - * WidgetInstanceEdit page. - * - * @var WidgetInstanceEdit - */ - protected $widgetInstanceEdit; - - /** - * Injection data. - * - * @param WidgetInstanceIndex $widgetInstanceIndex - * @param WidgetInstanceNew $widgetInstanceNew - * @param WidgetInstanceEdit $widgetInstanceEdit - * @return void - */ - public function __inject( - WidgetInstanceIndex $widgetInstanceIndex, - WidgetInstanceNew $widgetInstanceNew, - WidgetInstanceEdit $widgetInstanceEdit - ) { - $this->widgetInstanceIndex = $widgetInstanceIndex; - $this->widgetInstanceNew = $widgetInstanceNew; - $this->widgetInstanceEdit = $widgetInstanceEdit; - } - - /** - * Delete all widgets. - * - * @return void - */ - public function tearDown() - { - $this->objectManager->create('Mage\Widget\Test\TestStep\DeleteAllWidgetsStep')->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php b/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php deleted file mode 100644 index 3ad9d636f6b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/TestStep/DeleteAllWidgetsStep.php +++ /dev/null @@ -1,67 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Widget\Test\TestStep; - -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceEdit; -use Mage\Widget\Test\Page\Adminhtml\WidgetInstanceIndex; -use Magento\Mtf\TestStep\TestStepInterface; - -/** - * Delete all widgets on backend. - */ -class DeleteAllWidgetsStep implements TestStepInterface -{ - /** - * WidgetInstanceIndex page. - * - * @var WidgetInstanceIndex - */ - protected $widgetInstanceIndex; - - /** - * WidgetInstanceEdit page. - * - * @var WidgetInstanceEdit - */ - protected $widgetInstanceEdit; - - /** - * @constructor - * @param WidgetInstanceIndex $widgetInstanceIndex - * @param WidgetInstanceEdit $widgetInstanceEdit - */ - public function __construct(WidgetInstanceIndex $widgetInstanceIndex, WidgetInstanceEdit $widgetInstanceEdit) - { - $this->widgetInstanceIndex = $widgetInstanceIndex; - $this->widgetInstanceEdit = $widgetInstanceEdit; - } - - /** - * Delete Widget on backend. - * - * @return void - */ - public function run() - { - $this->widgetInstanceIndex->open(); - $this->widgetInstanceIndex->getWidgetGrid()->resetFilter(); - while ($this->widgetInstanceIndex->getWidgetGrid()->isFirstRowVisible()) { - $this->widgetInstanceIndex->getWidgetGrid()->openFirstRow(); - $this->widgetInstanceEdit->getTemplateBlock()->waitLoader(); - $this->widgetInstanceEdit->getPageActionsBlock()->delete(); - } - } -} diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml deleted file mode 100644 index 2c6d48f3ec7..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/curl/di.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/Magento/Mtf/ObjectManager/etc/config.xsd"> - <preference for="Mage\Widget\Test\Handler\Widget\WidgetInterface" type="\Mage\Widget\Test\Handler\Widget\Curl" /> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml b/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml deleted file mode 100644 index 39e73328e36..00000000000 --- a/dev/tests/functional/tests/app/Mage/Widget/Test/etc/fixture.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<fixture> - <widget module="Mage_Widget"> - <type>flat</type> - <entity_type>widget_instance</entity_type> - <collection>Mage\Widget\Model\Resource\Widget\Instance\Collection</collection> - <identifier>parameters</identifier> - <fields> - <type> - <attribute_code>type</attribute_code> - <backend_type>virtual</backend_type> - <group>settings</group> - </type> - <store_ids> - <attribute_code>store_ids</attribute_code> - <backend_type>virtual</backend_type> - <source>Mage\Widget\Test\Fixture\Widget\StoreIds</source> - </store_ids> - <widget_instance> - <attribute_code>widget_instance</attribute_code> - <backend_type>virtual</backend_type> - </widget_instance> - <id> - <attribute_code>id</attribute_code> - <backend_type>virtual</backend_type> - </id> - <page_id> - <attribute_code>page_id</attribute_code> - <backend_type>virtual</backend_type> - </page_id> - <layout> - <attribute_code>layout</attribute_code> - <backend_type>virtual</backend_type> - <group>layout_updates</group> - <source>Mage\Widget\Test\Fixture\Widget\LayoutUpdates</source> - </layout> - <widgetOptions> - <attribute_code>widgetOptions</attribute_code> - <backend_type>virtual</backend_type> - <group>widget_options</group> - <source>Mage\Widget\Test\Fixture\Widget\WidgetOptions</source> - </widgetOptions> - </fields> - </widget> -</fixture> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php deleted file mode 100644 index d5a24b8d3a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer; - -use Magento\Mtf\Block\Block; - -/** - * Wish list details block in "My Wish List" page. - */ -class Wishlist extends Block -{ - /** - * Button 'Update Wish List' css selector. - * - * @var string - */ - protected $updateButton = '.buttons-set2 .btn-update'; - - /** - * Empty block css selector. - * - * @var string - */ - protected $empty = '.wishlist-empty'; - - /** - * Click button 'Update Wish List'. - * - * @return void - */ - public function clickUpdateWishlist() - { - $this->_rootElement->find($this->updateButton)->click(); - } - - /** - * Check empty block visible. - * - * @return bool - */ - public function isEmptyBlockVisible() - { - return $this->_rootElement->find($this->empty)->isVisible(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php deleted file mode 100644 index 236f1909e60..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items.php +++ /dev/null @@ -1,49 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer\Wishlist; - -use Mage\Wishlist\Test\Block\Customer\Wishlist\Items\Product; -use Magento\Mtf\Block\Block; -use Magento\Mtf\Client\Locator; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Customer wishlist items block on frontend. - */ -class Items extends Block -{ - /** - * Item product block. - * - * @var string - */ - protected $itemProductBlock = '//tbody//tr[.//h3[@class="product-name" and *[text()="%s"]]]'; - - /** - * Get item product block. - * - * @param InjectableFixture $product - * @return Product - */ - public function getItemProductBlock(InjectableFixture $product) - { - $selector = sprintf($this->itemProductBlock, $product->getName()); - return $this->blockFactory->create( - 'Mage\Wishlist\Test\Block\Customer\Wishlist\Items\Product', - ['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)] - ); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php deleted file mode 100644 index 761a69fb2bc..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.php +++ /dev/null @@ -1,119 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Block\Customer\Wishlist\Items; - -use Magento\Mtf\Block\Form; - -/** - * Wishlist item product form. - */ -class Product extends Form -{ - /** - * Selector for 'View Details' element. - * - * @var string - */ - protected $viewDetails = '.details'; - - /** - * Selector for option's label. - * - * @var string - */ - protected $optionLabel = 'dl dt'; - - /** - * Selector for option's value. - * - * @var string - */ - protected $optionValue = 'dl dd'; - - /** - * Selector for 'Add to Cart' button. - * - * @var string - */ - protected $addToCart = '.btn-cart'; - - /** - * Edit button css selector. - * - * @var string - */ - protected $edit = '.link-edit'; - - /** - * Get product options. - * - * @return array|null - */ - public function getOptions() - { - $viewDetails = $this->_rootElement->find($this->viewDetails); - if ($viewDetails->isVisible()) { - $viewDetails->click(); - $labels = $this->_rootElement->getElements($this->optionLabel); - $values = $this->_rootElement->getElements($this->optionValue); - $data = []; - foreach ($labels as $key => $label) { - if (!$label->isVisible()) { - $viewDetails->click(); - } - $data[] = [ - 'title' => $label->getText(), - 'value' => str_replace('$', '', $values[$key]->getText()), - ]; - } - return $data; - } else { - return null; - } - } - - /** - * Fill item product details. - * - * @param array $fields - * @return void - */ - public function fillProduct(array $fields) - { - $mapping = $this->dataMapping($fields); - $this->_fill($mapping); - } - - /** - * Click button 'Add To Cart' - * - * @return void - */ - public function clickAddToCart() - { - $this->_rootElement->find($this->addToCart)->click(); - } - - /** - * Click edit button. - * - * @return void - */ - public function clickEdit() - { - $this->_rootElement->find($this->edit)->click(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml deleted file mode 100644 index 7007a51531c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Block/Customer/Wishlist/Items/Product.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<mapping strict="0"> - <fields> - <qty> - <selector>[name^="qty["]</selector> - </qty> - </fields> -</mapping> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php deleted file mode 100644 index ba0ee718857..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductToWishlistSuccessMessage.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on My Wish List page after adding product to wishlist. - */ -class AssertAddProductToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - - /** - * Assert that success message appears on My Wish List page after adding product to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(WishlistIndex $wishlistIndex, InjectableFixture $product) - { - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages() - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on My Wish List page after adding product to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php deleted file mode 100644 index 69e0c81c32c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertAddProductsToWishlistSuccessMessage.php +++ /dev/null @@ -1,63 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on My Wish List page after adding products to wishlist. - */ -class AssertAddProductsToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been added to your wishlist. Click here to continue shopping."; - - /** - * Assert that success message appears on My Wish List page after adding products to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param AssertAddProductToWishlistSuccessMessage $addProductToWishlistSuccessMessage - * @param InjectableFixture[] $products - * @return void - */ - public function processAssert( - WishlistIndex $wishlistIndex, - AssertAddProductToWishlistSuccessMessage $addProductToWishlistSuccessMessage, - array $products - ) { - foreach ($products as $product) { - $addProductToWishlistSuccessMessage->processAssert($wishlistIndex, $product); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on My Wish List page after adding products to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php deleted file mode 100644 index 5200194750c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertMoveProductToWishlistSuccessMessage.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that success message appears on Checkout Cart page after moving product to wishlist. - */ -class AssertMoveProductToWishlistSuccessMessage extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Success add message. - */ - const SUCCESS_MESSAGE = "%s has been moved to wishlist Wishlist"; - - /** - * Assert that success message appears on My Wish List page after moving product to wishlist. - * - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(WishlistIndex $wishlistIndex, InjectableFixture $product) - { - \PHPUnit_Framework_Assert::assertEquals( - sprintf(self::SUCCESS_MESSAGE, $product->getName()), - $wishlistIndex->getMessagesBlock()->getSuccessMessages(), - "Expected success move to wish list message doesn't match actual." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Success message appears on Checkout Cart page after moving product to wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php deleted file mode 100644 index 4b8dde1f30d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Checkout\Test\Fixture\Cart; -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractAssertForm; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that the correct option details are displayed on the "View Details" tool tip. - */ -class AssertProductDetailsInWishlist extends AbstractAssertForm -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that the correct option details are displayed on the "View Details" tool tip. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @param FixtureFactory $fixtureFactory - * @return void - */ - public function processAssert( - CmsIndex $cmsIndex, - WishlistIndex $wishlistIndex, - InjectableFixture $product, - FixtureFactory $fixtureFactory - ) { - $cmsIndex->getTopLinksBlock()->openAccount(); - $cmsIndex->getLinksBlock()->openLink("My Wishlist"); - $actualOptions = $wishlistIndex->getItemsBlock()->getItemProductBlock($product)->getOptions(); - $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]); - $expectedOptions = $this->prepareOptions($cartFixture); - - $errors = $this->verifyData($expectedOptions, $this->sortDataByPath($actualOptions, '::title')); - \PHPUnit_Framework_Assert::assertEmpty($errors, $errors); - } - - /** - * Prepare options. - * - * @param Cart $cart - * @return array - */ - protected function prepareOptions(Cart $cart) - { - $data = []; - $options = $cart->getItems()[0]->getData()['options']; - foreach ($options as $key => $option) { - foreach ($option as $index => $value){ - $data[$key][$index] = strtoupper($value); - } - } - - return $this->sortDataByPath($data, '::title'); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Expected product options are equal to actual."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php deleted file mode 100644 index 8c5e6b4a601..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInCustomerBackendWishlist.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Page\Adminhtml\CustomerIndex; -use Mage\Customer\Test\Page\Adminhtml\CustomerEdit; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Adminhtml\Test\Block\Wishlist\Customer\Edit\Tab\Wishlist\Grid; - -/** - * Assert that product added to wishlist is present on Customers account on backend - * - in section Customer Activities - Wishlist. - */ -class AssertProductIsPresentInCustomerBackendWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that products added to wishlist are present on Customers account on backend. - * - * @param CustomerIndex $customerIndex - * @param Customer $customer - * @param CustomerEdit $customerEdit - * @param InjectableFixture $product - * @return void - */ - public function processAssert( - CustomerIndex $customerIndex, - Customer $customer, - CustomerEdit $customerEdit, - InjectableFixture $product - ) { - $customerIndex->open(); - $customerIndex->getCustomerGridBlock()->searchAndOpen(['email' => $customer->getEmail()]); - $customerEdit->getCustomerForm()->openTab('wishlist'); - /** @var Grid $wishlistGrid */ - $wishlistGrid = $customerEdit->getCustomerForm()->getTabElement('wishlist')->getSearchGridBlock(); - - \PHPUnit_Framework_Assert::assertTrue( - $wishlistGrid->isRowVisible(['product_name' => $product->getName()], true, false), - $product->getName() . " is not visible in customer wishlist on backend." - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Product is visible in customer wishlist on backend."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php deleted file mode 100644 index 01b9db40924..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductIsPresentInWishlist.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that product is present in default wishlist. - */ -class AssertProductIsPresentInWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that product is present in default wishlist. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @param InjectableFixture $product - * @return void - */ - public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex, InjectableFixture $product) - { - $cmsIndex->getTopLinksBlock()->openAccount(); - $cmsIndex->getLinksBlock()->openLink("My Wishlist"); - - \PHPUnit_Framework_Assert::assertTrue( - $wishlistIndex->getItemsBlock()->getItemProductBlock($product)->isVisible(), - $product->getName() . ' is not visible on wishlist page.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is present in default wishlist.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php deleted file mode 100644 index 539da869343..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsArePresentInCustomerBackendWishlist.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Customer\Test\Fixture\Customer; -use Mage\Customer\Test\Page\Adminhtml\CustomerIndex; -use Mage\Customer\Test\Page\Adminhtml\CustomerEdit; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Assert that products added to wishlist are present on Customers account on backend - * - in section Customer Activities - Wishlist. - */ -class AssertProductsArePresentInCustomerBackendWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that products added to wishlist are present on Customers account on backend. - * - * @param CustomerIndex $customerIndex - * @param Customer $customer - * @param CustomerEdit $customerEdit - * @param AssertProductIsPresentInCustomerBackendWishlist $assertProductIsPresentInBackendWishlist - * @param array $products - * @return void - */ - public function processAssert( - CustomerIndex $customerIndex, - Customer $customer, - CustomerEdit $customerEdit, - AssertProductIsPresentInCustomerBackendWishlist $assertProductIsPresentInBackendWishlist, - array $products - ) { - foreach ($products as $product) { - $assertProductIsPresentInBackendWishlist->processAssert($customerIndex, $customer, $customerEdit, $product); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return "Products are visible in customer wishlist on backend."; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php deleted file mode 100644 index 32bba6981a2..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertProductsIsAbsentInWishlist.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; -use Magento\Mtf\Fixture\InjectableFixture; -use Mage\Customer\Test\Constraint\FrontendActionsForCustomer; - -/** - * Assert products is absent in Wishlist on frontend. - */ -class AssertProductsIsAbsentInWishlist extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert that product is not present in Wishlist on frontend. - * - * @param WishlistIndex $wishlistIndex - * @param CmsIndex $cmsIndex - * @param Customer $customer - * @param FrontendActionsForCustomer $frontendActionsForCustomer - * @param InjectableFixture[] $products - * @return void - */ - public function processAssert( - WishlistIndex $wishlistIndex, - CmsIndex $cmsIndex, - Customer $customer, - FrontendActionsForCustomer $frontendActionsForCustomer, - array $products - ) { - $frontendActionsForCustomer->loginCustomer($customer); - $cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - $itemBlock = $wishlistIndex->getItemsBlock(); - foreach ($products as $itemProduct) { - \PHPUnit_Framework_Assert::assertFalse( - $itemBlock->getItemProductBlock($itemProduct)->isVisible(), - "Product '{$itemProduct->getName()}' is present in Wishlist on frontend." - ); - } - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Product is absent in Wishlist on frontend.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php deleted file mode 100644 index defcfae97af..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Constraint/AssertWishlistIsEmpty.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\Constraint; - -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Constraint\AbstractConstraint; - -/** - * Assert wish list is empty on 'My Account' page. - */ -class AssertWishlistIsEmpty extends AbstractConstraint -{ - /* tags */ - const SEVERITY = 'low'; - /* end tags */ - - /** - * Assert wish list is empty. - * - * @param CmsIndex $cmsIndex - * @param WishlistIndex $wishlistIndex - * @return void - */ - public function processAssert(CmsIndex $cmsIndex, WishlistIndex $wishlistIndex) - { - $cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - \PHPUnit_Framework_Assert::assertTrue( - $wishlistIndex->getWishlistBlock()->isEmptyBlockVisible(), - 'Wish list is not empty.' - ); - } - - /** - * Returns a string representation of the object. - * - * @return string - */ - public function toString() - { - return 'Wish list is empty.'; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml deleted file mode 100644 index 46889c82611..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/Page/WishlistIndex.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> - <page name="WishlistIndex" mca="wishlist/index/index" module="Mage_Wishlist"> - <block name="messagesBlock" class="Mage\Core\Test\Block\Messages" locator=".messages" strategy="css selector"/> - <block name="wishlistBlock" class="Mage\Wishlist\Test\Block\Customer\Wishlist" locator="#wishlist-view-form" strategy="css selector"/> - <block name="itemsBlock" class="Mage\Wishlist\Test\Block\Customer\Wishlist\Items" locator="#wishlist-table" strategy="css selector"/> - </page> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php deleted file mode 100644 index 2ec36eb2ca9..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AbstractWishlistTest.php +++ /dev/null @@ -1,139 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Catalog\Test\Page\Product\CatalogProductView; -use Mage\Cms\Test\Page\CmsIndex; -use Mage\Customer\Test\Fixture\Customer; -use Mage\Wishlist\Test\Page\WishlistIndex; -use Magento\Mtf\Fixture\FixtureFactory; -use Magento\Mtf\ObjectManager; -use Magento\Mtf\TestCase\Injectable; -use Magento\Mtf\Fixture\InjectableFixture; - -/** - * Abstract class for wish list tests. - */ -abstract class AbstractWishlistTest extends Injectable -{ - /** - * Object Manager. - * - * @var ObjectManager - */ - protected $objectManager; - - /** - * Cms index page. - * - * @var CmsIndex - */ - protected $cmsIndex; - - /** - * Product view page. - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Fixture factory. - * - * @var FixtureFactory - */ - protected $fixtureFactory; - - /** - * Wishlist index page. - * - * @var WishlistIndex - */ - protected $wishlistIndex; - - /** - * Injection data. - * - * @param CmsIndex $cmsIndex - * @param CatalogProductView $catalogProductView - * @param FixtureFactory $fixtureFactory - * @param WishlistIndex $wishlistIndex - * @param ObjectManager $objectManager - * @param Customer $customer - * @return array - */ - public function __inject( - CmsIndex $cmsIndex, - CatalogProductView $catalogProductView, - FixtureFactory $fixtureFactory, - WishlistIndex $wishlistIndex, - ObjectManager $objectManager, - Customer $customer - ) { - $this->cmsIndex = $cmsIndex; - $this->catalogProductView = $catalogProductView; - $this->fixtureFactory = $fixtureFactory; - $this->wishlistIndex = $wishlistIndex; - $this->objectManager = $objectManager; - $customer->persist(); - - return ['customer' => $customer]; - } - - /** - * Login customer. - * - * @param Customer $customer - * @return void - */ - protected function loginCustomer(Customer $customer) - { - $this->objectManager->create( - 'Mage\Customer\Test\TestStep\LoginCustomerOnFrontendStep', - ['customer' => $customer] - )->run(); - } - - /** - * Create products. - * - * @param string $products - * @return array - */ - protected function createProducts($products) - { - return $this->objectManager->create( - 'Mage\Catalog\Test\TestStep\CreateProductsStep', - ['products' => $products] - )->run()['products']; - } - - /** - * Add products to wish list. - * - * @param InjectableFixture|InjectableFixture[] $products - * @param bool $configure [optional] - * @return void - */ - protected function addToWishlist($products, $configure = false) - { - $products = is_array($products) ? $products : [$products]; - $this->objectManager->create( - 'Mage\Wishlist\Test\TestStep\AddProductsToWishlistStep', - ['products' => $products, 'configure' => $configure] - )->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php deleted file mode 100644 index 8dfbde432fa..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Customer is registered. - * 2. Product is created. - * - * Steps: - * 1. Login as a customer. - * 2. Navigate to catalog page. - * 3. Add created product to Wishlist according to dataset. - * 4. Perform all assertions. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-6997 - */ -class AddProductToWishlistEntityTest extends AbstractWishlistTest -{ - /** - * Run Add Product To Wishlist test. - * - * @param Customer $customer - * @param string $product - * @param bool $configure - * @return array - */ - public function test(Customer $customer, $product, $configure) - { - $product = $this->createProducts($product)[0]; - - // Steps: - $this->loginCustomer($customer); - $this->addToWishlist([$product], $configure); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml deleted file mode 100644 index c2a8521ab5c..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductToWishlistEntityTest.xml +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\AddProductToWishlistEntityTest" summary="AddProductToWishlistEntityTest"> - <variation name="AddProductToWishlistEntityTestVariation1" method="test"> - <data name="descriptions" xsi:type="string">Add Simple product to Wishlist</data> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation2" method="test"> - <data name="descriptions" xsi:type="string">Add Virtual product to Wishlist</data> - <data name="product" xsi:type="string">catalogProductVirtual::order_default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation4" method="test"> - <data name="descriptions" xsi:type="string">Add Configurable product to Wishlist</data> - <data name="product" xsi:type="string">configurableProduct::default</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - <variation name="AddProductToWishlistEntityTestVariation5" method="test"> - <data name="descriptions" xsi:type="string">Add Grouped product to Wishlist</data> - <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> - <data name="configure" xsi:type="string">false</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertAddProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInCustomerBackendWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 3517fa85358..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Checkout\Test\Fixture\Cart; -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Create customer and login to frontend. - * 2. Create products. - * 3. Add products to customer's wishlist. - * - * Steps: - * 1. Navigate to My Account -> My Wishlist. - * 2. Fill qty and update wish list. - * 3. Click "Add to Cart". - * 4. Perform asserts. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-7293 - */ -class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Run add products to cart from customer wishlist on frontend test. - * - * @param Customer $customer - * @param string $products - * @param int|null $qty - * @return array - */ - public function test(Customer $customer, $products, $qty = null) - { - // Preconditions - $this->loginCustomer($customer); - $products = $this->createProducts($products); - $this->addToWishlist($products); - - // Steps - $this->addToCart($products, $qty); - - // Prepare data for asserts - $cart = $this->createCart($products, $qty); - - return ['products' => $products, 'customer' => $customer, 'cart' => $cart]; - } - - /** - * Add products from wish list to cart. - * - * @param array $products - * @param int|null $qty - * @return void - */ - protected function addToCart(array $products, $qty) - { - foreach ($products as $product) { - $this->cmsIndex->getTopLinksBlock()->openAccountLink("My Wishlist"); - $itemProductBlock = $this->wishlistIndex->getItemsBlock()->getItemProductBlock($product); - if ($qty !== null) { - $itemProductBlock->fillProduct(['qty' => $qty]); - $this->wishlistIndex->getWishlistBlock()->clickUpdateWishlist(); - } - $itemProductBlock->clickAddToCart(); - $productViewBlock = $this->catalogProductView->getViewBlock(); - if ($productViewBlock->isVisible()) { - $productViewBlock->fillOptions($product); - $productViewBlock->clickAddToCart(); - $this->catalogProductView->getMessagesBlock()->waitSuccessMessage(); - } - } - } - - /** - * Create cart fixture. - * - * @param array $products - * @return Cart - */ - protected function createCart(array $products) - { - return $this->fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => $products]]]); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 73002276b0b..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,48 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\AddProductsToCartFromCustomerWishlistOnFrontendTest" summary="AddProductsToCartFromCustomerWishlistOnFrontendTest"> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation1" method="test"> - <data name="products" xsi:type="string">catalogProductSimple::default</data> - <data name="qty" xsi:type="string">2</data> - <data name="verifyData/0/qty" xsi:type="string">2</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation3" method="test"> - <data name="products" xsi:type="string">catalogProductSimple::default,catalogProductVirtual::order_default,catalogProductSimple::default,catalogProductVirtual::order_default</data> - <data name="verifyData/0/qty" xsi:type="string">1</data> - <data name="verifyData/1/qty" xsi:type="string">1</data> - <data name="verifyData/2/qty" xsi:type="string">1</data> - <data name="verifyData/3/qty" xsi:type="string">1</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertWishlistIsEmpty" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation4" method="test"> - <data name="products" xsi:type="string">groupedProduct::three_simple_products</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - <variation name="AddProductsToCartFromCustomerWishlistOnFrontendTestVariation6" method="test"> - <data name="products" xsi:type="string">configurableProduct::default</data> - <data name="qty" xsi:type="string">3</data> - <data name="verifyData/0/qty" xsi:type="string">3</data> - <constraint name="Mage\Checkout\Test\Constraint\AssertProductQtyInShoppingCart" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductsIsAbsentInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php deleted file mode 100644 index 1f3c4a8522d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Customer\Test\Fixture\Customer; - -/** - * Preconditions: - * 1. Create customer. - * 2. Create composite products. - * 3. Log in to frontend. - * 4. Add products to the customer's wish list (unconfigured). - * - * Steps: - * 1. Open Wish list. - * 2. Click 'Edit' for the product. - * 3. Fill data. - * 4. Click 'Ok'. - * 5. Perform assertions. - * - * @group Wishlist_(CS) - * @ZephyrId MPERF-7630 - */ -class ConfigureProductInCustomerWishlistOnFrontendTest extends AbstractWishlistTest -{ - /** - * Configure customer wish list on frontend. - * - * @param Customer $customer - * @param string $product - * @return array - */ - public function test(Customer $customer, $product) - { - // Preconditions - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - $this->addToWishlist($product); - - // Steps - $this->cmsIndex->getTopLinksBlock()->openAccountLink('My Wishlist'); - $this->wishlistIndex->getItemsBlock()->getItemProductBlock($product)->clickEdit(); - $this->catalogProductView->getViewBlock()->updateWishlist($product); - - return ['product' => $product]; - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml deleted file mode 100644 index 33cfddbadbf..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest" summary="ConfigureProductInCustomerWishlistOnFrontendTest"> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation1"> - <data name="product" xsi:type="string">catalogProductSimple::with_two_custom_option</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation2"> - <data name="product" xsi:type="string">configurableProduct::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - <variation name="ConfigureProductInCustomerWishlistOnFrontendTestVariation5"> - <data name="product" xsi:type="string">groupedProduct::three_simple_products</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php deleted file mode 100644 index 9624eb1063d..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestCase; - -use Mage\Checkout\Test\Page\CheckoutCart; -use Mage\Customer\Test\Fixture\Customer; -use Magento\Mtf\Fixture\FixtureInterface; - -/** - * Preconditions: - * 1. Test products are created. - * 2. Create customer and login on frontend. - * - * Steps: - * 1. Add product to Shopping Cart. - * 2. Click 'Move to Wishlist' button from Shopping Cart for added product. - * 3. Perform asserts. - * - * @group Shopping_Cart_(CS) - * @ZephyrId MPERF-7605 - */ -class MoveProductFromShoppingCartToWishlistTest extends AbstractWishlistTest -{ - /** - * Run Move from ShoppingCard to Wishlist test. - * - * @param Customer $customer - * @param CheckoutCart $checkoutCart - * @param string $product - * @return array - */ - public function test(Customer $customer, CheckoutCart $checkoutCart, $product) { - // Preconditions: - $product = $this->createProducts($product)[0]; - $this->loginCustomer($customer); - - // Steps: - $this->addToCart($product); - $checkoutCart->open()->getCartBlock()->getCartItem($product)->moveToWishlist(); - - return ['product' => $product]; - } - - /** - * Add product to cart. - * - * @param FixtureInterface $product - * @return void - */ - protected function addToCart(FixtureInterface $product) - { - $this->objectManager->create('Mage\Checkout\Test\TestStep\AddProductsToTheCartStep', ['products' => [$product]]) - ->run(); - } -} diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml deleted file mode 100644 index 071eb6b6864..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - --> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd"> - <testCase name="Mage\Wishlist\Test\TestCase\MoveProductFromShoppingCartToWishlistTest" summary="MoveProductFromShoppingCartToWishlistTest"> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation1" method="test"> - <data name="product" xsi:type="string">catalogProductSimple::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - </variation> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation2" method="test"> - <data name="product" xsi:type="string">catalogProductVirtual::order_default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - </variation> - <variation name="MoveProductFromShoppingCartToWishlistTestVariation4" method="test"> - <data name="product" xsi:type="string">configurableProduct::default</data> - <constraint name="Mage\Wishlist\Test\Constraint\AssertMoveProductToWishlistSuccessMessage" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductIsPresentInWishlist" /> - <constraint name="Mage\Checkout\Test\Constraint\AssertCartIsEmpty" /> - <constraint name="Mage\Wishlist\Test\Constraint\AssertProductDetailsInWishlist" /> - </variation> - </testCase> -</config> diff --git a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php b/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php deleted file mode 100644 index bf64b198366..00000000000 --- a/dev/tests/functional/tests/app/Mage/Wishlist/Test/TestStep/AddProductsToWishlistStep.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Mage\Wishlist\Test\TestStep; - -use Mage\Catalog\Test\Page\Product\CatalogProductView; -use Magento\Mtf\Client\Browser; -use Magento\Mtf\TestStep\TestStepInterface; - -/** - * Adding created products to the wish list. - */ -class AddProductsToWishlistStep implements TestStepInterface -{ - /** - * Array with products. - * - * @var array - */ - protected $products; - - /** - * Frontend product view page. - * - * @var CatalogProductView - */ - protected $catalogProductView; - - /** - * Interface Browser. - * - * @var Browser - */ - protected $browser; - - /** - * Configure flag. - * - * @var bool - */ - protected $configure; - - /** - * @constructor - * @param CatalogProductView $catalogProductView - * @param Browser $browser - * @param array $products - * @param bool $configure [optional] - */ - public function __construct( - CatalogProductView $catalogProductView, - Browser $browser, - array $products, - $configure = false - ) { - $this->products = $products; - $this->catalogProductView = $catalogProductView; - $this->browser = $browser; - $this->configure = $configure; - } - - /** - * Add products to the wish list. - * - * @return void - */ - public function run() - { - foreach ($this->products as $product) { - $this->browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html'); - $viewBlock = $this->catalogProductView->getViewBlock(); - $this->configure ? $viewBlock->addToWishlist($product) : $viewBlock->clickAddToWishlist(); - } - } -} diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php deleted file mode 100644 index e87f3c29d91..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Mtf\TestSuite; - -use Magento\Mtf\ObjectManager; -use Magento\Mtf\ObjectManagerFactory; - -/** - * Injectable tests class. - */ -class InjectableTests extends \PHPUnit_Framework_TestSuite -{ - /** - * Object manager. - * - * @var ObjectManager - */ - protected $objectManager; - - /** - * Test suite. - * - * @var \PHPUnit_Framework_TestSuite - */ - protected $suite; - - /** - * Test result - * - * @var \PHPUnit_Framework_TestResult - */ - protected $result; - - /** - * Run collected tests. - * - * @param \PHPUnit_Framework_TestResult $result - * @param bool $filter - * @param array $groups - * @param array $excludeGroups - * @param bool $processIsolation - * @return \PHPUnit_Framework_TestResult|void - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function run( - \PHPUnit_Framework_TestResult $result = null, - $filter = false, - array $groups = [], - array $excludeGroups = [], - $processIsolation = false - ) { - if ($result === null) { - $this->result = $this->createResult(); - } - } - - /** - * Prepare test suite. - * - * @return mixed - */ - public static function suite() - { - $suite = new self(); - return $suite->prepareSuite(); - } - - /** - * Prepare test suite and apply application state. - * - * @return AppState - */ - public function prepareSuite() - { - $this->init(); - return $this->objectManager->create('Magento\Mtf\TestSuite\AppState'); - } - - /** - * Call the initialization of ObjectManager. - * - * @return void - */ - public function init() - { - $this->initObjectManager(); - } - - /** - * Initialize ObjectManager. - * - * @return void - */ - private function initObjectManager() - { - if (!isset($this->objectManager)) { - $objectManagerFactory = new ObjectManagerFactory(); - - $configFileName = isset($_ENV['testsuite_rule']) ? $_ENV['testsuite_rule'] : 'basic'; - $configFilePath = realpath(MTF_BP . '/testsuites/' . $_ENV['testsuite_rule_path']); - - /** @var \Magento\Mtf\Config\DataInterface $configData */ - $configData = $objectManagerFactory->getObjectManager()->create('Magento\Mtf\Config\TestRunner'); - $configData->setFileName($configFileName . '.xml')->load($configFilePath); - - $this->objectManager = $objectManagerFactory->create( - ['Magento\Mtf\Config\TestRunner' => $configData] - ); - } - } -} diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml deleted file mode 100644 index dfbab34e4eb..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/3rdParty.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testcase"> - <allow> - <tag group="test_type" value="3rd_party_test" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml deleted file mode 100644 index a74f189dce1..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenet.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="authorize_net" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml deleted file mode 100644 index fa07a695c43..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/authorizenetdp.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="authorize_net_dp" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml deleted file mode 100644 index eb059f9cf9b..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/basic.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testcase"> - <deny> - <tag group="test_type" value="3rd_party_test" /> - </deny> - </rule> - <rule scope="variation"> - <deny> - <tag group="test_type" value="install" /> - </deny> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml deleted file mode 100644 index 342f397a7fd..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/ce_main.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="main" value="ce" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml deleted file mode 100644 index 379e14ae59c..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml deleted file mode 100644 index 848440a3d84..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce2.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest2" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml deleted file mode 100644 index 9d4298296bb..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce3.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest3" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml deleted file mode 100644 index 41fc27257de..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce4.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest4" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml deleted file mode 100644 index 667dbd89e35..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce5.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest5" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml deleted file mode 100644 index 8d1f3cb38a4..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/installationce6.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Install\Test\TestCase\InstallTest6" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml deleted file mode 100644 index e0ec0057d22..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="paypal" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml deleted file mode 100644 index 1072725e09f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypal1.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateInvoiceForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml deleted file mode 100644 index a5e39783144..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaladvanced.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="advanced" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml deleted file mode 100644 index c339a1663aa..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypaldirect.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="payment_method" value="paypal_direct" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml deleted file mode 100644 index 6b978e52883..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbutton.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\TestCreationForExpressCheckoutWithinPayPalButtonTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml deleted file mode 100644 index 14b1cdd83a5..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecbuttonproduct.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\TestCreationForExpressCheckoutWithinPayPalButtonFromProductPageTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml deleted file mode 100644 index 1072725e09f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecinvoice.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateInvoiceForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml deleted file mode 100644 index d595aa50484..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecrefund.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateOnlineRefundForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml deleted file mode 100644 index 47dfd6500a9..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalecshipment.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Paypal\Test\TestCase\CreateShipmentForPaypalExpressCheckoutTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml deleted file mode 100644 index 83152b71ca1..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalhostedsolution.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="hosted_solution" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml deleted file mode 100644 index ec8c231df4e..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowlink.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payflow_link" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml deleted file mode 100644 index aeace134b65..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpayflowpro.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payflow_pro" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml deleted file mode 100644 index dc4e6fc9a34..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalpaymentspro.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="payments_pro" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml deleted file mode 100644 index 260a0dd5abc..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/paypalstandard.xml +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="variation"> - <allow> - <tag group="paypal" value="standard" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml deleted file mode 100644 index 22f9be10a0f..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite1.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Admin\Test\TestCase\CreateAdminUserEntityTest" /> - <class value="Mage\Admin\Test\TestCase\CreateAdminUserRoleEntityTest" /> - <class value="Mage\Admin\Test\TestCase\UseAclRoleWithRestrictedGwsScopeTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateStoreEntityTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateStoreGroupEntityTest" /> - <class value="Mage\Adminhtml\Test\TestCase\CreateWebsiteEntityTest" /> - <class value="Mage\Bundle\Test\TestCase\CreateBundleProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateConfigurableProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateGroupedProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\CreateSimpleProductEntityTest" /> - - <class value="Mage\Catalog\Test\TestCase\Product\CreateVirtualProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\DeleteProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\UpdateConfigurableProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\UpdateSimpleProductEntityTest" /> - <class value="Mage\Sales\Test\TestCase\CreateOrderFromBackendWithinOfflinePaymentMethodsTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml deleted file mode 100644 index a392f0b81e2..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite2.xml +++ /dev/null @@ -1,77 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Catalog\Test\TestCase\Category\CreateCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Category\DeleteCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Category\UpdateCategoryEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Layer\FilterProductListTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddCrossSellProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddProductsToCompareTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddRelatedProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\AddUpSellProductsEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\ApplyMapTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\ClearAllCompareProductsTest" /> - - <class value="Mage\Catalog\Test\TestCase\Product\DuplicateProductEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsCrossSellsTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsRelatedTest" /> - <class value="Mage\Catalog\Test\TestCase\Product\PromoteProductsAsUpSellsTest" /> - <class value="Mage\Catalog\Test\TestCase\ProductAttribute\CreateAttributeSetEntityTest" /> - <class value="Mage\Catalog\Test\TestCase\ProductAttribute\CreateProductAttributeEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\ApplySeveralCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\CreateCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogRule\Test\TestCase\DeleteCatalogPriceRuleEntityTest" /> - <class value="Mage\CatalogSearch\Test\TestCase\CreateSearchTermEntityTest" /> - - <class value="Mage\CatalogSearch\Test\TestCase\SuggestSearchingResultEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\AddProductsToShoppingCartEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\CheckoutWithMultishippingTest" /> - <class value="Mage\Checkout\Test\TestCase\CreateTermEntityTest" /> - <class value="Mage\Checkout\Test\TestCase\DeleteProductsFromShoppingCartTest" /> - <class value="Mage\Checkout\Test\TestCase\UpdateShoppingCartTest" /> - <class value="Mage\Cms\Test\TestCase\CreateCmsBlockEntityTest" /> - <class value="Mage\Cms\Test\TestCase\CreateCmsPageEntityTest" /> - <class value="Mage\Cms\Test\TestCase\DeleteCmsPageEntityTest" /> - <class value="Mage\Cms\Test\TestCase\UpdateCmsPageEntityTest" /> - - <class value="Mage\CurrencySymbol\Test\TestCase\EditCurrencySymbolEntityTest" /> - <class value="Mage\Customer\Test\TestCase\ChangeCustomerPasswordTest" /> - <class value="Mage\Customer\Test\TestCase\CreateCustomerFromBackendTest" /> - <class value="Mage\Customer\Test\TestCase\CreateCustomerGroupEntityTest" /> - <class value="Mage\Customer\Test\TestCase\CreateExistingCustomerFrontendEntity" /> - <class value="Mage\Customer\Test\TestCase\DeleteCustomerAddressEntityTest" /> - <class value="Mage\Customer\Test\TestCase\RegisterCustomerFrontendEntityTest" /> - <class value="Mage\GiftMessage\Test\TestCase\CheckoutWithGiftMessagesTest" /> - <class value="Mage\Review\Test\TestCase\CreateProductReviewFrontendEntityTest" /> - <class value="Mage\Sales\Test\TestCase\CancelCreatedOrderTest" /> - - <class value="Mage\Sales\Test\TestCase\CreateOrderFromBackendCustomerPageTest" /> - <class value="Mage\Sales\Test\TestCase\MoveShoppingCartProductsOnOrderPageTest" /> - <class value="Mage\Sales\Test\TestCase\ReorderOrderEntityTest" /> - <class value="Mage\SalesRule\Test\TestCase\DeleteSalesRuleEntityTest" /> - <class value="Mage\Sitemap\Test\TestCase\CreateSitemapEntityTest" /> - <class value="Mage\Sitemap\Test\TestCase\GenerateSitemapEntityTest" /> - <class value="Mage\Tax\Test\TestCase\AutomaticTaxApplyingBasedOnVatIdTest" /> - <class value="Mage\Tax\Test\TestCase\CreateTaxRateEntityTest" /> - <class value="Mage\Tax\Test\TestCase\CreateTaxRuleEntityTest" /> - - <class value="Mage\Tax\Test\TestCase\DeleteTaxRateEntityTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml b/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml deleted file mode 100644 index c94469a1824..00000000000 --- a/dev/tests/functional/testsuites/Magento/Mtf/TestSuite/InjectableTests/suite3.xml +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ ---> -<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../vendor/magento/mtf/Magento/Mtf/TestRunner/etc/testRunner.xsd"> - <rule scope="testsuite"> - <allow> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutTest" /> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutWithinOnlineShippingMethods" /> - <class value="Mage\Checkout\Test\TestCase\OnePageCheckoutWithinDhlShippingMethod" /> - <class value="Mage\Downloadable\Test\TestCase\CreateDownloadableProductEntityTest" /> - <class value="Mage\Downloadable\Test\TestCase\TaxCalculationForDownloadableProductTest" /> - <class value="Mage\SalesRule\Test\TestCase\CreateSalesRuleEntityTest" /> - <class value="Mage\Tax\Test\TestCase\TaxCalculationTest" /> - <class value="Mage\Tax\Test\TestCase\TaxWithCrossBorderTest" /> - <class value="Mage\Weee\Test\TestCase\CreateTaxWithFptTest" /> - <class value="Mage\Wishlist\Test\TestCase\AddProductsToCartFromCustomerWishlistOnFrontendTest" /> - <class value="Mage\Wishlist\Test\TestCase\AddProductToWishlistEntityTest" /> - - <class value="Mage\Wishlist\Test\TestCase\ConfigureProductInCustomerWishlistOnFrontendTest" /> - <class value="Mage\Wishlist\Test\TestCase\MoveProductFromShoppingCartToWishlistTest" /> - </allow> - </rule> -</config> diff --git a/dev/tests/functional/utils/bootstrap.php b/dev/tests/functional/utils/bootstrap.php deleted file mode 100644 index 9c3ec84ce68..00000000000 --- a/dev/tests/functional/utils/bootstrap.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -umask(0); - -$mtfRoot = dirname(__DIR__); -$mtfRoot = str_replace('\\', '/', $mtfRoot); -define('MTF_BP', $mtfRoot); -define('MTF_TESTS_PATH', MTF_BP . '/tests/app/'); - -$appRoot = dirname(dirname(dirname(dirname(__DIR__)))); -require __DIR__ . '/../vendor/autoload.php'; - -$objectManager = \Magento\Mtf\ObjectManagerFactory::getObjectManager(); -\Magento\Mtf\ObjectManagerFactory::configure($objectManager); diff --git a/dev/tests/functional/utils/generate.php b/dev/tests/functional/utils/generate.php deleted file mode 100644 index 3998809974e..00000000000 --- a/dev/tests/functional/utils/generate.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once __DIR__ . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Page')->launch(); -$objectManager->create('Magento\Mtf\Util\Generate\Fixture')->launch(); -$objectManager->create('Magento\Mtf\Util\Generate\Repository')->launch(); - -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/fixture.php b/dev/tests/functional/utils/generate/fixture.php deleted file mode 100644 index 07d9e47f94a..00000000000 --- a/dev/tests/functional/utils/generate/fixture.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Fixture')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/handler.php b/dev/tests/functional/utils/generate/handler.php deleted file mode 100644 index 35ff417b5d1..00000000000 --- a/dev/tests/functional/utils/generate/handler.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Handler')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/page.php b/dev/tests/functional/utils/generate/page.php deleted file mode 100644 index 78d9efc12dc..00000000000 --- a/dev/tests/functional/utils/generate/page.php +++ /dev/null @@ -1,17 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; -$objectManager->create('Magento\Mtf\Util\Generate\Page')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults(); diff --git a/dev/tests/functional/utils/generate/repository.php b/dev/tests/functional/utils/generate/repository.php deleted file mode 100644 index 324c6a8ede0..00000000000 --- a/dev/tests/functional/utils/generate/repository.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * OpenMage - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available at https://opensource.org/license/osl-3-0-php - * - * @category Tests - * @package Tests_Functional - * @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com) - * @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org) - * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -require_once dirname(__DIR__) . '/' . 'bootstrap.php'; - -$objectManager->create('Magento\Mtf\Util\Generate\Repository')->launch(); -\Magento\Mtf\Util\Generate\GenerateResult::displayResults();