meinaart / cypress-plugin-snapshots

Plugin for snapshot tests in Cypress.io
MIT License
497 stars 117 forks source link

Image Snapshot of Table return black square (bug) #75

Closed aorsten closed 4 years ago

aorsten commented 4 years ago

Describe the bug Using .toMatchImageSnapshot() on a table, I'm getting a black square as the snapshot. Best shown by the following images:

  1. How the table looks: image

  2. How the snapshot becomes: image

This is the HTML for the table (using NextJS):

<table class="jsx-1824392073 table table-sm table-striped table-hover">
        <caption class="figure-caption w-100 text-center">
          <span style="font-style:italic">Table </span
          >2<span style="font-style:italic">
            Showing a data tabel. This is a tabel where the content is only text
            and/or equations</span
          >
        </caption>
        <tbody>
          <tr>
            <td class="jsx-795880060 "></td>
            <td class="jsx-1311057988 ">
              <span style="font-weight:bold">Year 1</span>
            </td>
            <td class="jsx-1311057988 ">
              <span style="font-weight:bold">Year 2</span>
            </td>
          </tr>
          <tr>
            <td class="jsx-795880060 ">Category 1</td>
            <td class="jsx-1311057988 ">3</td>
            <td class="jsx-1311057988 ">5</td>
          </tr>
          <tr>
            <td class="jsx-795880060 ">Category 2</td>
            <td class="jsx-1311057988 ">4</td>
            <td class="jsx-1311057988 ">4</td>
          </tr>
          <tr>
            <td class="jsx-795880060 ">Category 3</td>
            <td class="jsx-1311057988 ">5</td>
            <td class="jsx-1311057988 ">6</td>
          </tr>
        </tbody>
      </table>

I haven't got time at this very moment to reproduce a bare bones example, but will provide more info if this is not a known and common issue? (If you need more - I will look at the point below)

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

meinaart commented 4 years ago

I need a bare bone example for this. Are you sure it's not a Cypress bug? Can you take a screenshot with Cypress and see if it produces a correct screenshot?

meinaart commented 4 years ago

@aorsten let me know if it's a Cypress bug or not. If it's not I will reopen the issue.