oro_behat_extension:
  elements:
    Lead:
      selector:
        locator: '//ul[contains(@class, "context-items-dropdown dropdown-menu")]/li[contains(text(),"Lead")]'
        type: xpath

    Lead Form:
      selector: 'form[name="oro_sales_lead_form"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Second Country:
            locator: '//div[contains(@id,"s2id_oro_sales_lead_form_addresses_1_country-uid")]/input'
            type: xpath
          Second State:
            locator: '//div[contains(@id,"s2id_oro_sales_lead_form_addresses_1_region-uid")]/input'
            type: xpath

    Business Customer Form:
      selector: 'form[name="oro_sales_b2bcustomer"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Billing Address Country:
            locator: '//div[contains(@id,"s2id_oro_sales_b2bcustomer_billingAddress_country-uid")]/input'
            type: xpath
          Billing Address State:
            locator: '//div[contains(@id,"s2id_oro_sales_b2bcustomer_billingAddress_region")]/input'
            type: xpath
          Billing Address City: 'oro_sales_b2bcustomer[billingAddress][city]'
          Billing Address Street: 'oro_sales_b2bcustomer[billingAddress][street]'
          Billing Address Postal Code: 'oro_sales_b2bcustomer[billingAddress][postalCode]'
          Shipping Address Country:
            locator: '//div[contains(@id,"s2id_oro_sales_b2bcustomer_shippingAddress_country-uid")]/input'
            type: xpath
          Shipping Address State:
            locator: '//div[contains(@id,"s2id_oro_sales_b2bcustomer_shippingAddress_region-uid")]/input'
            type: xpath
          Shipping Address City: 'oro_sales_b2bcustomer[shippingAddress][city]'
          Shipping Address Street: 'oro_sales_b2bcustomer[shippingAddress][street]'
          Shipping Address Postal Code: 'oro_sales_b2bcustomer[shippingAddress][postalCode]'

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

    Opportunity Form:
      selector: 'form[name="oro_sales_opportunity_form"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Budget Amount: 'oro_sales_opportunity_form[budgetAmount][value]'
          Budget Currency: 'oro_sales_opportunity_form[budgetAmount][currency]'
          Expected close date: 'oro_sales_opportunity_form[closeDate]'
          Close Revenue Amount: 'oro_sales_opportunity_form[closeRevenue][value]'
          Close Revenue Currency: 'oro_sales_opportunity_form[closeRevenue][currency]'
          DateTimeField: 'oro_sales_opportunity_form[DateTimeField]'

    ImportLead:
      selector: 'div[class="opportunity-card-view card-view ui-sortable-handle"]'

    Closed Lost:
      selector:
        locator: '//div[7][@class="board-column ui-sortable"]'
        type: xpath

    CustomerOpportunitiesGrid:
      selector: "div[id^='grid-sales-b2bcustomer-opportunities-grid-customer']"
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    OpportunityProbabilitiesConfigForm:
      selector: 'form[name="opportunity"]'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Element\OpportunityProbabilitiesConfigForm

    SalesB2bCustomerForm:
      selector: 'form[name="oro_sales_b2bcustomer"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form

    Develop Opportunity Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Budget Amount: 'oro_workflow_transition[budget_amount][value]'
          Customer need: 'oro_workflow_transition[customer_need]'
          Proposed solution: 'oro_workflow_transition[proposed_solution]'

    Close As Won Opportunity Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Close Revenue: 'oro_workflow_transition[close_revenue][value]'

    Close As Lost Opportunity Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Close reason: 'oro_workflow_transition[close_reason_name]'

    All Quotes Grid:
      selector: 'div[data-page-component-name="quotes-grid"]'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Element\QuotesGrid

    Quotes Grid:
      selector: '[id^="grid-opportunity-quotes-grid"]'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Element\QuotesGrid

    Quote Line Items:
      selector: '.quote-lineitems'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Product:
            type: 'css'
            locator: '.quote-lineitem-product-select .select2-offscreen[type="text"]'
          Unit Price: 'oro_sale_quote[quoteProducts][0][quoteProductOffers][0][price][value]'
          Quantity: 'oro_sale_quote[quoteProducts][0][quoteProductOffers][0][quantity]'

    Unit Price:
      selector: '[name="oro_sale_quote[quoteProducts][0][quoteProductOffers][0][price][value]"]'

    Shipping Address:
      selector: '[data-name="field__customer-address"]'
      class: Oro\Bundle\FormBundle\Tests\Behat\Element\Select2Entity

    Calculate Shipping:
      selector: '[data-role="possible_shipping_methods_btn"]'

    Shipping Method Form:
      selector: 'div.possible_shipping_methods_form'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Method:
            type: 'xpath'
            locator: "//input[@name='possibleShippingMethodType']"
            element: PrettyCheckbox

    Customer Quotes Grid:
      selector: '.frontend-datagrid'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\FrontendGrid

    Quote View Grid:
      selector: '.oro-grid-table'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\FrontendTableGrid

    Configuration Localization Form:
      selector: 'form[name="localization"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Default Localization: 'localization[oro_locale___default_localization][value]'
          Primary Location Use Default: 'localization[oro_locale___country][use_parent_scope_value]'
          Primary Location: 'localization[oro_locale___country][value]'

    CurrencyPopover:
      selector: '.action-cell button[data-toggle="popover"]'

    EuroAsDefaultValue:
      selector:
          type: xpath
          locator: '//td[text()[contains(.,"EUR")]]/parent::tr/*[1]//input'

    OpportunityStatusFilter:
       selector:
           type: xpath
           locator: '//div[text()[contains(.,"Status")]]'

    OpportunityStatusFilerSelectButton:
       selector:
           type: xpath
           locator: '//button[text()[contains(.,"is not any of")]]'

    OpportunityStatusFilerSelectField:
       selector:
           type: xpath
           locator: '//button[text()[contains(.,"is not any of")]]/ancestor::div[contains(@class, "choice-filter")]/div[contains(@class, "value-field-frame")]/div/ul'

    Leads Grid:
      selector: 'div[data-page-component-name="sales-lead-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    Business Customer Grid:
      selector: 'div[data-page-component-name="oro-sales-b2bcustomers-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    Business Customers Address Form:
      selector: 'form[name="oro_sales_b2bcustomer"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Billing Address Country: 'oro_sales_b2bcustomer[billingAddress][country]'
          Billing Address State: 'oro_sales_b2bcustomer[billingAddress][region]'
          Shipping Address Country: 'oro_sales_b2bcustomer[shippingAddress][country]'
          Shipping Address State: 'oro_sales_b2bcustomer[shippingAddress][region]'

    Bussines Customer Leads Paginator:
      selector: 'div[data-page-component-name="sales-customers-leads-grid"] div.toolbar div.pagination'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridPaginator

    Business Customer Leads Grid:
      selector: 'div[data-page-component-name="sales-customers-leads-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridToolbarPaginator: 'Business Customer Leads Grid Paginator'

    Business Customer Leads GridFilters:
      selector: 'div[data-page-component-name="sales-customers-leads-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters

    Business Customer Leads GridFilterItem:
      selector: 'div.filter-item'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilterItem

    First Widget Add Button:
      selector:
        locator: '(//div[(contains(@class,"widget-picker__results"))]//details[@style="opacity: 1;"]//button[contains(text(),"Add")])[1]'
        type: xpath

    Enter keyword:
      selector:
        locator: '//input[contains(@class,"widget-picker__filter-search")]'
        type: xpath

    Leads List:
      selector:
        type: 'xpath'
        locator: '//div[@title="Leads List"]/../..'

    Leads List Actions:
      selector:
        type: 'xpath'
        locator: '//div[@title="Leads List"]/..//button[contains(@id,"dashboard-action")]'

    Lead Statistics:
      selector:
        type: 'xpath'
        locator: '//div[@title="Lead statistics"]/../..'

    Leads Statistics Actions:
      selector:
        type: 'xpath'
        locator: '//div[@title="Lead statistics"]/..//button[contains(@id,"dashboard-action")]'

    Opportunity Statistics:
      selector:
        type: 'xpath'
        locator: '//div[@title="Opportunity statistics"]/../..'

    Opportunity Statistics Actions:
      selector:
        type: 'xpath'
        locator: '//div[@title="Opportunity statistics"]/..//button[contains(@id,"dashboard-action")]'

    Opportunities by Status:
      selector:
        type: 'xpath'
        locator: '//div[@title="Opportunities by Status"]/../..'

    Opportunities List:
      selector:
        type: 'xpath'
        locator: '//div[@title="Opportunities List"]/../..'

    Opportunities List Actions:
      selector:
        type: 'xpath'
        locator: '//div[@title="Opportunities List"]/..//button[contains(@id,"dashboard-action")]'

    Opportunity Statistics Form:
      selector: 'form[name="opportunity_statistics"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Start Date: 'opportunity_statistics[dateRange][value][start]'
          End Date: 'opportunity_statistics[dateRange][value][end]'
          Type:
            type: 'xpath'
            locator: '//select[@data-name="custom_part"]'

    Forecast Actions:
      selector:
        type: 'xpath'
        locator: '//div[@title="Forecast"]/..//button[contains(@id,"dashboard-action")]'

    Forecast:
      selector:
        type: 'xpath'
        locator: '//div[@title="Forecast"]/../..'

    Lead Statistics Form:
      selector: 'form[name="lead_statistics"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Start Date range: 'lead_statistics[dateRange][value][start]'
          End Date range: 'lead_statistics[dateRange][value][end]'
          Start Date filter:
            type: 'css'
            locator: '.datepicker-input[aria-label="Datetime filter from date value"]'
          End Date filter:
            type: 'css'
            locator: '.datepicker-input[aria-label="Datetime filter to date value"]'

    Previous period disable:
      selector: '[id^=lead_statistics_usePreviousInterval]'

    Lead Statistics Widget New Leads count:
      selector: '[data-widget-title="Lead statistics"] .deviation.positive'

    Forecast Form:
      selector: 'form[name="forecast_of_opportunities"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Start Date: 'forecast_of_opportunities[dateRange][value][start]'
          End Date: 'forecast_of_opportunities[dateRange][value][end]'
          Type:
            type: 'xpath'
            locator: '//select[@data-name="custom_part"]'

    Date Custom Part:
      selector:
        type: 'xpath'
        locator: '//select[@data-name="custom_part"]/..//span'

    Widget Save Button:
      selector:
        type: 'xpath'
        locator: '//div[@class="widget-actions-section"]/..//button[contains(text(),"Save")]'

    ChannelEntitiesGrid:
      selector: 'div.grid-container'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    DeviationNegative:
      selector: '.deviation.negative'

    Leads List Sort:
      selector: '[id^=leads_list_sortBy_order]'

    Leads List Updated At:
      selector:
        type: xpath
        locator: '//div[contains(@class, "select2-result-label") and contains(., "Updated At")]'

  pages:
    Opportunity Index:
      route: 'oro_sales_opportunity_index'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\OpportunityIndex

    Opportunity Create:
      route: 'oro_sales_opportunity_create'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\OpportunityCreate

    Opportunity View:
      route: 'oro_sales_opportunity_view'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\OpportunityView

    Lead Index:
      route: 'oro_sales_lead_index'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\LeadIndex

    Lead Create:
      route: 'oro_sales_lead_create'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\LeadCreate

    Lead View:
      route: 'oro_sales_lead_view'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\LeadView

    Customer Quotes List:
      route: 'oro_sale_frontend_quote'
      class: Oro\Bundle\SalesBundle\Tests\Behat\Page\CustomerQuotes

  suites:
    OroSalesBundle:
      contexts:
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\OroMainContext
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\FixturesContext
        - Oro\Bundle\DataGridBundle\Tests\Behat\Context\GridContext
        - Oro\Bundle\ActivityListBundle\Tests\Behat\Context\ActivityContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FormContext
        - Oro\Bundle\SecurityBundle\Tests\Behat\Context\ACLContext
        - Oro\Bundle\ImportExportBundle\Tests\Behat\Context\ImportExportContext
        - Oro\Bundle\AddressBundle\Tests\Behat\Context\AddressContext
        - Oro\Bundle\SalesBundle\Tests\Behat\Context\SalesContext
        - Oro\Bundle\SalesBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\NavigationBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\NavigationBundle\Tests\Behat\Context\PinbarContext
        - Oro\Bundle\NavigationBundle\Tests\Behat\Context\ScrollspyContext
        - Oro\Bundle\SalesBundle\Tests\Behat\Context\SalesFeatureToggleContext
        - Oro\Bundle\ConfigBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\QueryDesignerBundle\Tests\Behat\Context\QueryDesignerContext
        - Oro\Bundle\LocaleBundle\Tests\Behat\Context\LocalizationContext
        - Oro\Bundle\EmailBundle\Tests\Behat\Context\EmailContext
        - Oro\Bundle\SearchBundle\Tests\Behat\Context\SearchContext
        - Oro\Bundle\FilterBundle\Tests\Behat\Context\FilterContext
        - Oro\Bundle\DashboardBundle\Tests\Behat\Context\FeatureContext
      paths:
        - '@OroSalesBundle/Tests/Behat/Features'
