Skip to content

Commit

Permalink
feat: Display line break in cy.log (#25467)
Browse files Browse the repository at this point in the history
* add breaklines for log messages

* update cy.log tests

* run ci

Co-authored-by: Bill Glesias <[email protected]>
  • Loading branch information
nilgaar and AtofStryker authored Jan 24, 2023
1 parent bba226c commit c2e7b60
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/driver/cypress/e2e/cypress/log.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ describe('src/cypress/log', function () {
expect(this.cy.createSnapshot).not.to.be.called
expect(result).to.equal(log)
})

it('line break persists in snapshot', function () {
const log = this.log({ 'message': 'First line \n Second Line' })
const result = log.snapshot()

expect(result).to.equal(log)
})
})

context('countLogsByTests', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/reporter/cypress/e2e/unit/formatted_message.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ describe('formattedMessage', () => {
const specialMessage = 'hello\n world `code block`'
const result = formattedMessage(specialMessage)

expect(result).to.equal('hello\n world <code>code block</code>')
expect(result).to.equal('hello<br>\n world <code>code block</code>')
})
})
2 changes: 1 addition & 1 deletion packages/reporter/src/commands/command.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import HiddenIcon from '-!react-svg-loader!@packages/frontend-shared/src/assets/
import PinIcon from '-!react-svg-loader!@packages/frontend-shared/src/assets/icons/object-pin_x16.svg'
import RunningIcon from '-!react-svg-loader!@packages/frontend-shared/src/assets/icons/status-running_x16.svg'

const md = new Markdown()
const md = new Markdown({ breaks: true })

const displayName = (model: CommandModel) => model.displayName || model.name
const nameClassName = (name: string) => name.replace(/(\s+)/g, '-')
Expand Down

5 comments on commit c2e7b60

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c2e7b60 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.4.0/linux-arm64/develop-c2e7b60f541e01bb1e7f54f8582c458f619f9690/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c2e7b60 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.4.0/linux-x64/develop-c2e7b60f541e01bb1e7f54f8582c458f619f9690/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c2e7b60 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.4.0/darwin-arm64/develop-c2e7b60f541e01bb1e7f54f8582c458f619f9690/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c2e7b60 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.4.0/darwin-x64/develop-c2e7b60f541e01bb1e7f54f8582c458f619f9690/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on c2e7b60 Jan 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/12.4.0/win32-x64/develop-c2e7b60f541e01bb1e7f54f8582c458f619f9690/cypress.tgz

Please sign in to comment.