@@ -46,7 +46,7 @@ |
||
| 46 | 46 | ) |
| 47 | 47 | ); |
| 48 | 48 | } catch (\Exception $e) { |
| 49 | - throw new NoSuchShippingMethodException('Unable to find the shipping method: ' . $this->name); |
|
| 49 | + throw new NoSuchShippingMethodException('Unable to find the shipping method: '.$this->name); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Some products, such as virtual products, do not get shipped |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | $this->form->execute($registerForNewsletter); |
| 44 | 44 | |
| 45 | - $submitElement = $this->webdriver->byXpath($this->theme->getRegisterSubmitXpath()); |
|
| 45 | + $submitElement = $this->webdriver->byXpath($this->theme->getRegisterSubmitXpath()); |
|
| 46 | 46 | |
| 47 | 47 | $submitElement->click(); |
| 48 | 48 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @see Magium\Magento\Actions\Checkout\Steps\CustomerBillingAddress |
| 40 | 40 | * |
| 41 | - * @param $element The name of the element |
|
| 41 | + * @param string $element The name of the element |
|
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | 44 | public function bypassElement($element) |
@@ -88,6 +88,10 @@ discard block |
||
| 88 | 88 | return array_search($xpath, $this->bypass) === false; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | + /** |
|
| 92 | + * @param string $xpath |
|
| 93 | + * @param string $data |
|
| 94 | + */ |
|
| 91 | 95 | protected function sendData($xpath, $data) |
| 92 | 96 | { |
| 93 | 97 | if ($this->shouldProcess($xpath)) { |
@@ -62,6 +62,10 @@ |
||
| 62 | 62 | return false; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | + /** |
|
| 66 | + * @param string $xpath |
|
| 67 | + * @param string $data |
|
| 68 | + */ |
|
| 65 | 69 | protected function sendData($xpath, $data) |
| 66 | 70 | { |
| 67 | 71 | if ($xpath) { |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | $this->webDriver->byId('sagepaydirectpro_cc_owner')->clear(); |
| 68 | 68 | $this->webDriver->byId('sagepaydirectpro_cc_owner')->sendKeys( |
| 69 | - $this->customer->getBillingFirstName() . ' ' . $this->customer->getBillingLastName() |
|
| 69 | + $this->customer->getBillingFirstName().' '.$this->customer->getBillingLastName() |
|
| 70 | 70 | ); |
| 71 | 71 | |
| 72 | 72 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | $emailElement = $this->webdriver->byXpath($this->theme->getRegisterEmailXpath()); |
| 39 | 39 | $passwordElement = $this->webdriver->byXpath($this->theme->getRegisterPasswordXpath()); |
| 40 | 40 | $confirmElement = $this->webdriver->byXpath($this->theme->getRegisterConfirmPasswordXpath()); |
| 41 | - $registerElement = $this->webdriver->byXpath($this->theme->getRegisterNewsletterXpath()); |
|
| 41 | + $registerElement = $this->webdriver->byXpath($this->theme->getRegisterNewsletterXpath()); |
|
| 42 | 42 | |
| 43 | 43 | $firstnameElement->sendKeys($this->customerIdentity->getFirstName()); |
| 44 | 44 | $lastnameElement->sendKeys($this->customerIdentity->getLastName()); |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | { |
| 37 | 37 | |
| 38 | 38 | usleep(500000); // Give the UI some time to update |
| 39 | - $xpath .= '/descendant::' . $this->themeConfiguration->getNavigationChildXPathSelector($path); |
|
| 39 | + $xpath .= '/descendant::'.$this->themeConfiguration->getNavigationChildXPathSelector($path); |
|
| 40 | 40 | |
| 41 | - $element = $this->webdriver->byXpath($xpath . '/a'); |
|
| 41 | + $element = $this->webdriver->byXpath($xpath.'/a'); |
|
| 42 | 42 | |
| 43 | 43 | $this->execute($element); |
| 44 | 44 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // If we are passed just the class name we will prepend it with Magium\Magento\Actions\Checkout\PaymentMethods |
| 31 | 31 | if (strpos($method, '\\') === false) { |
| 32 | - $method = 'Checkout\PaymentMethods\\' . $method; |
|
| 32 | + $method = 'Checkout\PaymentMethods\\'.$method; |
|
| 33 | 33 | $method = self::resolveClass($method, 'Actions'); |
| 34 | 34 | } |
| 35 | 35 | $reflection = new \ReflectionClass($method); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | // When just the class name is passed we will prepend it with Magium\Magento\Actions\Checkout\PaymentMethods |
| 83 | 83 | if (strpos($method, '\\') === false) { |
| 84 | - $method = 'Magium\Magento\Actions\Checkout\ShippingMethods\\' . $method; |
|
| 84 | + $method = 'Magium\Magento\Actions\Checkout\ShippingMethods\\'.$method; |
|
| 85 | 85 | } |
| 86 | 86 | $reflection = new \ReflectionClass($method); |
| 87 | 87 | if ($reflection->implementsInterface('Magium\Magento\Actions\Checkout\ShippingMethods\ShippingMethodInterface')) { |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | if ($reflection->isSubclassOf('Magium\Magento\Themes\NavigableThemeInterface')) { |
| 107 | 107 | // Not entirely sure of hardcoding the various interface types. May make this configurable |
| 108 | 108 | parent::switchThemeConfiguration($fullyQualifiedClassName); |
| 109 | - $this->setTypePreference('Magium\Magento\Themes\AbstractThemeConfiguration',$fullyQualifiedClassName); |
|
| 110 | - $this->setTypePreference('Magium\Magento\Themes\NavigableThemeInterface',$fullyQualifiedClassName); |
|
| 111 | - $this->setTypePreference('Magium\Themes\BaseThemeInterface',$fullyQualifiedClassName); |
|
| 109 | + $this->setTypePreference('Magium\Magento\Themes\AbstractThemeConfiguration', $fullyQualifiedClassName); |
|
| 110 | + $this->setTypePreference('Magium\Magento\Themes\NavigableThemeInterface', $fullyQualifiedClassName); |
|
| 111 | + $this->setTypePreference('Magium\Themes\BaseThemeInterface', $fullyQualifiedClassName); |
|
| 112 | 112 | |
| 113 | - $this->setTypePreference('Magium\Magento\Themes\Customer\AbstractThemeConfiguration',$this->getTheme()->getCustomerThemeClass()); |
|
| 114 | - $this->setTypePreference('Magium\Magento\Themes\OnePageCheckout\AbstractThemeConfiguration',$this->getTheme()->getCheckoutThemeClass()); |
|
| 113 | + $this->setTypePreference('Magium\Magento\Themes\Customer\AbstractThemeConfiguration', $this->getTheme()->getCustomerThemeClass()); |
|
| 114 | + $this->setTypePreference('Magium\Magento\Themes\OnePageCheckout\AbstractThemeConfiguration', $this->getTheme()->getCheckoutThemeClass()); |
|
| 115 | 115 | } else { |
| 116 | 116 | throw new InvalidConfigurationException('The theme configuration extend Magium\Magento\Themes\NavigableThemeInterface'); |
| 117 | 117 | } |
@@ -15,25 +15,25 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var string The Xpath string that finds the base of the navigation menu |
| 17 | 17 | */ |
| 18 | - public $navigationBaseXPathSelector = '//ul[@id="nav"]'; |
|
| 18 | + public $navigationBaseXPathSelector = '//ul[@id="nav"]'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var string The Xpath string that can be used iteratively to find child navigation nodes |
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | - public $navigationChildXPathSelector = 'a[concat(" ",normalize-space(.)," ") = " %s "]/..'; |
|
| 24 | + public $navigationChildXPathSelector = 'a[concat(" ",normalize-space(.)," ") = " %s "]/..'; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * @var string A simple, default path to use for categories. |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | - public $navigationPathToSimpleProductCategory = '{{Electronics}}/{{Cell Phones}}'; |
|
| 30 | + public $navigationPathToSimpleProductCategory = '{{Electronics}}/{{Cell Phones}}'; |
|
| 31 | 31 | |
| 32 | 32 | public $defaultSimpleProductName = '{{Nokia 2610 Phone}}'; |
| 33 | 33 | |
| 34 | 34 | public $productPagePriceXpath = '(//form[@id="product_addtocart_form"]/descendant::span[contains(concat(" ",normalize-space(@class)," ")," regular-price ")]/span[contains(concat(" ",normalize-space(@class)," ")," price ")])[1]'; |
| 35 | 35 | |
| 36 | - public $navigationPathToConfigurableProductCategory = '{{Apparel}}/{{Shirts}}'; |
|
| 36 | + public $navigationPathToConfigurableProductCategory = '{{Apparel}}/{{Shirts}}'; |
|
| 37 | 37 | |
| 38 | 38 | public $defaultConfigurableProductName = '{{Zolof The Rock And Roll Destroyer: LOL Cat T-shirt}}'; |
| 39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * @var string Xpath to add a Simple product to the cart from the product's page |
| 42 | 42 | */ |
| 43 | 43 | |
| 44 | - public $addToCartXpath = '//button[@title="{{Add to Cart}}" and contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 44 | + public $addToCartXpath = '//button[@title="{{Add to Cart}}" and contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * @var string Xpath to add a Simple product to the cart from the category page |
@@ -53,15 +53,15 @@ discard block |
||
| 53 | 53 | * @var string Xpath to find a product's link on a category page. Used to navigate to the product from the category |
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | - public $categoryProductPageXpath = '//h2[@class="product-name"]/descendant::a'; |
|
| 56 | + public $categoryProductPageXpath = '//h2[@class="product-name"]/descendant::a'; |
|
| 57 | 57 | |
| 58 | - public $categorySpecificProductPageXpath = '//h2[@class="product-name"]/descendant::a[.="%s"]'; |
|
| 58 | + public $categorySpecificProductPageXpath = '//h2[@class="product-name"]/descendant::a[.="%s"]'; |
|
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | 61 | * @var string Xpath used after a product has been added to the cart to verify that the product has been added to the cart |
| 62 | 62 | */ |
| 63 | 63 | |
| 64 | - public $addToCartSuccessXpath = '//li[@class="success-msg" and contains(., "{{was added to your shopping cart}}")]'; |
|
| 64 | + public $addToCartSuccessXpath = '//li[@class="success-msg" and contains(., "{{was added to your shopping cart}}")]'; |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * @var string The base URL of the installation |
@@ -87,12 +87,12 @@ discard block |
||
| 87 | 87 | * @var array Instructions in an Xpath array syntax to get to the customer registration page |
| 88 | 88 | */ |
| 89 | 89 | |
| 90 | - public $logoutNavigationInstructions = [ |
|
| 90 | + public $logoutNavigationInstructions = [ |
|
| 91 | 91 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//ul[@class="links"]/descendant::a[.="{{Log Out}}"]'], |
| 92 | 92 | // [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//div[@id="header-account"]/descendant::a[@title="{{Log Out}}"]'] |
| 93 | 93 | ]; |
| 94 | 94 | |
| 95 | - public $cartNavigationInstructions = [ |
|
| 95 | + public $cartNavigationInstructions = [ |
|
| 96 | 96 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//string[@id="cartHeader"]'], |
| 97 | 97 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//div[@id="topCartContent"]/descendant::a/span[.="{{Go to Shopping Cart}}"]'] |
| 98 | 98 | ]; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @var array Instructions in an Xpath array syntax to get to the login page. |
| 102 | 102 | */ |
| 103 | 103 | |
| 104 | - public $navigateToCustomerPageInstructions = [ |
|
| 104 | + public $navigateToCustomerPageInstructions = [ |
|
| 105 | 105 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//ul[@class="links"]/descendant::a[.="{{My Account}}"]'], |
| 106 | 106 | //[\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//div[@id="header-account"]/descendant::a[@title="My Account"]'] |
| 107 | 107 | ]; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @var array Instructions in an Xpath array syntax to get to the start of the checkout page |
| 111 | 111 | */ |
| 112 | 112 | |
| 113 | - public $checkoutNavigationInstructions = [ |
|
| 113 | + public $checkoutNavigationInstructions = [ |
|
| 114 | 114 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//ul[@class="links"]/descendant::a[@title="{{Checkout}}"]'], |
| 115 | 115 | // [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//div[@class="minicart-actions"]/descendant::a[@title="Checkout"]'] |
| 116 | 116 | ]; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @var array Instructions in an Xpath array syntax to get to the customer registration page |
| 121 | 121 | */ |
| 122 | 122 | |
| 123 | - public $registrationNavigationInstructions = [ |
|
| 123 | + public $registrationNavigationInstructions = [ |
|
| 124 | 124 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//ul[@class="links"]/descendant::a[.="{{My Account}}"]'], |
| 125 | 125 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//button/span/span[.="{{Register}}"]/../..'] |
| 126 | 126 | ]; |
@@ -141,10 +141,10 @@ discard block |
||
| 141 | 141 | public $cartSummaryCheckoutProductLoopQtyXpath = '(//table[@id="checkout-review-table"]/tbody/descendant::td[@data-rwd-label="Qty"])[%d]'; |
| 142 | 142 | public $cartSummaryCheckoutProductLoopSubtotalXpath = '(//table[@id="checkout-review-table"]/tbody/descendant::td[@data-rwd-label="Subtotal"])[%d]'; |
| 143 | 143 | |
| 144 | - public $cartSummaryCheckoutSubTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Subtotal "]/../td[2]'; |
|
| 145 | - public $cartSummaryCheckoutTax = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Tax "]/../td[2]'; |
|
| 146 | - public $cartSummaryCheckoutGrandTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Grand Total "]/../td[2]'; |
|
| 147 | - public $cartSummaryCheckoutShippingTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[contains(concat(" ",normalize-space(.)," "), " Shipping & Handling (")]/../td[2]'; |
|
| 144 | + public $cartSummaryCheckoutSubTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Subtotal "]/../td[2]'; |
|
| 145 | + public $cartSummaryCheckoutTax = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Tax "]/../td[2]'; |
|
| 146 | + public $cartSummaryCheckoutGrandTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[concat(" ",normalize-space(.)," ") = " Grand Total "]/../td[2]'; |
|
| 147 | + public $cartSummaryCheckoutShippingTotal = '//table[@id="checkout-review-table"]/tfoot/tr/td[contains(concat(" ",normalize-space(.)," "), " Shipping & Handling (")]/../td[2]'; |
|
| 148 | 148 | |
| 149 | 149 | public $breadCrumbXpath = '//div[@class="breadcrumbs"]'; |
| 150 | 150 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | public $productListOriginalPriceXpath = '/descendant::div[@class="price-box"]/descendant::p[@class="old-price"]/descendant::*[@class="price"]'; |
| 158 | 158 | public $productListPriceXpath = '/descendant::div[@class="price-box"]/descendant::*[@class="regular-price" or @class="special-price"]/descendant::span[@class="price"]'; |
| 159 | 159 | public $productListWishlistLinkXpath = '/descendant::ul[@class="add-to-links"]/descendant::a[@class="link-wishlist"]'; |
| 160 | - public $productListAddToCartLinkXpath = '/descendant::div[@class="product-shop"]/descendant::button[contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 160 | + public $productListAddToCartLinkXpath = '/descendant::div[@class="product-shop"]/descendant::button[contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 161 | 161 | |
| 162 | 162 | public $productGridBaseXpath = '//ul[contains(concat(" ",normalize-space(@class)," ")," products-grid ")]/li[%d]'; |
| 163 | 163 | public $productGridDescriptionXpath = '/*[.="no description in the grid view"]'; |
@@ -168,15 +168,15 @@ discard block |
||
| 168 | 168 | public $productGridOriginalPriceXpath = '/descendant::div[@class="price-box"]/descendant::p[@class="old-price"]/descendant::*[@class="price"]'; |
| 169 | 169 | public $productGridPriceXpath = '/descendant::div[@class="price-box"]/descendant::*[@class="regular-price" or @class="special-price"]/descendant::span[@class="price"]'; |
| 170 | 170 | public $productGridWishlistLinkXpath = '/descendant::ul[@class="add-to-links"]/descendant::a[@class="link-wishlist"]'; |
| 171 | - public $productGridAddToCartLinkXpath = '/descendant::div[@class="actions"]/descendant::button[contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 171 | + public $productGridAddToCartLinkXpath = '/descendant::div[@class="actions"]/descendant::button[contains(concat(" ",normalize-space(@class)," ")," btn-cart ")]'; |
|
| 172 | 172 | |
| 173 | 173 | public $productCollectionViewModeXpath = '//p[@class="view-mode"]/strong'; |
| 174 | 174 | public $productCollectionSortByXpath = '//div[@class="sort-by"]/descendant::option[@selected]'; // We select using the div, not the title because the title may be translated |
| 175 | 175 | public $productCollectionShowCountXpath = '//div[@class="limiter"]/descendant::option[@selected]'; // dittos |
| 176 | - public $productCollectionShowCountOptionsXpath = '//div[@class="limiter"]/descendant::option'; |
|
| 176 | + public $productCollectionShowCountOptionsXpath = '//div[@class="limiter"]/descendant::option'; |
|
| 177 | 177 | public $productCollectionProductCountXpath = '//div[contains(concat(" ",normalize-space(@class)," ")," pager ")]/descendant::p[contains(concat(" ",normalize-space(@class)," ")," amount ")]'; |
| 178 | 178 | |
| 179 | - public $layeredNavigationBaseXpath = '//div[contains(concat(" ",normalize-space(@class)," ")," block-layered-nav ")]'; |
|
| 179 | + public $layeredNavigationBaseXpath = '//div[contains(concat(" ",normalize-space(@class)," ")," block-layered-nav ")]'; |
|
| 180 | 180 | |
| 181 | 181 | public $searchInputXpath = '//input[@id="search"]'; |
| 182 | 182 | public $searchSubmitXpath = '//form[@id="search_mini_form"]/descendant::button[@type="submit"]'; |
@@ -195,11 +195,11 @@ discard block |
||
| 195 | 195 | public $breadCrumbMemberXpath = '/descendant::a[concat(" ",normalize-space(.)," ")=" {{%s}} "]'; |
| 196 | 196 | public $breadCrumbSelectorXpath = '/descendant::a[%d]'; |
| 197 | 197 | |
| 198 | - public $layeredNavigationFilterNameXpath = '//dl[@id="narrow-by-list"]/dt'; |
|
| 198 | + public $layeredNavigationFilterNameXpath = '//dl[@id="narrow-by-list"]/dt'; |
|
| 199 | 199 | |
| 200 | 200 | public $layeredNavigationFilterTypesXpath = '//dt[.="%s"]/following-sibling::dd[1]/descendant::li'; |
| 201 | 201 | public $layeredNavigationFilterLinkXpath = '//dt[.="%s"]/following-sibling::dd[1]/descendant::li/descendant::a'; |
| 202 | - public $layeredNavigationFilterNameElementXpath = '//dl[@id="narrow-by-list"]/dt[normalize-space(.) = "%s"]'; |
|
| 202 | + public $layeredNavigationFilterNameElementXpath = '//dl[@id="narrow-by-list"]/dt[normalize-space(.) = "%s"]'; |
|
| 203 | 203 | |
| 204 | 204 | public $storeSwitcherInstructionsXpath = [ |
| 205 | 205 | [\Magium\WebDriver\WebDriver::INSTRUCTION_MOUSE_CLICK, '//select[@id="select-language"]/descendant::option[contains(@href,"___store=%s"]'], |