title: Cypress testing pseudo CSS class :before
body: <p>Is there a way in which I can test the <code>content</code> of the pseudo CSS class for :before on my element with Cypress?</p>
  
  <p>I have seen links documenting:</p>
  
  <ul>
  <li><a href="https://docs.cypress.io/api/commands/eq.html#Syntax" rel="noreferrer">Accessing nth-child pseudo element</a></li>
  <li><a href="https://github.com/cypress-io/cypress-example-recipes/issues/207" rel="noreferrer">Accessing the actual <code>content</code> pseudo class of a normal CSS class</a></li>
  </ul>
  
  <p>But I have not found anything for CSS classes using the <code>::before</code> pseudo class.</p>
  
  <p>Imagine the code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.myClass:before {
    content: "foo-";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;span class="myClass"&gt;Bar&lt;/span&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How could one test that 'foo-' is present? </p>