/docs/Docs/assertions.html
HTML | 211 lines | 211 code | 0 blank | 0 comment | 0 complexity | 719c12dcfd539e40385f7c269d10f337 MD5 | raw file
Possible License(s): MIT, Apache-2.0
- <!doctype html>
- <html data-reactroot="" lang="en"><head><title>canopy docs / assertions.html-canopy</title><meta name="viewport" content="width=device-width, initial-scale=1" /><link href="https://lefthandedgoat.github.io/canopy/content/toggle-bootstrap.min.css?version=637191850341272396" type="text/css" rel="stylesheet" /><link href="https://lefthandedgoat.github.io/canopy/content/toggle-bootstrap-dark.min.css?version=637191850341272396" type="text/css" rel="stylesheet" /><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" rel="stylesheet" integrity="sha384-KA6wR/X5RY4zFAHpv/CnoG2UW1uogYfdnP67Uv7eULvTveboZJg0qUpmJZb5VqzN" crossorigin="anonymous" /><link href="https://lefthandedgoat.github.io/canopy/content/style.css?version=637191850341272396" type="text/css" rel="stylesheet" /></head><body><nav class="navbar navbar-expand-md sticky-top navbar-dark bg-dark"><a class="navbar-brand" href="https://lefthandedgoat.github.io/canopy/index.html"><i class="fa fa-tree text-white mr-2"></i>canopy</a><button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button><div class="collapse navbar-collapse" id="navbarNav"><ul class="navbar-nav mr-auto"><li class="nav-item dropdown"><a id="navbarDropdown-Api_Reference" href="#" data-toggle="dropdown" aria-haspopup class="nav-link dropdown-toggle">Api Reference</a><ul aria-labelledby="dropdownMenu1" class="dropdown-menu border-0 shadow"><li class="dropdown-submenu"><a id="navbarDropdown-canopy" href="#" role="button" data-toggle="dropdown" aria-haspopup class="dropdown-item dropdown-toggle">canopy</a><ul aria-labelledby="dropdownMenu2" class="dropdown-menu border-0 shadow"><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy.html">canopy</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-classic.html">canopy classic</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-configuration.html">canopy configuration</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-csharp-canopy.html">canopy csharp canopy</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-finders.html">canopy finders</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-finders-byjquery.html">canopy finders byjquery</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-history.html">canopy history</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-jarowinkler.html">canopy jarowinkler</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-jarowinkler-result.html">canopy jarowinkler result</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-parallell-functions.html">canopy parallell functions</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-parallell-functions-navigate.html">canopy parallell functions navigate</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-parallell-instanced.html">canopy parallell instanced</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-parallell-instanced-instance.html">canopy parallell instanced instance</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-reporters.html">canopy reporters</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-reporters-consolereporter.html">canopy reporters consolereporter</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-reporters-junitreporter.html">canopy reporters junitreporter</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-reporters-livehtmlreporter.html">canopy reporters livehtmlreporter</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-reporters-teamcityreporter.html">canopy reporters teamcityreporter</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-runner-classic.html">canopy runner classic</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-screen.html">canopy screen</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-screen-screenboundary.html">canopy screen screenboundary</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types.html">canopy types</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-browsers.html">canopy types browsers</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-browserstartmode.html">canopy types browserstartmode</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopycheckfailedexception.html">canopy types canopycheckfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopycontainsfailedexception.html">canopy types canopycontainsfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopycountexception.html">canopy types canopycountexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopydeselectionfailedexception.html">canopy types canopydeselectionfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopydisabledfailedexception.html">canopy types canopydisabledfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopydisplayedfailedexception.html">canopy types canopydisplayedfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyelementnotfoundexception.html">canopy types canopyelementnotfoundexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyenabledfailedexception.html">canopy types canopyenabledfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyequalityfailedexception.html">canopy types canopyequalityfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyexception.html">canopy types canopyexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopymorethanoneelementfoundexception.html">canopy types canopymorethanoneelementfoundexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopynobrowserexception.html">canopy types canopynobrowserexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopynotcontainsfailedexception.html">canopy types canopynotcontainsfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopynotdisplayedfailedexception.html">canopy types canopynotdisplayedfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopynotequalsfailedexception.html">canopy types canopynotequalsfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopynotstringorelementexception.html">canopy types canopynotstringorelementexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyonexception.html">canopy types canopyonexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyoptionnotfoundexception.html">canopy types canopyoptionnotfoundexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyreadexception.html">canopy types canopyreadexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyreadonlyexception.html">canopy types canopyreadonlyexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyselectionfailedexeception.html">canopy types canopyselectionfailedexeception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyskiptestexception.html">canopy types canopyskiptestexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyuncheckfailedexception.html">canopy types canopyuncheckfailedexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyvalueinlistexception.html">canopy types canopyvalueinlistexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopyvaluenotinlistexception.html">canopy types canopyvaluenotinlistexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-canopywaitforexception.html">canopy types canopywaitforexception</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-direction.html">canopy types direction</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-ireporter.html">canopy types ireporter</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-result.html">canopy types result</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-suite.html">canopy types suite</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-types-test.html">canopy types test</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\canopy-wait.html">canopy wait</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\global-screensizes.html">global screensizes</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy\global-useragents.html">global useragents</a></li></ul></li><li class="dropdown-submenu"><a id="navbarDropdown-canopy.integration" href="#" role="button" data-toggle="dropdown" aria-haspopup class="dropdown-item dropdown-toggle">canopy.integration</a><ul aria-labelledby="dropdownMenu2" class="dropdown-menu border-0 shadow"><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-csharp-integration.html">canopy csharp integration</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-csharp-loadtest-job.html">canopy csharp loadtest job</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-csharp-loadtest-runner.html">canopy csharp loadtest runner</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-csharp-loadtest-task.html">canopy csharp loadtest task</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-integration-loadtest.html">canopy integration loadtest</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-integration-loadtest-job.html">canopy integration loadtest job</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy-integration-loadtest-task.html">canopy integration loadtest task</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\canopy.integration.html">canopy.integration</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\global-jsonvalidator.html">global jsonvalidator</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\jsonvalidator-difference.html">jsonvalidator difference</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\jsonvalidator-meta.html">jsonvalidator meta</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Api_Reference\canopy.integration\jsonvalidator-type.html">jsonvalidator type</a></li></ul></li></ul></li><li class="nav-item dropdown"><a id="navbarDropdown-Docs" href="#" data-toggle="dropdown" aria-haspopup class="nav-link dropdown-toggle">Docs</a><ul aria-labelledby="dropdownMenu1" class="dropdown-menu border-0 shadow"><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Docs\actions.html">actions</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Docs\assertions.html">assertions</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Docs\configuration.html">configuration</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Docs\reporting.html">reporting</a></li><li class="nav-item"><a class="dropdown-item" href="https://lefthandedgoat.github.io/canopy/\Docs\testing.html">testing</a></li></ul></li></ul><ul class="navbar-nav"><button id="theme-toggle" class=""></button><li class="nav-item"><a class="nav-link" aria-label="canopy Repository on Github" href="https://github.com/lefthandedgoat/canopy"><i class="fab fa-github fa-lg fa-fw text-light"></i></a></li></ul></div></nav><div class="wrapper d-flex flex-column justify-content-between min-vh-100"><main class="container main mb-4"><div><h1><a name="Assertions" class="anchor" href="#Assertions">Assertions</a></h1>
- <h2><a name="equals" class="anchor" href="#equals">== (equals)</a></h2>
- <p>Assert that the element on the left is equal to the value on the right.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"#firstName"</span> <span class="o">==</span> <span class="s">"Alex"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="does-not-equal" class="anchor" href="#does-not-equal">!= (does not equal)</a></h2>
- <p>Assert that the element on the left is not equal to the value on the right.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"#firstName"</span> <span class="o">!=</span> <span class="s">"Tom"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="aliased-as-is" class="anchor" href="#aliased-as-is">=== (aliased as is)</a></h2>
- <p>Assert that the value on the left is equal to the value on right.
- * Note: does not use retry-ability. Equivalent to Assert.Equals.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"Not a selector"</span> <span class="o">===</span> <span class="s">"Not a selector"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="one-of-many-equals" class="anchor" href="#one-of-many-equals">*= (one of many equals)</a></h2>
- <p>Assert that at least one element in a list equals a value.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">".todoItem"</span> <span class="o">*=</span> <span class="s">"Buy milk"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="none-equals" class="anchor" href="#none-equals">*!= (none equals)</a></h2>
- <p>Assert that none of the items in a list equals a value.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">".todoItem"</span> <span class="o">*!=</span> <span class="s">"Sell everything"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="contains" class="anchor" href="#contains">contains</a></h2>
- <p>Assert that one string contains another.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '5', 6)" onmouseover="showTip(event, '5', 6)" class="fn">contains</span> <span class="s">"Log"</span> <span class="pn">(</span><span onmouseout="hideTip(event, '6', 7)" onmouseover="showTip(event, '6', 7)" class="fn">read</span> <span class="s">"#logout"</span><span class="pn">)</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="containsInsensitive" class="anchor" href="#containsInsensitive">containsInsensitive</a></h2>
- <p>Assert that one string contains (case insensitive) another.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '7', 8)" onmouseover="showTip(event, '7', 8)" class="fn">containsInsensitive</span> <span class="s">"Log"</span> <span class="pn">(</span><span onmouseout="hideTip(event, '6', 9)" onmouseover="showTip(event, '6', 9)" class="fn">read</span> <span class="s">"#logout"</span><span class="pn">)</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="notContains" class="anchor" href="#notContains">notContains</a></h2>
- <p>Assert that one string does not contains another.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '8', 10)" onmouseover="showTip(event, '8', 10)" class="fn">notContains</span> <span class="s">"Hello Bob!"</span> <span class="pn">(</span><span onmouseout="hideTip(event, '6', 11)" onmouseover="showTip(event, '6', 11)" class="fn">read</span> <span class="s">"#name"</span><span class="pn">)</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="count" class="anchor" href="#count">count</a></h2>
- <p>Assert there are <code>X</code> items of given css selector.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '9', 12)" onmouseover="showTip(event, '9', 12)" class="fn">count</span> <span class="s">".todoItem"</span> <span class="n">5</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="regex-match" class="anchor" href="#regex-match">=~ (regex match)</a></h2>
- <p>Assert that an element <code>regex</code> matches a value.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- <span class="l">2: </span>
- <span class="l">3: </span>
- <span class="l">4: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"#lastName"</span> <span class="o"><<</span> <span class="s">"Gray"</span>
- <span class="s">"#lastName"</span> <span class="o">=~</span> <span class="s">"Gr[ae]y"</span>
- <span class="s">"#lastName"</span> <span class="o"><<</span> <span class="s">"Grey"</span>
- <span class="s">"#lastName"</span> <span class="o">=~</span> <span class="s">"Gr[ae]y"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="regex-match-1" class="anchor" href="#regex-match-1">!=~ (regex match)</a></h2>
- <p>Assert that an element does not <code>regex</code> match a value.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- <span class="l">2: </span>
- <span class="l">3: </span>
- <span class="l">4: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"#lastName"</span> <span class="o"><<</span> <span class="s">"Gr0y"</span>
- <span class="s">"#lastName"</span> <span class="o">!=~</span> <span class="s">"Gr[ae]y"</span>
- <span class="s">"#lastName"</span> <span class="o"><<</span> <span class="s">"Gr1y"</span>
- <span class="s">"#lastName"</span> <span class="o">!=~</span> <span class="s">"Gr[ae]y"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="one-of-many-regex-match" class="anchor" href="#one-of-many-regex-match">*~ (one of many regex match)</a></h2>
- <p>Assert that one of many element <code>regex</code> matches a value.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="s">"#colors li"</span> <span class="o">*~</span> <span class="s">"gr[ea]y"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="on" class="anchor" href="#on">on</a></h2>
- <p>Assert that the browser is currently on a url. Falls back to using <code>String.Contains</code> after page timeout.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- <span class="l">2: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '10', 13)" onmouseover="showTip(event, '10', 13)" class="fn">url</span> <span class="s">"https://duckduckgo.com/?q=canopy+f%23"</span>
- <span onmouseout="hideTip(event, '11', 14)" onmouseover="showTip(event, '11', 14)" class="fn">on</span> <span class="s">"https://duckduckgo.com/?q"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="onn" class="anchor" href="#onn">onn</a></h2>
- <p>Same as <code>on</code> but does not fall back to using <code>String.Contains</code>.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- <span class="l">2: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '10', 15)" onmouseover="showTip(event, '10', 15)" class="fn">url</span> <span class="s">"https://duckduckgo.com/about"</span>
- <span onmouseout="hideTip(event, '12', 16)" onmouseover="showTip(event, '12', 16)" class="fn">onn</span> <span class="s">"https://duckduckgo.com/about"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="selected" class="anchor" href="#selected">selected</a></h2>
- <p>Assert that a radio or checkbox is selected.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '13', 17)" onmouseover="showTip(event, '13', 17)" class="fn">selected</span> <span class="s">"#yes"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="deselected" class="anchor" href="#deselected">deselected</a></h2>
- <p>Assert that a radio or checkbox is not selected.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '14', 18)" onmouseover="showTip(event, '14', 18)" class="fn">deselected</span> <span class="s">"#yes"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="displayed" class="anchor" href="#displayed">displayed</a></h2>
- <p>Assert that an element is displayed on the screen. (Note: Will not walk up the dom. If a parent container is hidden this may give the wrong results, try adding :visible to selector)</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '15', 19)" onmouseover="showTip(event, '15', 19)" class="fn">displayed</span> <span class="s">"#modal"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="notDisplayed" class="anchor" href="#notDisplayed">notDisplayed</a></h2>
- <p>Assert that an element is not displayed on the screen. (Note: Will not walk up the dom. If a parent container is hidden this may give the wrong results, try adding :visible to selector)</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '16', 20)" onmouseover="showTip(event, '16', 20)" class="fn">notDisplayed</span> <span class="s">"#modal"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="enabled" class="anchor" href="#enabled">enabled</a></h2>
- <p>Assert that an element is enabled.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '17', 21)" onmouseover="showTip(event, '17', 21)" class="fn">enabled</span> <span class="s">"#button"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="disabled" class="anchor" href="#disabled">disabled</a></h2>
- <p>Assert that an element is not enabled.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span onmouseout="hideTip(event, '18', 22)" onmouseover="showTip(event, '18', 22)" class="fn">disabled</span> <span class="s">"#button"</span>
- </code></pre></td>
- </tr>
- </table>
- <h2><a name="fadedIn" class="anchor" href="#fadedIn">fadedIn</a></h2>
- <p>Returns true/false if element has finished fading in and is shown.</p>
- <table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
- <span class="l">2: </span>
- </pre></td>
- <td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, '19', 23)" onmouseover="showTip(event, '19', 23)" class="id">isShown</span> <span class="o">=</span> <span class="pn">(</span><span onmouseout="hideTip(event, '20', 24)" onmouseover="showTip(event, '20', 24)" class="fn">fadedIn</span> <span class="s">"#message"</span><span class="pn">)</span><span class="pn">(</span><span class="pn">)</span>
- <span onmouseout="hideTip(event, '21', 25)" onmouseover="showTip(event, '21', 25)" class="fn">waitFor</span> <span class="o"><|</span> <span onmouseout="hideTip(event, '20', 26)" onmouseover="showTip(event, '20', 26)" class="fn">fadedIn</span> <span class="s">"#message"</span>
- </code></pre></td>
- </tr>
- </table>
- <div class="tip" id="1">namespace canopy</div>
- <div class="tip" id="2">module classic<br /><br />from canopy</div>
- <div class="tip" id="3">namespace canopy.runner</div>
- <div class="tip" id="4">namespace System</div>
- <div class="tip" id="5">val contains : value1:string -> value2:string -> unit</div>
- <div class="tip" id="6">val read : item:'a -> string</div>
- <div class="tip" id="7">val containsInsensitive : value1:string -> value2:string -> unit</div>
- <div class="tip" id="8">val notContains : value1:string -> value2:string -> unit</div>
- <div class="tip" id="9">val count : cssSelector:string -> count':int -> unit</div>
- <div class="tip" id="10">val url : u:string -> unit</div>
- <div class="tip" id="11">val on : u:string -> unit</div>
- <div class="tip" id="12">val onn : u:string -> unit</div>
- <div class="tip" id="13">val selected : item:'a -> unit</div>
- <div class="tip" id="14">val deselected : item:'a -> unit</div>
- <div class="tip" id="15">val displayed : item:'a -> unit</div>
- <div class="tip" id="16">val notDisplayed : item:'a -> unit</div>
- <div class="tip" id="17">val enabled : item:'a -> unit</div>
- <div class="tip" id="18">val disabled : item:'a -> unit</div>
- <div class="tip" id="19">val isShown : bool</div>
- <div class="tip" id="20">val fadedIn : cssSelector:string -> ('a -> bool)</div>
- <div class="tip" id="21">val waitFor : ((unit -> bool) -> unit)</div>
- </div></main><footer class="footer font-small m-0 py-4 bg-dark"><div class="container"><div class="row"><div class="col-12 col-md-4 mb-4 mb-md-0"><div class="text-light"><h2 class="h5">Project Resources</h2><ul class="list-group list-group-flush"><li class="list-group-item bg-dark ml-0 pl-0"><a href="https://github.com/lefthandedgoat/canopy/blob/master/README.md" class="text-white"><i class="fas fa-book-reader fa-fw mr-2"></i>README</a></li><li class="list-group-item bg-dark ml-0 pl-0"><a href="https://github.com/lefthandedgoat/canopy/blob/master/CHANGELOG.md" class="text-white"><i class="fas fa-sticky-note fa-fw mr-2"></i>Release Notes / Changelog</a></li><li class="list-group-item bg-dark ml-0 pl-0"><a href="https://github.com/lefthandedgoat/canopy/blob/master/LICENSE.md" class="text-white"><i class="fas fa-id-card fa-fw mr-2"></i>License</a></li></ul></div></div><div class="col-12 col-md-4 mb-4 mb-md-0"><div class="text-light"><h2 class="h5">Other Links</h2><ul class="list-group list-group-flush"><li class="list-group-item bg-dark ml-0 pl-0"><a href="https://docs.microsoft.com/en-us/dotnet/fsharp/" class="text-white"><i class="fab fa-microsoft fa-fw mr-2"></i>F# Documentation</a></li><li class="list-group-item bg-dark ml-0 pl-0"><a href="https://fsharp.org/guides/slack/" class="text-white"><i class="fab fa-slack fa-fw mr-2"></i>F# Slack</a></li><li class="list-group-item bg-dark ml-0 pl-0"><a href="http://foundation.fsharp.org/" class="text-white"><img class="fsharp-footer-logo mr-2" src="https://fsharp.org/img/logo/fsharp.svg" alt="FSharp Logo" />F# Software Foundation</a></li></ul></div></div><div class="col-12 col-md-4 mb-4 mb-md-0"><div class="text-light"><h2 class="h5">Metadata</h2><ul class="list-group list-group-flush"><li class="list-group-item bg-dark ml-0 pl-0">Generated for version <a class="text-white" href="https://github.com/lefthandedgoat/canopy/releases/tag/2.1.5">2.1.5</a> on 2020/03/07</li><li class="list-group-item bg-dark ml-0 pl-0">Found an issue? <a class="text-white" href="https://github.com/lefthandedgoat/canopy/edit/master/docsSrc/Docs/assertions.fsx">Edit this page.</a></li></ul></div></div></div><div class="row"><div class="col text-center"><small class="text-light"><i class="fas fa-copyright mr-1"></i>2020 canopy, All rights reserved</small></div></div></div></footer></div><script src="https://lefthandedgoat.github.io/canopy/content/themes.js?version=637191850341272396"></script><script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script><script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script><script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script><script src="https://lefthandedgoat.github.io/canopy/content/tips.js?version=637191850341272396"></script><script src="https://lefthandedgoat.github.io/canopy/content/submenu.js?version=637191850341272396"></script><script src="https://lefthandedgoat.github.io/canopy/content/cleanups.js?version=637191850341272396"></script></body></html>