Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/magento/module-catalog/Test/Mftf/Test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/magento/module-catalog/Test/Mftf/Test/SimpleProductTwoCustomOptionsTest.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
 /**
  * Copyright © Magento, Inc. All rights reserved.
  * See COPYING.txt for license details.
  */
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
    <test name="SimpleProductTwoCustomOptionsTest">
        <annotations>
            <features value="Catalog"/>
            <stories value="Create simple product with two custom options" />
            <title value="Admin should be able to create simple product with two custom options"/>
            <description value="Admin should be able to create simple product with two custom options"/>
            <severity value="BLOCKER"/>
            <testCaseId value="MC-248"/>
            <group value="Catalog"/>
        </annotations>
        <before>
            <!-- log in as admin -->
            <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>

            <!--Create product-->
            <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/>
            <actionGroup ref="GoToCreateProductPageActionGroup" stepKey="goToCreateSimpleProduct">
                <argument name="product" value="SimpleProduct3"/>
            </actionGroup>
            <actionGroup ref="FillMainProductFormNoWeightActionGroup" stepKey="fillSimpleProductMain">
                <argument name="product" value="SimpleProduct3"/>
            </actionGroup>
        </before>
        <after>
            <!-- Delete the created product -->
            <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteProduct">
                <argument name="product" value="SimpleProduct3"/>
            </actionGroup>
            <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
            <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
        </after>

        <!-- opens the custom option panel and clicks add options -->
        <click stepKey="openCustomizableOptions" selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}"/>
        <waitForPageLoad stepKey="waitForCustomOptionsOpen"/>

        <!-- Create a custom option with 2 values -->
        <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption1">
            <argument name="customOptionName" value="ProductOptionRadiobutton.title"/>
            <argument name="productOption" value="ProductOptionField"/>
            <argument name="productOption2" value="ProductOptionField2"/>
        </actionGroup>

        <!-- Create another custom option with 2 values -->
        <actionGroup ref="CreateCustomRadioOptionsActionGroup" stepKey="createCustomOption2">
            <argument name="customOptionName" value="ProductOptionRadiobutton.title"/>
            <argument name="productOption" value="ProductOptionField"/>
            <argument name="productOption2" value="ProductOptionField2"/>
        </actionGroup>

        <!-- Save the product -->
        <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="saveProduct"/>
        <comment userInput="BIC workaround" stepKey="waitForProductSaved"/>
        <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/>

        <!-- navigate to the created product page -->
        <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goToCreatedProduct">
            <argument name="productUrl" value="{{SimpleProduct3.urlKey}}"/>
        </actionGroup>
        <comment userInput="BIC workaround" stepKey="waitForProductPageLoad"/>

        <!-- Check to make sure all of the created names are there -->
        <see stepKey="assertNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.title}}"/>
        <see stepKey="assertNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.title}}"/>
        <see stepKey="assertSecondNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.title}}"/>
        <see stepKey="assertSecondNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.title}}"/>

        <!-- Check to see that all of the created prices are there -->
        <see stepKey="assertPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.price}}"/>
        <see stepKey="assertPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.price}}"/>
        <see stepKey="assertSecondPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.price}}"/>
        <see stepKey="assertSecondPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.price}}"/>

        <!-- select two of the radio buttons -->
        <click stepKey="selectFirstCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('1','2')}}"/>
        <click stepKey="selectSecondCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('2','1')}}"/>

        <!-- Check that the price has actually changed -->
        <see stepKey="assertPriceHasChanged" selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="153.00"/>
    </test>
</tests>

Spamworldpro Mini