mbolotov / intellij-cypress

IntelliJ-Cypress plugin: https://plugins.jetbrains.com/plugin/13819-intellij-cypress Pro version: https://plugins.jetbrains.com/plugin/13987-cypress-support-pro
MIT License
35 stars 5 forks source link

Exception in plugin Cypress Support (1.4.2) WebStorm 2021.3.3 #86

Closed Threnos closed 2 years ago

Threnos commented 2 years ago

Plugin unexpectedly threw error after a day of use. Ran a correctly-written spec, which failed due to frontend error. I put error traces into respectful files as they were shown in ide error window (a lot of text). I will gladly provide further information needed.

WebStorm 2021.3.3 Build #WS-213.7172.31, built on March 18, 2022 Runtime version: 11.0.14.1+1-b1751.46 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.13.0-39-generic GC: G1 Young Generation, G1 Old Generation Memory: 1926M Cores: 16 Non-Bundled Plugins: net.vektah.codeglance2 (1.5.5) me.mbolotov.cypress (1.4.2) Current Desktop: X-Cinnamon

Cypress: 9.5.3

stacktrace.txt invalidation.trace.txt

mbolotov commented 2 years ago

Hi @Threnos! Could you please provide more details on how the spec you run looks like?

Threnos commented 2 years ago

This is how it looks in "run", if that is what you mean. image

Threnos commented 2 years ago

Tried to reproduce it, but it happened only once.

mbolotov commented 2 years ago

I mean the code of spec. The error happened when plugin was trying to remove the '.only' keyword after the run. I'm trying to figure out why it could fail. I can fix it anyway by simply skipping this step but I want to know if it's really impossible to remove the keyword in such a specific condition.

mbolotov commented 2 years ago

Do you remember if you change the spec code while running it?

Threnos commented 2 years ago

Nope, I did not change it before running. Started by clicking on filename -> Run stoplighting.ts

import { encode } from '@/plugins/encoder'
import { trackRequest } from '@cy/support/commands/common'
import { projectFilesAdd } from '@cy/support/commands/projectFiles'
import { projectScheduleRecallProject, setProjectSchedule } from '@cy/support/commands/projectSchedule'
import { userAdminLogin } from '@cy/support/commands/user'

describe('[Response Representative] UI test of Project Documents stoplighting', function() {
  const firstFileName = 'file.png'
  const secondFileName = 'file1.png'

  before(function() {
    cy.task('restoreDb')
    cy.login()

    // Upload project file
    projectScheduleRecallProject(this.db.customers[0].projects[5].id, '')
    projectFilesAdd(this.db.customers[0].projects[5].id, [firstFileName, secondFileName])
    setProjectSchedule(this.db.customers[0].projects[5].id)

    userAdminLogin(this.db.customers[0].projects[5].vendors[0].associates[0].id)

    trackRequest('projectFilesAll')
    cy.visit(`/Project/${encode(this.db.customers[0].projects[5].id)}/Documents`).waitForRequest('projectFilesAll')
  })

  it('Initial status should be pending', function() {
    cy.get('[data-cy="projectNavigation_projectDocuments"]').find('[data-cy="stoplightingIcon_red"]')
  })

  context('Incomplete', function() {
    before('Sign one of two files', function() {
      // Sign first file
      cy.get('tr')
        .containsExactly(firstFileName)
        .parents('tr')
        .find('[data-cy="vendorProjectDocuments_document_btnNotSigned"]')
        .click()

      cy.get('[data-cy="vendor_projectDocuments_document_signDocumentDialog_checkboxSign"]').click({ force: true }) // Checkbox input is covered with wrapping div

      trackRequest('projectFilesESign')
      cy.get('[data-cy="vendor_projectDocuments_document_signDocumentDialog_btnSubmit"]')
        .click()
        .waitForRequest('projectFilesESign')
    })

    it('Status should be incomplete when some files are signed', function() {
      cy.get('[data-cy="projectNavigation_projectDocuments"]').find('[data-cy="stoplightingIcon_yellow"]')
    })
  })

  context('Finished', function() {
    before('Sign second file', function() {
      // Sign second file
      cy.get('tr')
        .containsExactly(secondFileName)
        .parents('tr')
        .find('[data-cy="vendorProjectDocuments_document_btnNotSigned"]')
        .click()

      cy.get('[data-cy="vendor_projectDocuments_document_signDocumentDialog_checkboxSign"]').click({ force: true }) // Checkbox input is covered with wrapping div

      trackRequest('projectFilesESign')
      cy.get('[data-cy="vendor_projectDocuments_document_signDocumentDialog_btnSubmit"]')
        .click()
        .waitForRequest('projectFilesESign')
    })

    it('Status should be finished when all files are signed', function() {
      cy.get('[data-cy="projectNavigation_projectDocuments"]').find('[data-cy="stoplightingIcon_green"]')
    })
  })

  after(function() {
    cy.logout()
  })
})