Sha256: 2689877f30086c837cc57d151291beac9a7195fa683b4947d7438ff08e0d43e7

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

// CypressOnRails: dont remove these command
Cypress.Commands.add('appCommands', function (body) {
  cy.log("APP: " + JSON.stringify(body))
  return cy.request({
    method: 'POST',
    url: "/__cypress__/command",
    body: JSON.stringify(body),
    log: true,
    failOnStatusCode: true
  }).then((response) => {
    return response.body
  });
});

Cypress.Commands.add('app', function (name, command_options) {
  return cy.appCommands({name: name, options: command_options}).then((body) => {
    return body[0]
  });
});

Cypress.Commands.add('appScenario', function (name, options = {}) {
  return cy.app('scenarios/' + name, options)
});

Cypress.Commands.add('appEval', function (code) {
  return cy.app('eval', code)
});

Cypress.Commands.add('appFactories', function (options) {
  return cy.app('factory_bot', options)
});

Cypress.Commands.add('appFixtures', function (options) {
  cy.app('activerecord_fixtures', options)
});
// CypressOnRails: end

// The next is optional
// beforeEach(() => {
//  cy.app('clean') // have a look at cypress/app_commands/clean.rb
// });

// comment this out if you do not want to attempt to log additional info on test fail
Cypress.on('fail', (err, runnable) => {
  // allow app to generate additional logging data
  Cypress.$.ajax({
    url: '/__cypress__/command',
    data: JSON.stringify({name: 'log_fail', options: {error_message: err.message, runnable_full_title: runnable.fullTitle() }}),
    async: false,
    method: 'POST'
  });

  throw err;
});

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cypress-on-rails-1.9.1 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.9.0 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.8.1 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.8.0 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.7.0 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.6.0 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.5.1 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
cypress-on-rails-1.5.0 lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js