Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions docs/api/expect/_cookie.md

This file was deleted.

14 changes: 0 additions & 14 deletions docs/api/expect/_title.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/api/expect/_url.md

This file was deleted.

78 changes: 75 additions & 3 deletions docs/api/expect/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,52 @@ These methods will perform assertions on the specified target on the current ele
</div>
</div>

<%- include('./_cookie.md') %>

<h2 id="expect-cookie">expect.cookie()</h2>
<div class="apimethod">

Expect assertions operating on a single cookie after retrieving the entire cookie string, using `.getCookies()`.

<h5>Syntax:</h5>
<div class="sample-test" style="max-width:600px">
<pre data-language="javascript" style="padding-top: 10px" class="default-theme language-javascript"><code class="default-theme language-javascript">browser.expect.cookie('cookie-name', ['cookie-domain'])</code></pre>
</div>

<div class="sample-test">
<pre class="line-numbers" data-language="javascript"><code class="language-javascript">this.demoTest = function (browser) {
browser.expect.cookie('cookie-name').to.contain('cookie-value');
browser.expect.cookie('cookie-name').to.match(/regex/);
browser.expect.cookie('loginCookie', 'example.org').to.contain('cookie-value');
};</code></pre>
</div>

<h5>Parameters:</h5>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="width: 100px;">Name</th>
<th style="width: 100px;">Type</th>
<th>description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>name</code></td>
<td>String</td>
<td>The name of the cookie to be inspected.</td>
</tr>
<tr>
<td><code>domain</code><br><span class="optional">Optional</span></td>
<td>String</td>
<td>The domain name on which the cookie is set to.</td>
</tr>
</tbody>
</table>
</div>
</div>



<h2 id="expect-element">expect.element()</h2>

Expand All @@ -120,5 +165,32 @@ These methods will perform assertions on the specified target on the current ele
### Assertions:
- [count()](/api/expect/elements/count.html)

<%- include('./_title.md') %>
<%- include('./_url.md') %>
<h2 id="expect-title">expect.title()</h2>

<div class="apimethod">

Retrieves the page title value in order to be used for performing `equal`, `match` or `contains` assertions on it.

<h5>Usage:</h5>
<div class="sample-test">
<pre class="line-numbers" data-language="javascript"><code class="language-javascript">this.demoTest = function (browser) {
browser.expect.title().to.contain('value');
browser.expect.title().to.match(/value/);
};</code></pre>
</div>
</div>


<h2 id="expect-url">expect.url()</h3>
<div class="apimethod">

Retrieves the page url value in order to be used for performing `equal`, `match` or `contains` assertions on it.

<h5>Usage:</h5>
<div class="sample-test">
<pre class="line-numbers" data-language="javascript"><code class="language-javascript">this.demoTest = function (browser) {
browser.expect.url().to.contain('https://');
browser.expect.url().to.endWith('.org');
};</code></pre>
</div>
</div>