oro_behat_extension:
  suites:
    OroCheckoutBundle:
      contexts:
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\OroMainContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ConfigBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FormContext
        - Oro\Bundle\DataGridBundle\Tests\Behat\Context\GridContext
        - Oro\Bundle\ApplicationBundle\Tests\Behat\Context\CommerceMainContext
        - Oro\Bundle\ShippingBundle\Tests\Behat\Context\SingleCurrencyContext
        - Oro\Bundle\ShippingBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ShoppingListBundle\Tests\Behat\Context\ShoppingListContext
        - Oro\Bundle\ShoppingListBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\CustomerBundle\Tests\Behat\Context\CustomerUserContext
        - Oro\Bundle\CustomerBundle\Tests\Behat\Context\FrontendGridContext
        - Oro\Bundle\CheckoutBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ProductBundle\Tests\Behat\Context\QuickOrderFormContext
        - Oro\Bundle\OrderBundle\Tests\Behat\Context\OrderContext
        - Oro\Bundle\CustomerBundle\Tests\Behat\Context\ACLContext
        - Oro\Bundle\ProductBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\AttachmentBundle\Tests\Behat\Context\AttachmentImageContext
        - Oro\Bundle\PricingBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\LocaleBundle\Tests\Behat\Context\LocalizationContext
        - Oro\Bundle\FrontendLocalizationBundle\Tests\Behat\Context\LocalizationSwitcherContext
        - Oro\Bundle\UIBundle\Tests\Behat\Context\DatepickerContext
        - Oro\Bundle\EmailBundle\Tests\Behat\Context\EmailContext
        - Oro\Bundle\PromotionBundle\Tests\Behat\Context\PromotionContext
        - Oro\Bundle\WorkflowBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\NavigationBundle\Tests\Behat\Context\TabContext
        - Oro\Bundle\SaleBundle\Tests\Behat\Context\FeatureContext
        - Oro\Bundle\ImportExportBundle\Tests\Behat\Context\ImportExportContext
      paths:
        - '@OroCheckoutBundle/Tests/Behat/Features'

  elements:
    Select Billing Address:
      selector: '[name="oro_workflow_transition[billing_address][customerAddress]"]'

    Billing Address:
      selector: 'select[name="oro_workflow_transition[billing_address][customerAddress]"]'
      class: Oro\Bundle\FormBundle\Tests\Behat\Element\Select

    Checkout Billing Address:
      selector: 'select[name="oro_workflow_transition[billing_address][customerAddress]"]'
      class: Oro\Bundle\FormBundle\Tests\Behat\Element\Select

    Checkout Shipping Address:
      selector: 'select[name="oro_workflow_transition[shipping_address][customerAddress]"]'
      class: Oro\Bundle\FormBundle\Tests\Behat\Element\Select

    Select Shipping Address:
      selector: '[name="oro_workflow_transition[shipping_address][customerAddress]"]'

    Select Single Page Checkout Billing Address:
      selector: '[name="oro_workflow_transition[billing_address]"]'

    Select Single Page Checkout Shipping Address:
      selector: '[name="oro_workflow_transition[shipping_address]"]'

    Edit Billing Information:
      selector: '[data-title="Edit Billing Information"]'

    Edit Shipping Information:
      selector: '[data-title="Edit Shipping Information"]'

    Checkout Shipping Method:
      selector: '[data-content="shipping_method_form"] .checkout-form__radio label'

    Checkout Payment Method:
      selector: '[data-content="payment_method_form"] .checkout-form__radio label'

    CheckoutStep:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\CheckoutStep
      selector: 'div[data-role="checkout-content"]'

    CheckoutProductTableRow:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\ProductTableRow
      selector: 'tr.grid-row'

    CheckoutProductViewLink:
      selector: 'h3.grid-line-items__title a'

    Single Page Checkout Step:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\CheckoutStep
      selector: 'div.checkout-order-summary__totals'

    CheckoutStepTitle:
      selector: 'h2.checkout__title'

    CheckoutSuccessStep:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\CheckoutSuccessStep
      selector: '.checkout__success'

    CheckoutSuccessStepTitle:
      selector: 'h1.checkout__success__title'

    Checkout Order Review Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          PO Number: 'oro_workflow_transition[po_number]'
          Notes: 'oro_workflow_transition[customer_notes]'
          Do not ship later than:
            type: 'xpath'
            locator: '//input[@name="oro_workflow_transition[ship_until]"]/../../input'

    Do not ship later than Datepicker:
      selector: 'form[name="oro_workflow_transition"] input.hasDatepicker'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\DateTimePicker

    Checkout Totals:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\CheckoutPage
      selector: '.totals-container'

    OpenOrdersGrid:
      selector: 'div[data-page-component-name="frontend-checkouts-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    OpenOrdersGridFilters:
      selector: 'div[data-page-component-name="frontend-checkouts-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters

    OpenOrdersGridToolbarActions:
        selector: 'div[data-page-component-name="frontend-checkouts-grid"] div.toolbar div.actions-panel'
        class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridToolbarActions

    OpenOrdersGridFiltersState:
        selector: 'div[data-page-component-name="frontend-checkouts-grid"] .filters-state'

    OpenOrdersGridFilterItem:
      selector: 'div.filter-items-hint span'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilterItem

    OpenOrdersGridFilterDateTimeItem:
      selector: 'div.filter-item'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilterDateTimeItem

    PastOrdersGrid:
      selector: 'div[data-page-component-name="frontend-orders-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    PastOrdersGridFilters:
      selector: 'div[data-page-component-name="frontend-orders-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters

    PastOrdersGridToolbarActions:
      selector: 'div[data-page-component-name="frontend-orders-grid"] div.toolbar div.actions-panel'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridToolbarActions

    PastOrdersGridFiltersState:
      selector: 'div[data-page-component-name="frontend-orders-grid"] .filters-state'

    BackendOrderLineItemsGrid:
      selector: 'div[data-page-component-name="order-line-items-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    OrderLineItemsGrid:
      selector: 'div[data-page-component-name="order-line-items-grid-frontend"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid

    Checkout Line Items Table:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\ProductTable
      selector: 'div.checkout-order-summary__content table'

    CheckoutStepLineItem:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Element\CheckoutStepLineItem
      selector: 'table[data-scrollable-inner-content] tr'

    CheckoutStepLineItemProductSku:
      selector: 'td.grid-body-cell-item div.grid-line-items__row span, td.grid-body-cell-sku'

    Checkout Line Item Product Attribute:
      selector: 'td.grid-body-cell-item div.grid-line-items__configuration div.grid-line-items__field'

    Ship to This Address:
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Checkbox
      selector:
        type: xpath
        locator: '//label[contains(., "Ship to this address")]'

    Order Summary Products Grid:
      selector: '.checkout-order-summary__content'

    Order Summary Products GridProductLine:
      selector: 'table tr.grid-row'

    Order Summary Products GridProductLineName:
      selector: '.grid-body-cell-item'

    Order Summary Products GridProductLineQuantity:
      selector: '.grid-body-cell-quantity'

    Order Summary Products GridProductLineUnit:
      selector: '.grid-body-cell-unit'

    Order Summary Products GridProductLinePrice:
      selector: '.grid-body-cell-price'

    Order Summary Products GridProductLineSubtotal:
      selector: '.grid-body-cell-subtotal'

    Checkout Order Summary Notes:
      selector: 'div.shopping-list-notes'

    CheckoutGoBackButton:
        selector: 'div.checkout-sidebar ol.checkout-navigation > li > h3.checkout-navigation__title > a'

    ShippingMethodFlatRate2:
      selector: 'div[data-content="shipping_method_form"] div.checkout-form__radio label.checkbox-label:contains("Flat Rate 2: $2.00")'

    PaymentMethodPaymentTerm30:
      selector: 'div[data-content="payment_method_form"] div.checkout-form__radio label.checkbox-label:contains("Payment Term 30")'

    Billing Information Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Billing Address: 'oro_workflow_transition[billing_address][customerAddress]'
          First Name: 'oro_workflow_transition[billing_address][firstName]'
          Last Name: 'oro_workflow_transition[billing_address][lastName]'
          Organization: 'oro_workflow_transition[billing_address][organization]'
          Email: 'oro_workflow_transition[email]'
          Street: 'oro_workflow_transition[billing_address][street]'
          City: 'oro_workflow_transition[billing_address][city]'
          Country: 'oro_workflow_transition[billing_address][country]'
          State: 'oro_workflow_transition[billing_address][region]'
          Zip/Postal Code: 'oro_workflow_transition[billing_address][postalCode]'
          Ship to this address: 'oro_workflow_transition[ship_to_billing_address]'

    Shipping Country:
      selector: 'select[name="oro_workflow_transition[shipping_address][country]"]'

    Shipping Information Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          First Name: 'oro_workflow_transition[shipping_address][firstName]'
          Last Name: 'oro_workflow_transition[shipping_address][lastName]'
          Organization: 'oro_workflow_transition[shipping_address][organization]'
          Street: 'oro_workflow_transition[shipping_address][street]'
          City: 'oro_workflow_transition[shipping_address][city]'
          Country: 'oro_workflow_transition[shipping_address][country]'
          State: 'oro_workflow_transition[shipping_address][region]'
          Zip/Postal Code: 'oro_workflow_transition[shipping_address][postalCode]'

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

    Checkout Edit Order Link:
      selector: '.checkout-order-summary__edit-link'

    Submit Order:
      selector: '.order-checkout-widget button:contains("Submit Order")'

    # Disabled Submit order button is actually other element (div)
    Disabled Submit Order Button:
      selector: '.order-checkout-widget .btn--disabled.checkout__submit-btn:contains("Submit Order")'

    Customer Users List button:
      selector:
        locator: '//div[contains(@id,"oro_sale_quote_customerUser-uid")]/div/button[contains(@class, "entity-select-btn")]'
        type: xpath

    Paste Your Order Input Field:
      selector:
        locator: '//textarea[contains(@id,"oro_product_quick_add_copy_paste_copyPaste")]'
        type: xpath

    Quick Add Row Product Field:
      selector:
        locator: '//input[contains(@id,"oro_product_quick_add_products_1_product-uid")]'
        type: xpath

    Quick Add Row Quantity Field:
      selector:
        locator: '//input[contains(@id,"oro_product_quick_add_products_1_quantity-uid")]'
        type: xpath

    Assigned To Input Field:
      selector:
        locator: '//input[contains(@id,"oro_rfp_frontend_request_assignedCustomerUsers-uid")]'
        type: xpath

    Customers Address Book Paginator:
      selector: 'div[data-page-component-name="frontend-customer-customer-address-grid"] div.visible-items-counter'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\GridToolbarPaginator

    Customers Address Book Grid:
      selector: 'div[data-page-component-name="frontend-customer-customer-address-grid"]'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridToolbarPaginator: 'Customers Address Book Paginator'

    Customers Address Book GridFilters:
      selector: 'div[data-page-component-name="frontend-customer-customer-address-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters

    Customers Address Book GridFiltersState:
      selector: 'div[data-page-component-name="frontend-customer-customer-address-grid"] .filters-state'

    Customers Address Book GridToolbarActions:
      selector: 'div[data-page-component-name="frontend-customer-customer-address-grid"] div.toolbar div.actions-panel'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridToolbarActions

    Customers Address Book GridFilterItem:
      selector: 'span.filter-criteria-hint-item'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\GridFilterItem

    Customer Users Address Book Paginator:
      selector: 'div[data-page-component-name="frontend-customer-customer-user-address-grid"] div.visible-items-counter'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\GridToolbarPaginator

    Customer Users Address Book Grid:
      selector: 'div[data-page-component-name="frontend-customer-customer-user-address-grid"]'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridToolbarPaginator: 'Customer Users Address Book Paginator'

    Customer Users Address Book GridFilters:
      selector: 'div[data-page-component-name="frontend-customer-customer-user-address-grid"] div.filter-box'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridFilters

    Customer Users Address Book GridFiltersState:
      selector: 'div[data-page-component-name="frontend-customer-customer-user-address-grid"] .filters-state'

    Customer Users Address Book GridToolbarActions:
      selector: 'div[data-page-component-name="frontend-customer-customer-user-address-grid"] div.toolbar div.actions-panel'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\GridToolbarActions

    Customer Users Address Book GridFilterItem:
      selector: 'span.filter-criteria-hint-item'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\GridFilterItem

    Permissions Dropdown Items:
      selector: '.dropdown-menu__permissions-item a'

    Billing Address Select:
      selector:
        type: xpath
        locator: '//*[contains(@id, "s2id_oro_workflow_transition_billing_address-uid-")]/a'

    Shipping Address Select:
      selector:
        type: xpath
        locator: '//*[contains(@id, "s2id_oro_workflow_transition_shipping_address-uid-")]/a'

    New Address Option:
      selector:
        type: xpath
        locator: '//ul[@class="select2-results"]/li/div[contains(., "New address")]'

    New Address Popup Form:
      selector: 'form[name="oro_action_operation"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Email: 'oro_action_operation[visitor_email]'
          Label: 'oro_action_operation[address][label]'
          Name Prefix: 'oro_action_operation[address][namePrefix]'
          First Name: 'oro_action_operation[address][firstName]'
          Middle Name: 'oro_action_operation[address][middleName]'
          Last Name: 'oro_action_operation[address][lastName]'
          Name Suffix: 'oro_action_operation[address][nameSuffix]'
          Organization: 'oro_action_operation[address][organization]'
          Phone: 'oro_action_operation[address][phone]'
          Street: 'oro_action_operation[address][street]'
          Street 2: 'oro_action_operation[address][street2]'
          City: 'oro_action_operation[address][city]'
          Country: 'oro_action_operation[address][country]'
          State: 'oro_action_operation[address][region]'
          Postal Code: 'oro_action_operation[address][postalCode]'
          Save Address: 'oro_action_operation[save_address]'

    Checkout Address Fields:
      selector: '#checkout-address-fields-container'

    Checkout Line Item Product Link:
      selector: 'h3.grid-line-items__title a[title]'

    Multi Shipping Shopping List:
      selector: 'div[data-page-component-name="frontend-customer-user-shopping-list-edit-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridRowStrict: CheckoutMultiShippingGridRow

    MultiShipping Checkout Line Items Grid:
      selector: 'div[data-page-component-name="frontend-checkout-line-items-grid"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridRowStrict: CheckoutMultiShippingGridRow

    First Checkout Shipping Grid Title:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:1"]/preceding-sibling::h3[1]'
        type: 'xpath'

    First Checkout Shipping Grid:
      selector: 'div[data-page-component-name="frontend-checkout-line-items-grid:1"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridRowStrict: CheckoutMultiShippingGridRow

    Second Checkout Shipping Grid Title:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:2"]/preceding-sibling::h3[1]'
        type: 'xpath'

    Second Checkout Shipping Grid:
      selector: 'div[data-page-component-name="frontend-checkout-line-items-grid:2"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridRowStrict: CheckoutMultiShippingGridRow

    Third Checkout Shipping Grid Title:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:3"]/preceding-sibling::h3[1]'
        type: 'xpath'

    Third Checkout Shipping Grid:
      selector: 'div[data-page-component-name="frontend-checkout-line-items-grid:3"]'
      class: Oro\Bundle\DataGridBundle\Tests\Behat\Element\Grid
      options:
        mapping:
          GridRowStrict: CheckoutMultiShippingGridRow

    CheckoutMultiShippingGridRow:
      selector: 'tbody tr[aria-rowindex]'
      class: Oro\Bundle\FrontendBundle\Tests\Behat\Element\GridRow

    First Checkout Shipping Grid First Line Item Flat Rate Shipping Method:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:1"]//table//tr[@aria-rowindex="2"]//ul//label[contains(., "Flat Rate:")]//input[@type="radio"]'
        type: 'xpath'

    Second Line Item Flat Rate Shipping Method:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:2"]//table//tr[@aria-rowindex="2"]//ul//label[contains(., "Flat Rate:")]//input[@type="radio"]'
        type: 'xpath'

    Third Line Item Flat Rate Shipping Method:
      selector:
        locator: '//div[@data-page-component-name="frontend-checkout-line-items-grid:2"]//table//tr[@aria-rowindex="3"]//ul//label[contains(., "Flat Rate:")]//input[@type="radio"]'
        type: 'xpath'

    Lighting Products Checkout Category Name:
      selector:
        locator: '//div[contains(@class,"checkout-order-summary__content")]//h3[text()="Lighting Products"]'
        type: 'xpath'

    Phones Checkout Category Name:
      selector:
        locator: '//div[contains(@class,"checkout-order-summary__content")]//h3[text()="Phones"]'
        type: 'xpath'

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

    Checkout Line Item:
      selector: 'tbody.grid-body tr.grid-row'

    After Validation Buttons Controls Group:
      selector: '.quick-order-add__buttons-wrapper:last-child'
  pages:
    Checkout:
      class: Oro\Bundle\CheckoutBundle\Tests\Behat\Page\CheckoutPage
      route: oro_checkout_frontend_checkout
