<?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="BundleProductWithDynamicTierPriceInCartTest" extends="BundleProductWithTierPriceWithFixedAndPercentOptionsInCartTest">
        <annotations>
            <stories value="Add bundle product to cart on storefront"/>
            <title value="Customer should get the right subtotal in cart when the bundle product with dynamic tier price added to the cart"/>
            <description value="Customer should be able to add bundle product with dynamic tier price to the cart and get the right price"/>
            <severity value="CRITICAL"/>
            <group value="cloud"/>
        </annotations>

        <before>
            <createData entity="VirtualProduct" stepKey="createProductForBundleItem1">
                <field key="price">50.00</field>
            </createData>
            <createData entity="SimpleProduct2" stepKey="createProductForBundleItem2">
                <field key="price">100.00</field>
            </createData>
        </before>

        <remove keyForRemoval="clickDynamicPriceSwitcher"/>
        <remove keyForRemoval="fillBundlePrice"/>
        <remove keyForRemoval="disableDynamicSku"/>
        <remove keyForRemoval="fillBundleOption1Price"/>
        <remove keyForRemoval="selectPercentPrice"/>
        <remove keyForRemoval="fillBundleOption2Price"/>
        <assertEquals message="ExpectedPrice" stepKey="assertBundleProductPrice">
            <actualResult type="variable">grabProductPrice</actualResult>
            <expectedResult type="string">$75.00</expectedResult>
        </assertEquals>
        <actionGroup ref="AssertSubTotalOnStorefrontMiniCartActionGroup" stepKey="assertSubTotalOnStorefrontMiniCart">
            <argument name="subTotal" value="$75.00"/>
        </actionGroup>
    </test>
</tests>
