|
2393 | 2393 | <argument name="productIndex" value="1"/>
|
2394 | 2394 | </actionGroup>
|
2395 | 2395 | </test>
|
| 2396 | + <test name="AdminPageBuilderVerifySwatchDisplayedInPreview"> |
| 2397 | + <annotations> |
| 2398 | + <features value="PageBuilder"/> |
| 2399 | + <stories value="Products"/> |
| 2400 | + <title value="Verify products display swatches within the admin"/> |
| 2401 | + <description value="Verify that a product which has swatches display the swatches within the admin"/> |
| 2402 | + <severity value="MAJOR"/> |
| 2403 | + <useCaseId value="PB-76"/> |
| 2404 | + <testCaseId value="MC-22763"/> |
| 2405 | + <group value="pagebuilder"/> |
| 2406 | + <group value="pagebuilder-products"/> |
| 2407 | + </annotations> |
| 2408 | + <before> |
| 2409 | + <createData entity="_emptyCmsPage" stepKey="createCMSPage"/> |
| 2410 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 2411 | + </before> |
| 2412 | + <after> |
| 2413 | + <deleteData createDataKey="createCMSPage" stepKey="deleteCMSPage"/> |
| 2414 | + <actionGroup ref="deleteProductBySku" stepKey="deleteProduct"> |
| 2415 | + <argument name="sku" value="{{BaseConfigurableProduct.sku}}"/> |
| 2416 | + </actionGroup> |
| 2417 | + <actionGroup ref="deleteProductAttributeByLabel" stepKey="deleteAttribute"> |
| 2418 | + <argument name="ProductAttribute" value="visualSwatchAttribute"/> |
| 2419 | + </actionGroup> |
| 2420 | + <actionGroup ref="logout" stepKey="logout"/> |
| 2421 | + </after> |
| 2422 | + <!-- Create a configurable swatch product via the UI --> |
| 2423 | + <comment userInput="Create a configurable swatch product via the UI" stepKey="commentCreateConfigurableProduct" /> |
| 2424 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="goToProductIndex"/> |
| 2425 | + <waitForPageLoad stepKey="waitForProductPage"/> |
| 2426 | + <actionGroup ref="goToCreateProductPage" stepKey="goToCreateProductPage"> |
| 2427 | + <argument name="product" value="BaseConfigurableProduct"/> |
| 2428 | + </actionGroup> |
| 2429 | + <actionGroup ref="fillMainProductForm" stepKey="fillProductForm"> |
| 2430 | + <argument name="product" value="BaseConfigurableProduct"/> |
| 2431 | + </actionGroup> |
| 2432 | + <!-- Add swatch attribute to configurable product --> |
| 2433 | + <comment userInput="Add swatch attribute to configurable product" stepKey="commentAddSwatchesToProduct"/> |
| 2434 | + <actionGroup ref="AddVisualSwatchToProductWithStorefrontConfigActionGroup" stepKey="addSwatchToProduct"/> |
| 2435 | + <click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="saveProduct"/> |
| 2436 | + <!-- Add product to Page Builder Products content type --> |
| 2437 | + <comment userInput="Add product to Page Builder Products content type" stepKey="commentAddProductToPageBuilder"/> |
| 2438 | + <actionGroup ref="navigateToCMSPage" stepKey="navigateToCMSPage"> |
| 2439 | + <argument name="CMSPage" value="$$createCMSPage$$"/> |
| 2440 | + </actionGroup> |
| 2441 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage"/> |
| 2442 | + <actionGroup ref="expandPageBuilderPanelMenuSection" stepKey="expandMenuSectionAddContent"> |
| 2443 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 2444 | + </actionGroup> |
| 2445 | + <actionGroup ref="dragContentTypeToStage" stepKey="dragProductsIntoStage"> |
| 2446 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 2447 | + </actionGroup> |
| 2448 | + <actionGroup ref="openPageBuilderEditPanel" stepKey="openEditAfterDrop"> |
| 2449 | + <argument name="contentType" value="PageBuilderProductsContentType"/> |
| 2450 | + </actionGroup> |
| 2451 | + <actionGroup ref="chooseVisualSelectOption" stepKey="chooseSelectProductsBy"> |
| 2452 | + <argument name="property" value="PageBuilderProductsSelectProductsBySKU"/> |
| 2453 | + </actionGroup> |
| 2454 | + <actionGroup ref="addSKUsToSelectProductsBySKU" stepKey="addProductsSKUsToInputField"> |
| 2455 | + <argument name="SKUs" value="{{BaseConfigurableProduct.sku}}"/> |
| 2456 | + </actionGroup> |
| 2457 | + <actionGroup ref="saveEditPanelSettings" stepKey="saveEditPanelSettings"/> |
| 2458 | + <actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage"> |
| 2459 | + <argument name="page" value="ProductsOnStage"/> |
| 2460 | + <argument name="count" value="1"/> |
| 2461 | + </actionGroup> |
| 2462 | + <!-- Verify displayed swatches --> |
| 2463 | + <comment userInput="Verify displayed swatches" stepKey="commentVerifySwatches"/> |
| 2464 | + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch(visualSwatchOption1.default_label)}}" stepKey="assertAddedWidgetS"/> |
| 2465 | + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch(visualSwatchOption2.default_label)}}" stepKey="assertAddedWidgetM"/> |
| 2466 | + <!-- Save page and verify swatches display on reload --> |
| 2467 | + <comment userInput="Save page and verify swatches display on reload" stepKey="commentSaveAndReload"/> |
| 2468 | + <actionGroup ref="saveAndContinueEditCmsPage" stepKey="saveAndContinueEditCmsPage"/> |
| 2469 | + <actionGroup ref="switchToPageBuilderStage" stepKey="switchToPageBuilderStage2"/> |
| 2470 | + <actionGroup ref="validateProductCountInProducts" stepKey="validateProductsCountStage2"> |
| 2471 | + <argument name="page" value="ProductsOnStage"/> |
| 2472 | + <argument name="count" value="1"/> |
| 2473 | + </actionGroup> |
| 2474 | + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch(visualSwatchOption1.default_label)}}" stepKey="assertAddedWidgetS2"/> |
| 2475 | + <seeElement selector="{{StorefrontProductInfoMainSection.productSwatch(visualSwatchOption2.default_label)}}" stepKey="assertAddedWidgetM2"/> |
| 2476 | + </test> |
2396 | 2477 | </tests>
|
0 commit comments