oro_behat_extension:
  suites:
    OroPricingBundle:
      contexts:
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\OroMainContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ConfigBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\PricingBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\PricingBundle\Tests\Behat\Context\PricingImportExportContext
        - Oro\Bundle\DataGridBundle\Tests\Behat\Context\GridContext
        - Oro\Bundle\ProductBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\AttachmentBundle\Tests\Behat\Context\AttachmentImageContext
        - Oro\Bundle\ProductBundle\Tests\Behat\Context\QuickOrderFormContext
        - Oro\Bundle\WorkflowBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FormContext
        - Oro\Bundle\CheckoutBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ApplicationBundle\Tests\Behat\Context\CommerceMainContext
        - Oro\Bundle\UIBundle\Tests\Behat\Context\TypeaheadContext
        - Oro\Bundle\ImportExportBundle\Tests\Behat\Context\ImportExportContext
        - Oro\Bundle\EmailBundle\Tests\Behat\Context\EmailContext
        - Oro\Bundle\CustomerBundle\Tests\Behat\Context\ACLContext
        - Oro\Bundle\ShoppingListBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\LocaleBundle\Tests\Behat\Context\LocalizationContext
        - Oro\Bundle\FrontendLocalizationBundle\Tests\Behat\Context\LocalizationSwitcherContext
        - Oro\Bundle\ShoppingListBundle\Tests\Behat\Context\ShoppingListContext
        - Oro\Bundle\CatalogBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\ConsoleContext
        - Oro\Bundle\PricingBundle\Tests\Behat\Context\PriceCalculationDetailsContext
      paths:
        - '@OroPricingBundle/Tests/Behat/Features'

  elements:
    AddPrice:
      selector: '.product-price-collection .add-list-item'
    UnassignPriceList:
      selector: '.pricing-price-list .removeRow'
    ProductPriceForm:
      selector:
        type: xpath
        locator: '(//div[@id="product_prices"]//DIV[@class="row-oro oro-multiselect-holder"])[last()]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Currency:
            type: xpath
            locator: '(//select[@class="price-currency"])[last()]'
            element: Select2Choices
    PriceSelectionStrategyForm:
      selector: '.control-group-oro_pricing_list_strategy_selection'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
    Product Price Container:
      selector: '.product-price__container'
    Product Price Main:
      selector: '.product-price__main'
    Product Price Your:
      selector: '.product-price__your'
    Product Price Listed:
      selector: '.product-price__listed'
    Product Price Hint:
      selector: '.product-price-hint-btn'
    Product Price Popover:
      selector: '.prices-hint-content.popover'
    Product Assignment Rule:
      selector: 'textarea[name="oro_pricing_price_list[productAssignmentRule]"]'
    Price Calculation Add:
      selector: '.price_rules__add_btn .add-list-item'
    Price Calculation Quantity:
      selector: 'input[name="oro_pricing_price_list[priceRules][0][quantity]"]'
    Price Calculation Unit Expression:
      selector: 'input[name="oro_pricing_price_list[priceRules][0][productUnitExpression]"]'
    Price Calculation Unit Expression Button:
      selector: 'a.price-rule-item-product-unit-type-expression'
    Price Calculation Currency Expression:
      selector: 'input[name="oro_pricing_price_list[priceRules][0][currencyExpression]"]'
    Price Calculation Currency Expression Button:
      selector: 'a.price-rule-item-currency-type-expression'
    Price Calculation Calculate As:
      selector: 'textarea[name="oro_pricing_price_list[priceRules][0][rule]"]'
    Price Calculation Condition:
      selector: 'textarea[name="oro_pricing_price_list[priceRules][0][ruleCondition]"]'
    Price List Select Grid Button:
      selector: '.active.expression-editor-data-source .entity-select-btn'
    Price List Select Clear Button:
      selector: '.active.expression-editor-data-source .select2-search-choice-close'
    Product Price Attributes Table:
      selector: 'table.grid.product-price-attributes'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Table
    Product Price Attributes Grid 1:
      selector: 'div[data-page-component-name="product-price-attributes-grid:1"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
    Product Price Attribute MSRP Form:
      selector:
        locator: '//div[@class="price-attributes-collection"]/div/div/label[text()="MSRP"]/../..'
        type: xpath
    Product Price Attribute Unit Each:
      selector:
        locator: '//td/span[text()="each"]'
        type: xpath
    Product Price Attribute Unit Item:
      selector:
        locator: '//td/span[text()="item"]'
        type: xpath
    ProductPricesGrid:
      selector: 'div[data-page-component-name="product-prices-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
    ProductPricesGridFilters:
      selector: 'div[data-page-component-name="product-prices-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters
    ProductPricesGridToolbarActions:
        selector: 'div[data-page-component-name="product-prices-grid"] div.toolbar div.actions-panel'
        class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridToolbarActions
    ProductPricesGridFiltersState:
        selector: 'div[data-page-component-name="product-prices-grid"] .filters-state'
    ProductPricesGridFilterItem:
      selector: 'div.filter-item'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilterItem
    ProductPricesGridFiltersButton:
      selector:
        locator: '//div/h4[text()="Product Prices"]/../..//div[@class="oro-datagrid"]/div[@class="toolbar"]//a[@title="Filter Toggle"]'
        type: xpath
    PriceListFilterHint:
      selector:
        locator: '//div[@class="filter-item oro-drop"]/div[contains(text(), "Price List")]/span[@class="filter-item-hint"]/span/b'
        type: 'xpath'
    PriceListSidebarSelector:
      selector: 'input[name="oro_pricing_price_list_select"]'
      class: Oro\Bundle\FormBundle\Tests\Behat\Element\Select2Entity
    Price Calculation Details Grid Sidebar:
      selector: '[data-role="sidebar"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Website:
            type: 'css'
            locator: 'input[name="oro_multiwebsite_website_select"]'
            element: Select2Entity
          Customer:
            type: 'css'
            locator: 'input[name="oro_customer_customer_select"]'
            element: Select2Entity
    Price Calculation Details Element Label:
      selector: '.attribute-item__term'
    Price Calculation Details Price List Label:
      selector: '.terms-title-divider'
    Price Calculation Details Prices Collection:
      selector:
        locator: "/following-sibling::*//*[contains(concat(' ', normalize-space(@class), ' '), ' prices-collection ')]"
        type: 'xpath'
    Price Calculation Details Price Block:
      selector: '.price-details'
    Price Calculation Details Price Unit:
      selector: '.price-details-unit'
    Price Calculation Details Price Item:
      selector: '.price-details-item'
    PricingConfigurationForm:
      selector: 'form[name="pricing"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Offset Of Processing CPL Prices Use Default: 'pricing[oro_pricing___offset_of_processing_cpl_prices][use_parent_scope_value]'
          Offset Of Processing CPL Prices: 'pricing[oro_pricing___offset_of_processing_cpl_prices][value]'
          Default Currency: 'pricing[oro_pricing_pro___default_currency][value]'
          Subtotals Calculation Precision in Sales Documents System: 'pricing[oro_pricing___precision][use_parent_scope_value]'
          Subtotals Calculation Precision in Sales Documents: 'pricing[oro_pricing___precision][value]'
          Pricing Rounding Type System: 'pricing[oro_pricing___rounding_type][use_parent_scope_value]'
          Pricing Rounding Type: 'pricing[oro_pricing___rounding_type][value]'
          Pricing Default Price List Use Default: 'pricing[oro_pricing___default_price_list][use_parent_scope_value]'
          Pricing Default Price List:
            type: 'xpath'
            locator: '//input[@name="pricing[oro_pricing___default_price_list][value]"]'
            element: Select2Entity

    Add Product Price Form:
      selector: '[id^="oro_action_operation-uid"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Product:
            type: 'xpath'
            locator: '//div[contains(@id,"s2id_oro_action_operation_price_product-uid")]//input'
          Quantity: 'oro_action_operation[price][quantity]'
          Unit: 'oro_action_operation[price][unit]'
          Price: 'oro_action_operation[price][price][value]'
          Currency: 'oro_action_operation[price][price][currency]'

    Update Product Price Form:
      selector: '[id^="oro_pricing_price_list_product_price-uid"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Quantity: 'oro_pricing_price_list_product_price[quantity]'
          Unit: 'oro_pricing_price_list_product_price[unit]'
          Price: 'oro_pricing_price_list_product_price[price][value]'
          Currency: 'oro_pricing_price_list_product_price[price][currency]'

    Price Product hamburger:
      selector:
        locator: '//label[text()="Product"]/../..//button[contains(@class,"entity-select-btn")]'
        type: xpath

    Price List Form:
      selector: 'form[name="oro_pricing_price_list"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Name: 'oro_pricing_price_list[name]'
          Currencies: 'oro_pricing_price_list[currencies][]'
          Active: 'oro_pricing_price_list[active]'
          Activate At (first):
            type: 'xpath'
            locator: '//input[contains(@name,"oro_pricing_price_list_schedules_0_activeAt-uid")]'
          Deactivate At (first):
            type: 'xpath'
            locator: '//input[contains(@name,"oro_pricing_price_list_schedules_0_deactivateAt-uid")]'
          Rule: 'oro_pricing_price_list[productAssignmentRule]'

    Order Review Form:
      selector: '[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          PO Number: 'oro_workflow_transition[po_number]'

    Price list Product prices Grid:
      selector: 'div[data-page-component-name="price-list-product-prices-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    Currency Switcher:
      selector:
        type: 'xpath'
        locator: '//div[contains(@data-bound-component, "currency-switcher")]/ancestor::div[@class="oro-toolbar"]'

    Currency Switcher Button:
      selector:
        type: 'xpath'
        locator: '//div[contains(@data-bound-component, "currency-switcher")]/ancestor::div[@class="oro-toolbar"]/div[@data-toggle="dropdown"]'

    Open Price Dropdown Button:
      selector:
        type: 'xpath'
        locator: '//button[@data-prices-hint-trigger]'

    Export Button:
      selector:
        locator: '//a[@role="button" and contains(text(),"Export")]'
        type: xpath

    Chosen Select Option:
      selector:
        locator: '//span[@class="select2-chosen"]'
        type: 'xpath'

    Open Filters Panel Button:
      selector:
        type: 'xpath'
        locator: '//div[@class="btn-group not-expand frontend-datagrid__panel"]/a[@title="Filter Toggle"]'

    Price Modal Window Form:
      selector: 'form[id^="oro_pricing_price_list_product_price"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Price: 'oro_pricing_price_list_product_price[price][value]'

    QuickOrderFirstSkuField:
      selector: 'form[name="oro_product_quick_add"] input[name="oro_product_quick_add[products][0][product]"]'

    QuickOrderFirstSkuFieldTypeahead:
      selector: 'form[name="oro_product_quick_add"] input[name="oro_product_quick_add[products][0][product]"] + .oro-select2__dropdown'

    ConfirmButton:
      selector: '.modal-footer .btn-primary'

    Merge Allowed In Row 1:
      selector:
        locator: '//input[@type="checkbox" and contains(@name, "[0][mergeAllowed]")]'
        type: 'xpath'
    Merge Allowed In Row 2:
      selector:
        locator: '//input[@type="checkbox" and contains(@name, "[1][mergeAllowed]")]'
        type: 'xpath'
    Merge Allowed In Row 3:
      selector:
        locator: '//input[@type="checkbox" and contains(@name, "[2][mergeAllowed]")]'
        type: 'xpath'
