| Selector | Element |
|---|---|
<h1>Utilities</h1> | |
<p>Examples of the use of methods from other commonly used libraries in Cypress, for a full reference of commands, go to <a href="https://on.cypress.io/_" target="_blank">docs.cypress.io</a>
</p> | |
<a href="https://on.cypress.io/_" target="_blank">docs.cypress.io</a> | |
<span class="badge">14</span> | |
<span class="badge">22</span> | |
<span class="hljs-comment">// https://github.com/nolanlawson/blob-util#imgSrcToDataURL</span> | |
<span class="hljs-comment">// get the dataUrl string for the javascript-logo</span> | |
<span class="hljs-literal">undefined</span> | |
<span class="hljs-comment">// create an </span> | |
<span class="hljs-comment"> element and set its src to the dataUrl</span> | |
<span class="hljs-comment">// need to explicitly return cy here since we are initially returning</span> | |
<span class="hljs-comment">// the Cypress.Blob.imgSrcToDataURL promise to our test</span> | |
<span class="hljs-comment">// append the image</span> | |
<span class="hljs-literal">true</span> | |
<span class="hljs-literal">false</span> | |
<span class="hljs-comment">// return a promise that resolves after 1 second</span> | |
<span class="hljs-comment">// set waited to true</span> | |
<span class="hljs-literal">true</span> | |
<span class="hljs-comment">// resolve with 'foo' string</span> | |
<span class="hljs-number">1000</span> | |
<span class="hljs-comment">// return a promise to cy.then() that</span> | |
<span class="hljs-comment">// is awaited until it resolves</span> |
| Selector | Element |
|---|---|
<h4 id="_"><a href="https://on.cypress.io/_">Cypress._</a></h4> |
| Selector | Element |
|---|---|
<img> | |
<img> |
| Selector | Element |
|---|---|
<html lang="en"> |
| Selector | Element |
|---|---|
<div class="banner"> | |
<div class="container content-container"> |
| Selector | Element |
|---|---|
<code class="javascript hljs"> |
| Selector | Element |
|---|---|
<h1>Cypress API</h1> | |
<p>Examples of uses of the Cypress API, for a full reference, go to <a href="https://on.cypress.io/custom-commands" target="_blank">docs.cypress.io</a>
</p> | |
<a href="https://on.cypress.io/custom-commands" target="_blank">docs.cypress.io</a> | |
<span class="hljs-literal">true</span> | |
<span class="hljs-comment">// log the subject to the console</span> | |
<span class="hljs-built_in">console</span> | |
<span class="hljs-comment">// Cypress will now log in the console when</span> | |
<span class="hljs-comment">// cookies are set or removed</span> | |
<span class="hljs-literal">true</span> | |
<span class="hljs-literal">null</span> | |
<span class="hljs-number">4000</span> | |
<span class="hljs-number">5000</span> | |
<span class="hljs-number">30000</span> | |
<span class="hljs-number">660</span> | |
<span class="hljs-number">1000</span> | |
<span class="hljs-number">60000</span> | |
<span class="hljs-literal">true</span> | |
<span class="hljs-number">60000</span> | |
<span class="hljs-number">20000</span> | |
<span class="hljs-number">20000</span> | |
<span class="hljs-number">60000</span> | |
<span class="hljs-comment">// our first paragraph has css class 'hidden'</span> | |
<span class="hljs-comment">// set multiple environment variables</span> | |
<span class="hljs-comment">// get environment variable</span> | |
<span class="hljs-comment">// set environment variable</span> | |
<span class="hljs-comment">// get all environment variable</span> |
| Selector | Element |
|---|---|
<h4 id="Commands.add"><a href="https://on.cypress.io/custom-commands">Cypress.Commands.add()</a></h4> |
| Selector | Element |
|---|---|
<html lang="en"> |
| Selector | Element |
|---|---|
<div class="banner">
<div class="container">
<h1>Cypress API</h1>
<p>Examples of uses of the Cypress API, for a full reference, go to <a href="https://on.cypress.io/custom-commands" target="_blank">docs.cypress.io</a>
</p>
</div>
</div> | |
<div class="col-xs-12"> | |
<div class="col-xs-12"> | |
<div class="col-xs-12"> | |
<div class="col-xs-12"> | |
<div class="col-xs-7"> | |
<p class="visible">I'm visible!</p> | |
<div class="col-xs-12"> | |
<div class="col-xs-12">
<h4 id="log">Cypress.log()</h4>
<p>To control what is printed to the Command Log <a href="https://on.cypress.io/cypress-log"><code>Cypress.log()</code></a>.</p>
<pre><code class="javascript hljs"></code></pre>
</div> | |
<div class="col-xs-12"> | |
<div class="col-xs-12"> |