package com.sdl.selenium.web;

/**
 * Contains all Search types :
 * see details for all in :
 * <p>{@link SearchType#EQUALS}</p>
 * <p>{@link SearchType#CONTAINS}</p>
 * <p>{@link SearchType#STARTS_WITH}</p>
 * <p>{@link SearchType#TRIM}</p>
 * <p>{@link SearchType#CHILD_NODE}</p>
 * <p>{@link SearchType#DEEP_CHILD_NODE}</p>
 * <p>{@link SearchType#HTML_NODE}</p>
 * <p>{@link SearchType#CONTAINS_ALL}</p>
 * <p>{@link SearchType#CONTAINS_ANY}</p>
 */
public enum SearchType {

    EQUALS,

    CONTAINS,

    STARTS_WITH,

    /**
     * will use : normalize-spaces on text()
     */
    TRIM,

    /**
     * For finding elements that contain text (and text is not first node in that element).
     * eg. next button has the span.icon as first childNode in html:
     * <pre>
    &lt;div class="btn">
        &lt;span class="icon">&lt;/span>
        Cancel
    &lt;/div></pre>
     * <p>so must be used like:</p>
     * <pre>WebLocator cancelBtn = new WebLocator().setClasses("btn").setText("Cancel", SearchType.CHILD_NODE);</pre>
     */
    CHILD_NODE,

    /**
     * For finding elements that contain text (and text is not in any of direct childNodes in that element, but inside of them).
     * eg. next button has the span.icon as first childNode in html, and text is inside span.btn-text childNode:
     * <pre>
     &lt;div class="btn">
        &lt;span class="icon">&lt;/span>
        &lt;span class="btn-text">Cancel&lt;/span>
     &lt;/div></pre>
     * <p>so must be used like:</p>
     * <pre>WebLocator cancelBtn = new WebLocator().setClasses("btn").setText("Cancel", SearchType.DEEP_CHILD_NODE);</pre>
     */
    DEEP_CHILD_NODE,

    DEEP_CHILD_NODE_OR_SELF,

    /**
     * TODO add better documentation and working example
     * For finding elements that contain text  composed by html nodes
     * eg. "Get an instant Quote" button contains text containing html node &lt;span>instant &lt;/span>
     * <pre>
     &lt;div class="btn">
        Get an &lt;span class="bold">instant&lt;/span> Quote
     &lt;/div>
     </pre>
     * <p>so must be used like:</p>
     * <pre>WebLocator cancelBtn = new WebLocator().setClasses("btn").setText("Get an instant Quote", SearchType.HTML_NODE);</pre>
     */
    HTML_NODE,

    /**
     * <p>For finding elements that contain all text segments.</p>
     * <p>Segments will be made by splitting text into elements with first char of input text</p>
     * <pre>
     &lt;div class="btn">
     &lt;span class="btn-text">Cancel is a Button&lt;/span>
     &lt;/div></pre>
     * <p>so must be used like:</p>
     * <pre>
     *     WebLocator cancelBtn = new WebLocator().setClasses("btn")
     *          .setText("&Cancel&Button", SearchType.CONTAINS_ALL);
     * </pre>
     */
    CONTAINS_ALL,

    /**
     * <p>For finding elements that contain any text segments.</p>
     * <p>Segments will be made by splitting text into elements with first char of input text</p>
     * <pre>
     &lt;div class="btn">
        &lt;span class="btn-text">Cancel is a Button&lt;/span>
     &lt;/div></pre>
     * <p>so must be used like:</p>
     * <pre>
     WebLocator cancelBtn = new WebLocator().setClasses("btn")
        .setText("|Cancel|Button", SearchType.CONTAINS_ANY);</pre>
     */
    CONTAINS_ANY

}

@@ -1695,24 +1695,734 @@
 LD_NODE,%0D%0A%0D%0A
+    /**%0D%0A     * For finding elements that contain text (and text is not in any of direct childNodes in that element, but inside of them or text is direct in that element).%0D%0A     * eg. next button has the span.icon as first childNode in html, and text is inside span.btn-text childNode or text is direct in that element:%0D%0A     * %3Cpre%3E%0D%0A     &lt;div class=%22btn%22%3E%0D%0A        &lt;span class=%22icon%22%3E&lt;/span%3E%0D%0A        &lt;span class=%22btn-text%22%3ECancel&lt;/span%3E%0D%0A     &lt;/div%3E%3C/pre%3E%0D%0A%0D%0A     %3Cpre%3E%0D%0A     &lt;div class=%22btn%22%3ECancel&lt;/div%3E%3C/pre%3E%0D%0A     * %3Cp%3Eso must be used like:%3C/p%3E%0D%0A     * %3Cpre%3EWebLocator cancelBtn = new WebLocator().setClasses(%22btn%22).setText(%22Cancel%22, SearchType.DEEP_CHILD_NODE);%3C/pre%3E%0D%0A     */%0D%0A
     DEEP_CHI
@@ -2554,17 +2554,16 @@
 in text 
- 
 composed
@@ -3224,24 +3224,27 @@
 ass=%22btn%22%3E%0D%0A
+   
      &lt;spa

add documentation SearchType.DEEP_CHILD_NODE_OR_SELF