oro_behat_extension:
  suites:
    OroWorkflowBundle:
      contexts:
        - Oro\Bundle\TestFrameworkBundle\Tests\Behat\Context\OroMainContext
        - Oro\Bundle\FormBundle\Tests\Behat\Context\FormContext
        - Oro\Bundle\DataGridBundle\Tests\Behat\Context\GridContext
        - Oro\Bundle\WorkflowBundle\Tests\Behat\Context\FeatureContext
      paths:
        - '@OroWorkflowBundle/Tests/Behat/Features'

  elements:
    Workflow Page Title:
      selector: 'div.top-row h1, h1.page-title span.page-title__text'

    Workflow Transition Form:
      selector: 'form[name="oro_workflow_transition"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form

    Workflow Edit Form:
      selector: 'form[name="oro_workflow_definition_form"]'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Name: 'oro_workflow_definition_form[label]'
          Related Entity: 'oro_workflow_definition_form[related_entity]'
          Display Steps Ordered: 'oro_workflow_definition_form[steps_display_ordered]'
          Default Step: 'oro_workflow_definition_form[start_step]'

    Workflow Step Edit Form:
      selector: 'div[id="step-form"] form'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Name: 'label'
          Position: 'order'

    Workflow Transition Edit Info Form:
      selector: 'div[id="transition-form"] form'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Name: 'label'
          From step: 'step_from'
          To step: 'step_to'
          View form: 'display_type'
          Destination Page: 'destination_page'
          Warning message: 'message'
          Button Label: 'button_label'
          Button Title: 'button_title'

    Workflow Transition Edit Attributes Form:
      selector: 'div[id="transition-attributes"] form'
      class: Oro\Bundle\TestFrameworkBundle\Behat\Element\Form
      options:
        mapping:
          Entity field:
            type: 'css'
            locator: 'input[name="property_path"].select2-offscreen'
          Label: 'label'

    Workflow System Label:
      selector: '.badge:contains("System") i.fa-circle'

    Workflow Readonly Label:
      selector: '.badge:contains("Read-only") i.fa-circle'

    User Role View Workflow Permissions:
      selector:
        type: 'xpath'
        locator: '//div[contains(@data-page-component-name,"workflow-permission-grid")]/..'
      class: Oro\Bundle\UserBundle\Tests\Behat\Element\UserRoleViewForm

    Default Step Dropdown:
      selector: 'label:contains("Default step") + .controls > .select2-container > a'
