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 chileNodes 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,

    //TODO documentatia nu e buna!!!
    /**
     * For finding elements that contain text (and text is not in any of direct chileNodes 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 is Button text", 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

}

@@ -1180,33 +1180,33 @@
 y of direct chil
-e
+d
 Nodes in that el
@@ -1708,292 +1708,244 @@
    /
-/TODO documentatia nu e buna!!!%0D%0A    /**%0D%0A     * For finding elements that contain text (and text is not in any of direct chileNodes in that element, but inside of them).%0D%0A     * eg. next button has the span.icon as first childNode 
+**%0D%0A     * TODO add better documentation and working example%0D%0A     * For finding elements that contain text  composed by html nodes%0D%0A     * eg. %22Get an instant Quote%22 button contains text contain
 in
+g
  html
-, and text is inside span.btn-text childNode:
+ node &lt;span%3Einstant &lt;/span%3E
 %0D%0A  
@@ -1995,49 +1995,14 @@
     
-&lt;span class=%22icon%22%3E&lt;/span%3E%0D%0A       
+Get an
  &lt
@@ -2011,39 +2011,36 @@
 pan class=%22b
-tn-text%22%3ECancel
+old%22%3Einstant
 &lt;/span%3E%0D%0A
@@ -2029,32 +2029,38 @@
 nstant&lt;/span%3E
+ Quote
 %0D%0A     &lt;/div%3E
@@ -2194,29 +2194,28 @@
 xt(%22
-Cancel is Button text
+Get an instant Quote
 %22, S

Fix documentation for HTML_NODE