- retail Customer
+ retail_customer
GroupName%isolation%
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php
index 745b576a528ab..b305528390cf0 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php
@@ -61,7 +61,7 @@ public function __construct(
public function run()
{
$this->cmsIndex->open();
- $this->cmsIndex->getLinksBlock()->waitWelcomeMessage();
+ $this->cmsIndex->getCmsPageBlock()->waitPageInit();
if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
$this->cmsIndex->getLinksBlock()->openLink("Log Out");
$this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
diff --git a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
index 57fb8c5d9527d..8e3861485f447 100644
--- a/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
+++ b/dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LogoutCustomerOnFrontendStep.php
@@ -39,6 +39,7 @@ public function __construct(CmsIndex $cmsIndex)
public function run()
{
$this->cmsIndex->open();
+ $this->cmsIndex->getCmsPageBlock()->waitPageInit();
if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
$this->cmsIndex->getLinksBlock()->openLink("Log Out");
$this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php
index a68a64dc05794..e620a4ca4ac6a 100644
--- a/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php
+++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/Fixture/DownloadableProduct/CheckoutData.php
@@ -29,7 +29,7 @@ protected function getPreset($name)
'options' => [
'links' => [
[
- 'label' => 'link_1',
+ 'label' => 'link_0',
'value' => 'Yes',
],
],
@@ -43,11 +43,11 @@ protected function getPreset($name)
'options' => [
'links' => [
[
- 'label' => 'link_1',
+ 'label' => 'link_0',
'value' => 'Yes',
],
[
- 'label' => 'link_2',
+ 'label' => 'link_1',
'value' => 'Yes'
],
],
@@ -75,7 +75,7 @@ protected function getPreset($name)
'options' => [
'links' => [
[
- 'label' => 'link_1',
+ 'label' => 'link_0',
'value' => 'Yes',
],
],
@@ -92,7 +92,7 @@ protected function getPreset($name)
],
'links' => [
[
- 'label' => 'link_1',
+ 'label' => 'link_0',
'value' => 'Yes'
]
],
diff --git a/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml
new file mode 100644
index 0000000000000..1409e9a0d2f08
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Downloadable/Test/TestCase/DuplicateProductEntityTest.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+ downloadableProduct::default
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..dccd3aa897208
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Email/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Marketing > Email Templates
+ Email Templates
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php
index 4d111e4a6f603..a9a17c123c4c1 100644
--- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php
+++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/Constraint/AssertGiftMessageInFrontendOrderItems.php
@@ -10,7 +10,7 @@
use Magento\Customer\Test\Page\CustomerAccountLogout;
use Magento\GiftMessage\Test\Fixture\GiftMessage;
use Magento\Sales\Test\Page\OrderHistory;
-use Magento\Sales\Test\Page\SalesOrderView;
+use Magento\Sales\Test\Page\CustomerOrderView;
use Magento\Mtf\Constraint\AbstractConstraint;
/**
@@ -25,7 +25,7 @@ class AssertGiftMessageInFrontendOrderItems extends AbstractConstraint
* @param GiftMessage $giftMessage
* @param Customer $customer
* @param OrderHistory $orderHistory
- * @param SalesOrderView $salesOrderView
+ * @param CustomerOrderView $customerOrderView
* @param CustomerAccountLogout $customerAccountLogout
* @param string $orderId
* @param array $products
@@ -35,7 +35,7 @@ public function processAssert(
GiftMessage $giftMessage,
Customer $customer,
OrderHistory $orderHistory,
- SalesOrderView $salesOrderView,
+ CustomerOrderView $customerOrderView,
CustomerAccountLogout $customerAccountLogout,
$orderId,
$products = []
@@ -64,7 +64,7 @@ public function processAssert(
}
\PHPUnit_Framework_Assert::assertEquals(
$expectedData,
- $salesOrderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()),
+ $customerOrderView->getGiftMessageForItemBlock()->getGiftMessage($product->getName()),
'Wrong gift message is displayed on "' . $product->getName() . '" item.'
);
}
diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml
deleted file mode 100644
index 10cedb90faf83..0000000000000
--- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/scenario.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-
-
-
-
-
-
-
- setupConfiguration
-
-
- - cashondelivery, enable_gift_messages
-
- createProducts
-
-
- createCustomer
-
-
- loginCustomerOnFrontend
-
-
- addProductsToTheCart
-
-
- proceedToCheckout
-
-
- fillBillingInformation
-
-
- fillShippingMethod
-
-
- fillShippingMethod
-
-
- selectPaymentMethod
-
-
- placeOrder
-
-
-
-
-
-
-
-
-
-
- setupConfiguration
-
-
- - cashondelivery, enable_gift_messages
-
- createProducts
-
-
- createCustomer
-
-
-
-
- - johndoe_with_addresses
-
-
- openSalesOrders
-
-
- createNewOrder
-
-
- selectCustomerOrder
-
-
- selectStore
-
-
- addProducts
-
-
- addGiftMessageBackend
-
-
- fillBillingAddress
-
-
- selectPaymentMethodForOrder
-
-
- selectShippingMethodForOrder
-
-
- submitOrder
-
-
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml
index 0678443518429..44be0fed9e25d 100644
--- a/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml
+++ b/dev/tests/functional/tests/app/Magento/GiftMessage/Test/etc/testcase.xml
@@ -6,40 +6,40 @@
*/
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..528dc68a50b1c
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/GoogleShopping/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ Products > Attributes
+ Google Content Attributes
+
+
+
+ Products > Items
+ Google Content Items
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php
index e7605924ad258..0a883fed4545d 100644
--- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.php
@@ -12,10 +12,6 @@
use Magento\Mtf\TestCase\Injectable;
/**
- * Test Creation for Update GroupedProductEntity
- *
- * Test Flow:
- *
* Preconditions:
* 1. Create Grouped Product.
*
@@ -38,21 +34,21 @@ class UpdateGroupedProductEntityTest extends Injectable
/* end tags */
/**
- * Page product on backend
+ * Page product on backend.
*
* @var CatalogProductIndex
*/
protected $catalogProductIndex;
/**
- * Edit page on backend
+ * Edit page on backend.
*
* @var CatalogProductEdit
*/
protected $catalogProductEdit;
/**
- * Filling objects of the class
+ * Filling objects of the class.
*
* @param CatalogProductIndex $catalogProductIndexNewPage
* @param CatalogProductEdit $catalogProductEditPage
@@ -67,7 +63,7 @@ public function __inject(
}
/**
- * Test update grouped product
+ * Test update grouped product.
*
* @param GroupedProduct $product
* @param GroupedProduct $originalProduct
diff --git a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml
index dd1f2144e4e3f..cc918d24c96e6 100644
--- a/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/GroupedProduct/Test/TestCase/UpdateGroupedProductEntityTest.xml
@@ -6,78 +6,59 @@
*/
-->
-
-
- grouped_product_out_of_stock
- GroupedProduct_edited %isolation%
- GroupedProduct_sku_edited %isolation%
- In Stock
- category_%isolation%
- -
- -
- This is edited description for grouped product
- This is edited short description for grouped product
- updated-grouped-product-%isolation%
-
-
-
-
-
- default
- GroupedProduct_edited %isolation%
- GroupedProduct_sku_edited %isolation%
- -
- -
- catalogProductVirtual::default,catalogProductVirtual::product_50_dollar
- defaultVirtualProduct
- -
- -
- updated-grouped-product-%isolation%
-
-
-
-
- default
- GroupedProduct_edited %isolation%
- GroupedProduct_sku_edited %isolation%
- -
- -
- catalogProductSimple::simple_for_composite_products,catalogProductSimple::default
- defaultSimpleProduct_without_qty
- -
- -
- updated-grouped-product-%isolation%
-
-
-
-
-
- default
- GroupedProduct_edited %isolation%
- GroupedProduct_sku_edited %isolation%
- -
- -
- catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice
- defaultSimpleProduct_with_specialPrice
- -
- -
- updated-grouped-product-%isolation%
-
-
-
-
- default
- GroupedProduct_edited %isolation%
- GroupedProduct_sku_edited %isolation%
- Out of Stock
- -
- -
- -
- -
- -
- updated-grouped-product-%isolation%
-
-
-
-
+
+
+ grouped_product_out_of_stock
+ GroupedProduct_edited %isolation%
+ GroupedProduct_sku_edited %isolation%
+ In Stock
+ category_%isolation%
+ This is edited description for grouped product
+ This is edited short description for grouped product
+ updated-grouped-product-%isolation%
+
+
+
+
+
+ default
+ GroupedProduct_edited %isolation%
+ GroupedProduct_sku_edited %isolation%
+ catalogProductVirtual::default,catalogProductVirtual::product_50_dollar
+ defaultVirtualProduct
+ updated-grouped-product-%isolation%
+
+
+
+
+ default
+ GroupedProduct_edited %isolation%
+ GroupedProduct_sku_edited %isolation%
+ catalogProductSimple::simple_for_composite_products,catalogProductSimple::default
+ defaultSimpleProduct_without_qty
+ updated-grouped-product-%isolation%
+
+
+
+
+
+ default
+ GroupedProduct_edited %isolation%
+ GroupedProduct_sku_edited %isolation%
+ catalogProductSimple::withSpecialPrice,catalogProductSimple::withSpecialPrice
+ defaultSimpleProduct_with_specialPrice
+ updated-grouped-product-%isolation%
+
+
+
+
+ default
+ GroupedProduct_edited %isolation%
+ GroupedProduct_sku_edited %isolation%
+ Out of Stock
+ updated-grouped-product-%isolation%
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..94a696047e1e9
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/ImportExport/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ System > Import
+ Import
+
+
+
+ System > Export
+ Export
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..0a1afb249ef8f
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Indexer/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ System > Index Management
+ Index Management
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..ab448ae81e249
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Integration/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ System > Integrations
+ Integrations
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php
index 23b69f7123443..a05c605294479 100644
--- a/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php
+++ b/dev/tests/functional/tests/app/Magento/Multishipping/Test/TestStep/ProceedToMultipleAddressCheckoutStep.php
@@ -35,6 +35,7 @@ public function __construct(CheckoutCart $checkoutCart)
*/
public function run()
{
+ $this->checkoutCart->open();
$this->checkoutCart->getMultipleAddressCheckoutBlock()->multipleAddressesCheckout();
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php
index 3de754dffa925..098fff98e7ec5 100644
--- a/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php
+++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/Block/Adminhtml/Template/Preview.php
@@ -45,6 +45,9 @@ function () use ($browser, $selector) {
);
$this->browser->switchToFrame(new Locator($this->iFrame));
- return $this->_rootElement->getText();
+ $content = $this->_rootElement->getText();
+
+ $this->browser->switchToFrame();
+ return $content;
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..b830ba8af1c5d
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Newsletter/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Marketing > Newsletter Template
+ Newsletter Templates
+
+
+
+ Marketing > Newsletter Queue
+ Newsletter Queue
+
+
+
+ Marketing > Newsletter Subscribers
+ Newsletter Subscribers
+
+
+
+ Reports > Newsletter Problem Reports
+ Newsletter Problems Report
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..46bb69f248a90
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+ Reports > Products in Cart
+ Products in Carts
+
+
+
+ Reports > Abandoned Carts
+ Abandoned Carts
+
+
+
+ Reports > Orders
+ Sales Report
+
+
+
+ Reports > Tax
+ Tax Report
+
+
+
+ Reports > Invoiced
+ Invoice Report
+
+
+
+ Reports > Coupons
+ Coupons Report
+
+
+
+ Reports > Order Total
+ Order Total Report
+
+
+
+ Reports > Order Count
+ Order Count Report
+
+
+
+ Reports > New
+ New Accounts Report
+
+
+
+ Reports > Views
+ Product Views Report
+
+
+
+ Reports > Bestsellers
+ Best Sellers Report
+
+
+
+ Reports > Low Stock
+ Low Stock Report
+
+
+
+ Reports > Ordered
+ Ordered Products Report
+
+
+
+ Reports > Downloads
+ Downloads Report
+
+
+
+ Reports > Refresh statistics
+ Refresh Statistics
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php
index f00195c836913..f71fd73490e3a 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/NewAccountsReportEntityTest.php
@@ -70,7 +70,7 @@ public function __inject(CustomerIndex $customerIndexPage, CustomerAccounts $cus
*/
public function test(Customer $customer, array $customersReport)
{
- $this->markTestIncomplete('MAGETWO-26663');
+ $this->markTestIncomplete('Bug: MAGETWO-35037');
// Preconditions
$this->customerIndexPage->open();
$this->customerIndexPage->getCustomerGridBlock()->massaction([], 'Delete', true, 'Select All');
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php
index a850585fabc19..b260e667b7fd1 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.php
@@ -65,7 +65,6 @@ class ViewedProductsReportEntityTest extends Injectable
*/
public function __prepare(CatalogProductIndex $catalogProductIndexPage)
{
- $this->markTestIncomplete('Bug: MAGETWO-33029');
$catalogProductIndexPage->open();
$catalogProductIndexPage->getProductGrid()->massaction([], 'Delete', true, 'Select All');
}
diff --git a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml
index 631230c2956a1..b0d0b350efa71 100644
--- a/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Reports/Test/TestCase/ViewedProductsReportEntityTest.xml
@@ -6,36 +6,36 @@
*/
-->
-
-
- view products on front and verify they all reflected in Year report
- 2, 1
- catalogProductSimple::default, catalogProductVirtual::default
- Year
- m/d/Y -1 year
- m/d/Y
- No
-
-
-
- view products on front and verify they all reflected in Month report
- 1, 1
- downloadableProduct::default, bundleProduct::bundle_dynamic_product
- Month
- m/d/Y
- m/d/Y
- No
-
-
-
- view products on front and verify they all reflected in Day report
- 1, 1
- configurableProduct::default, groupedProduct::default
- Day
- m/d/Y -1 day
- m/d/Y +1 day
- Yes
-
-
-
+
+
+ View products on front and verify they all reflected in Year report.
+ 1, 1
+ catalogProductSimple::default, catalogProductVirtual::default
+ Year
+ m/d/Y -1 year
+ m/d/Y
+ No
+
+
+
+ View products on front and verify they all reflected in Month report.
+ 1, 1
+ downloadableProduct::default, bundleProduct::bundle_dynamic_product
+ Month
+ m/d/Y - 1 month
+ m/d/Y
+ No
+
+
+
+ View products on front and verify they all reflected in Day report.
+ 1, 1
+ configurableProduct::default, groupedProduct::default
+ Day
+ m/d/Y -1 day
+ m/d/Y +1 day
+ Yes
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
index 6d38c764c63b9..d2042d8a8370e 100644
--- a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/CreateProductReviewBackendEntityTest.php
@@ -80,16 +80,6 @@ class CreateProductReviewBackendEntityTest extends Injectable
*/
protected $review;
- /**
- * Skip test due to a Magento bug.
- *
- * @return void
- */
- public function __prepare()
- {
- $this->markTestIncomplete('Bug: MAGETWO-33912');
- }
-
/**
* Inject pages into test
*
diff --git a/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..2c68c7f55f969
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Review/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+ Marketing > Reviews
+ Reviews
+
+
+
+ Reports > By Customers
+ Customer Reviews Report
+
+
+
+ Reports > By Products
+ Product Reviews Report
+
+
+
+ Stores > Rating
+ Ratings
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php
index 09919efbd1dba..f402dd1f6273c 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Grid.php
@@ -10,48 +10,49 @@
use Magento\Mtf\Client\Locator;
/**
- * Class Grid
- * Sales order grid
+ * Sales order grid.
*/
class Grid extends GridInterface
{
/**
- * 'Add New' order button
+ * 'Add New' order button.
*
* @var string
*/
protected $addNewOrder = "../*[@class='page-actions']//*[@id='add']";
/**
- * Purchase Point Filter selector
+ * Purchase Point Filter selector.
*
* @var string
*/
protected $purchasePointFilter = '//*[@data-ui-id="widget-grid-column-filter-store-0-filter-store-id"]';
/**
- * Purchase Point Filter option group elements selector
+ * Purchase Point Filter option group elements selector.
*
* @var string
*/
protected $purchasePointOptGroup = '//*[@data-ui-id="widget-grid-column-filter-store-0-filter-store-id"]/optgroup';
/**
- * Order Id td selector
+ * Order Id td selector.
*
* @var string
*/
protected $editLink = 'td[class*=col-action] a';
/**
- * First row selector
+ * First row selector.
*
* @var string
*/
protected $firstRowSelector = '//tbody/tr[1]//a';
/**
- * {@inheritdoc}
+ * Filters array mapping.
+ *
+ * @var array
*/
protected $filters = [
'id' => [
@@ -64,7 +65,7 @@ class Grid extends GridInterface
];
/**
- * Start to create new order
+ * Start to create new order.
*/
public function addNewOrder()
{
@@ -72,24 +73,20 @@ public function addNewOrder()
}
/**
- * Get selected data from Purchase Point filter
+ * Get StoreGroup list of Purchase Point on filter.
*
- * @return string
+ * @return array
*/
- public function getPurchasePointFilterText()
+ public function getPurchasePointStoreGroups()
{
- return $this->_rootElement->find($this->purchasePointFilter, Locator::SELECTOR_XPATH)->getText();
- }
+ $storeGroupElements = $this->_rootElement->find($this->purchasePointFilter, Locator::SELECTOR_XPATH)
+ ->getElements('.//optgroup[./option]', Locator::SELECTOR_XPATH);
+ $result = [];
- /**
- * Assert the number of Purchase Point Filter option group elements by checking non-existing group
- *
- * @param $number
- * @return bool
- */
- public function assertNumberOfPurchasePointFilterOptionsGroup($number)
- {
- $selector = $this->purchasePointOptGroup . '[' . ($number + 1) . ']';
- return !$this->_rootElement->find($selector, Locator::SELECTOR_XPATH)->isVisible();
+ foreach ($storeGroupElements as $storeGroupElement) {
+ $result[] = trim($storeGroupElement->getAttribute('label'), ' ');
+ }
+
+ return $result;
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php
index 893bde7b41f36..fda4c7814591b 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/Constraint/AssertReorderStatusIsCorrect.php
@@ -36,8 +36,8 @@ public function processAssert(
$salesOrder->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
\PHPUnit_Framework_Assert::assertEquals(
- $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(),
$previousOrderStatus,
+ $salesOrderView->getOrderForm()->getOrderInfoBlock()->getOrderStatus(),
'Order status is incorrect on order page in backend.'
);
}
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..0278a74760af2
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+ Sales > Orders
+ Orders
+
+
+
+ Sales > Invoices
+ Invoices
+
+
+
+ Sales > Shipments
+ Shipments
+
+
+
+ Sales > Credit Memos
+ Credit Memos
+
+
+
+ Sales > Transactions
+ Transactions
+
+
+
+ Stores > Order Status
+ Order Status
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php
index e873f8fc8e758..8deb7b0dbb028 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/TestStep/FillBillingAddressStep.php
@@ -42,7 +42,7 @@ class FillBillingAddressStep implements TestStepInterface
* @param Address $billingAddress
* @param string $saveAddress
*/
- public function __construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress, $saveAddress)
+ public function __construct(OrderCreateIndex $orderCreateIndex, Address $billingAddress, $saveAddress = 'No')
{
$this->orderCreateIndex = $orderCreateIndex;
$this->billingAddress = $billingAddress;
diff --git a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml
index c80098f59e636..f42ed2705b6c7 100644
--- a/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml
+++ b/dev/tests/functional/tests/app/Magento/Sales/Test/etc/testcase.xml
@@ -6,72 +6,73 @@
*/
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..14a87c13b7efc
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/SalesRule/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Marketing > Cart Price Rules
+ Cart Price Rules
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php
index 670aca38ebfd3..c8b09124666bd 100644
--- a/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php
+++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/Handler/Sitemap/Curl.php
@@ -62,8 +62,7 @@ protected function getSitemapId(array $data)
{
//Sort data in grid to define sitemap id if more than 20 items in grid
$url = 'admin/sitemap/index/sort/sitemap_id/dir/desc';
- $pattern = '/class=\" col\-id col\-sitemap_id\W*>\W+(\d+)\W+<\/td>\W+\W+?'
- . $data['sitemap_filename'] . '/siu';
+ $pattern = '/col-sitemap_id\W*(\d+)<.td><[^<>]*?>' . $data['sitemap_filename'] . '/siu';
$extractor = new Extractor($url, $pattern);
$match = $extractor->getData();
diff --git a/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..fbebdaee2d655
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Sitemap/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Marketing > Site Map
+ Site Map
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php
index 3e796d62655d4..3e23c4cbfb1d7 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.php
@@ -34,6 +34,7 @@ class CreateStoreEntityTest extends Injectable
/* tags */
const MVP = 'yes';
const DOMAIN = 'PS';
+ const TEST_TYPE = 'acceptance_test';
/* end tags */
/**
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml
index 1da9ff702e422..4ba86215b1c13 100644
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/CreateStoreEntityTest.xml
@@ -6,39 +6,52 @@
*/
-->
-
-
- default
- store_name_%isolation%
- storecode_%isolation%
- Enabled
-
-
-
-
-
-
-
- default
- store_name_%isolation%
- storecode_%isolation%
- Disabled
-
-
-
-
-
-
-
- custom
- store_name_%isolation%
- storecode_%isolation%
- Enabled
-
-
-
-
-
-
-
+
+
+ default
+ store_name_%isolation%
+ storecode_%isolation%
+ Enabled
+
+
+
+
+
+
+
+ default
+ store_name_%isolation%
+ storecode_%isolation%
+ Disabled
+
+
+
+
+
+
+
+ custom
+ store_name_%isolation%
+ storecode_%isolation%
+ Enabled
+
+
+
+
+
+
+
+ MAGETWO-12405: Create New Localized Store View
+ default
+ DE_%isolation%
+ de_%isolation%
+ Enabled
+ German (Germany)
+ Den gesamten Shop durchsuchen
+ test_type:acceptance_test
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php b/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php
deleted file mode 100644
index ab189ce353019..0000000000000
--- a/dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php
+++ /dev/null
@@ -1,72 +0,0 @@
-magentoBackendLoginUser();
- }
-
- /**
- * @ZephyrId MAGETWO-12405
- */
- public function testCreateNewLocalizedStoreView()
- {
- $objectManager = Factory::getObjectManager();
- $storeFixture = $objectManager->create('Magento\Store\Test\Fixture\Store', ['dataSet' => 'german']);
-
- $storeListPage = Factory::getPageFactory()->getAdminSystemStore();
- $storeListPage->open();
- $storeListPage->getGridPageActions()->addStoreView();
-
- $newStorePage = Factory::getPageFactory()->getAdminSystemStoreNewStore();
- $newStorePage->getStoreForm()->fill($storeFixture);
- $newStorePage->getFormPageActions()->save();
- $storeListPage->getMessagesBlock()->waitSuccessMessage();
- $this->assertContains(
- 'The store view has been saved',
- $storeListPage->getMessagesBlock()->getSuccessMessages()
- );
- $this->assertTrue(
- $storeListPage->getStoreGrid()->isStoreExists($storeFixture->getName())
- );
-
- $cachePage = Factory::getPageFactory()->getAdminCache();
- $cachePage->open();
- $cachePage->getActionsBlock()->flushCacheStorage();
- $cachePage->getMessagesBlock()->waitSuccessMessage();
-
- $configPage = Factory::getPageFactory()->getAdminSystemConfig();
- $configPage->open();
- $configPage->getPageActions()->selectStore($storeFixture->getGroupId() . "/" . $storeFixture->getName());
- $configGroup = $configPage->getForm()->getGroup('Locale Options');
- $configGroup->open();
- $configGroup->setValue('select-groups-locale-fields-code-value', 'German (Germany)');
- $configPage->getPageActions()->save();
- $configPage->getMessagesBlock()->waitSuccessMessage();
-
- $homePage = Factory::getPageFactory()->getCmsIndexIndex();
- $homePage->open();
-
- $homePage->getStoreSwitcherBlock()->selectStoreView($storeFixture->getName());
- $this->assertTrue($homePage->getSearchBlock()->isPlaceholderContains('Den gesamten Shop durchsuchen'));
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
index 4c5e2cabf1c61..b5631910c0d44 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AssertTaxRuleApplying.php
@@ -141,7 +141,9 @@ public function processAssert(
$checkoutCart->open()->getCartBlock()->clearShoppingCart();
$browser->open($_ENV['app_frontend_url'] . $this->productSimple->getUrlKey() . '.html');
$catalogProductView->getViewBlock()->clickAddToCart();
+ $catalogProductView->getMessagesBlock()->waitSuccessMessage();
// Estimate Shipping and Tax
+ $checkoutCart->open();
$checkoutCart->getShippingBlock()->openEstimateShippingAndTax();
$checkoutCart->getShippingBlock()->fill($address);
$checkoutCart->getShippingBlock()->clickGetQuote();
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php
index 997d0600cc759..b40b943db5786 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxClass.php
@@ -6,8 +6,8 @@
namespace Magento\Tax\Test\Fixture\TaxRule;
+use Magento\Mtf\Fixture\DataSource;
use Magento\Mtf\Fixture\FixtureFactory;
-use Magento\Mtf\Fixture\FixtureInterface;
/**
* Class TaxClass
@@ -15,23 +15,17 @@
* Data keys:
* - dataSet
*/
-class TaxClass implements FixtureInterface
+class TaxClass extends DataSource
{
/**
- * Array with tax class names
- *
- * @var array
- */
- protected $data;
-
- /**
- * Array with tax class fixtures
+ * Array with tax class fixtures.
*
* @var array
*/
protected $fixture;
/**
+ * @constructor
* @param FixtureFactory $fixtureFactory
* @param array $params
* @param array $data
@@ -42,51 +36,16 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array
if (isset($data['dataSet'])) {
$dataSets = $data['dataSet'];
foreach ($dataSets as $dataSet) {
- if ($dataSet !== '-') {
- /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */
- $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]);
- $this->fixture[] = $taxClass;
- $this->data[] = $taxClass->getClassName();
- }
+ /** @var \Magento\Tax\Test\Fixture\TaxClass $taxClass */
+ $taxClass = $fixtureFactory->createByCode('taxClass', ['dataSet' => $dataSet]);
+ $this->fixture[] = $taxClass;
+ $this->data[] = $taxClass->getClassName();
}
}
}
/**
- * Persist custom selections tax classes
- *
- * @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 data set configuration settings
- *
- * @return string
- */
- public function getDataConfig()
- {
- return $this->params;
- }
-
- /**
- * Return tax class fixture
+ * Return tax class fixture.
*
* @return array
*/
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php
index aacc3a65e7ab9..238a754ee6048 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Fixture/TaxRule/TaxRate.php
@@ -6,8 +6,8 @@
namespace Magento\Tax\Test\Fixture\TaxRule;
+use Magento\Mtf\Fixture\DataSource;
use Magento\Mtf\Fixture\FixtureFactory;
-use Magento\Mtf\Fixture\FixtureInterface;
/**
* Class TaxRate
@@ -15,23 +15,17 @@
* Data keys:
* - dataSet
*/
-class TaxRate implements FixtureInterface
+class TaxRate extends DataSource
{
/**
- * Array with tax rates codes
- *
- * @var array
- */
- protected $data;
-
- /**
- * Array with tax rate fixtures
+ * Array with tax rate fixtures.
*
* @var array
*/
protected $fixture;
/**
+ * @constructor
* @param FixtureFactory $fixtureFactory
* @param array $params
* @param array $data
@@ -42,51 +36,16 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array
if (isset($data['dataSet'])) {
$dataSets = $data['dataSet'];
foreach ($dataSets as $dataSet) {
- if ($dataSet !== '-') {
- /** @var \Magento\Tax\Test\Fixture\TaxRate $taxRate */
- $taxRate = $fixtureFactory->createByCode('taxRate', ['dataSet' => $dataSet]);
- $this->fixture[] = $taxRate;
- $this->data[] = $taxRate->getCode();
- }
+ /** @var \Magento\Tax\Test\Fixture\TaxRate $taxRate */
+ $taxRate = $fixtureFactory->createByCode('taxRate', ['dataSet' => $dataSet]);
+ $this->fixture[] = $taxRate;
+ $this->data[] = $taxRate->getCode();
}
}
}
/**
- * Persist custom selections tax rates
- *
- * @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 data set configuration settings
- *
- * @return string
- */
- public function getDataConfig()
- {
- return $this->params;
- }
-
- /**
- * Return tax rate fixtures
+ * Return tax rate fixtures.
*
* @return array
*/
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php
index a183fa5490125..28e77379db72e 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/Handler/TaxClass/Curl.php
@@ -14,13 +14,12 @@
use Magento\Mtf\Util\Protocol\CurlTransport\BackendDecorator;
/**
- * Class Curl
- * Curl handler for creating customer and product tax class
+ * Curl handler for creating customer and product tax class.
*/
class Curl extends AbstractCurl implements TaxClassInterface
{
/**
- * Post request for creating tax class
+ * Post request for creating tax class.
*
* @param FixtureInterface $fixture [optional]
* @return mixed|string
@@ -29,7 +28,7 @@ public function persist(FixtureInterface $fixture = null)
{
$data = $fixture->getData();
- $url = $_ENV['app_backend_url'] . 'tax/tax/ajaxSAve/?isAjax=true';
+ $url = $_ENV['app_backend_url'] . 'tax/tax/ajaxSave/?isAjax=true';
$curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
$curl->write(CurlInterface::POST, $url, '1.0', [], $data);
$response = $curl->read();
@@ -40,7 +39,7 @@ public function persist(FixtureInterface $fixture = null)
}
/**
- * Return saved class id if saved
+ * Return saved class id if saved.
*
* @param $response
* @return int|null
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml
index fe148b022e717..b8770c32386bd 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/CreateTaxRuleEntityTest.xml
@@ -6,82 +6,72 @@
*/
-->
-
-
- TaxIdentifier%isolation%
- US-CA-Rate_1
- -
- -
- -
- -
- -
- -
- -
- -
-
-
-
-
-
- TaxIdentifier%isolation%
- US-CA-Rate_1
- US-NY-Rate_1
- -
- customer_tax_class
- -
- product_tax_class
- -
- 1
- 1
-
-
-
-
-
- Creating tax rule with new tax classes and tax rate
- TaxIdentifier%isolation%
- default
- US-NY-Rate_1
- US-CA-Rate_1
- retail_customer
- customer_tax_class
- Taxable Goods
- -
- -
- 1
-
-
-
-
-
- TaxIdentifier%isolation%
- withZipRange
- US-CA-Rate_1
- -
- retail_customer
- customer_tax_class
- Taxable Goods
- product_tax_class
- 1
- -
-
-
-
-
-
- MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class
- TaxIdentifier%isolation%
- US-CA-*-Rate 1
- us_ny_rate_8_1
- -
- Retail Customer
- customer_tax_class
- Taxable Goods
- product_tax_class
- bamboo_plan:end_to_end,test_type:acceptance_test
-
-
-
-
-
+
+
+ TaxIdentifier%isolation%
+ US-CA-Rate_1
+ -
+ -
+ -
+ -
+
+
+
+
+
+ TaxIdentifier%isolation%
+ US-CA-Rate_1
+ US-NY-Rate_1
+ customer_tax_class
+ -
+ product_tax_class
+ -
+ 1
+ 1
+
+
+
+
+
+ Creating tax rule with new tax classes and tax rate
+ TaxIdentifier%isolation%
+ default
+ US-NY-Rate_1
+ US-CA-Rate_1
+ retail_customer
+ customer_tax_class
+ taxable_goods
+ 1
+
+
+
+
+
+ TaxIdentifier%isolation%
+ withZipRange
+ US-CA-Rate_1
+ retail_customer
+ customer_tax_class
+ taxable_goods
+ product_tax_class
+ 1
+
+
+
+
+
+ MAGETWO-12438: Create Tax Rule with New and Existing Tax Rate, Customer Tax Class, Product Tax Class
+ TaxIdentifier%isolation%
+ US-CA-*-Rate 1
+ us_ny_rate_8_1
+ retail_customer
+ customer_tax_class
+ taxable_goods
+ product_tax_class
+ bamboo_plan:end_to_end,test_type:acceptance_test
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php
index 3c8e925589b39..bef4c799b43f3 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.php
@@ -6,26 +6,22 @@
namespace Magento\Tax\Test\TestCase;
-use Magento\Customer\Test\Fixture\Address;
use Magento\Tax\Test\Fixture\TaxRule;
use Magento\Tax\Test\Page\Adminhtml\TaxRuleIndex;
use Magento\Tax\Test\Page\Adminhtml\TaxRuleNew;
-use Magento\Mtf\Fixture\FixtureFactory;
+use Magento\Customer\Test\Fixture\Customer;
use Magento\Mtf\TestCase\Injectable;
/**
- * Test Creation for Delete TaxRuleEntity
- *
- * Test Flow:
* Preconditions:
- * 1. Tax Rule is created
+ * 1. Tax Rule is created.
*
* Steps:
* 1. Log in as default admin user.
- * 2. Go to Sales > Tax Rules
- * 3. Select required tax rule from preconditions
- * 4. Click on the "Delete Rule" button
- * 5. Perform all assertions
+ * 2. Go to Sales > Tax Rules.
+ * 3. Select required tax rule from preconditions.
+ * 4. Click on the "Delete Rule" button.
+ * 5. Perform all assertions.
*
* @group Tax_(CS)
* @ZephyrId MAGETWO-20924
@@ -38,35 +34,34 @@ class DeleteTaxRuleEntityTest extends Injectable
/* end tags */
/**
- * Tax Rule grid page
+ * Tax Rule grid page.
*
* @var TaxRuleIndex
*/
protected $taxRuleIndexPage;
/**
- * Tax Rule new and edit page
+ * Tax Rule new and edit page.
*
* @var TaxRuleNew
*/
protected $taxRuleNewPage;
/**
- * Preparing data
+ * Create customer.
*
- * @param FixtureFactory $fixtureFactory
+ * @param Customer $customer
* @return array
*/
- public function __prepare(FixtureFactory $fixtureFactory)
+ public function __prepare(Customer $customer)
{
- $customer = $fixtureFactory->createByCode('customer', ['dataSet' => 'default']);
$customer->persist();
return ['customer' => $customer];
}
/**
- * Injection data
+ * Inject pages.
*
* @param TaxRuleIndex $taxRuleIndexPage
* @param TaxRuleNew $taxRuleNewPage
@@ -80,28 +75,19 @@ public function __inject(
}
/**
- * Delete Tax Rule Entity test
+ * Delete Tax Rule Entity test.
*
* @param TaxRule $taxRule
- * @param Address $address
- * @param array $shipping
- *
- * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+ * @return void
*/
- public function testDeleteTaxRule(
- TaxRule $taxRule,
- Address $address,
- array $shipping
- ) {
+ public function testDeleteTaxRule(TaxRule $taxRule)
+ {
// Precondition
$taxRule->persist();
// Steps
- $filters = [
- 'code' => $taxRule->getCode(),
- ];
$this->taxRuleIndexPage->open();
- $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen($filters);
+ $this->taxRuleIndexPage->getTaxRuleGrid()->searchAndOpen(['code' => $taxRule->getCode()]);
$this->taxRuleNewPage->getFormPageActions()->delete();
}
}
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml
index 86c84ac32a392..8c8aa1e3888b4 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/DeleteTaxRuleEntityTest.xml
@@ -6,18 +6,18 @@
*/
-->
-
-
- tax_rule_with_custom_tax_classes
- United States
- California
- 90001
- Flat Rate
- Fixed
- 5
-
-
-
-
-
+
+
+ tax_rule_with_custom_tax_classes
+ United States
+ California
+ 90001
+ Flat Rate
+ Fixed
+ 5
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..2b07ad78838c0
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+ Stores > Tax Rules
+ Tax Rules
+
+
+
+ Stores > Tax Zones and Rates
+ Tax Zones and Rates
+
+
+
+ System > Import/Export Tax Rates
+ Import and Export Tax Rates
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml
index 48c142a660842..1cc98aeb5bf1a 100644
--- a/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/UpdateTaxRuleEntityTest.xml
@@ -6,84 +6,63 @@
*/
-->
-
-
- tax_rule_default
- -
- -
- -
- -
- -
- -
- New Tax Rule name%isolation%
- default
- customer_tax_class
- product_tax_class
- product_tax_class
- 2
- 2
-
-
-
-
-
- tax_rule_with_custom_tax_classes
- -
- -
- -
- -
- -
- -
- -
- withZipRange
- retail_customer
- product_tax_class
- taxable_goods
- -
- -
-
-
-
-
-
- tax_rule_with_custom_tax_classes
- United States
- Utah
- 84001
- Flat Rate
- Fixed
- 5
- -
- us_ut_fixed_zip_rate_20
- -
- product_tax_class
- -
- -
- -
-
-
-
-
-
-
- tax_rule_with_custom_tax_classes
- United States
- Idaho
- 83201
- Flat Rate
- Fixed
- 5
- -
- withFixedZip
- -
- product_tax_class
- -
- -
- -
-
-
-
-
-
-
+
+
+ tax_rule_default
+ New Tax Rule name%isolation%
+ default
+ customer_tax_class
+ product_tax_class
+ product_tax_class
+ 2
+ 2
+
+
+
+
+
+ tax_rule_with_custom_tax_classes
+ withZipRange
+ retail_customer
+ product_tax_class
+ taxable_goods
+
+
+
+
+
+ tax_rule_with_custom_tax_classes
+ United States
+ Utah
+ 84001
+ Flat Rate
+ Fixed
+ 5
+ us_ut_fixed_zip_rate_20
+ -
+ product_tax_class
+ -
+
+
+
+
+
+
+ tax_rule_with_custom_tax_classes
+ United States
+ Idaho
+ 83201
+ Flat Rate
+ Fixed
+ 5
+ withFixedZip
+ -
+ product_tax_class
+ -
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
index dd7936803646c..027b1ca6ec7ff 100644
--- a/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
+++ b/dev/tests/functional/tests/app/Magento/Theme/Test/Block/Links.php
@@ -57,6 +57,24 @@ public function isLinkVisible($linkTitle)
return $this->_rootElement->find(sprintf($this->link, $linkTitle), Locator::SELECTOR_XPATH)->isVisible();
}
+ /**
+ * Wait for link is visible.
+ *
+ * @param string $linkTitle
+ * @return void
+ */
+ public function waitLinkIsVisible($linkTitle)
+ {
+ $browser = $this->_rootElement;
+ $selector = sprintf($this->link, $linkTitle);
+ $browser->waitUntil(
+ function () use ($browser, $selector) {
+ $element = $browser->find($selector, Locator::SELECTOR_XPATH);
+ return $element->isVisible() ? true : null;
+ }
+ );
+ }
+
/**
* Get the number of products added to compare list.
*
diff --git a/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..4fb8159fe9870
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Theme/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Content > Themes
+ Themes
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php
index dcae5848887be..373c6c4cabd7c 100644
--- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php
+++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Block/Adminhtml/Catalog/Edit/UrlRewriteForm.php
@@ -12,13 +12,12 @@
use Magento\Mtf\Fixture\FixtureInterface;
/**
- * Class UrlRewriteForm
- * Catalog URL rewrite edit form
+ * Catalog URL rewrite edit form.
*/
class UrlRewriteForm extends Form
{
/**
- * Fill the root form
+ * Fill the root form.
*
* @param FixtureInterface $fixture
* @param SimpleElement|null $element
diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php
index 8b176051fc183..9dc49ec06a9ba 100644
--- a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php
+++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/Constraint/AssertUrlRewriteCustomRedirect.php
@@ -29,7 +29,7 @@ public function processAssert(UrlRewrite $urlRewrite, BrowserInterface $browser,
{
$browser->open($_ENV['app_frontend_url'] . $urlRewrite->getRequestPath());
$entity = $urlRewrite->getDataFieldConfig('target_path')['source']->getEntity();
- $title = $entity->hasData('name') ? $entity->getName() : $entity->getTitle();
+ $title = $entity->hasData('name') ? $entity->getName() : $entity->getContentHeading();
$pageTitle = $cmsIndex->getTitleBlock()->getTitle();
\PHPUnit_Framework_Assert::assertEquals(
$pageTitle,
diff --git a/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..3423afc8018e0
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/UrlRewrite/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Marketing > URL Rewrites
+ URL Rewrites
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php
index 8c034e549edfa..3127b4b3f195a 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleInGrid.php
@@ -6,7 +6,7 @@
namespace Magento\User\Test\Constraint;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Page\Adminhtml\UserRoleIndex;
use Magento\Mtf\Constraint\AbstractConstraint;
@@ -19,14 +19,14 @@ class AssertRoleInGrid extends AbstractConstraint
* Asserts that saved role is present in Role Grid.
*
* @param UserRoleIndex $rolePage
- * @param AdminUserRole $role
- * @param AdminUserRole $roleInit
+ * @param Role $role
+ * @param Role $roleInit
* @return void
*/
public function processAssert(
UserRoleIndex $rolePage,
- AdminUserRole $role,
- AdminUserRole $roleInit = null
+ Role $role,
+ Role $roleInit = null
) {
$filter = ['rolename' => $role->hasData('rolename') ? $role->getRoleName() : $roleInit->getRoleName()];
$rolePage->open();
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php
index 9615318c08384..2eb134bb51309 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertRoleNotInGrid.php
@@ -6,7 +6,7 @@
namespace Magento\User\Test\Constraint;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Page\Adminhtml\UserRoleIndex;
use Magento\Mtf\Constraint\AbstractConstraint;
@@ -19,12 +19,12 @@ class AssertRoleNotInGrid extends AbstractConstraint
* Asserts that role is not present in Role Grid.
*
* @param UserRoleIndex $rolePage
- * @param AdminUserRole $role
+ * @param Role $role
* @return void
*/
public function processAssert(
UserRoleIndex $rolePage,
- AdminUserRole $role
+ Role $role
) {
$filter = ['rolename' => $role->getRoleName()];
$rolePage->open();
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php
index 4e409ccc9f3b4..2761f88026453 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserInGrid.php
@@ -11,7 +11,7 @@
use Magento\Mtf\Constraint\AbstractConstraint;
/**
- * Class AssertUserInGrid
+ * Asserts that user is present in User Grid.
*/
class AssertUserInGrid extends AbstractConstraint
{
@@ -20,20 +20,16 @@ class AssertUserInGrid extends AbstractConstraint
*
* @param UserIndex $userIndex
* @param User $user
- * @param User $customAdmin
* @return void
*/
- public function processAssert(
- UserIndex $userIndex,
- User $user,
- User $customAdmin = null
- ) {
- $adminUser = ($user->hasData('password') || $user->hasData('username')) ? $user : $customAdmin;
- $filter = ['username' => $adminUser->getUsername()];
+ public function processAssert(UserIndex $userIndex, User $user)
+ {
+ $filter = ['username' => $user->getUsername()];
+
$userIndex->open();
\PHPUnit_Framework_Assert::assertTrue(
$userIndex->getUserGrid()->isRowVisible($filter),
- 'User with name \'' . $adminUser->getUsername() . '\' is absent in User grid.'
+ 'User with name \'' . $user->getUsername() . '\' is absent in User grid.'
);
}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php
new file mode 100644
index 0000000000000..3cc808867742e
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleRestrictedAccess.php
@@ -0,0 +1,57 @@
+objectManager->create('Magento\User\Test\TestStep\LoginUserOnBackendStep', ['user' => $user])->run();
+
+ $menuItems = $dashboard->getMenuBlock()->getTopMenuItems();
+ \PHPUnit_Framework_Assert::assertEquals($menuItems, $restrictedAccess, 'Wrong display menu.');
+
+ $browser->open($_ENV['app_backend_url'] . $denyUrl);
+ $deniedMessage = $dashboard->getAccessDeniedBlock()->getTextFromAccessDeniedBlock();
+ \PHPUnit_Framework_Assert::assertEquals(self::DENIED_ACCESS, $deniedMessage, 'Possible access to denied page.');
+ }
+
+ /**
+ * Returns success message if assert true.
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Sales item is present in Menu block.';
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php
deleted file mode 100644
index 7d1f1e298a4e6..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserRoleSalesRestrictedAccess.php
+++ /dev/null
@@ -1,52 +0,0 @@
-getMenuBlock()->getTopMenuItems();
- $userIndex->open();
- $deniedMessage = $userIndex->getAccessDeniedBlock()->getTextFromAccessDeniedBlock();
- $isMenuItemSingle = (count($menuItems) == 1);
- $hasSales = in_array(self::ROLE_RESOURCE, $menuItems);
- \PHPUnit_Framework_Assert::assertTrue(
- $hasSales && $isMenuItemSingle && (self::DENIED_ACCESS == $deniedMessage),
- 'Sales item is absent in Menu block or possible access to another page, not related to Sales.'
- );
- }
-
- /**
- * Returns success message if assert true.
- *
- * @return string
- */
- public function toString()
- {
- return 'Sales item is present in Menu block.';
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php
index c1214de922e8d..ef60f6f470385 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Constraint/AssertUserSuccessLogin.php
@@ -6,40 +6,25 @@
namespace Magento\User\Test\Constraint;
-use Magento\Backend\Test\Page\AdminAuthLogin;
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
use Magento\User\Test\Fixture\User;
use Magento\Mtf\Constraint\AbstractConstraint;
/**
- * Class AssertUserSuccessLogin
+ * Verify whether customer has logged in to the Backend.
*/
class AssertUserSuccessLogin extends AbstractConstraint
{
/**
- * Verify whether customer has logged in to the Backend
+ * Verify whether customer has logged in to the Backend.
*
* @param User $user
- * @param AdminAuthLogin $adminAuth
* @param Dashboard $dashboard
- * @param User $customAdmin
- * @internal param null|string $userToLoginInAssert
* @return void
*/
- public function processAssert(
- User $user,
- AdminAuthLogin $adminAuth,
- Dashboard $dashboard,
- User $customAdmin = null
- ) {
- $adminAuth->open();
- $adminUser = $customAdmin === null ? $user : $customAdmin;
- if ($dashboard->getAdminPanelHeader()->isVisible()) {
- $dashboard->getAdminPanelHeader()->logOut();
- }
- $adminAuth->getLoginBlock()->fill($adminUser);
- $adminAuth->getLoginBlock()->submit();
-
+ public function processAssert(User $user, Dashboard $dashboard)
+ {
+ $this->objectManager->create('Magento\User\Test\TestStep\LoginUserOnBackendStep', ['user' => $user])->run();
\PHPUnit_Framework_Assert::assertTrue(
$dashboard->getAdminPanelHeader()->isLoggedIn(),
'Admin user was not logged in.'
@@ -47,7 +32,7 @@ public function processAssert(
}
/**
- * Returns success message if equals to expected message
+ * Returns success message if equals to expected message.
*
* @return string
*/
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php
deleted file mode 100644
index 669ab32c19e25..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUser.php
+++ /dev/null
@@ -1,125 +0,0 @@
-_placeholders['sales_all_scopes'] = [$this, 'roleProvider'];
- }
-
- /**
- * Retrieve specify data from role.trieve specify data from role.
- *
- * @param $roleName
- * @return mixed
- */
- protected function roleProvider($roleName)
- {
- $role = Factory::getFixtureFactory()->getMagentoUserRole();
- $role->switchData($roleName);
- $data = $role->persist();
- return $data['id'];
- }
-
- /**
- * initialize data
- */
- protected function _initData()
- {
- /** @var \Magento\Mtf\Config $systemConfig */
- $systemConfig = ObjectManager::getInstance()->create('Magento\Mtf\Config');
- $superAdminPassword = $systemConfig->get('application/backendPassword');
- $this->_data = [
- 'fields' => [
- 'email' => [
- 'value' => 'email%isolation%@example.com',
- ],
- 'firstname' => [
- 'value' => 'firstname%isolation%',
- ],
- 'lastname' => [
- 'value' => 'lastname%isolation%',
- ],
- 'password' => [
- 'value' => '%password%',
- ],
- 'password_confirmation' => [
- 'value' => '%password%',
- ],
- 'roles' => [
- 'value' => ['1'],
- ],
- 'username' => [
- 'value' => 'admin%isolation%',
- ],
- 'current_password' => [
- 'value' => $superAdminPassword,
- ],
- ],
- ];
- }
-
- /**
- * @return string
- */
- public function getEmail()
- {
- return $this->getData('fields/email/value');
- }
-
- /**
- * @return string
- */
- public function getPassword()
- {
- return $this->getData('fields/password/value');
- }
-
- /**
- * @return string
- */
- public function getUsername()
- {
- return $this->getData('fields/username/value');
- }
-
- /**
- * Create user
- */
- public function persist()
- {
- Factory::getApp()->magentoUserCreateUser($this);
- }
-
- /**
- * Set password for user
- *
- * @param string $password
- */
- public function setPassword($password)
- {
- $this->_data['fields']['password']['value'] = $password;
- $this->_data['fields']['password_confirmation']['value'] = $password;
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml
deleted file mode 100644
index 3cdab7dfc0b11..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
- AdminRole%isolation%
- All
-
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- AdminRole%isolation%
-
-
-
-
-
- All
-
-
-
-
-
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php
deleted file mode 100644
index 89e81d3e7b73d..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Resource.php
+++ /dev/null
@@ -1,128 +0,0 @@
- null,
- 'Magento_Sales::sales' => null,
- 'Magento_Sales::sales_operation' => 'Magento_Sales::sales',
- 'Magento_Sales::sales_order' => 'Magento_Sales::sales_operation',
- 'Magento_Sales::actions' => 'Magento_Sales::sales_order',
- 'Magento_Sales::create' => 'Magento_Sales::actions',
- 'Magento_Sales::actions_view' => 'Magento_Sales::actions',
- 'Magento_Sales::email' => 'Magento_Sales::actions',
- 'Magento_Sales::reorder' => 'Magento_Sales::actions',
- 'Magento_Sales::actions_edit' => 'Magento_Sales::actions',
- 'Magento_Sales::cancel' => 'Magento_Sales::actions',
- 'Magento_Sales::review_payment' => 'Magento_Sales::actions',
- 'Magento_Sales::capture' => 'Magento_Sales::actions',
- 'Magento_Sales::invoice' => 'Magento_Sales::actions',
- 'Magento_Sales::creditmemo' => 'Magento_Sales::actions',
- 'Magento_Sales::hold' => 'Magento_Sales::actions',
- 'Magento_Sales::unhold' => 'Magento_Sales::actions',
- 'Magento_Sales::ship' => 'Magento_Sales::actions',
- 'Magento_Sales::comment' => 'Magento_Sales::actions',
- 'Magento_Sales::emails' => 'Magento_Sales::actions',
- 'Magento_Sales::sales_invoice' => 'Magento_Sales::sales_operation',
- 'Magento_Sales::shipment' => 'Magento_Sales::sales_operation',
- 'Magento_Sales::sales_creditmemo' => 'Magento_Sales::sales_operation',
- 'Magento_Paypal::billing_agreement' => 'Magento_Sales::sales_operation',
- 'Magento_Paypal::billing_agreement_actions' => 'Magento_Paypal::billing_agreement',
- 'Magento_Paypal::billing_agreement_actions_view' => 'Magento_Paypal::billing_agreement_actions',
- 'Magento_Paypal::actions_manage' => 'Magento_Paypal::billing_agreement_actions',
- 'Magento_Paypal::use' => 'Magento_Paypal::billing_agreement_actions',
- 'Magento_Sales::transactions' => 'Magento_Sales::sales_operation',
- 'Magento_Sales::transactions_fetch' => 'Magento_Sales::transactions',
- ];
-
- /**
- * {@inheritdoc}
- */
- protected function _initData()
- {
- }
-
- /**
- * Just a stub of inherited method
- *
- * @throws \BadMethodCallException
- */
- public function persist()
- {
- throw new \BadMethodCallException('This method is not applicable here. It is data provider for role fixture');
- }
-
- /**
- * Return requested resource, all it's children and parents
- *
- * @param string $resourceId
- * @throws \InvalidArgumentException
- * @return array
- */
- public function get($resourceId = null)
- {
- if (!array_key_exists($resourceId, $this->resources)) {
- throw new \InvalidArgumentException('No resource "' . $resourceId . '" found');
- }
- $withParents = $this->getParents($resourceId);
- $withParents[] = $resourceId;
- return array_merge($withParents, $this->getChildren($resourceId));
- }
-
- /**
- * Get all direct parents
- *
- * @param string $resourceId
- * @return array
- */
- protected function getParents($resourceId)
- {
- if (is_null($this->resources[$resourceId])) {
- return [];
- }
-
- $parents = [];
- $current = $this->resources[$resourceId];
-
- while (!is_null($this->resources[$current])) {
- $parents[] = $current;
- $current = $this->resources[$current];
- }
- $parents[] = $current;
-
- return $parents;
- }
-
- /**
- * Get all child resources
- *
- * @param string $resourceId
- * @return array
- */
- protected function getChildren($resourceId)
- {
- $children = array_keys($this->resources, $resourceId);
- $result = $children;
- foreach ($children as $child) {
- $result = array_merge($result, $this->getChildren($child));
- }
- return $result;
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php
deleted file mode 100644
index acb266f5d6c69..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.php
+++ /dev/null
@@ -1,105 +0,0 @@
-magentoUserCreateRole($this);
- }
-
- /**
- * {@inheritdoc}
- */
- protected function _initData()
- {
- $this->_repository = Factory::getRepositoryFactory()
- ->getMagentoUserRole($this->_dataConfig, $this->_data);
- }
-
- /**
- * Set custom ACL resource array to role
- *
- * @param array $resource
- */
- public function setResource(array $resource)
- {
- $this->_data['fields']['resource']['value'] = $resource;
- }
-
- /**
- * Merge resource array with existing values
- *
- * @param array $resource
- */
- public function addResource(array $resource)
- {
- $this->_data['fields']['resource']['value'] = array_merge_recursive(
- $this->_data['fields']['resource']['value'],
- $resource
- );
- }
-
- /**
- * Set websites of stores if current data set works with them
- *
- * @param array $items
- * @throws \InvalidArgumentException
- */
- public function setScopeItems(array $items)
- {
- if (array_key_exists('gws_store_groups', $this->_data['fields'])) {
- $scope = 'gws_store_groups';
- } elseif (array_key_exists('gws_websites', $this->_data['fields'])) {
- $scope = 'gws_websites';
- } else {
- throw new \InvalidArgumentException('Current data set doesn\'t work with stores and websites');
- }
- $this->_data['fields'][$scope]['value'] = $items;
- }
-
- /**
- * Convert data from canonical array to repository native format
- *
- * @param array $data
- * @return array
- */
- protected function convertData(array $data)
- {
- $result = [];
- foreach ($data as $key => $value) {
- $result['fields'][$key]['value'] = $value;
- }
- return $result;
- }
-
- /**
- * Save custom data set to repository
- *
- * @param string $name
- * @param array $data
- * @param bool $convert convert data from canonical array to repository native format
- */
- public function save($name, array $data, $convert = true)
- {
- if ($convert) {
- $data = $this->convertData($data);
- }
- $this->_repository->set($name, $data);
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml
new file mode 100644
index 0000000000000..671556ced6002
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+ AdminRole%isolation%
+ All
+
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ AdminRole%isolation%
+
+
+
+
+
+ All
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php
similarity index 97%
rename from dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php
rename to dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php
index eb1f27ccdc821..bd716bbeabb47 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/AdminUserRole/InRoleUsers.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/Role/InRoleUsers.php
@@ -4,7 +4,7 @@
* See COPYING.txt for license details.
*/
-namespace Magento\User\Test\Fixture\AdminUserRole;
+namespace Magento\User\Test\Fixture\Role;
use Magento\User\Test\Fixture\User;
use Magento\Mtf\Fixture\FixtureFactory;
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php
index 6ee9c5eb5ed81..93e9e336080fe 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Fixture/User/RoleId.php
@@ -6,12 +6,12 @@
namespace Magento\User\Test\Fixture\User;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\Mtf\Fixture\FixtureFactory;
use Magento\Mtf\Fixture\FixtureInterface;
/**
- * Class RoleId
+ * Source for Role of User.
*
* Data keys:
* - dataSet
@@ -20,14 +20,14 @@
class RoleId implements FixtureInterface
{
/**
- * Admin User Role
+ * Admin User Role.
*
- * @var AdminUserRole
+ * @var Role
*/
protected $role;
/**
- * User role name
+ * User role name.
*
* @var string
*/
@@ -43,20 +43,23 @@ public function __construct(FixtureFactory $fixtureFactory, array $params, array
{
$this->params = $params;
if (isset($data['dataSet']) && $data['dataSet'] !== '-') {
- $this->role = $fixtureFactory->createByCode('adminUserRole', ['dataSet' => $data['dataSet']]);
+ list($fixtureCode, $dataSet) = explode('::', $data['dataSet']);
+ $this->role = $fixtureFactory->createByCode($fixtureCode, ['dataSet' => $dataSet]);
if (!$this->role->hasData('role_id')) {
$this->role->persist();
}
$this->data = $this->role->getRoleName();
}
- if (isset($data['role']) && $data['role'] instanceof AdminUserRole) {
+ if (isset($data['role']) && $data['role'] instanceof Role) {
$this->role = $data['role'];
$this->data = $data['role']->getRoleName();
+ } elseif (isset($data['value'])) {
+ $this->data = $data['value'];
}
}
/**
- * Persist user role
+ * Persist user role.
*
* @return void
*/
@@ -66,7 +69,7 @@ public function persist()
}
/**
- * Return prepared data set
+ * Return prepared data set.
*
* @param string $key [optional]
* @return string|null
@@ -79,7 +82,7 @@ public function getData($key = null)
}
/**
- * Return data set configuration settings
+ * Return data set configuration settings.
*
* @return array
*/
@@ -89,9 +92,9 @@ public function getDataConfig()
}
/**
- * Return role fixture
+ * Return role fixture.
*
- * @return AdminUserRole
+ * @return Role
*/
public function getRole()
{
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php
deleted file mode 100644
index faec3b0798ed3..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/Curl.php
+++ /dev/null
@@ -1,70 +0,0 @@
-getData();
- $data['all'] = ($data['resource_access'] == 'All') ? 1 : 0;
- if (isset($data['roles_resources'])) {
- foreach ((array)$data['roles_resources'] as $resource) {
- $data['resource'][] = $resource;
- }
- }
- unset($data['roles_resources']);
- $data['gws_is_all'] = (isset($data['gws_is_all'])) ? $data['gws_is_all'] : '1';
- if ($fixture->hasData('in_role_user')) {
- $adminUsers = $fixture->getDataFieldConfig('in_role_user')['source']->getAdminUsers();
- $userIds = [];
- foreach ($adminUsers as $adminUser) {
- $userIds[] = $adminUser->getUserId() . "=true";
- }
- $data['in_role_user'] = implode('&', $userIds);
- }
- $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/active_tab/info/';
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->addOption(CURLOPT_HEADER, 1);
- $curl->write(CurlInterface::POST, $url, '1.0', [], $data);
- $response = $curl->read();
- $curl->close();
-
- if (!strpos($response, 'data-ui-id="messages-message-success"')) {
- throw new \Exception("Role creating by curl handler was not successful! Response: $response");
- }
-
- $url = 'admin/user_role/roleGrid/sort/role_id/dir/desc/';
- $regExpPattern = '/class=\"\scol\-id col\-role_id\W*>\W+(\d+)\W+<\/td>\W+ | \W+?'
- . $data['rolename'] . '/siu';
-
- $extractor = new Extractor($url, $regExpPattern);
-
- return ['role_id' => $extractor->getData()[1]];
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php
deleted file mode 100644
index 8c5e8cde4eb08..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateRole.php
+++ /dev/null
@@ -1,137 +0,0 @@
- $value) {
- $data[$key] = $value['value'];
- }
- return $data;
- }
-
- /**
- * Look for role id on grid
- *
- * @param string $name
- * @param string $page
- * @return bool|string
- */
- protected function findRoleOnPage($name, $page)
- {
- $dom = new \DOMDocument();
- $dom->loadHTML($page);
- $xpath = new \DOMXPath($dom);
- $row = '//tr[td[@data-column="role_name" and contains(text(),"' . $name . '")]]';
- $nodes = $xpath->query($row . '/td[@data-column="role_id"]');
- if ($nodes->length == 0) {
- return false;
- }
- $node = $nodes->item(0);
- $id = trim($node->nodeValue);
- return $id;
- }
-
- /**
- * Send POST request with encoded filter parameters in URL
- *
- * @param $name
- * @return string
- */
- protected function filterByName($name)
- {
- $filter = base64_encode('role_name=' . $name);
- $url = $_ENV['app_backend_url'] . 'admin/user_role/roleGrid/filter/' . $filter . '/';
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->write(CurlInterface::POST, $url, '1.0', [], []);
- $response = $curl->read();
- $curl->close();
- return $response;
- }
-
- /**
- * Look for needed role name and define id by name,
- * if the role is absent on the page, filtering is performed
- *
- * @param string $name
- * @param string $response
- * @return bool|string
- * @throws \UnderflowException
- * @throws \Exception
- */
- protected function findIdWithFilter($name, $response)
- {
- preg_match('/.*?<\/table>/siu', $response, $matches);
- if (empty($matches)) {
- throw new \Exception('Cannot find grid in response');
- }
- $gridHtml = $matches[0];
-
- $id = $this->findRoleOnPage($name, $gridHtml);
-
- // maybe, role is on another page, let's filter
- if (false === $id) {
- $newPage = $this->filterByName($name);
- $id = $this->findRoleOnPage($name, $newPage);
- }
-
- // still not found?? It's very suspicious.
- if (false === $id) {
- throw new \UnderflowException('Role with name "' . $name . '" not found');
- }
-
- return $id;
- }
-
- /**
- * Execute handler
- *
- * @param FixtureInterface|null $fixture [optional]
- * @throws \UnexpectedValueException
- * @throws \UnderflowException from findIdWithFilter
- * @throws \Exception from findIdWithFilter
- * @return mixed
- */
- public function persist(FixtureInterface $fixture = null)
- {
- $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/';
- $data = $this->_preparePostData($fixture->getData('fields'));
-
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->write(CurlInterface::POST, $url, '1.0', [], $data);
- $response = $curl->read();
- $curl->close();
-
- if (!strpos($response, 'data-ui-id="messages-message-success"')) {
- throw new \UnexpectedValueException('Success confirmation not found');
- }
-
- $data['id'] = $this->findIdWithFilter($data['rolename'], $response);
- return $data;
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php
deleted file mode 100644
index ed2c2f0a2e039..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Curl/CreateUser.php
+++ /dev/null
@@ -1,92 +0,0 @@
- $value) {
- $data[$key] = $value['value'];
- }
- return $data;
- }
-
- /**
- * Get id for newly created user
- *
- * @param $data
- * @return mixed
- * @throws \Exception
- */
- protected function _getUserId($data)
- {
- //Sort data in grid to define user id if more than 20 items in grid
- $url = $_ENV['app_backend_url'] . 'admin/user/roleGrid/sort/user_id/dir/desc';
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->addOption(CURLOPT_HEADER, 1);
- $curl->write(CurlInterface::POST, $url, '1.0');
- $response = $curl->read();
- $curl->close();
- preg_match(
- '/class=\"\scol\-id col\-user_id\W*>\W*(\d+)\W*<\/td>\W*\W*?' . $data['username'] . '/siu',
- $response,
- $matches
- );
- if (empty($matches)) {
- throw new \Exception('Cannot find user id');
- }
- return $matches[1];
- }
-
- /**
- * Post request for creating user in backend
- *
- * @param FixtureInterface $fixture
- * @return array|mixed
- * @throws \Exception
- */
- public function persist(FixtureInterface $fixture = null)
- {
- $url = $_ENV['app_backend_url'] . 'admin/user/save';
- $data = $this->_prepareData($fixture->getData('fields'));
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->addOption(CURLOPT_HEADER, 1);
- $curl->write(CurlInterface::POST, $url, '1.0', [], $data);
- $response = $curl->read();
- $curl->close();
- if (!strpos($response, 'data-ui-id="messages-message-success"')) {
- throw new \Exception("User creation by curl handler was not successful! Response: $response");
- }
- //Sort data in grid to define user id if more than 20 items in grid
- $url = $_ENV['app_backend_url'] . 'admin/user/roleGrid/sort/user_id/dir/desc';
- $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
- $curl->addOption(CURLOPT_HEADER, 1);
- $curl->write(CurlInterface::POST, $url, '1.0', [], $data);
- $curl->read();
- $curl->close();
- $data['id'] = $this->_getUserId($data);
- return $data;
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php
new file mode 100644
index 0000000000000..ad63a648f0bd1
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/Curl.php
@@ -0,0 +1,142 @@
+mappingData = array_merge(
+ (null !== $this->mappingData) ? $this->mappingData : [],
+ $this->additionalMappingData
+ );
+ parent::__construct($configuration);
+ }
+
+ /**
+ * Curl creation of Admin User Role.
+ *
+ * @param FixtureInterface $fixture
+ * @return array|mixed
+ * @throws \Exception
+ */
+ public function persist(FixtureInterface $fixture = null)
+ {
+ $data = $this->prepareData($fixture);
+ $url = $_ENV['app_backend_url'] . 'admin/user_role/saverole/active_tab/info/';
+ $curl = new BackendDecorator(new CurlTransport(), $this->_configuration);
+ $curl->addOption(CURLOPT_HEADER, 1);
+ $curl->write(CurlInterface::POST, $url, '1.0', [], $data);
+ $response = $curl->read();
+ $curl->close();
+
+ if (!strpos($response, 'data-ui-id="messages-message-success"')) {
+ throw new \Exception("Role creating by curl handler was not successful! Response: $response");
+ }
+
+ $url = 'admin/user_role/roleGrid/sort/role_id/dir/desc/';
+ $regExpPattern = '/col\-role_id\W*(\d+)<.td><[^<>]*?>' . $data['rolename'] . '/siu';
+
+ $extractor = new Extractor($url, $regExpPattern);
+
+ return ['role_id' => $extractor->getData()[1]];
+ }
+
+ /**
+ * Prepare fixture data before send.
+ *
+ * @param FixtureInterface $fixture
+ * @return array
+ */
+ protected function prepareData(FixtureInterface $fixture = null)
+ {
+ $data = $fixture->getData();
+ $data = $this->prepareResourceAccess($data);
+ $data = array_merge($data, $this->prepareAssignedUsers($fixture));
+ $data = array_merge($data, $this->prepareAdminScope($data));
+
+ return $this->replaceMappingData($data);
+ }
+
+ /**
+ * Prepare role resources data.
+ *
+ * @param array $data
+ * @return array
+ */
+ protected function prepareResourceAccess(array $data)
+ {
+ $data['all'] = ($data['resource_access'] == 'All') ? 1 : 0;
+ if (isset($data['roles_resources'])) {
+ foreach ((array)$data['roles_resources'] as $resource) {
+ $data['resource'][] = $resource;
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Assign users to the role.
+ *
+ * @param FixtureInterface $fixture
+ * @return array
+ */
+ protected function prepareAssignedUsers(FixtureInterface $fixture)
+ {
+ if (!$fixture->hasData('in_role_user')) {
+ return [];
+ }
+ $adminUsers = $fixture->getDataFieldConfig('in_role_user')['source']->getAdminUsers();
+ $userIds = [];
+ foreach ($adminUsers as $adminUser) {
+ $userIds[] = $adminUser->getUserId() . "=true";
+ }
+
+ return ['in_role_user' => implode('&', $userIds)];
+ }
+
+ // TODO: Method should be removed in scope of MAGETWO-31563
+ /**
+ * Prepare admin gws option.
+ *
+ * @param array $data
+ * @return array
+ */
+ protected function prepareAdminScope(array $data)
+ {
+ if (isset($data['gws_is_all'])) {
+ $data['gws_is_all'] = 'All' == $data['gws_is_all'] ? 1 : 0;
+ } else {
+ $data['gws_is_all'] = 1;
+ }
+
+ return $data;
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php
similarity index 53%
rename from dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php
rename to dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php
index a7d0408abdba7..904bf57a01ca5 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/AdminUserRole/AdminUserRoleInterface.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/Role/RoleInterface.php
@@ -4,14 +4,14 @@
* See COPYING.txt for license details.
*/
-namespace Magento\User\Test\Handler\AdminUserRole;
+namespace Magento\User\Test\Handler\Role;
use Magento\Mtf\Handler\HandlerInterface;
/**
- * Interface AdminUserRoleInterface
+ * Interface RoleInterface
*/
-interface AdminUserRoleInterface extends HandlerInterface
+interface RoleInterface extends HandlerInterface
{
//
}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php
index 2ba46490546be..a79b2ec796f6c 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Handler/User/Curl.php
@@ -47,8 +47,7 @@ public function persist(FixtureInterface $fixture = null)
}
$url = 'admin/user/roleGrid/sort/user_id/dir/desc';
- $regExpPattern = '/class=\"\scol\-id col\-user_id\W*>\W+(\d+)\W+<\/td>\W+ | \W+?'
- . $data['username'] . '/siu';
+ $regExpPattern = '/col-user_id\W*(\d+)<.td><[^<>]*?>' . $data['username'] . '/siu';
$extractor = new Extractor($url, $regExpPattern);
return ['user_id' => $extractor->getData()[1]];
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml b/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml
index 93868a2d47a88..35e58ff38d2fa 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Page/Adminhtml/UserIndex.xml
@@ -6,10 +6,9 @@
*/
-->
-
-
-
-
-
-
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php b/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php
deleted file mode 100644
index 9046699e1a452..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUser.php
+++ /dev/null
@@ -1,49 +0,0 @@
-_data['admin_default'] = [
- 'config' => $defaultConfig,
- 'data' => $defaultData,
- ];
- $this->_data['user_with_sales_resource'] = $this->_getUserWithRole('sales_all_scopes');
- }
-
- /**
- * Build data for user
- *
- * @param string $roleName
- * @return array
- */
- protected function _getUserWithRole($roleName)
- {
- $role = [
- 'data' => [
- 'fields' => [
- 'roles' => [
- 'value' => ["%$roleName%"],
- ],
- ],
- ],
- ];
-
- return array_replace_recursive($this->_data['admin_default'], $role);
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php
deleted file mode 100644
index 08eb926a06a3e..0000000000000
--- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.php
+++ /dev/null
@@ -1,152 +0,0 @@
-_data['default'] = [
- 'config' => $defaultConfig,
- 'data' => $defaultData,
- ];
-
- $this->initRoleTemplates();
- $this->initCustomRoles();
- }
-
- /**
- * Role templates with different scopes for custom filling with resources, sites or stores
- */
- protected function initRoleTemplates()
- {
- $dataTemplate = [
- 'fields' => [
- 'all' => [
- 'value' => 0,
- ],
- 'gws_is_all' => [
- 'value' => 0,
- ],
- 'rolename' => [
- 'value' => 'auto%isolation%',
- ],
- ],
- ];
-
- $this->_data['all_permissions_all_scopes']['data'] = $this->setPermissions(
- 'all',
- $this->setScope('all', $dataTemplate)
- );
-
- $this->_data['all_permissions_website_scope']['data'] = $this->setPermissions(
- 'all',
- $this->setScope('website', $dataTemplate)
- );
-
- $this->_data['all_permissions_store_scope']['data'] = $this->setPermissions(
- 'all',
- $this->setScope('store', $dataTemplate)
- );
-
- $this->_data['custom_permissions_all_scopes']['data'] = $this->setPermissions(
- 'custom',
- $this->setScope('all', $dataTemplate)
- );
-
- $this->_data['custom_permissions_website_scope']['data'] = $this->setPermissions(
- 'custom',
- $this->setScope('website', $dataTemplate)
- );
-
- $this->_data['custom_permissions_store_scope']['data'] = $this->setPermissions(
- 'custom',
- $this->setScope('store', $dataTemplate)
- );
- }
-
- /**
- * Init most popular custom roles
- */
- protected function initCustomRoles()
- {
- $resourceFixture = Factory::getFixtureFactory()->getMagentoUserResource();
- $salesAllScopes = $this->_data['custom_permissions_all_scopes']['data'];
- $salesAllScopes['fields']['resource']['value'] = $resourceFixture->get('Magento_Sales::sales');
- $this->_data['sales_all_scopes']['data'] = $salesAllScopes;
- }
-
- /**
- * Add role permission values to data array
- *
- * @param $permissions string. Possible values 'custom' or 'all'
- * @param array $data
- * @return array
- * @throws \InvalidArgumentException
- */
- protected function setPermissions($permissions, $data = [])
- {
- if ('all' == $permissions) {
- $data['fields']['all']['value'] = 1;
- } elseif ('custom' == $permissions) {
- $data['fields']['all']['value'] = 0;
- $data['fields']['resource']['value'] = [];
- } else {
- throw new \InvalidArgumentException('Invalid permissions "' . $permissions . '"');
- }
- return $data;
- }
-
- /**
- * Set role scope: all, website or store
- *
- * @param string $scope possible values 'all', 'website', 'store'
- * @param array $data
- * @return array
- * @throws \InvalidArgumentException
- */
- protected function setScope($scope, $data = [])
- {
- switch ($scope) {
- case 'all':
- $data['fields']['gws_is_all']['value'] = 1;
- break;
- case 'website':
- $data['fields']['gws_is_all']['value'] = 0;
- $data['fields']['gws_websites']['value'] = [];
- break;
- case 'store':
- $data['fields']['gws_is_all']['value'] = 0;
- $data['fields']['gws_store_groups']['value'] = [];
- break;
- default:
- throw new \InvalidArgumentException('Invalid role scope "' . $scope . '"');
- }
- return $data;
- }
-
- /**
- * Save custom data set to repository
- *
- * @param string $dataSetName
- * @param array $data
- */
- public function set($dataSetName, array $data)
- {
- $this->_data[$dataSetName]['data'] = $data;
- }
-}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml
similarity index 97%
rename from dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml
rename to dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml
index 153c99a4b9436..0413aad55c01e 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/AdminUserRole.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Repository/Role.xml
@@ -7,7 +7,7 @@
-->
-
+
RoleName%isolation%
All
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml
index e16fae4b2fc76..ab4fdba7cb44f 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/Repository/User.xml
@@ -36,7 +36,7 @@
123123q
123123q
- - default
+ - role::default
%current_password%
Active
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml
index 39f5dee8caa4b..c71d32fb5b91f 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserEntityTest.xml
@@ -6,93 +6,89 @@
*/
-->
-
-
- AdminUser%isolation%
- FirstName%isolation%
- LastName%isolation%
- email%isolation%@example.com
- 123123q
- 123123q
- Active
- Administrators
- -
- %current_password%
-
-
-
-
-
-
- AdminUser%isolation%
- FirstName%isolation%
- LastName%isolation%
- email%isolation%@example.com
- 123123q
- 123123q
- Inactive
- Administrators
- -
- %current_password%
-
-
-
-
-
-
- -
- FirstName%isolation%
- LastName%isolation%
- email%isolation%@example.com
- 123123q
- 123123q
- Active
- Administrators
- username
- %current_password%
-
-
-
- AdminUser%isolation%
- FirstName%isolation%
- LastName%isolation%
- -
- 123123q
- 123123q
- Active
- Administrators
- email
- %current_password%
-
-
-
- AdminUser%isolation%
- FirstName%isolation%
- LastName%isolation%
- email%isolation%@example.com
- 123123q
- 123123q
- Active
- -
- -
- %current_password%
-
-
-
-
-
-
- AdminUser%isolation%
- FirstName%isolation%
- LastName%isolation%
- email%isolation%@example.cim
- 123123q
- 123123q
- Active
- -
- -
- %current_password%
-
-
-
+
+
+ AdminUser%isolation%
+ FirstName%isolation%
+ LastName%isolation%
+ email%isolation%@example.com
+ 123123q
+ 123123q
+ Active
+ role::Administrators
+ -
+ %current_password%
+
+
+
+
+
+
+ AdminUser%isolation%
+ FirstName%isolation%
+ LastName%isolation%
+ email%isolation%@example.com
+ 123123q
+ 123123q
+ Inactive
+ role::Administrators
+ -
+ %current_password%
+
+
+
+
+
+
+ FirstName%isolation%
+ LastName%isolation%
+ email%isolation%@example.com
+ 123123q
+ 123123q
+ Active
+ role::Administrators
+ username
+ %current_password%
+
+
+
+ AdminUser%isolation%
+ FirstName%isolation%
+ LastName%isolation%
+ 123123q
+ 123123q
+ Active
+ role::Administrators
+ email
+ %current_password%
+
+
+
+ AdminUser%isolation%
+ FirstName%isolation%
+ LastName%isolation%
+ email%isolation%@example.com
+ 123123q
+ 123123q
+ Active
+ -
+ %current_password%
+
+
+
+
+
+
+ AdminUser%isolation%
+ FirstName%isolation%
+ LastName%isolation%
+ email%isolation%@example.cim
+ 123123q
+ 123123q
+ Active
+ -
+ %current_password%
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php
index 57ae388e1a34c..f37fc9ab0694a 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.php
@@ -6,7 +6,7 @@
namespace Magento\User\Test\TestCase;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Page\Adminhtml\UserRoleEditRole;
use Magento\User\Test\Page\Adminhtml\UserRoleIndex;
use Magento\Mtf\TestCase\Injectable;
@@ -59,9 +59,9 @@ public function __inject(
/**
* Runs Create Admin User Role Entity test.
*
- * @param AdminUserRole $role
+ * @param Role $role
*/
- public function testCreateUserRole(AdminUserRole $role)
+ public function testCreateUserRole(Role $role)
{
//Steps
$this->userRoleIndex->open();
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml
index 0113079846524..aa70d5ad8bf4e 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/CreateAdminUserRoleEntityTest.xml
@@ -6,20 +6,19 @@
*/
-->
-
-
- AdminRole%isolation%
- Custom
- Sales
-
-
-
-
- AdminRole%isolation%
- All
- -
-
-
-
-
+
+
+ AdminRole%isolation%
+ Custom
+ Sales
+
+
+
+
+ AdminRole%isolation%
+ All
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml
index 49cf5bf2094e7..0a8c1deb857b4 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteAdminUserEntityTest.xml
@@ -6,15 +6,16 @@
*/
-->
-
-
-
-
-
-
- 1
-
-
-
-
+
+
+ 0
+
+
+
+
+ 1
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
index 161917c3b5461..b4cf004d50b01 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.php
@@ -8,7 +8,7 @@
use Magento\Backend\Test\Page\AdminAuthLogin;
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Fixture\User;
use Magento\User\Test\Page\Adminhtml\UserRoleEditRole;
use Magento\User\Test\Page\Adminhtml\UserRoleIndex;
@@ -100,13 +100,13 @@ public function __inject(
/**
* Runs Delete User Role Entity test.
*
- * @param AdminUserRole $role
+ * @param Role $role
* @param User $adminUser
* @param string $isDefaultUser
* @return void
*/
public function testDeleteAdminUserRole(
- AdminUserRole $role,
+ Role $role,
User $adminUser,
$isDefaultUser
) {
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml
index 5a3817a86bf89..51c92524b1b0c 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/DeleteUserRoleEntityTest.xml
@@ -8,6 +8,7 @@
+ 0
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..692af412394d2
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+ System > All Users
+ Users
+
+
+
+ System > User Roles
+ Roles
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
index cad7c857bfb47..66c76db855a19 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.php
@@ -15,9 +15,6 @@
use Magento\Mtf\TestCase\Injectable;
/**
- * Test Creation for UpdateAdminUserEntity
- *
- * Test Flow:
* Preconditions:
* 1. Admin user with assigned full access role is created.
* 2. Custom role with restricted permission: Sales is created
@@ -38,35 +35,46 @@ class UpdateAdminUserEntityTest extends Injectable
/* tags */
const MVP = 'no';
const DOMAIN = 'PS';
+ const TEST_TYPE = 'acceptance_test';
/* end tags */
/**
+ * User list page on backend.
+ *
* @var UserIndex
*/
protected $userIndex;
/**
+ * User edit page on backend.
+ *
* @var UserEdit
*/
protected $userEdit;
/**
+ * Dashboard page on backend.
+ *
* @var Dashboard
*/
protected $dashboard;
/**
+ * Authorization page on backend.
+ *
* @var AdminAuthLogin
*/
protected $adminAuth;
/**
+ * Fixture factory.
+ *
* @var FixtureFactory
*/
protected $fixtureFactory;
/**
- * Setup necessary data for test
+ * Setup necessary data for test.
*
* @param UserIndex $userIndex
* @param UserEdit $userEdit
@@ -90,16 +98,17 @@ public function __inject(
}
/**
- * Runs Update Admin User test
+ * Runs Update Admin User test.
*
- * @param User $user
* @param User $initialUser
+ * @param User $user
* @param string $loginAsDefaultAdmin
* @return array
+ * @throws \Exception
*/
public function testUpdateAdminUser(
- User $user,
User $initialUser,
+ User $user,
$loginAsDefaultAdmin
) {
// Precondition
@@ -117,20 +126,18 @@ public function testUpdateAdminUser(
$this->userEdit->getUserForm()->fill($user);
$this->userEdit->getPageActions()->save();
- return ['customAdmin' => $this->mergeUsers($user, $initialUser)];
+ return ['user' => $this->mergeUsers($initialUser, $user)];
}
/**
- * Merging user data and returns custom user
+ * Merging user data and returns custom user.
*
- * @param User $user
* @param User $initialUser
+ * @param User $user
* @return User
*/
- protected function mergeUsers(
- User $user,
- User $initialUser
- ) {
+ protected function mergeUsers(User $initialUser, User $user)
+ {
$data = array_merge($initialUser->getData(), $user->getData());
if (isset($data['role_id'])) {
$data['role_id'] = [
@@ -144,7 +151,7 @@ protected function mergeUsers(
}
/**
- * Logout Admin User from account
+ * Logout Admin User from account.
*
* @return void
*/
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml
index dd0f2c27818ef..c002a9df38696 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserEntityTest.xml
@@ -7,55 +7,59 @@
-->
-
- custom_admin_with_default_role
- NewAdminUser%isolation%
- NewFirstName%isolation%
- NewLastName%isolation%
- NewEmail%isolation%@example.com
- 123123qa
- 123123qa
- -
- -
- 123123q
-
-
-
-
-
-
- custom_admin_with_default_role
- -
- -
- -
- -
- -
- -
- -
- role_sales
- 123123q
-
-
-
-
-
-
-
- custom_admin_with_default_role
- -
- -
- -
- -
- -
- -
- Inactive
- -
- 1
- 123123q
-
-
-
-
-
+
+ custom_admin_with_default_role
+ NewAdminUser%isolation%
+ NewFirstName%isolation%
+ NewLastName%isolation%
+ NewEmail%isolation%@example.com
+ 123123qa
+ 123123qa
+ 123123q
+ 0
+
+
+
+
+
+
+ custom_admin_with_default_role
+ role::role_sales
+ 123123q
+ 0
+
+ - sales
+
+ admin/user
+
+
+
+
+
+
+
+ custom_admin_with_default_role
+ Inactive
+ 123123q
+ 1
+
+
+
+
+
+
+ MAGETWO-12375: Use ACL Role with Full GWS Scope (without Using Secret Key to URLs)
+ 1
+ custom_admin_with_default_role
+ role::role_sales
+ 123123q
+
+ - sales
+
+ catalog/product
+ test_type:acceptance_test
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
index 06a396c982cba..5908a7ffd7b91 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.php
@@ -8,7 +8,7 @@
use Magento\Backend\Test\Page\AdminAuthLogin;
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Fixture\User;
use Magento\User\Test\Page\Adminhtml\UserRoleEditRole;
use Magento\User\Test\Page\Adminhtml\UserRoleIndex;
@@ -81,14 +81,14 @@ public function __inject(
/**
* Runs Update Admin User Roles Entity test
*
- * @param AdminUserRole $roleInit
- * @param AdminUserRole $role
+ * @param Role $roleInit
+ * @param Role $role
* @param User $user
* @return array
*/
public function testUpdateAdminUserRolesEntity(
- AdminUserRole $roleInit,
- AdminUserRole $role,
+ Role $roleInit,
+ Role $role,
User $user
) {
// Preconditions
@@ -108,7 +108,7 @@ public function testUpdateAdminUserRolesEntity(
$this->userRoleEditRole->getPageActions()->save();
return [
- 'customAdmin' => $role->hasData('in_role_users')
+ 'user' => $role->hasData('in_role_users')
? $role->getDataFieldConfig('in_role_users')['source']->getAdminUsers()[0]
: $user,
];
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml
index b4ce41cdb8545..e64b21124c8b1 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UpdateAdminUserRoleEntityTest.xml
@@ -6,29 +6,33 @@
*/
-->
-
-
- custom_admin_with_default_role
- NewAdminRole%isolation%
- -
- -
- -
-
-
-
-
-
-
- default
- -
- Custom
- Sales
- custom_admin
-
-
-
-
-
-
-
+
+
+ custom_admin_with_default_role
+ NewAdminRole%isolation%
+ -
+ -
+ -
+
+
+
+
+
+
+ default
+ -
+ Custom
+ Sales
+ custom_admin
+
+ - sales
+
+ catalog/product
+
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php
index 003e6640bdfe7..b67ceaa5b97e3 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestCase/UserLoginAfterChangingPermissionsTest.php
@@ -7,7 +7,7 @@
namespace Magento\User\Test\TestCase;
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
-use Magento\User\Test\Fixture\AdminUserRole;
+use Magento\User\Test\Fixture\Role;
use Magento\User\Test\Fixture\User;
use Magento\User\Test\Page\Adminhtml\UserEdit;
use Magento\User\Test\Page\Adminhtml\UserIndex;
@@ -122,14 +122,14 @@ public function __inject(
}
/**
- * @param AdminUserRole $role
- * @param AdminUserRole $updatedRole
+ * @param Role $role
+ * @param Role $updatedRole
* @param User $user
* @return void
*/
public function testLoginAfterChangingPermissions(
- AdminUserRole $role,
- AdminUserRole $updatedRole,
+ Role $role,
+ Role $updatedRole,
User $user
) {
/** Create role and a new user with this role */
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php
new file mode 100644
index 0000000000000..de73873c4950e
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LoginUserOnBackendStep.php
@@ -0,0 +1,69 @@
+logoutUserOnBackendStep = $logoutUserOnBackendStep;
+ $this->adminAuth = $adminAuth;
+ $this->user = $user;
+ }
+
+ /**
+ * Run step flow.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ $this->logoutUserOnBackendStep->run();
+
+ $this->adminAuth->open();
+ $this->adminAuth->getLoginBlock()->fill($this->user);
+ $this->adminAuth->getLoginBlock()->submit();
+ $this->adminAuth->getLoginBlock()->waitFormNotVisible();
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php
new file mode 100644
index 0000000000000..cf3227fafecba
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/User/Test/TestStep/LogoutUserOnBackendStep.php
@@ -0,0 +1,55 @@
+adminAuth = $adminAuth;
+ $this->dashboard = $dashboard;
+ }
+
+ /**
+ * Run step flow.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ $this->adminAuth->open();
+ if ($this->dashboard->getAdminPanelHeader()->isVisible()) {
+ $this->dashboard->getAdminPanelHeader()->logOut();
+ }
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml
index e5d8c6b54b072..7801b2d8fc637 100644
--- a/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml
+++ b/dev/tests/functional/tests/app/Magento/User/Test/etc/curl/di.xml
@@ -6,6 +6,6 @@
*/
-->
-
+
\ No newline at end of file
diff --git a/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..7a832e8763322
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Variable/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ System > Custom Variables
+ Custom Variables
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php
new file mode 100644
index 0000000000000..bce4e8a44da81
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/ChosenOption.php
@@ -0,0 +1,143 @@
+ 'Magento\Cms\Test\Block\Adminhtml\Page\Widget\Chooser',
+ 'category' => 'Magento\Catalog\Test\Block\Adminhtml\Category\Widget\Chooser',
+ 'product' => 'Magento\Catalog\Test\Block\Adminhtml\Product\Widget\Chooser',
+ ];
+
+ /**
+ * Select widget options.
+ *
+ * @param string $value
+ * @return void
+ */
+ public function setValue($value)
+ {
+ $this->clickSelectButton();
+ if (isset($value['filter_url_key'])) {
+ $this->getClassBlock($this->chooserClasses['page'])
+ ->searchAndOpen(['chooser_identifier' => $value['filter_url_key']]);
+ }
+ if (isset($value['filter_identifier'])) {
+ $this->getClassBlock($this->chooserClasses['page'])
+ ->searchAndOpen(['chooser_identifier' => $value['filter_identifier']]);
+ }
+ if (isset($value['category_path'])) {
+ if (isset($value['filter_sku'])) {
+ $this->getClassBlock($this->chooserClasses['category'])
+ ->selectCategoryByName($value['category_path']);
+ $this->getClassBlock($this->chooserClasses['product'])
+ ->searchAndOpen(['chooser_sku' => $value['filter_sku']]);
+ } else {
+ $this->getClassBlock($this->chooserClasses['category'])
+ ->selectCategoryByName($value['category_path']);
+ }
+ }
+ }
+
+ /**
+ * Clicking to select button.
+ *
+ * @return void
+ */
+ protected function clickSelectButton()
+ {
+ $this->find($this->selectButton, Locator::SELECTOR_XPATH)->click();
+ $this->waitLoader();
+ }
+
+ /**
+ * Waiting loader.
+ *
+ * @return void
+ */
+ protected function waitLoader()
+ {
+ $browser = $this;
+ $loaderSelector = $this->loaderOld;
+ $this->waitUntil(
+ function () use ($browser, $loaderSelector) {
+ $loader = $browser->find($loaderSelector);
+ return $loader->isVisible() == false ? true : null;
+ }
+ );
+ }
+
+ /**
+ * Get block by class.
+ *
+ * @param string $class
+ * @return mixed
+ */
+ protected function getClassBlock($class)
+ {
+ return \Magento\Mtf\ObjectManager::getInstance()->create(
+ $class,
+ ['element' => $this->find($this->selectBlock, Locator::SELECTOR_XPATH)]
+ );
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php
new file mode 100644
index 0000000000000..570f597f47de9
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/Widget/WidgetGrid.php
@@ -0,0 +1,40 @@
+ [
+ 'selector' => 'input[name="title"]',
+ ],
+ ];
+}
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php
new file mode 100644
index 0000000000000..27cdefabd160d
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.php
@@ -0,0 +1,74 @@
+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->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH);
+ }
+
+ /**
+ * Click Insert Widget button.
+ *
+ * @return void
+ */
+ protected function insertWidget()
+ {
+ $this->_rootElement->find($this->insertButton)->click();
+ $this->waitForElementNotVisible($this->loaderOld, Locator::SELECTOR_XPATH);
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml
new file mode 100644
index 0000000000000..5f089a8e4ff00
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/Block/Adminhtml/WidgetForm.xml
@@ -0,0 +1,34 @@
+
+
+
+ parameters
+
+
+ #select_widget_type
+ select
+
+
+
+
+ select
+
+
+ .control button
+ \Magento\Widget\Test\Block\Adminhtml\Widget\ChosenOption
+
+
+ select
+
+
+ select
+
+
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml
new file mode 100644
index 0000000000000..d66ba7af5f9c1
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Widget/Test/TestCase/NavigateMenuTest.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Content > Frontend Apps
+ Frontend Apps
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php
new file mode 100644
index 0000000000000..bb60457362c20
--- /dev/null
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AbstractAssertWishlistProductDetails.php
@@ -0,0 +1,42 @@
+getItemsBlock()->getItemProduct($product)->getOptions();
+ $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]);
+ $expectedOptions = $cartFixture->getItems()[0]->getData()['options'];
+
+ $errors = $this->verifyData(
+ $this->sortDataByPath($expectedOptions, '::title'),
+ $this->sortDataByPath($actualOptions, '::title')
+ );
+ \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
+ }
+}
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php
index a3a6c805a6fce..405852f2ee186 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/Constraint/AssertProductDetailsInWishlist.php
@@ -13,13 +13,12 @@
use Magento\Mtf\Fixture\InjectableFixture;
/**
- * Class AssertBundleProductDetailsInWishlist
- * Assert that the correct option details are displayed on the "View Details" tool tip
+ * Assert that the correct option details are displayed on the "View Details" tool tip.
*/
-class AssertProductDetailsInWishlist extends AbstractAssertForm
+class AssertProductDetailsInWishlist extends AbstractAssertWishlistProductDetails
{
/**
- * Assert that the correct option details are displayed on the "View Details" tool tip
+ * Assert that the correct option details are displayed on the "View Details" tool tip.
*
* @param CmsIndex $cmsIndex
* @param WishlistIndex $wishlistIndex
@@ -34,19 +33,11 @@ public function processAssert(
FixtureFactory $fixtureFactory
) {
$cmsIndex->getLinksBlock()->openLink('My Wish List');
- $actualOptions = $wishlistIndex->getItemsBlock()->getItemProduct($product)->getOptions();
- $cartFixture = $fixtureFactory->createByCode('cart', ['data' => ['items' => ['products' => [$product]]]]);
- $expectedOptions = $cartFixture->getItems()[0]->getData()['options'];
-
- $errors = $this->verifyData(
- $this->sortDataByPath($expectedOptions, '::title'),
- $this->sortDataByPath($actualOptions, '::title')
- );
- \PHPUnit_Framework_Assert::assertEmpty($errors, $errors);
+ $this->assertProductDetails($wishlistIndex, $fixtureFactory, $product);
}
/**
- * Returns a string representation of the object
+ * Returns a string representation of the object.
*
* @return string
*/
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php
index b83ca2292615d..5c1d741634498 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/AddProductsToCartFromCustomerWishlistOnFrontendTest.php
@@ -43,6 +43,7 @@ class AddProductsToCartFromCustomerWishlistOnFrontendTest extends AbstractWishli
*/
public function test(Customer $customer, $products, $qty)
{
+ $this->markTestIncomplete('Bug: MAGETWO-34757');
// Preconditions
$customer->persist();
$this->loginCustomer($customer);
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
index b358e5c134402..233640f3eb490 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnBackendTest.php
@@ -44,6 +44,7 @@ class ConfigureProductInCustomerWishlistOnBackendTest extends AbstractWishlistTe
*/
public function __prepare(Customer $customer)
{
+ $this->markTestIncomplete('Bug: MAGETWO-31868');
$customer->persist();
return ['customer' => $customer];
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml
index 65a635664b919..c1ff8db58e314 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ConfigureProductInCustomerWishlistOnFrontendTest.xml
@@ -6,31 +6,33 @@
*/
-->
-
-
- catalogProductSimple::with_two_custom_option
-
-
-
-
- configurableProduct::default
-
-
-
-
- bundleProduct::bundle_dynamic_product
-
-
-
-
- downloadableProduct::with_two_separately_links
-
-
-
-
- groupedProduct::three_simple_products
-
-
-
-
+
+
+ catalogProductSimple::with_two_custom_option
+
+
+
+
+ configurableProduct::default
+
+
+
+
+ Bug: MAGETWO-33952
+ bundleProduct::bundle_dynamic_product
+
+
+
+
+ Bug: MAGETWO-33952
+ downloadableProduct::with_two_separately_links
+
+
+
+
+ groupedProduct::three_simple_products
+
+
+
+
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php
index 7083e3e70ace5..d325e868b4e70 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/MoveProductFromShoppingCartToWishlistTest.php
@@ -12,8 +12,6 @@
use Magento\Mtf\Fixture\FixtureInterface;
/**
- * Test Flow:
- *
* Preconditions:
* 1. Test products are created.
*
@@ -68,6 +66,7 @@ public function test(
// Steps:
$this->addToCart($product);
$assertAddedProductToCartSuccessMessage->processAssert($checkoutCart, $product);
+ $checkoutCart->open();
$checkoutCart->getCartBlock()->getCartItem($product)->moveToWishlist();
return ['product' => $product];
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php
index 881161d8d5166..47ffc259d718d 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php
@@ -165,7 +165,9 @@ public function test(
$this->loginCustomer($customer);
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
$this->catalogProductView->getViewBlock()->clickAddToWishlist();
+ $this->wishlistIndex->getMessagesBlock()->waitSuccessMessage();
$this->wishlistIndex->getWishlistBlock()->clickShareWishList();
+ $this->cmsIndex->getCmsPageBlock()->waitPageInit();
$this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo);
$this->wishlistShare->getSharingInfoForm()->shareWishlist();
}
diff --git a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml
index ee8bb12399779..1282b05826c50 100644
--- a/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml
+++ b/dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ViewProductInCustomerWishlistOnBackendTest.xml
@@ -16,10 +16,12 @@
+ Bug: MAGETWO-33952
bundleProduct::bundle_dynamic_product
+ Bug: MAGETWO-34633
downloadableProduct::with_two_separately_links
| |