<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mickey Streicher</title>
    <description>The latest articles on DEV Community by Mickey Streicher (@mickeystreicher).</description>
    <link>https://dev.to/mickeystreicher</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1157083%2F449a445a-f248-4345-be7f-28c4cfeb36a6.png</url>
      <title>DEV Community: Mickey Streicher</title>
      <link>https://dev.to/mickeystreicher</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mickeystreicher"/>
    <language>en</language>
    <item>
      <title>Vedro Hooks</title>
      <dc:creator>Mickey Streicher</dc:creator>
      <pubDate>Thu, 28 Nov 2024 17:48:32 +0000</pubDate>
      <link>https://dev.to/mickeystreicher/vedro-hooks-14ei</link>
      <guid>https://dev.to/mickeystreicher/vedro-hooks-14ei</guid>
      <description>&lt;p&gt;Vedro offers powerful extensibility through its &lt;a href="https://vedro.io/docs/guides/writing-plugins" rel="noopener noreferrer"&gt;plugin system&lt;/a&gt;, allowing you to create robust, reusable solutions that can be shared across different projects and teams. But what if you're just experimenting with your codebase, prototyping a concept, or adding a small tweak? Writing a full plugin might feel like overkill. That’s where vedro-hooks comes in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/vedro-hooks/" rel="noopener noreferrer"&gt;&lt;strong&gt;vedro-hooks&lt;/strong&gt;&lt;/a&gt; is a lightweight library that lets you attach custom hooks to various Vedro events. Whether you're starting a mock server before tests run, launching a browser for end-to-end testing or setting up custom logging, vedro-hooks enables you to inject functionality with minimal boilerplate.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Example
&lt;/h2&gt;

&lt;p&gt;Suppose you want to identify slow tests in your suite — let's define "slow" as any test that takes longer than 1 second to run. Traditionally, you’d need to create a custom plugin for this. Here’s how that might look:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;vedro.core&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dispatcher&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Plugin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;PluginConfig&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;vedro.events&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ScenarioFailedEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ScenarioPassedEvent&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SlowTestPlugin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Plugin&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;subscribe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;dispatcher&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Dispatcher&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;dispatcher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ScenarioPassedEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;on_scenario_end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;dispatcher&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ScenarioFailedEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;on_scenario_end&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_scenario_end&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ScenarioPassedEvent&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ScenarioFailedEvent&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scenario_result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;elapsed&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scenario_result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_extra_details&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;⚠️ Slow test!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;SlowTestPluginConfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PluginConfig&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;plugin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SlowTestPlugin&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach works, but creating a full-fledged plugin involves more setup and additional boilerplate. It’s great for reusable solutions but can feel cumbersome for quick experimentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Simplifying with Hooks
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;vedro-hooks&lt;/code&gt;, you can achieve the same functionality with just a few lines of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;vedro_hooks&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;on_scenario_passed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;on_scenario_failed&lt;/span&gt;

&lt;span class="nd"&gt;@on_scenario_passed&lt;/span&gt;
&lt;span class="nd"&gt;@on_scenario_failed&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;highlight_slow_tests&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scenario_result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;elapsed&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;elapsed&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;1.0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scenario_result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_extra_details&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;⚠️ Slow test!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code uses decorators to register a function that will be called when a scenario passes or fails. It checks the elapsed time and adds extra details if the scenario took longer than 1 second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scenarios
*
 ✔ retrieve user info (0.52s)
 ✔ retrieve user repos (1.02s)
   |&amp;gt; ⚠️ Slow test!

# 2 scenarios, 2 passed, 0 failed, 0 skipped (1.54s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Managing Hooks: Downsides and Solutions
&lt;/h2&gt;

&lt;p&gt;One downside of using hooks in this way is that they can be registered from anywhere in your project, which might make them harder to track down later. In contrast, plugins in Vedro are registered in the &lt;code&gt;vedro.cfg.py&lt;/code&gt; file, providing a centralized location for all your plugin configurations.&lt;/p&gt;

&lt;p&gt;To help mitigate the downside of hooks being registered throughout your codebase, &lt;code&gt;vedro-hooks&lt;/code&gt; provides the &lt;code&gt;--hooks-show&lt;/code&gt; command-line argument. When enabled, after the testing process completes, a summary of all registered hooks along with their source locations will be displayed. This is useful for debugging and verifying which hooks are active.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Scenarios
*
 ✔ retrieve user repos

# [vedro-hooks] Hooks:
#  - 'highlight_slow_tests' (ScenarioFailedEvent) vedro.cfg.py:26
#  - 'highlight_slow_tests' (ScenarioPassedEvent) vedro.cfg.py:26
# 1 scenario, 1 passed, 0 failed, 0 skipped (0.55s)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While &lt;code&gt;--hooks-show&lt;/code&gt; is helpful, you need to remember to use it during debugging. It's still best practice to register your hooks in a central location like &lt;code&gt;vedro.cfg.py&lt;/code&gt; to maintain clarity and consistency with plugins configurations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;vedro-hooks&lt;/code&gt; is a fantastic tool for enhancing your Vedro tests without the overhead of creating a custom plugin. It shines when you need a quick, focused solution for extending functionality. By using it wisely and keeping your configuration organized, you can enjoy the best of both worlds: simplicity and maintainability.&lt;/p&gt;

</description>
      <category>python</category>
      <category>testing</category>
      <category>vedro</category>
    </item>
    <item>
      <title>Enhancing Merge Requests with Vedro and GitLab Test Reports</title>
      <dc:creator>Mickey Streicher</dc:creator>
      <pubDate>Sat, 06 Jan 2024 09:59:51 +0000</pubDate>
      <link>https://dev.to/mickeystreicher/enhancing-merge-requests-with-vedro-and-gitlab-test-reports-1cl9</link>
      <guid>https://dev.to/mickeystreicher/enhancing-merge-requests-with-vedro-and-gitlab-test-reports-1cl9</guid>
      <description>&lt;p&gt;As more development teams adopt Continuous Integration (CI) practices, the ability to visualize and manage test results within merge requests becomes increasingly important. GitLab CI provides developers with a user-friendly platform to view &lt;a href="https://docs.gitlab.com/ee/ci/testing/unit_test_reports.html" rel="noopener noreferrer"&gt;test reports&lt;/a&gt; directly in the context of their changes, streamlining the workflow and speeding up the review process.&lt;/p&gt;

&lt;p&gt;When configured correctly, your GitLab merge request will display a new section illustrating the test report, showcasing which tests passed or failed. This section makes it incredibly easy for reviewers to assess the impact of code changes on the existing codebase, all without leaving the merge request view. The integration appears as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbhy447ubz6rvjo4cedr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbhy447ubz6rvjo4cedr.png" alt="overview" width="800" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Full Report:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0dq4s0dv05343ea6r2a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0dq4s0dv05343ea6r2a.png" alt="fullreport" width="800" height="265"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up GitLab CI Test Reports
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Installing vedro-xunit-reporter
&lt;/h3&gt;

&lt;p&gt;Before generating test reports, you need to install the &lt;a href="https://pypi.org/project/vedro-xunit-reporter/" rel="noopener noreferrer"&gt;vedro-xunit-reporter&lt;/a&gt; plugin. This plugin will produce test reports in the xUnit XML format, which GitLab CI can interpret and display within merge requests.&lt;/p&gt;

&lt;p&gt;To install the plugin, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;vedro plugin &lt;span class="nb"&gt;install &lt;/span&gt;vedro-xunit-reporter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installing the plugin, remember to add it to your &lt;code&gt;requirements.txt&lt;/code&gt; file, ensuring its installation during CI pipeline executions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Configuring .gitlab-ci.yml
&lt;/h3&gt;

&lt;p&gt;The next step involves updating your &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file to define how artifacts and test reports are handled within your GitLab CI pipeline. You will need to specify that the artifact produced by the test stage is a report in the xUnit XML format, and indicate the path where this report can be found.&lt;/p&gt;

&lt;p&gt;Here is an example configuration for your &lt;code&gt;.gitlab-ci.yml&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;python:3.11&lt;/span&gt;
  &lt;span class="na"&gt;stage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;test&lt;/span&gt;

  &lt;span class="na"&gt;before_script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;pip install -r requirements.txt&lt;/span&gt;

  &lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;vedro run -r rich xunit --xunit-report-path xunit_report.xml&lt;/span&gt;

  &lt;span class="na"&gt;artifacts&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;when&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;always&lt;/span&gt;
    &lt;span class="na"&gt;reports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;junit&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;xunit_report.xml&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the example above, the CI pipeline includes a test stage, running Vedro with the &lt;a href="https://vedro.io/docs/basics/reporting-system" rel="noopener noreferrer"&gt;rich&lt;/a&gt; and &lt;a href="https://pypi.org/project/vedro-xunit-reporter/" rel="noopener noreferrer"&gt;xunit&lt;/a&gt; reporters. The &lt;code&gt;--xunit-report-path&lt;/code&gt; option specifies the output filename for the test report, which, in this case, is &lt;code&gt;xunit_report.xml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Additionally, the &lt;code&gt;artifacts:reports:junit&lt;/code&gt; section instructs GitLab CI to treat the generated &lt;code&gt;xunit_report.xml&lt;/code&gt; file as a JUnit format test report. &lt;code&gt;when: always&lt;/code&gt; ensures that the report is saved as an artifact regardless of whether the test passes or fails.&lt;/p&gt;

&lt;p&gt;By following these two steps, you can initiate &lt;a href="https://vedro.io/" rel="noopener noreferrer"&gt;Vedro&lt;/a&gt; tests within your GitLab CI pipeline and visually represent the results in merge requests. This integration enhances the efficiency of code reviews by providing immediate and clear feedback on the success of tests related to the proposed code changes. It also helps to catch issues early, prior to merging your code, thus maintaining the stability and reliability of your code base.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Vedro: How To Define Environment Variables</title>
      <dc:creator>Mickey Streicher</dc:creator>
      <pubDate>Sat, 25 Nov 2023 12:43:32 +0000</pubDate>
      <link>https://dev.to/mickeystreicher/-vedro-how-to-define-environment-variables-nl0</link>
      <guid>https://dev.to/mickeystreicher/-vedro-how-to-define-environment-variables-nl0</guid>
      <description>&lt;p&gt;Environment variables are key-value pairs used in software development to store configuration settings and control application behavior without hardcoding them into the source code. They facilitate managing different configurations across various environments, like local development or staging. This approach is essential for maintaining clean, adaptable code and securely handling sensitive information, such as API keys.&lt;/p&gt;

&lt;p&gt;In automated testing, environment variables facilitate seamless transitions between various settings or data sources, simplifying the testing process across multiple deployment environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Scenario: Retrieving a List of Asteroids
&lt;/h2&gt;

&lt;p&gt;To illustrate, consider a &lt;a href="https://vedro.io/"&gt;Vedro&lt;/a&gt; test scenario that requires loading an API key from an environment variable to access an endpoint providing a list of asteroids. For this example, the focus will be on the &lt;a href="https://api.nasa.gov/"&gt;NeoWs&lt;/a&gt; (Near Earth Object Web Service) provided by NASA, which offers comprehensive data about near-Earth asteroids.&lt;/p&gt;

&lt;p&gt;Here's the basic structure of a Vedro test scenario:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vedro&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retrieve list of asteroids&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;given_api_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# API key will be loaded from environment variable
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;when_user_retrieves_asteroids&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# Make a GET request to the NeoWs API
&lt;/span&gt;        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.nasa.gov/neo/rest/v1/feed&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;then_it_should_return_success_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="c1"&gt;# Assert the success of the response
&lt;/span&gt;        &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reading Environment Variables in Python
&lt;/h2&gt;

&lt;p&gt;To read environment variables in Python, you can use the &lt;a href="https://docs.python.org/3/library/os.html#os.environ"&gt;os&lt;/a&gt; module. Here's how to modify the &lt;code&gt;given_api_key&lt;/code&gt; method to load the API key from an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;environ&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retrieve list of asteroids&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;given_api_key&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Defining Environment Variables
&lt;/h2&gt;

&lt;p&gt;There are two primary ways to define environment variables for tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 1: Directly in the Environment
&lt;/h3&gt;

&lt;p&gt;Define environment variables directly in the shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"DEMO_KEY"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run tests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;vedro run
Scenarios
&lt;span class="k"&gt;*&lt;/span&gt;
 ✔ retrieve list of asteroids

&lt;span class="c"&gt;# 1 scenario, 1 passed, 0 failed, 0 skipped (1.79s)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: Using a .env File
&lt;/h3&gt;

&lt;p&gt;Alternatively, you can use a &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;API_KEY="DEMO_KEY"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the &lt;a href="https://pypi.org/project/python-dotenv/"&gt;python-dotenv&lt;/a&gt; package to load variables from the &lt;code&gt;.env&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip3 &lt;span class="nb"&gt;install &lt;/span&gt;python-dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, load the environment variables in the &lt;code&gt;vedro.cfg.py&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vedro&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vedro_allure_reporter&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dotenv&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_dotenv&lt;/span&gt;

&lt;span class="nf"&gt;load_dotenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.env&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Plugins&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Plugins&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

        &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AllureReporter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro_allure_reporter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AllureReporter&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;enabled&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The configuration above includes the &lt;a href="https://pypi.org/project/vedro-allure-reporter/"&gt;Allure reporter plugin&lt;/a&gt; for Vedro. This plugin generates comprehensive, interactive reports, enhancing test result visualization. For detailed integration instructions, refer to the blog post: &lt;a href="https://dev.to/mickeystreicher/how-to-integrate-vedro-with-allure-3jkb"&gt;How to Integrate Vedro with Allure&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Run tests again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;vedro run
Scenarios
&lt;span class="k"&gt;*&lt;/span&gt;
 ✔ retrieve list of asteroids

&lt;span class="c"&gt;# 1 scenario, 1 passed, 0 failed, 0 skipped (1.61s)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A significant advantage of using &lt;code&gt;.env&lt;/code&gt; files in testing scenarios is their flexibility in managing multiple environment variables across different testing environments. For instance, separate env-files like &lt;code&gt;.env-local&lt;/code&gt; for local development and &lt;code&gt;.env-staging&lt;/code&gt; for staging environments can be used. This approach enables developers and testers to easily switch contexts without altering the code or the command line environment. &lt;/p&gt;

&lt;p&gt;Regardless of the chosen method, environment variables can be utilized anywhere in your tests: within the test itself, in contexts, or in a separate configuration file.&lt;/p&gt;

</description>
      <category>python</category>
      <category>testing</category>
      <category>vedro</category>
    </item>
    <item>
      <title>How to Integrate Vedro with Allure</title>
      <dc:creator>Mickey Streicher</dc:creator>
      <pubDate>Sat, 09 Sep 2023 14:07:49 +0000</pubDate>
      <link>https://dev.to/mickeystreicher/how-to-integrate-vedro-with-allure-3jkb</link>
      <guid>https://dev.to/mickeystreicher/how-to-integrate-vedro-with-allure-3jkb</guid>
      <description>&lt;p&gt;In modern software development, a comprehensive reporting tool is as crucial as the test cases themselves. &lt;a href="https://docs.qameta.io/allure/" rel="noopener noreferrer"&gt;Allure&lt;/a&gt; has emerged as a highly flexible and insightful reporting tool that provides an in-depth look into what has been tested and what needs further attention. If you're using &lt;a href="https://vedro.io" rel="noopener noreferrer"&gt;Vedro&lt;/a&gt;, a pragmatic testing framework, integrating it with Allure can significantly enhance your test reporting capabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Laying the Groundwork
&lt;/h2&gt;

&lt;p&gt;Before delving into the integration, ensure that you have Vedro installed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install vedro
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Consider the following simple Vedro scenario, which tests the retrieval of repositories for a GitHub user:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vedro&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retrieve user repos&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;given_user&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gvanrossum&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;when_guest_retrieves_repos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;httpx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.github.com/users/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;/repos&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;then_it_should_return_a_successful_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;assert&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, let's integrate this with Allure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Install the Allure Plugin for Vedro
&lt;/h2&gt;

&lt;p&gt;To get started with Allure in Vedro, first install the &lt;a href="https://pypi.org/project/vedro-allure-reporter/" rel="noopener noreferrer"&gt;Allure Reporter plugin&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vedro plugin install vedro-allure-reporter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2: Execute Tests and Generate Report Data
&lt;/h2&gt;

&lt;p&gt;After installing the plugin, you can execute your tests and generate Allure report data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vedro run -r rich allure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default, this command saves the report data in the &lt;code&gt;./allure_reports&lt;/code&gt; directory. To specify a different directory, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vedro run -r rich allure --allure-report-dir ./custom_allure_reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Visualize the Report with the Allure CLI
&lt;/h2&gt;

&lt;p&gt;To view the report, you'll need to install the Allure command-line tool first. Follow the installation instructions provided in the &lt;a href="https://docs.qameta.io/allure/#_installing_a_commandline" rel="noopener noreferrer"&gt;official Allure guide&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After you've installed the Allure CLI, serve the report:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;allure serve ./allure_reports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command will generate and open the report in your default web browser, providing a clear and interactive view of your test results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwke4dj46bh5amv7gnxa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwke4dj46bh5amv7gnxa.png" alt="AllureScreenshot" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Enhance Reports Through Categorization and Labeling
&lt;/h2&gt;

&lt;p&gt;To improve report visualization and understanding, consider labeling your tests. For example, label the previously defined scenario to categorize it under "GitHub API Testing":&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;vedro&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;vedro_allure_reporter&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;allure_labels&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Story&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Epic&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Feature&lt;/span&gt;

&lt;span class="nd"&gt;@allure_labels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Epic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;GitHub API Testing&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nc"&gt;Feature&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;User Repositories&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vedro&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Scenario&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;subject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;retrieve user repos&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="bp"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Labeling is particularly useful when you have an extensive test suite and need to filter or group tests. For example, to run tests labeled under a specific epic, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vedro run --allure-labels epic="GitHub API Testing"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In summary, integrating Vedro with Allure not only enhances your testing workflow but also provides a comprehensive and interactive reporting experience, making it easier to track, filter, and understand your test results.&lt;/p&gt;

</description>
      <category>python</category>
      <category>testing</category>
      <category>vedro</category>
    </item>
  </channel>
</rss>
