Skip to content

Stack trace log (failed line number) printed in cypress run is different from the stack trace in cypress open #7715

@frankliu1776

Description

@frankliu1776

Current behavior:

  1. when run a cypress script on terminal with command: ./node_modules/.bin/cypress run --port 3019 --browser chrome --config testFiles=myCypressPath/cypress/test/20200426172648.js
    I can get stack trace printed in terminal like:
    image
    We can see that the log indicates the failed line number is in line 24, which is not correct
  2. in the meanwhile when I run it with cypress open, it indicates that the failed line number is 31 which is correct:
    image

Desired behavior:

how can I get correct stack trace on ternimal? I am using some automation framework to automate cypress scripts and parse the stack trace log to get failed line number

Test code to reproduce

var test1 = "http://argo-ui.oss-cn-beijing.aliyuncs.com/test.js";
var test2 = "http://argo-ui.oss-cn-beijing.aliyuncs.com/test (2).js";
var test4 = 111111;
describe('test_name', function() {

 it('what_it_does', function() {

    cy.viewport(1024, 768)

    cy.setCookie('currentRegionId', 'test')
    cy.wait(4000)
 
    cy.visit('https://test.com')
cy.clickText('尊敬的用户');
cy.wait(3000)
    cy.wait(1000)
    cy.visit('https://test.com')

    cy.wait(1000)
 
    cy.get('li.J_submenu_edasAppManage > div.el-submenu__title > div:nth-child(1) > div').click()
 
    cy.wait(2000)
 
    cy.xpath('//div[text()="配置管理"]').click()
 
    cy.wait(4000)
    cy.visit('https://test.com/?regionNo=test')
    
    cy.wait(2000)
    cy.getIFrameBody('.J_iframe_Contianer').xpath('//span[text()="创建"]').click()
 
    cy.wait(2000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('#dataId').click()
 
    cy.wait(1000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('#dataId').clear().type('dfdfdfdfdfdfiiii')
 
    cy.wait(1000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('div.view-lines').click()
 
    cy.wait(2000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('textarea.inputarea').clear().type('fdfdfdfdf')
 
    cy.wait(1000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('button.next-btn-primary').click()
 
    cy.wait(1000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('div.next-dialog-footer > div > button[type="button"].next-btn-medium').click()
 
    cy.wait(1000)
 
    cy.getIFrameBody('.J_iframe_Contianer').find('button.next-btn-normal').click()

 })
})

Versions

Cypress: 4.7.0
operating system: MacOS Catalina 10.15.5
browser: chrome 83.0.4103.97

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions