diff --git a/dev/tests/functional/lib/Magento/Mtf/Client/Element/LiselectstoreElement.php b/dev/tests/functional/lib/Magento/Mtf/Client/Element/LiselectstoreElement.php index 65985c017d08195438e94d07b032d035c6712788..1ef99365d95eb681d06b9295bd85649e2886fb6d 100644 --- a/dev/tests/functional/lib/Magento/Mtf/Client/Element/LiselectstoreElement.php +++ b/dev/tests/functional/lib/Magento/Mtf/Client/Element/LiselectstoreElement.php @@ -74,7 +74,7 @@ class LiselectstoreElement extends SimpleElement } $optionSelector = './/' . implode($this->optionMaskFollowing, $optionSelector) . '/a'; - $option = $this->driver->find($optionSelector, Locator::SELECTOR_XPATH); + $option = $this->context->find($optionSelector, Locator::SELECTOR_XPATH); if (!$option->isVisible()) { throw new \Exception('[' . implode('/', $value) . '] option is not visible in store switcher.'); } diff --git a/dev/tests/functional/phpunit.xml.dist b/dev/tests/functional/phpunit.xml.dist index bcd8adec52eee81173b52bcaa3efca23efaa6a6e..afc68476ee4123c72a4f52e9f3cc8cf84c67aa0b 100644 --- a/dev/tests/functional/phpunit.xml.dist +++ b/dev/tests/functional/phpunit.xml.dist @@ -39,6 +39,7 @@ <env name="basedir" value="var/log" /> <env name="credentials_file_path" value="./credentials.xml.dist" /> <env name="mage_mode" value="developer" /> + <env name="magento_timezone" value="America/Los_Angeles" /> </php> </phpunit> diff --git a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php index 9bc78a1416ef8536e51da1e69b499add05a4567f..2d625e2a7213153a2d3f98a9829645187b261691 100644 --- a/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php +++ b/dev/tests/functional/tests/app/Magento/Backend/Test/Fixture/Source/Date.php @@ -13,9 +13,17 @@ use Magento\Mtf\Fixture\DataSource; * * Data keys: * - pattern (Format a local time/date with delta, e.g. 'm/d/Y -3 days' = current day - 3 days) + * - apply_timezone (true if it is needed to apply timezone) */ class Date extends DataSource { + /** + * Indicates whether timezone setting is applied or not. + * + * @var bool + */ + private $isTimezoneApplied; + /** * @constructor * @param array $params @@ -35,7 +43,16 @@ class Date extends DataSource if (!$timestamp) { throw new \Exception('Invalid date format for "' . $this->params['attribute_code'] . '" field'); } - $date = date(str_replace($delta, '', $data['pattern']), $timestamp); + if (isset($data['apply_timezone']) && $data['apply_timezone'] === true) { + $date = new \DateTime(); + $date->setTimestamp($timestamp); + $date->setTimezone(new \DateTimeZone($_ENV['magento_timezone'])); + $date = $date->format(str_replace($delta, '', $data['pattern'])); + $this->isTimezoneApplied = true; + } else { + $date = date(str_replace($delta, '', $data['pattern']), $timestamp); + $this->isTimezoneApplied = false; + } if (!$date) { $date = date('m/d/Y'); } @@ -44,4 +61,14 @@ class Date extends DataSource $this->data = $data; } } + + /** + * Verifies if timezone setting has been already applied. + * + * @return bool + */ + public function isTimezoneApplied() + { + return $this->isTimezoneApplied; + } } diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml index 2f0b248b800b3ce9feb2c42129a13975821dfefe..ebab7cc83b283e2a8bd5285c5361cdba7f453385 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/ProductForm.xml @@ -57,6 +57,10 @@ <selector>[name="use_default[name]"]</selector> <input>checkbox</input> </use_default_name> + <use_default_price> + <selector>[name="use_default[price]"]</selector> + <input>checkbox</input> + </use_default_price> </fields> </product-details> <advanced-pricing> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml index bb2c8bc6ead7cdca55ab42daf72e3e88f0f79310..8f73299d5f6dcfc234465faddec418a67964d092 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/CatalogProductSimple.xml @@ -48,6 +48,7 @@ <field name="msrp_display_actual_price_type" is_required="0" /> <field name="name" is_required="1" group="product-details" /> <field name="use_default_name" group="product-details" /> + <field name="use_default_price" group="product-details" /> <field name="old_id" is_required="0" /> <field name="options_container" is_required="0" /> <field name="page_layout" is_required="0" /> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml index 79b00f58cd742cb3bf19175e5916209b21810d0d..e9791de338bd36e9c5ec904423888913a54f6211 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml @@ -1799,5 +1799,35 @@ <item name="dataset" xsi:type="string">simple_order_default</item> </field> </dataset> + + <dataset name="product_with_additional_website"> + <field name="sku" xsi:type="string">simple_product_with_category_%isolation%</field> + <field name="name" xsi:type="string">Simple product with category %isolation%</field> + <field name="quantity_and_stock_status" xsi:type="array"> + <item name="qty" xsi:type="string">777</item> + <item name="is_in_stock" xsi:type="string">In Stock</item> + </field> + <field name="product_has_weight" xsi:type="string">This item has weight</field> + <field name="weight" xsi:type="string">1</field> + <field name="attribute_set_id" xsi:type="array"> + <item name="dataset" xsi:type="string">default</item> + </field> + <field name="price" xsi:type="array"> + <item name="value" xsi:type="string">10</item> + <item name="dataset" xsi:type="string" /> + </field> + <field name="category_ids" xsi:type="array"> + <item name="dataset" xsi:type="string">default_subcategory</item> + </field> + <field name="website_ids" xsi:type="array"> + <item name="0" xsi:type="array"> + <item name="dataset" xsi:type="string">default</item> + </item> + <item name="1" xsi:type="array"> + <item name="dataset" xsi:type="string">custom_store</item> + </item> + </field> + <field name="url_key" xsi:type="string">simple-product-%isolation%</field> + </dataset> </repository> </config> diff --git a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ConfigData.xml b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ConfigData.xml index 308bff869265fb64eb4a667c30397e84dd174864..28ea191568cb6c8bc4b12cb3eb84b9aeb5092907 100644 --- a/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ConfigData.xml +++ b/dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/ConfigData.xml @@ -45,5 +45,21 @@ <item name="inherit" xsi:type="number">1</item> </field> </dataset> + <dataset name="price_scope_website"> + <field name="catalog/price/scope" xsi:type="array"> + <item name="scope" xsi:type="string">default</item> + <item name="scope_id" xsi:type="number">0</item> + <item name="label" xsi:type="string">Website</item> + <item name="value" xsi:type="number">1</item> + </field> + </dataset> + <dataset name="price_scope_website_rollback"> + <field name="catalog/price/scope" xsi:type="array"> + <item name="scope" xsi:type="string">default</item> + <item name="scope_id" xsi:type="number">0</item> + <item name="label" xsi:type="string">Global</item> + <item name="value" xsi:type="number">0</item> + </field> + </dataset> </repository> </config>