<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>tests/rustdoc-gui/README.md - fork/rust @ master</title>
<meta name="description" content="tests/rustdoc-gui/README.md in fork/rust at master.">
<meta property="og:title" content="tests/rustdoc-gui/README.md - fork/rust @ master">
<meta property="og:description" content="tests/rustdoc-gui/README.md in fork/rust at master.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="master" data-tip="3bcad65fbf67b6edf87c949531fbc13435882e6b">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/rust</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/rust</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">bors</span><span class="commit-message" data-commit="3bcad65fbf67b6edf87c949531fbc13435882e6b">Auto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee</span><span class="snapshot-sha sha" data-commit="3bcad65fbf67b6edf87c949531fbc13435882e6b">3bcad65fbf6</span><time datetime="2023-10-05T15:24:54+00:00" title="2023-10-05 15:24:54 +0000">2023-10-05</time></p>
<header class="topbar"><details class="switcher"><summary>master</summary><div class="menu"><strong>branches</strong><a class="current" href="/fork/rust/ref/master/">master</a><strong>tags</strong><a href="/fork/rust/ref/1.39.0/">1.39.0</a><a href="/fork/rust/ref/1.40.0/">1.40.0</a><a href="/fork/rust/ref/1.41.0/">1.41.0</a><a href="/fork/rust/ref/1.41.1/">1.41.1</a><a href="/fork/rust/ref/1.42.0/">1.42.0</a><a href="/fork/rust/ref/1.43.0/">1.43.0</a><a href="/fork/rust/ref/1.43.1/">1.43.1</a><a href="/fork/rust/ref/1.44.0/">1.44.0</a><a class="all" href="/fork/rust/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/rust/">rust</a> / <a href="/fork/rust/ref/master/tree/tests/">tests</a> / <a href="/fork/rust/ref/master/tree/tests/rustdoc-gui/">rustdoc-gui</a> / <span class="cur">README.md</span></nav>
<span class="view-stats"><span>1.1 KiB</span><span>34 lines</span></span><span class="actions"><a class="raw" href="/fork/rust/raw/1126a72ab67eae6de43659511812bed5047c4245/tests/rustdoc-gui/README.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><p>The tests present here are used to test the generated HTML from rustdoc. The
goal is to prevent unsound/unexpected GUI changes.</p>
<p>This is using the <a href="https://github.com/GuillaumeGomez/browser-UI-test/">browser-ui-test</a> framework to do so. It works as follows:</p>
<p>It wraps <a href="https://pptr.dev/">puppeteer</a> to send commands to a web browser in order to navigate and
test what's being currently displayed in the web page.</p>
<p>You can find more information and its documentation in its <a href="https://github.com/GuillaumeGomez/browser-UI-test/">repository</a>.</p>
<p>If you need to have more information on the tests run, you can use <code>--test-args</code>:</p>
<pre class="language-bash"><a-o>$</a-o> <a-f>./x.py</a-f> test tests/rustdoc-gui <a-co>--stage</a-co> 1 <a-co>--test-args</a-co> <a-co>--debug</a-co></pre>
<p>If you don't want to run in headless mode (helpful to debug sometimes), you can use
<code>--no-headless</code>:</p>
<pre class="language-bash"><a-o>$</a-o> <a-f>./x.py</a-f> test tests/rustdoc-gui <a-co>--stage</a-co> 1 <a-co>--test-args</a-co> <a-co>--no-headless</a-co></pre>
<p>To see the supported options, use <code>--help</code>.</p>
<p>Important to be noted: if the chromium instance crashes when you run it, you might need to
use <code>--no-sandbox</code> to make it work:</p>
<pre class="language-bash"><a-o>$</a-o> <a-f>./x.py</a-f> test tests/rustdoc-gui <a-co>--stage</a-co> 1 <a-co>--test-args</a-co> <a-co>--no-sandbox</a-co></pre>
</section><div class="code-panel"><pre class="code src" data-hl="tests/rustdoc-gui/README.md"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text">The tests present here are used to test the generated HTML from rustdoc. The</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text">goal is to prevent unsound/unexpected GUI changes.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text">This is using the [browser-ui-test] framework to do so. It works as follows:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">It wraps [puppeteer] to send commands to a web browser in order to navigate and</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">test what's being currently displayed in the web page.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">You can find more information and its documentation in its [repository][browser-ui-test].</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text">If you need to have more information on the tests run, you can use `--test-args`:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text">```bash</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --debug</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text">```</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text">If you don't want to run in headless mode (helpful to debug sometimes), you can use</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text">`--no-headless`:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text">```bash</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text">$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text">```</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text">To see the supported options, use `--help`.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text">Important to be noted: if the chromium instance crashes when you run it, you might need to</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text">use `--no-sandbox` to make it work:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text">```bash</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text">$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text">```</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text">[browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text">[puppeteer]: https://pptr.dev/</span></span></pre></div></div>
</main>
</body>
</html>
