e-nms_qa_automation/docs/build/html/fixtures.html

268 lines
16 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html class="writer-html5" lang="ru" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>fixtures package &mdash; документация e-nms-qa-automation 0.1.0</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=b86133f3" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=e59714d7" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=6ff560e8"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/translations.js?v=cd1d70c9"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Алфавитный указатель" href="genindex.html" />
<link rel="search" title="Поиск" href="search.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home">
e-nms-qa-automation
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Поиск в документации" aria-label="Поиск в документации" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Меню навигации">
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">fixtures package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-fixtures.pages">fixtures.pages module</a><ul>
<li><a class="reference internal" href="#fixtures.pages.pytest_addoption"><code class="docutils literal notranslate"><span class="pre">pytest_addoption()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.browser"><code class="docutils literal notranslate"><span class="pre">browser()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.get_firefox_browser"><code class="docutils literal notranslate"><span class="pre">get_firefox_browser()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.get_chrome_browser"><code class="docutils literal notranslate"><span class="pre">get_chrome_browser()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.get_remote_chrome"><code class="docutils literal notranslate"><span class="pre">get_remote_chrome()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.get_context"><code class="docutils literal notranslate"><span class="pre">get_context()</span></code></a></li>
<li><a class="reference internal" href="#fixtures.pages.return_back"><code class="docutils literal notranslate"><span class="pre">return_back()</span></code></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-fixtures">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Меню навигации для мобильных устройств" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">e-nms-qa-automation</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Навигация по страницам">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">fixtures package</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/fixtures.rst.txt" rel="nofollow"> Просмотреть исходный код страницы</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="fixtures-package">
<h1>fixtures package<a class="headerlink" href="#fixtures-package" title="Ссылка на этот заголовок"></a></h1>
<section id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Ссылка на этот заголовок"></a></h2>
</section>
<section id="module-fixtures.pages">
<span id="fixtures-pages-module"></span><h2>fixtures.pages module<a class="headerlink" href="#module-fixtures.pages" title="Ссылка на этот заголовок"></a></h2>
<p>Модуль pages содержит фикстуры и функции для работы с Playwright.</p>
<p>Предоставляет инструменты для управления браузером, контекстами и страницами
в тестах pytest, включая настройку параметров запуска.</p>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.pytest_addoption">
<span class="sig-name descname"><span class="pre">pytest_addoption</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">parser</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#pytest_addoption"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.pytest_addoption" title="Ссылка на это определение"></a></dt>
<dd><p>Добавляет опции командной строки для настройки браузера.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>parser</strong> (<em>Parser</em>) Парсер pytest для добавления опций.</p>
</dd>
</dl>
<dl class="simple">
<dt>Опции:</dt><dd><p>bn: Браузер (chrome, remote_chrome, firefox)
h: Режим headless (True/False)
s: Размер окна {„width“: int, „height“: int}
slow: Задержка между действиями (мс)
t: Таймаут по умолчанию (мс)
l: Локаль браузера</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.browser">
<span class="sig-name descname"><span class="pre">browser</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#browser"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.browser" title="Ссылка на это определение"></a></dt>
<dd><p>Фикстура для управления экземпляром браузера.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>request</strong> (<em>FixtureRequest</em>) Объект запроса pytest для доступа к конфигурации.</p>
</dd>
<dt class="field-even">Результат<span class="colon">:</span></dt>
<dd class="field-even"><p>Экземпляр страницы браузера.</p>
</dd>
<dt class="field-odd">Тип результата<span class="colon">:</span></dt>
<dd class="field-odd"><p>Page</p>
</dd>
<dt class="field-even">Yields<span class="colon">:</span></dt>
<dd class="field-even"><p><em>Page</em> Страница для использования в тестах.</p>
</dd>
</dl>
<div class="admonition note">
<p class="admonition-title">Примечание</p>
<p>Автоматически закрывает браузер после тестов.</p>
</div>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.get_firefox_browser">
<span class="sig-name descname"><span class="pre">get_firefox_browser</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">playwright</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#get_firefox_browser"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.get_firefox_browser" title="Ссылка на это определение"></a></dt>
<dd><p>Создает и возвращает экземпляр Firefox браузера.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>playwright</strong> (<em>Playwright</em>) Экземпляр Playwright.</p></li>
<li><p><strong>request</strong> (<em>FixtureRequest</em>) Объект запроса pytest.</p></li>
</ul>
</dd>
<dt class="field-even">Результат<span class="colon">:</span></dt>
<dd class="field-even"><p>Экземпляр Firefox.</p>
</dd>
<dt class="field-odd">Тип результата<span class="colon">:</span></dt>
<dd class="field-odd"><p>Browser</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.get_chrome_browser">
<span class="sig-name descname"><span class="pre">get_chrome_browser</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">playwright</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#get_chrome_browser"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.get_chrome_browser" title="Ссылка на это определение"></a></dt>
<dd><p>Создает и возвращает экземпляр Chrome браузера.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>playwright</strong> (<em>Playwright</em>) Экземпляр Playwright.</p></li>
<li><p><strong>request</strong> (<em>FixtureRequest</em>) Объект запроса pytest.</p></li>
</ul>
</dd>
<dt class="field-even">Результат<span class="colon">:</span></dt>
<dd class="field-even"><p>Экземпляр Chrome.</p>
</dd>
<dt class="field-odd">Тип результата<span class="colon">:</span></dt>
<dd class="field-odd"><p>Browser</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.get_remote_chrome">
<span class="sig-name descname"><span class="pre">get_remote_chrome</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">playwright</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#get_remote_chrome"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.get_remote_chrome" title="Ссылка на это определение"></a></dt>
<dd><p>Создает экземпляр Chrome для удаленного запуска.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>playwright</strong> (<em>Playwright</em>) Экземпляр Playwright.</p></li>
<li><p><strong>request</strong> (<em>FixtureRequest</em>) Объект запроса pytest.</p></li>
</ul>
</dd>
<dt class="field-even">Результат<span class="colon">:</span></dt>
<dd class="field-even"><p>Экземпляр Chrome в headless режиме.</p>
</dd>
<dt class="field-odd">Тип результата<span class="colon">:</span></dt>
<dd class="field-odd"><p>Browser</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.get_context">
<span class="sig-name descname"><span class="pre">get_context</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">browser</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">request</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">start</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#get_context"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.get_context" title="Ссылка на это определение"></a></dt>
<dd><p>Создает и настраивает контекст браузера.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>browser</strong> (<em>Browser</em>) Экземпляр браузера.</p></li>
<li><p><strong>request</strong> (<em>FixtureRequest</em>) Объект запроса pytest.</p></li>
<li><p><strong>start</strong> (<em>str</em>) Тип запуска („local“ или „remote“).</p></li>
</ul>
</dd>
<dt class="field-even">Результат<span class="colon">:</span></dt>
<dd class="field-even"><p>Настроенный контекст.</p>
</dd>
<dt class="field-odd">Тип результата<span class="colon">:</span></dt>
<dd class="field-odd"><p>BrowserContext</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="fixtures.pages.return_back">
<span class="sig-name descname"><span class="pre">return_back</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">browser</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/fixtures/pages.html#return_back"><span class="viewcode-link"><span class="pre">[исходный</span> <span class="pre">код]</span></span></a><a class="headerlink" href="#fixtures.pages.return_back" title="Ссылка на это определение"></a></dt>
<dd><p>Фикстура для возврата на предыдущую страницу.</p>
<dl class="field-list simple">
<dt class="field-odd">Параметры<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>browser</strong> (<em>Page</em>) Экземпляр страницы браузера.</p>
</dd>
</dl>
</dd></dl>
</section>
<section id="module-fixtures">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-fixtures" title="Ссылка на этот заголовок"></a></h2>
<p>Package initialization.</p>
</section>
</section>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>&#169; Авторские права 2025, NPO KIS. </p>
</div>
Собрано при помощи <a href="https://www.sphinx-doc.org/">Sphinx</a> с использованием
<a href="https://github.com/readthedocs/sphinx_rtd_theme">темы,</a>
предоставленной <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>