# WebViewAssertions

Summary: [Nested Classes](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#nestedclasses) \| [Methods](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#inhmethods) \| [\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#)  

# WebViewAssertions

| This package is part of the Android [support library](https://developer.android.com/topic/libraries/support-library) which is no longer maintained. The support library has been superseded by [AndroidX](https://developer.android.com/jetpack/androidx) which is part of [Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider [migrating](https://developer.android.com/jetpack/androidx/migrate) existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library [class
| mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).


`
public

final

class
WebViewAssertions
`


`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


`

`


`

|---|---------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.web.assertion.WebViewAssertions |

<br />

*** ** * ** ***

A collection of [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)s that assert on [WebView](https://developer.android.com/reference/android/webkit/WebView.html)s.

## Summary

|                                                                                              ### Nested classes                                                                                              ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` interface` | [WebViewAssertions.ResultDescriber](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions.ResultDescriber)`<E>` Converts a result to a String. |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                        ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<`[Document](https://developer.android.com/reference/org/w3c/dom/Document.html)`>` | ` `[webContent](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#webContent(org.hamcrest.Matcher<org.w3c.dom.Document>))`(Matcher<`[Document](https://developer.android.com/reference/org/w3c/dom/Document.html)`> domMatcher) ` A WebAssertion which asserts that the document is matched by th provided matcher.                                                                                                                                                                                                                                                                                                                                          |
| ` static <E> `[WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<E>`                                                                           | ` `[webMatches](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#webMatches(android.support.test.espresso.web.model.Atom<E>, org.hamcrest.Matcher<E>, android.support.test.espresso.web.assertion.WebViewAssertions.ResultDescriber<? super E>))`(`[Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E> atom, Matcher<E> resultMatcher, `[ResultDescriber](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions.ResultDescriber)`<? super E> resultDescriber) ` A WebAssertion which asserts that the given Atom's result is accepted by the provided matcher. |
| ` static <E> `[WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<E>`                                                                           | ` `[webMatches](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#webMatches(android.support.test.espresso.web.model.Atom<E>, org.hamcrest.Matcher<E>))`(`[Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E> atom, Matcher<E> resultMatcher) ` A WebAssertion which asserts that the given Atom's result is accepted by the provided matcher.                                                                                                                                                                                                                                                                  |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions#)From class ` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public methods

### webContent

```
WebAssertion<Document> webContent (Matcher<Document> domMatcher)
```

A WebAssertion which asserts that the document is matched by th provided matcher.

<br />

|           Parameters           ||
|--------------|------------------|
| `domMatcher` | `Matcher` <br /> |

|                                                                                                   Returns                                                                                                   ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|
| [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<`[Document](https://developer.android.com/reference/org/w3c/dom/Document.html)`>` | <br /> |

### webMatches

```
WebAssertion<E> webMatches (Atom<E> atom, 
                Matcher<E> resultMatcher, 
                ResultDescriber<? super E> resultDescriber)
```

A WebAssertion which asserts that the given Atom's result is accepted by the provided matcher.

<br />

|                                           Parameters                                           ||
|-------------------|-----------------------------------------------------------------------------|
| `atom`            | `Atom`: an atom to evaluate on the webview <br />                           |
| `resultMatcher`   | `Matcher`: a matcher to apply to the result of the atom. <br />             |
| `resultDescriber` | `ResultDescriber`: a describer that converts the result to a string. <br /> |

|                                                            Returns                                                            ||
|-----------------------------------------------------------------------------------------------------------------------|--------|
| [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<E>` | <br /> |

### webMatches

```
WebAssertion<E> webMatches (Atom<E> atom, 
                Matcher<E> resultMatcher)
```

A WebAssertion which asserts that the given Atom's result is accepted by the provided matcher.

<br />

|                                    Parameters                                    ||
|-----------------|-----------------------------------------------------------------|
| `atom`          | `Atom`: an atom to evaluate on the webview <br />               |
| `resultMatcher` | `Matcher`: a matcher to apply to the result of the atom. <br /> |

|                                                            Returns                                                            ||
|-----------------------------------------------------------------------------------------------------------------------|--------|
| [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)`<E>` | <br /> |

-

  ## Interfaces

  - [WebViewAssertions.ResultDescriber](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions.ResultDescriber)
-

  ## Classes

  - [TagSoupDocumentParser](https://developer.android.com/reference/android/support/test/espresso/web/assertion/TagSoupDocumentParser)
  - [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)
  - [WebViewAssertions](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions)