Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertImportedConfigurableProducts.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Fixture\FixtureInterface;
11 
16 {
22  protected $productType = 'configurable';
23 
29  protected $neededKeys = [
30  'sku',
31  'name',
32  'additional_attributes',
33  'configurable_variations',
34  'url_key',
35  ];
36 
43  protected function getDisplayedProductData(FixtureInterface $product)
44  {
46  $attributesData = $productData['configurable_attributes_data']['matrix']['0'];
47  $form = $this->catalogProductEdit->getProductForm();
48  $form->openSection('variations');
49  $productAttribute = $form->getSection('variations')->getVariationsBlock()->getProductAttribute();
50  $productAttribute = str_replace(': ', '=', $productAttribute);
51  $productData['additional_attributes'] = $productAttribute;
52  $productData['configurable_variations'] = 'sku=' . $attributesData['sku'] . ',' . $productAttribute;
53  unset($productData['configurable_attributes_data']);
54 
55  return $this->getResultProductsData($productData);
56  }
57 
63  public function toString()
64  {
65  return 'Products data from CSV import file and data from product edit page are correct and match.';
66  }
67 }
$attributesData
$productData