public String toCssString() { return cssFinder.toString(); }
public String toCssString() { return cssFinder.toString(); }
/** * <p>Everytime sQ executes a selector, it has to check if it has native support or not by the WebDriver.</p> * * <p>This method returns the pseudo-class selector that will be used to check if the driver supports this pseudo.</p> * * <p>Example: return ":nth-child(1)"</p> * * <p>The value returned will be appended to an id selector for the checking, e.g., if the value returned for this * method is {@code ":my-crazy-pseudo(1)"}, then we will send to the driver something like * {@code "#randomId:my-crazy-pseudo(1)"} which will be considered supported if no exception is thrown.</p> * * @param webDriver The webDriver that should be used to generate the CSS. * @return The css selector to be appended to an id selector for checking if the selector is supported. */ default String pseudoClassForCSSNativeSupportCheck(WebDriver webDriver) { return toCssWhenNativelySupported(webDriver).toString(); }
/** * <p>Everytime sQ executes a selector, it has to check if it has native support or not by the WebDriver.</p> * * <p>This method returns the pseudo-class selector that will be used to check if the driver supports this pseudo.</p> * * <p>Example: return ":nth-child(1)"</p> * * <p>The value returned will be appended to an id selector for the checking, e.g., if the value returned for this * method is {@code ":my-crazy-pseudo(1)"}, then we will send to the driver something like * {@code "#randomId:my-crazy-pseudo(1)"} which will be considered supported if no exception is thrown.</p> * * @param webDriver The webDriver that should be used to generate the CSS. * @return The css selector to be appended to an id selector for checking if the selector is supported. */ default String pseudoClassForCSSNativeSupportCheck(WebDriver webDriver) { return toCssWhenNativelySupported(webDriver).toString(); }
public CssFinder combineAsLeftPart(String combinator) { if (this.canFetchAllElementsOfTheQueryByItself()) { return new CssFinder(this.toString() + combinator, UNIVERSAL_SELECTOR, ""); } return CSS_NOT_NATIVELY_SUPPORTED; }
public CssFinder combineAsLeftPart(String combinator) { if (this.canFetchAllElementsOfTheQueryByItself()) { return new CssFinder(this.toString() + combinator, UNIVERSAL_SELECTOR, ""); } return CSS_NOT_NATIVELY_SUPPORTED; }
public List<WebElement> findElements(SearchContext context) { String finalCssSelector = this.toString(); return new By.ByCssSelector(finalCssSelector).findElements(context); }
public List<WebElement> findElements(SearchContext context) { String finalCssSelector = this.toString(); return new By.ByCssSelector(finalCssSelector).findElements(context); }
@Test public void cssMerge__should_merge() { CssFinder mergedCss = fromTag("div").merge(new CssFinder(".clz")); assertThat(mergedCss.toString(), is("div.clz")); }
@Test public void cssMerge__should_remove_asterisk() { CssFinder mergedCss = universalSelector().merge(new CssFinder(".clz")); assertThat(mergedCss.toString(), is(".clz")); }
@Test public void cssMerge__should_let_it_be_if_both_tags_are_not_universalSelector__but_are_equal() { CssFinder mergedCss = fromTag("div").merge(fromTag("div")); assertThat(mergedCss.toString(), is("div")); }
@Test public void toCssString() { CssFinder cssFinder = new CssFinder("a", "b", "c"); ElementFinder elementFinder = new ElementFinder(null, cssFinder, null); assertEquals(cssFinder.toString(), elementFinder.toCssString()); }