title: How to check the number of times particular row with text is visible using cypress?
body: <p>i wanted to assert the number of times the table row with text is visible using cypress.</p>
  <p>below is html,</p>
  <pre><code>&lt;div data-testid=&quot;container&quot;&gt;
      &lt;div data-testid=&quot;body&quot;&gt;
          &lt;div role=&quot;row&quot; data-testid=&quot;table-row-0&quot;&gt;
              &lt;div role=&quot;cell&quot;&gt;
                  &lt;input type=&quot;checkbox&quot;/&gt;
              &lt;/div&gt;
              &lt;div role=&quot;table-cell-row-0-column-name&quot; role=&quot;cell&quot;&gt;
                  &lt;button type=&quot;button&quot; data-testid=&quot;expand-row&quot;&gt;&lt;/button&gt;
                  &quot;Parent 1&quot;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div role=&quot;row&quot; data-testid=&quot;table-row-0.0&quot;&gt;
              &lt;div role=&quot;cell&quot;&gt;
                  &lt;input type=&quot;checkbox&quot;/&gt;
              &lt;/div&gt;
              &lt;div role=&quot;table-cell-0.0-column-name&gt;
                  &lt;button type=&quot;button&quot; data-testid=&quot;expand-row&quot;&gt;&lt;/button&gt;
                  Child 1 of Parent 1
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div role=&quot;row&quot; data-testid=&quot;table-row-0.1&quot;&gt;
              &lt;div role=&quot;cell&quot;&gt;
                  &lt;input type=&quot;checkbox&quot;/&gt;
              &lt;/div&gt;
              &lt;div role=&quot;table-cell-0.1-column-name&gt;
                  &lt;button type=&quot;button&quot; data-testid=&quot;expand-row&quot;&gt;&lt;/button&gt;
                  Child 2 of Parent 1
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div role=&quot;row&quot; data-testid=&quot;table-row-1&quot;&gt;
              &lt;div role=&quot;cell&quot;&gt;
                  &lt;input type=&quot;checkbox&quot;/&gt;
              &lt;/div&gt;
              &lt;div data-testid=&quot;table-row-1-column-name&quot;&gt;
                  &lt;button type=&quot;button&quot; data-testid=&quot;expand-row&quot;&gt;&lt;/button&gt;
                  Parent 2
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div role=&quot;row&quot; data-testid=&quot;table-row-1.0&quot;&gt;
              &lt;div role=&quot;cell&quot;&gt;
                  &lt;input type=&quot;checkbox&quot;/&gt;
              &lt;/div&gt;
              &lt;div data-testid=&quot;table-row-1.0-column-name&quot;&gt;
                  &lt;button type=&quot;button&quot; data-testid=&quot;expand-row&quot;&gt;&lt;/button&gt;
                  Child 1 of Parent 2
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
          
  </code></pre>
  <p>Now for the above html code, how can i check if the text &quot;Child 1 of Parent 1&quot; exists only once in the table using cypress.</p>
  <p>Could someone help me with this. I am new to using cypress. In the process of learning.</p>
  <p>Thanks.</p>