📣 Join our Developer Experience Team on September 30th @ 2PM EDT/11AM PDT for an exclusive webcast on Cypress Patterns and Practices

Register

Cypress.spec

Improve this doc

Cypress.spec returns you the properties of the spec under test.

Syntax

Cypress.spec // returns spec object

Examples

Log spec information

Cypress.spec returns an object

it('log spec info', () => {
  console.log(Cypress.spec)
  // {
  //   name: 'filter.spec.js',
  //   relative: 'cypress/integration/filter.spec.js',
  //   absolute: '/Users/janelane/Dev/web-app/cypress/integration/filter.spec.js',
  // }
})