cypress-on-rails 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/LICENSE +21 -0
  4. data/README.md +14 -14
  5. data/Rakefile +1 -1
  6. data/cypress-on-rails.gemspec +3 -2
  7. data/lib/cypress-on-rails.rb +5 -1
  8. data/lib/cypress/smart_factory_wrapper.rb +1 -1
  9. data/lib/cypress_dev.rb +1 -4
  10. data/lib/cypress_dev/middleware.rb +2 -65
  11. data/lib/cypress_dev/smart_factory_wrapper.rb +2 -91
  12. data/lib/{cypress_dev → cypress_on_rails}/command_executor.rb +3 -3
  13. data/lib/{cypress_dev → cypress_on_rails}/configuration.rb +1 -1
  14. data/lib/cypress_on_rails/middleware.rb +65 -0
  15. data/lib/{cypress_dev → cypress_on_rails}/railtie.rb +4 -4
  16. data/lib/{cypress_dev → cypress_on_rails}/simple_rails_factory.rb +1 -1
  17. data/lib/cypress_on_rails/smart_factory_wrapper.rb +91 -0
  18. data/lib/cypress_on_rails/version.rb +3 -0
  19. data/lib/generators/{cypress_dev → cypress_on_rails}/install_generator.rb +2 -2
  20. data/lib/generators/{cypress_dev/templates/config/initializers/cypress_dev.rb.erb → cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb} +4 -4
  21. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress.json +0 -0
  22. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/activerecord_fixtures.rb +0 -0
  23. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/clean.rb +0 -0
  24. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/eval.rb +0 -0
  25. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/factory_bot.rb +1 -1
  26. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/log_fail.rb +0 -0
  27. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/app_commands/scenarios/basic.rb +0 -0
  28. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/cypress_helper.rb +3 -3
  29. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/fixtures/example.json +0 -0
  30. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/actions.spec.js +0 -0
  31. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/aliasing.spec.js +0 -0
  32. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/assertions.spec.js +0 -0
  33. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/connectors.spec.js +0 -0
  34. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/cookies.spec.js +0 -0
  35. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/cypress_api.spec.js +0 -0
  36. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/files.spec.js +0 -0
  37. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/local_storage.spec.js +0 -0
  38. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/location.spec.js +0 -0
  39. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/misc.spec.js +0 -0
  40. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/navigation.spec.js +0 -0
  41. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/network_requests.spec.js +0 -0
  42. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/querying.spec.js +0 -0
  43. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/spies_stubs_clocks.spec.js +0 -0
  44. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/traversal.spec.js +0 -0
  45. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/utilities.spec.js +0 -0
  46. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/viewport.spec.js +0 -0
  47. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/waiting.spec.js +0 -0
  48. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/examples/window.spec.js +0 -0
  49. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/rails_examples/other_spec.js +0 -0
  50. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/rails_examples/using_factory_bot.js +0 -0
  51. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/rails_examples/using_fixtures.js +0 -0
  52. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/integration/rails_examples/using_scenarios_spec.js +0 -0
  53. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/support/commands.js +0 -0
  54. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/support/index.js +0 -0
  55. data/lib/generators/{cypress_dev → cypress_on_rails}/templates/spec/cypress/support/on-rails.js +4 -4
  56. data/spec/{cypress_dev → cypress_on_rails}/command_executor/cypress_helper.rb +0 -0
  57. data/spec/{cypress_dev → cypress_on_rails}/command_executor/test_command.rb +0 -0
  58. data/spec/{cypress_dev → cypress_on_rails}/command_executor/test_command_with_options.rb +0 -0
  59. data/spec/{cypress_dev → cypress_on_rails}/command_executor_spec.rb +3 -3
  60. data/spec/cypress_on_rails/configuration_spec.rb +23 -0
  61. data/spec/{cypress_dev → cypress_on_rails}/middleware_spec.rb +3 -3
  62. data/spec/{cypress_dev → cypress_on_rails}/railtie_spec.rb +3 -3
  63. data/spec/{cypress_dev → cypress_on_rails}/simple_rails_factory_spec.rb +3 -3
  64. data/spec/{cypress_dev → cypress_on_rails}/smart_factory_wrapper_spec.rb +3 -3
  65. data/spec/integrations/rails_3_2/.gitignore +1 -1
  66. data/spec/integrations/rails_3_2/test.sh +1 -1
  67. data/spec/integrations/rails_4_2/.gitignore +1 -1
  68. data/spec/integrations/rails_4_2/test.sh +1 -1
  69. data/spec/integrations/rails_5_2/.gitignore +1 -1
  70. data/spec/integrations/rails_5_2/test.sh +1 -1
  71. data/spec/spec_helper.rb +2 -2
  72. metadata +58 -54
  73. data/lib/cypress_dev/version.rb +0 -3
  74. data/spec/cypress_dev/configuration_spec.rb +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8cd6d039bfcc0993cbf1f1c1888207e07925b743ba955537fcf53dfdbc5f31c
4
- data.tar.gz: 4e0512ffff7f8d7a7c96110d562f645b644e49a4c521936d5ce95afec7d6c851
3
+ metadata.gz: c5f09d5e33b22fb99ee869c2872dbcf2deccbe24ead5fb7ef831ea92f86841cf
4
+ data.tar.gz: 57ed1bb945c66b17f9363d33f98e126fcfba82004bcc817554be0772a968610b
5
5
  SHA512:
6
- metadata.gz: c0aeee57d5b38c12e75dd12028e658b0d67b757c2b439372ed227d4e3255ea89f5845c3d4a3c5c2c1adab832c909e01dac89d3538732a79c7e9aeb7f1f7579f6
7
- data.tar.gz: b02576eb3edf7f79af8b4a055acb8360be1f7163843a902aef8d253b59ea1c2797d17111397672b8361165d4dfc8cd896e33e75925cab14a2269e0c86dc7390d
6
+ metadata.gz: de223cbc75d2e6390639269d7a809a4dd9b6761aba9d2202b2dd06b2c26c83ffc1c1d6b38d362e6cdecca17f6f823b648cf879fceb388ad7a4d48fac04b5e056
7
+ data.tar.gz: bc858ab72ca05da05399aa867f4919a7c2cb58dc7070f2272c3a95cd4c500f1649a355223633a66e09925ec3ec2c819c62d434b333eb47cdd80a6b1ad786bcf1
@@ -1,3 +1,10 @@
1
+ ## 1.4.0
2
+ * Accept an options argument for scenarios
3
+
4
+ ### Tasks
5
+ * renamed to CypressOnRails
6
+
7
+ ## 1.3.0
1
8
  * send any arguments to simple rails factory, not only hashes
2
9
  ### Tasks
3
10
  * stop running cypress examples on CI
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 ShakaCode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # CypressDev
1
+ # CypressOnRails
2
2
 
3
3
  [![Build Status](https://travis-ci.org/grantspeelman/cypress-on-rails.svg?branch=master)](https://travis-ci.org/grantspeelman/cypress-on-rails)
4
4
 
@@ -33,17 +33,17 @@ end
33
33
 
34
34
  The generate the boilerplate code using:
35
35
  ```
36
- bin/rails g cypress_dev:install
36
+ bin/rails g cypress_on_rails:install
37
37
 
38
38
  # if you have/want a different cypress folder (default is spec/cypress)
39
- bin/rails g cypress_dev:install --cypress_folder=test/cypress
39
+ bin/rails g cypress_on_rails:install --cypress_folder=test/cypress
40
40
 
41
41
  # if you want to install cypress with npm
42
- bin/rails g cypress_dev:install --install_cypress_with=npm
42
+ bin/rails g cypress_on_rails:install --install_cypress_with=npm
43
43
  ```
44
44
 
45
45
  The generator adds the following files/directory to your application:
46
- * `config/initializers/cypress_dev` used to configure CypressDev
46
+ * `config/initializers/cypress_on_rails` used to configure CypressDev
47
47
  * `spec/cypress/integrations/` contains your cypress tests
48
48
  * `spec/cypress/support/on-rails.js` contains CypressDev support code
49
49
  * `spec/cypress/app_commands/scenarios/` contains your CypressDev scenario definitions
@@ -76,9 +76,9 @@ You can run your [factory_bot](https://github.com/thoughtbot/factory_bot) direct
76
76
 
77
77
  ```ruby
78
78
  # spec/cypress/app_commands/factory_bot.rb
79
- require 'cypress_dev/smart_factory_wrapper'
79
+ require 'cypress_on_rails/smart_factory_wrapper'
80
80
 
81
- CypressDev::SmartFactoryWrapper.configure(
81
+ CypressOnRails::SmartFactoryWrapper.configure(
82
82
  always_reload: !Rails.configuration.cache_classes,
83
83
  factory: FactoryBot,
84
84
  files: Dir['./spec/factories/**/*.rb']
@@ -141,7 +141,7 @@ You define a scenario in the `spec/cypress/app_commands/scenarios` directory:
141
141
  Profile.create name: "Cypress Hill"
142
142
 
143
143
  # or if you have factory_bot enabled in your cypress_helper
144
- CypressDev::SmartFactoryWrapper.create(:profile, name: "Cypress Hill")
144
+ CypressOnRails::SmartFactoryWrapper.create(:profile, name: "Cypress Hill")
145
145
  ```
146
146
 
147
147
  Then reference the scenario in your test:
@@ -183,17 +183,17 @@ describe('My First Test', function() {
183
183
 
184
184
  ## Usage with other rack applications
185
185
 
186
- Add CypressDev to your config.ru
186
+ Add CypressOnRails to your config.ru
187
187
 
188
188
  ```ruby
189
189
  # an example config.ru
190
190
  require File.expand_path('my_app', File.dirname(__FILE__))
191
191
 
192
- require 'cypress_dev/middleware'
193
- CypressDev.configure do |c|
192
+ require 'cypress_on_rails/middleware'
193
+ CypressOnRails.configure do |c|
194
194
  c.cypress_folder = File.expand_path("#{__dir__}/test/cypress")
195
195
  end
196
- use CypressDev::Middleware
196
+ use CypressOnRails::Middleware
197
197
 
198
198
  run MyApp
199
199
  ```
@@ -202,7 +202,7 @@ add the following file to cypress
202
202
 
203
203
  ```js
204
204
  // test/cypress/support/on-rails.js
205
- // CypressDev: dont remove these command
205
+ // CypressOnRails: dont remove these command
206
206
  Cypress.Commands.add('appCommands', function (body) {
207
207
  cy.request({
208
208
  method: 'POST',
@@ -224,7 +224,7 @@ Cypress.Commands.add('appScenario', function (name) {
224
224
  Cypress.Commands.add('appFactories', function (options) {
225
225
  cy.app('factory_bot', options)
226
226
  });
227
- // CypressDev: end
227
+ // CypressOnRails: end
228
228
 
229
229
  // The next is optional
230
230
  beforeEach(() => {
data/Rakefile CHANGED
@@ -3,7 +3,7 @@ require 'bundler/gem_tasks'
3
3
 
4
4
  require 'rspec/core/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec) do |t|
6
- t.pattern = 'spec/cypress/*_spec.rb'
6
+ t.pattern = 'spec/cypress_on_rails/*_spec.rb'
7
7
  end
8
8
 
9
9
  task default: %w[spec build]
@@ -1,15 +1,16 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $LOAD_PATH.push File.expand_path("../lib", __FILE__)
3
- require "cypress_dev/version"
3
+ require "cypress_on_rails/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "cypress-on-rails"
7
- s.version = CypressDev::VERSION
7
+ s.version = CypressOnRails::VERSION
8
8
  s.author = ["miceportal team", 'Grant Petersen-Speelman']
9
9
  s.email = ["info@miceportal.de", 'grantspeelman@gmail.com']
10
10
  s.homepage = "http://github.com/grantspeelman/cypress-on-rails"
11
11
  s.summary = "Integrates cypress with rails or rack applications"
12
12
  s.description = "Integrates cypress with rails or rack applications"
13
+ s.post_install_message = 'The CypressDev constant is being deprecated and will be completely removed and replaced with CypressOnRails.'
13
14
  s.rubyforge_project = s.name
14
15
  s.files = `git ls-files`.split("\n")
15
16
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
@@ -1,3 +1,7 @@
1
- require 'cypress_dev'
1
+ require 'cypress_on_rails/version'
2
+ require 'cypress_on_rails/configuration'
3
+ require_relative './cypress_on_rails/railtie' if defined?(Rails)
2
4
 
5
+ # maintain backward compatibility
6
+ CypressDev = CypressOnRails
3
7
  Cypress = CypressDev
@@ -1,3 +1,3 @@
1
1
  require 'cypress-on-rails'
2
- require 'cypress_dev/smart_factory_wrapper'
2
+ require 'cypress_on_rails/smart_factory_wrapper'
3
3
  # for backward compatibility
@@ -1,4 +1 @@
1
- require 'cypress_dev/version'
2
- require 'cypress_dev/configuration'
3
- require_relative './cypress_dev/railtie' if defined?(Rails)
4
-
1
+ require 'cypress-on-rails'
@@ -1,65 +1,2 @@
1
- require 'json'
2
- require 'rack'
3
- require 'cypress_dev/configuration'
4
- require 'cypress_dev/command_executor'
5
-
6
- module CypressDev
7
- # Middleware to handle cypress commands and eval
8
- class Middleware
9
- def initialize(app, command_executor = CommandExecutor, file = ::File)
10
- @app = app
11
- @command_executor = command_executor
12
- @file = file
13
- end
14
-
15
- def call(env)
16
- request = Rack::Request.new(env)
17
- if request.path.start_with?('/__cypress__/command')
18
- configuration.tagged_logged { handle_command(request) }
19
- else
20
- @app.call(env)
21
- end
22
- end
23
-
24
- private
25
-
26
- def configuration
27
- CypressDev.configuration
28
- end
29
-
30
- def logger
31
- configuration.logger
32
- end
33
-
34
- Command = Struct.new(:name, :options, :cypress_folder) do
35
- # @return [Array<Cypress::Middleware::Command>]
36
- def self.from_body(body, configuration)
37
- if body.is_a?(Array)
38
- command_params = body
39
- else
40
- command_params = [body]
41
- end
42
- command_params.map do |params|
43
- new(params.fetch('name'), params['options'], configuration.cypress_folder)
44
- end
45
- end
46
-
47
- def file_path
48
- "#{cypress_folder}/app_commands/#{name}.rb"
49
- end
50
- end
51
-
52
- def handle_command(req)
53
- body = JSON.parse(req.body.read)
54
- logger.info "handle_command: #{body}"
55
- commands = Command.from_body(body, configuration)
56
- missing_command = commands.find {|command| !@file.exists?(command.file_path) }
57
- if missing_command.nil?
58
- commands.each { |command| @command_executor.load(command.file_path, command.options) }
59
- [201, {}, ['success']]
60
- else
61
- [404, {}, ["could not find command file: #{missing_command.file_path}"]]
62
- end
63
- end
64
- end
65
- end
1
+ warn "cypress_dev is being deprecated, please require \"cypress_on_rails/middleware\" instead"
2
+ require 'cypress_on_rails/middleware'
@@ -1,91 +1,2 @@
1
- require 'cypress_dev/configuration'
2
- require 'cypress_dev/simple_rails_factory'
3
-
4
- module CypressDev
5
- class SmartFactoryWrapper
6
- module FactoryCleaner
7
- def self.clean(f = FactoryBot)
8
- f.factories.clear if f.respond_to?(:factories)
9
- f.traits.clear if f.respond_to?(:traits)
10
- f.callbacks.clear if f.respond_to?(:callbacks)
11
- f.sequences.clear if f.respond_to?(:sequences)
12
- end
13
- end
14
-
15
- def self.instance
16
- @instance ||= new(files: [], factory: SimpleRailsFactory)
17
- end
18
-
19
- def self.configure(files:, factory:, always_reload: true)
20
- @instance = new(files: files, factory: factory, always_reload: always_reload)
21
- end
22
-
23
- def self.create(*args)
24
- instance.create(*args)
25
- end
26
-
27
- def self.create_list(*args)
28
- instance.create_list(*args)
29
- end
30
-
31
- # @return [Array]
32
- attr_accessor :factory
33
- attr_accessor :always_reload
34
-
35
- def initialize(files:, factory:, always_reload: false,
36
- factory_cleaner: FactoryCleaner, kernel: Kernel, file_system: File,
37
- dir_system: Dir)
38
- self.files = files
39
- self.factory = factory
40
- self.always_reload = always_reload
41
- @kernel = kernel
42
- @file_system = file_system
43
- @factory_cleaner = factory_cleaner
44
- @latest_mtime = nil
45
- @dir_system = dir_system
46
- end
47
-
48
- def create(*args)
49
- load_files
50
- factory.create(*args)
51
- end
52
-
53
- def create_list(*args)
54
- load_files
55
- factory.create_list(*args)
56
- end
57
-
58
- private
59
-
60
- # @param [String,Array] arg
61
- def files=(array)
62
- array = [array] if array.is_a?(String)
63
- @dir_array = array
64
- end
65
-
66
- # @return [Array<String>]
67
- def files
68
- Dir[*@dir_array]
69
- end
70
-
71
- def logger
72
- CypressDev.configuration.logger
73
- end
74
-
75
- def load_files
76
- current_latest_mtime = files.map{|file| @file_system.mtime(file) }.max
77
- return unless should_reload?(current_latest_mtime)
78
- logger.info 'Loading Factories'
79
- @latest_mtime = current_latest_mtime
80
- @factory_cleaner.clean(factory)
81
- files.each do |file|
82
- logger.debug "-- Loading: #{file}"
83
- @kernel.load(file)
84
- end
85
- end
86
-
87
- def should_reload?(current_latest_mtime)
88
- @always_reload || @latest_mtime.nil? || @latest_mtime < current_latest_mtime
89
- end
90
- end
91
- end
1
+ warn "cypress_dev is being deprecated, please require \"cypress_on_rails/smart_factory_wrapper\" instead"
2
+ require 'cypress_on_rails/smart_factory_wrapper'
@@ -1,6 +1,6 @@
1
- require 'cypress_dev/configuration'
1
+ require 'cypress_on_rails/configuration'
2
2
 
3
- module CypressDev
3
+ module CypressOnRails
4
4
  # loads and evals the command files
5
5
  class CommandExecutor
6
6
  def self.load(file,command_options = nil)
@@ -27,7 +27,7 @@ module CypressDev
27
27
  end
28
28
 
29
29
  def self.configuration
30
- CypressDev.configuration
30
+ CypressOnRails.configuration
31
31
  end
32
32
  end
33
33
  end
@@ -1,6 +1,6 @@
1
1
  require 'logger'
2
2
 
3
- module CypressDev
3
+ module CypressOnRails
4
4
  class Configuration
5
5
  attr_accessor :cypress_folder
6
6
  attr_accessor :use_middleware
@@ -0,0 +1,65 @@
1
+ require 'json'
2
+ require 'rack'
3
+ require 'cypress_on_rails/configuration'
4
+ require 'cypress_on_rails/command_executor'
5
+
6
+ module CypressOnRails
7
+ # Middleware to handle cypress commands and eval
8
+ class Middleware
9
+ def initialize(app, command_executor = CommandExecutor, file = ::File)
10
+ @app = app
11
+ @command_executor = command_executor
12
+ @file = file
13
+ end
14
+
15
+ def call(env)
16
+ request = Rack::Request.new(env)
17
+ if request.path.start_with?('/__cypress__/command')
18
+ configuration.tagged_logged { handle_command(request) }
19
+ else
20
+ @app.call(env)
21
+ end
22
+ end
23
+
24
+ private
25
+
26
+ def configuration
27
+ CypressOnRails.configuration
28
+ end
29
+
30
+ def logger
31
+ configuration.logger
32
+ end
33
+
34
+ Command = Struct.new(:name, :options, :cypress_folder) do
35
+ # @return [Array<Cypress::Middleware::Command>]
36
+ def self.from_body(body, configuration)
37
+ if body.is_a?(Array)
38
+ command_params = body
39
+ else
40
+ command_params = [body]
41
+ end
42
+ command_params.map do |params|
43
+ new(params.fetch('name'), params['options'], configuration.cypress_folder)
44
+ end
45
+ end
46
+
47
+ def file_path
48
+ "#{cypress_folder}/app_commands/#{name}.rb"
49
+ end
50
+ end
51
+
52
+ def handle_command(req)
53
+ body = JSON.parse(req.body.read)
54
+ logger.info "handle_command: #{body}"
55
+ commands = Command.from_body(body, configuration)
56
+ missing_command = commands.find {|command| !@file.exists?(command.file_path) }
57
+ if missing_command.nil?
58
+ commands.each { |command| @command_executor.load(command.file_path, command.options) }
59
+ [201, {}, ['success']]
60
+ else
61
+ [404, {}, ["could not find command file: #{missing_command.file_path}"]]
62
+ end
63
+ end
64
+ end
65
+ end
@@ -1,11 +1,11 @@
1
1
  require 'rails/railtie'
2
- require 'cypress_dev/configuration'
3
- require 'cypress_dev/middleware'
2
+ require 'cypress_on_rails/configuration'
3
+ require 'cypress_on_rails/middleware'
4
4
 
5
- module CypressDev
5
+ module CypressOnRails
6
6
  class Railtie < Rails::Railtie
7
7
  initializer :setup_cypress_middleware do |app|
8
- if CypressDev.configuration.use_middleware?
8
+ if CypressOnRails.configuration.use_middleware?
9
9
  app.middleware.use Middleware
10
10
  end
11
11
  end
@@ -1,6 +1,6 @@
1
1
  require 'active_support/core_ext/string'
2
2
 
3
- module CypressDev
3
+ module CypressOnRails
4
4
  module SimpleRailsFactory
5
5
  def self.create(type, *params)
6
6
  params = [{}] if params.empty?
@@ -0,0 +1,91 @@
1
+ require 'cypress_on_rails/configuration'
2
+ require 'cypress_on_rails/simple_rails_factory'
3
+
4
+ module CypressOnRails
5
+ class SmartFactoryWrapper
6
+ module FactoryCleaner
7
+ def self.clean(f = FactoryBot)
8
+ f.factories.clear if f.respond_to?(:factories)
9
+ f.traits.clear if f.respond_to?(:traits)
10
+ f.callbacks.clear if f.respond_to?(:callbacks)
11
+ f.sequences.clear if f.respond_to?(:sequences)
12
+ end
13
+ end
14
+
15
+ def self.instance
16
+ @instance ||= new(files: [], factory: SimpleRailsFactory)
17
+ end
18
+
19
+ def self.configure(files:, factory:, always_reload: true)
20
+ @instance = new(files: files, factory: factory, always_reload: always_reload)
21
+ end
22
+
23
+ def self.create(*args)
24
+ instance.create(*args)
25
+ end
26
+
27
+ def self.create_list(*args)
28
+ instance.create_list(*args)
29
+ end
30
+
31
+ # @return [Array]
32
+ attr_accessor :factory
33
+ attr_accessor :always_reload
34
+
35
+ def initialize(files:, factory:, always_reload: false,
36
+ factory_cleaner: FactoryCleaner, kernel: Kernel, file_system: File,
37
+ dir_system: Dir)
38
+ self.files = files
39
+ self.factory = factory
40
+ self.always_reload = always_reload
41
+ @kernel = kernel
42
+ @file_system = file_system
43
+ @factory_cleaner = factory_cleaner
44
+ @latest_mtime = nil
45
+ @dir_system = dir_system
46
+ end
47
+
48
+ def create(*args)
49
+ load_files
50
+ factory.create(*args)
51
+ end
52
+
53
+ def create_list(*args)
54
+ load_files
55
+ factory.create_list(*args)
56
+ end
57
+
58
+ private
59
+
60
+ # @param [String,Array] arg
61
+ def files=(array)
62
+ array = [array] if array.is_a?(String)
63
+ @dir_array = array
64
+ end
65
+
66
+ # @return [Array<String>]
67
+ def files
68
+ Dir[*@dir_array]
69
+ end
70
+
71
+ def logger
72
+ CypressOnRails.configuration.logger
73
+ end
74
+
75
+ def load_files
76
+ current_latest_mtime = files.map{|file| @file_system.mtime(file) }.max
77
+ return unless should_reload?(current_latest_mtime)
78
+ logger.info 'Loading Factories'
79
+ @latest_mtime = current_latest_mtime
80
+ @factory_cleaner.clean(factory)
81
+ files.each do |file|
82
+ logger.debug "-- Loading: #{file}"
83
+ @kernel.load(file)
84
+ end
85
+ end
86
+
87
+ def should_reload?(current_latest_mtime)
88
+ @always_reload || @latest_mtime.nil? || @latest_mtime < current_latest_mtime
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,3 @@
1
+ module CypressOnRails
2
+ VERSION = '1.4.0'
3
+ end
@@ -1,4 +1,4 @@
1
- module CypressDev
1
+ module CypressOnRails
2
2
  class InstallGenerator < Rails::Generators::Base
3
3
  class_option :cypress_folder, type: :string, default: 'spec/cypress'
4
4
  class_option :install_cypress_with, type: :string, default: 'yarn'
@@ -31,7 +31,7 @@ module CypressDev
31
31
  end
32
32
 
33
33
  def add_initial_files
34
- template "config/initializers/cypress_dev.rb.erb", "config/initializers/cypress_dev.rb"
34
+ template "config/initializers/cypress_on_rails.rb.erb", "config/initializers/cypress_on_rails.rb"
35
35
  copy_file "spec/cypress/cypress_helper.rb", "#{options.cypress_folder}/cypress_helper.rb"
36
36
  copy_file "spec/cypress/support/on-rails.js", "#{options.cypress_folder}/support/on-rails.js"
37
37
  directory 'spec/cypress/app_commands', "#{options.cypress_folder}/app_commands"
@@ -1,9 +1,9 @@
1
- if defined?(CypressDev)
2
- CypressDev.configure do |c|
1
+ if defined?(CypressOnRails)
2
+ CypressOnRails.configure do |c|
3
3
  c.cypress_folder = File.expand_path("#{__dir__}/../../<%= options.cypress_folder %>")
4
- # WARNING!! CypressDev can execute arbitrary ruby code
4
+ # WARNING!! CypressOnRails can execute arbitrary ruby code
5
5
  # please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0
6
6
  c.use_middleware = Rails.env.test?
7
7
  c.logger = Rails.logger
8
8
  end
9
- end
9
+ end
@@ -2,7 +2,7 @@ Array.wrap(command_options).each do |factory_options|
2
2
  factory_method = factory_options.shift
3
3
  begin
4
4
  logger.debug "running #{factory_method}, #{factory_options}"
5
- CypressDev::SmartFactoryWrapper.public_send(factory_method, *factory_options)
5
+ CypressOnRails::SmartFactoryWrapper.public_send(factory_method, *factory_options)
6
6
  rescue => e
7
7
  logger.error "#{e.class}: #{e.message}"
8
8
  logger.error e.backtrace.join("\n")
@@ -17,13 +17,13 @@ rescue LoadError => e
17
17
  end
18
18
  end
19
19
 
20
- require 'cypress_dev/smart_factory_wrapper'
20
+ require 'cypress_on_rails/smart_factory_wrapper'
21
21
 
22
- factory = CypressDev::SimpleRailsFactory
22
+ factory = CypressOnRails::SimpleRailsFactory
23
23
  factory = FactoryBot if defined?(FactoryBot)
24
24
  factory = FactoryGirl if defined?(FactoryGirl)
25
25
 
26
- CypressDev::SmartFactoryWrapper.configure(
26
+ CypressOnRails::SmartFactoryWrapper.configure(
27
27
  always_reload: !Rails.configuration.cache_classes,
28
28
  factory: factory,
29
29
  files: %w(spec/factories.rb ./spec/factories/**/*.rb)
@@ -1,4 +1,4 @@
1
- // CypressDev: dont remove these command
1
+ // CypressOnRails: dont remove these command
2
2
  Cypress.Commands.add('appCommands', function (body) {
3
3
  cy.log("APP: " + JSON.stringify(body))
4
4
  cy.request({
@@ -14,8 +14,8 @@ Cypress.Commands.add('app', function (name, command_options) {
14
14
  cy.appCommands({name: name, options: command_options})
15
15
  });
16
16
 
17
- Cypress.Commands.add('appScenario', function (name) {
18
- cy.app('scenarios/' + name)
17
+ Cypress.Commands.add('appScenario', function (name, options = {}) {
18
+ cy.app('scenarios/' + name, options)
19
19
  });
20
20
 
21
21
  Cypress.Commands.add('appEval', function (code) {
@@ -29,7 +29,7 @@ Cypress.Commands.add('appFactories', function (options) {
29
29
  Cypress.Commands.add('appFixtures', function (options) {
30
30
  cy.app('activerecord_fixtures', options)
31
31
  });
32
- // CypressDev: end
32
+ // CypressOnRails: end
33
33
 
34
34
  // The next is optional
35
35
  // beforeEach(() => {
@@ -1,6 +1,6 @@
1
- require 'cypress_dev/command_executor'
1
+ require 'cypress_on_rails/command_executor'
2
2
 
3
- RSpec.describe CypressDev::CommandExecutor do
3
+ RSpec.describe CypressOnRails::CommandExecutor do
4
4
  describe '.load' do
5
5
  let(:folder) { "#{__dir__}/command_executor" }
6
6
  subject { described_class }
@@ -10,7 +10,7 @@ RSpec.describe CypressDev::CommandExecutor do
10
10
  end
11
11
 
12
12
  before do
13
- CypressDev.configuration.cypress_folder = folder
13
+ CypressOnRails.configuration.cypress_folder = folder
14
14
  DummyTest.values.clear if defined?(DummyTest)
15
15
  end
16
16
 
@@ -0,0 +1,23 @@
1
+ require 'cypress_on_rails/configuration'
2
+
3
+ RSpec.describe CypressOnRails::Configuration do
4
+ it 'has defaults' do
5
+ CypressOnRails.configure { |config| config.reset }
6
+
7
+ expect(CypressOnRails.configuration.cypress_folder).to eq('spec/cypress')
8
+ expect(CypressOnRails.configuration.use_middleware?).to eq(true)
9
+ expect(CypressOnRails.configuration.logger).to_not be_nil
10
+ end
11
+
12
+ it 'can be configured' do
13
+ my_logger = Logger.new(STDOUT)
14
+ CypressOnRails.configure do |config|
15
+ config.cypress_folder = 'my/path'
16
+ config.use_middleware = false
17
+ config.logger = my_logger
18
+ end
19
+ expect(CypressOnRails.configuration.cypress_folder).to eq('my/path')
20
+ expect(CypressOnRails.configuration.use_middleware?).to eq(false)
21
+ expect(CypressOnRails.configuration.logger).to eq(my_logger)
22
+ end
23
+ end
@@ -1,8 +1,8 @@
1
- require 'cypress_dev/middleware'
1
+ require 'cypress_on_rails/middleware'
2
2
 
3
- RSpec.describe CypressDev::Middleware do
3
+ RSpec.describe CypressOnRails::Middleware do
4
4
  let(:app) { ->(env) { [200, {}, ["app did #{env['PATH_INFO']}"]] } }
5
- let(:command_executor) { class_double(CypressDev::CommandExecutor) }
5
+ let(:command_executor) { class_double(CypressOnRails::CommandExecutor) }
6
6
  let(:file) { class_double(File) }
7
7
  subject { described_class.new(app, command_executor, file) }
8
8
 
@@ -1,11 +1,11 @@
1
- require 'cypress_dev/railtie'
1
+ require 'cypress_on_rails/railtie'
2
2
 
3
3
  module Rails
4
4
  def self.env
5
5
  end
6
6
  end
7
7
 
8
- RSpec.describe CypressDev::Railtie do
8
+ RSpec.describe CypressOnRails::Railtie do
9
9
  let(:rails_env) { double }
10
10
  let(:middleware) { double('Middleware', use: true) }
11
11
  let(:rails_app) { double('RailsApp', middleware: middleware) }
@@ -15,7 +15,7 @@ RSpec.describe CypressDev::Railtie do
15
15
  end
16
16
 
17
17
  it 'runs the middleware in test mode' do
18
- CypressDev::Railtie.initializers.each do |initializer|
18
+ CypressOnRails::Railtie.initializers.each do |initializer|
19
19
  initializer.run(rails_app)
20
20
  end
21
21
  end
@@ -1,7 +1,7 @@
1
- require 'cypress_dev/simple_rails_factory'
1
+ require 'cypress_on_rails/simple_rails_factory'
2
2
 
3
- RSpec.describe CypressDev::SimpleRailsFactory do
4
- subject { CypressDev::SimpleRailsFactory }
3
+ RSpec.describe CypressOnRails::SimpleRailsFactory do
4
+ subject { CypressOnRails::SimpleRailsFactory }
5
5
 
6
6
  class AppRecord
7
7
  def self.create!(*)
@@ -1,6 +1,6 @@
1
- require 'cypress_dev/smart_factory_wrapper'
1
+ require 'cypress_on_rails/smart_factory_wrapper'
2
2
 
3
- RSpec.describe CypressDev::SmartFactoryWrapper do
3
+ RSpec.describe CypressOnRails::SmartFactoryWrapper do
4
4
  FileSystemDummy = Struct.new(:file_hash) do
5
5
  def mtime(filename)
6
6
  file_hash.fetch(filename)
@@ -11,7 +11,7 @@ RSpec.describe CypressDev::SmartFactoryWrapper do
11
11
  let(:mtime_hash) { {'file1.rb' => time_now, 'file2.rb' => time_now } }
12
12
  let(:files) { %w(file1.rb file2.rb) }
13
13
  let(:factory_double) { double('FactoryBot', create: true, create_list: true) }
14
- let(:factory_cleaner) { class_double(CypressDev::SmartFactoryWrapper::FactoryCleaner, clean: true) }
14
+ let(:factory_cleaner) { class_double(CypressOnRails::SmartFactoryWrapper::FactoryCleaner, clean: true) }
15
15
  let(:kernel_double) { class_double(Kernel, load: true) }
16
16
  let(:file_double) { FileSystemDummy.new(mtime_hash) }
17
17
  let(:dir_double) { class_double(Dir) }
@@ -3,7 +3,7 @@ node_modules
3
3
  cypress.json
4
4
  package-lock.json
5
5
  cypress/
6
- config/initializers/cypress_dev.rb
6
+ config/initializers/cypress_on_rails.rb
7
7
  vendor/bundle
8
8
  tmp/pids
9
9
  tmp/cache
@@ -14,7 +14,7 @@ bundle --version
14
14
  bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2 --path vendor/bundle
15
15
 
16
16
  echo '-- cypress install'
17
- bundle exec ./bin/rails g cypress_dev:install --cypress_folder=cypress --install_cypress_with=npm --no-install-cypress-examples
17
+ bundle exec ./bin/rails g cypress_on_rails:install --cypress_folder=cypress --install_cypress_with=npm --no-install-cypress-examples
18
18
 
19
19
  echo '-- start rails server'
20
20
  # make sure the server is not running
@@ -4,7 +4,7 @@ spec/cypress.json
4
4
  spec/package.json
5
5
  spec/yarn.lock
6
6
  spec/cypress
7
- config/initializers/cypress_dev.rb
7
+ config/initializers/cypress_on_rails.rb
8
8
  vendor/bundle
9
9
  tmp/pids
10
10
  tmp/cache
@@ -14,7 +14,7 @@ bundle --version
14
14
  bundle install --quiet --gemfile="$DIR/Gemfile" --retry 2 --path vendor/bundle
15
15
 
16
16
  echo '-- cypress install'
17
- bundle exec ./bin/rails g cypress_dev:install --no-install-cypress-examples
17
+ bundle exec ./bin/rails g cypress_on_rails:install --no-install-cypress-examples
18
18
 
19
19
  echo '-- start rails server'
20
20
  # make sure the server is not running
@@ -4,7 +4,7 @@ test/cypress.json
4
4
  test/package.json
5
5
  test/yarn.lock
6
6
  test/cypress/
7
- config/initializers/cypress_dev.rb
7
+ config/initializers/cypress_on_rails.rb
8
8
  vendor/bundle
9
9
  tmp/pids
10
10
  db/*.sqlite3
@@ -17,7 +17,7 @@ echo '-- migration'
17
17
  bin/rails db:migrate
18
18
 
19
19
  echo '-- cypress install'
20
- bundle exec ./bin/rails g cypress_dev:install --cypress_folder=test/cypress --no-install-cypress-examples
20
+ bundle exec ./bin/rails g cypress_on_rails:install --cypress_folder=test/cypress --no-install-cypress-examples
21
21
 
22
22
  echo '-- start rails server'
23
23
  # make sure the server is not running
@@ -95,8 +95,8 @@ RSpec.configure do |config|
95
95
  Kernel.srand config.seed
96
96
 
97
97
  config.before(:each) do
98
- require 'cypress_dev/configuration'
99
- CypressDev.configure do |config|
98
+ require 'cypress_on_rails/configuration'
99
+ CypressOnRails.configure do |config|
100
100
  config.reset
101
101
  config.logger = Logger.new('spec/test.log')
102
102
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-on-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - miceportal team
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-02-21 00:00:00.000000000 Z
12
+ date: 2019-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
@@ -80,65 +80,68 @@ files:
80
80
  - ".travis.yml"
81
81
  - CHANGELOG.md
82
82
  - Gemfile
83
+ - LICENSE
83
84
  - README.md
84
85
  - Rakefile
85
86
  - cypress-on-rails.gemspec
86
87
  - lib/cypress-on-rails.rb
87
88
  - lib/cypress/smart_factory_wrapper.rb
88
89
  - lib/cypress_dev.rb
89
- - lib/cypress_dev/command_executor.rb
90
- - lib/cypress_dev/configuration.rb
91
90
  - lib/cypress_dev/middleware.rb
92
- - lib/cypress_dev/railtie.rb
93
- - lib/cypress_dev/simple_rails_factory.rb
94
91
  - lib/cypress_dev/smart_factory_wrapper.rb
95
- - lib/cypress_dev/version.rb
96
- - lib/generators/cypress_dev/install_generator.rb
97
- - lib/generators/cypress_dev/templates/config/initializers/cypress_dev.rb.erb
98
- - lib/generators/cypress_dev/templates/spec/cypress.json
99
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/activerecord_fixtures.rb
100
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/clean.rb
101
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/eval.rb
102
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/factory_bot.rb
103
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/log_fail.rb
104
- - lib/generators/cypress_dev/templates/spec/cypress/app_commands/scenarios/basic.rb
105
- - lib/generators/cypress_dev/templates/spec/cypress/cypress_helper.rb
106
- - lib/generators/cypress_dev/templates/spec/cypress/fixtures/example.json
107
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/actions.spec.js
108
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/aliasing.spec.js
109
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/assertions.spec.js
110
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/connectors.spec.js
111
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/cookies.spec.js
112
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/cypress_api.spec.js
113
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/files.spec.js
114
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/local_storage.spec.js
115
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/location.spec.js
116
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/misc.spec.js
117
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/navigation.spec.js
118
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/network_requests.spec.js
119
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/querying.spec.js
120
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/spies_stubs_clocks.spec.js
121
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/traversal.spec.js
122
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/utilities.spec.js
123
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/viewport.spec.js
124
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/waiting.spec.js
125
- - lib/generators/cypress_dev/templates/spec/cypress/integration/examples/window.spec.js
126
- - lib/generators/cypress_dev/templates/spec/cypress/integration/rails_examples/other_spec.js
127
- - lib/generators/cypress_dev/templates/spec/cypress/integration/rails_examples/using_factory_bot.js
128
- - lib/generators/cypress_dev/templates/spec/cypress/integration/rails_examples/using_fixtures.js
129
- - lib/generators/cypress_dev/templates/spec/cypress/integration/rails_examples/using_scenarios_spec.js
130
- - lib/generators/cypress_dev/templates/spec/cypress/support/commands.js
131
- - lib/generators/cypress_dev/templates/spec/cypress/support/index.js
132
- - lib/generators/cypress_dev/templates/spec/cypress/support/on-rails.js
133
- - spec/cypress_dev/command_executor/cypress_helper.rb
134
- - spec/cypress_dev/command_executor/test_command.rb
135
- - spec/cypress_dev/command_executor/test_command_with_options.rb
136
- - spec/cypress_dev/command_executor_spec.rb
137
- - spec/cypress_dev/configuration_spec.rb
138
- - spec/cypress_dev/middleware_spec.rb
139
- - spec/cypress_dev/railtie_spec.rb
140
- - spec/cypress_dev/simple_rails_factory_spec.rb
141
- - spec/cypress_dev/smart_factory_wrapper_spec.rb
92
+ - lib/cypress_on_rails/command_executor.rb
93
+ - lib/cypress_on_rails/configuration.rb
94
+ - lib/cypress_on_rails/middleware.rb
95
+ - lib/cypress_on_rails/railtie.rb
96
+ - lib/cypress_on_rails/simple_rails_factory.rb
97
+ - lib/cypress_on_rails/smart_factory_wrapper.rb
98
+ - lib/cypress_on_rails/version.rb
99
+ - lib/generators/cypress_on_rails/install_generator.rb
100
+ - lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb
101
+ - lib/generators/cypress_on_rails/templates/spec/cypress.json
102
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/activerecord_fixtures.rb
103
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/clean.rb
104
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/eval.rb
105
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/factory_bot.rb
106
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/log_fail.rb
107
+ - lib/generators/cypress_on_rails/templates/spec/cypress/app_commands/scenarios/basic.rb
108
+ - lib/generators/cypress_on_rails/templates/spec/cypress/cypress_helper.rb
109
+ - lib/generators/cypress_on_rails/templates/spec/cypress/fixtures/example.json
110
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/actions.spec.js
111
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/aliasing.spec.js
112
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/assertions.spec.js
113
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/connectors.spec.js
114
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/cookies.spec.js
115
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/cypress_api.spec.js
116
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/files.spec.js
117
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/local_storage.spec.js
118
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/location.spec.js
119
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/misc.spec.js
120
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/navigation.spec.js
121
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/network_requests.spec.js
122
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/querying.spec.js
123
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/spies_stubs_clocks.spec.js
124
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/traversal.spec.js
125
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/utilities.spec.js
126
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/viewport.spec.js
127
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/waiting.spec.js
128
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/examples/window.spec.js
129
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/rails_examples/other_spec.js
130
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/rails_examples/using_factory_bot.js
131
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/rails_examples/using_fixtures.js
132
+ - lib/generators/cypress_on_rails/templates/spec/cypress/integration/rails_examples/using_scenarios_spec.js
133
+ - lib/generators/cypress_on_rails/templates/spec/cypress/support/commands.js
134
+ - lib/generators/cypress_on_rails/templates/spec/cypress/support/index.js
135
+ - lib/generators/cypress_on_rails/templates/spec/cypress/support/on-rails.js
136
+ - spec/cypress_on_rails/command_executor/cypress_helper.rb
137
+ - spec/cypress_on_rails/command_executor/test_command.rb
138
+ - spec/cypress_on_rails/command_executor/test_command_with_options.rb
139
+ - spec/cypress_on_rails/command_executor_spec.rb
140
+ - spec/cypress_on_rails/configuration_spec.rb
141
+ - spec/cypress_on_rails/middleware_spec.rb
142
+ - spec/cypress_on_rails/railtie_spec.rb
143
+ - spec/cypress_on_rails/simple_rails_factory_spec.rb
144
+ - spec/cypress_on_rails/smart_factory_wrapper_spec.rb
142
145
  - spec/integrations/cypress.json
143
146
  - spec/integrations/rails_3_2/.gitignore
144
147
  - spec/integrations/rails_3_2/Gemfile
@@ -280,7 +283,8 @@ files:
280
283
  homepage: http://github.com/grantspeelman/cypress-on-rails
281
284
  licenses: []
282
285
  metadata: {}
283
- post_install_message:
286
+ post_install_message: The CypressDev constant is being deprecated and will be completely
287
+ removed and replaced with CypressOnRails.
284
288
  rdoc_options: []
285
289
  require_paths:
286
290
  - lib
@@ -1,3 +0,0 @@
1
- module CypressDev
2
- VERSION = '1.3.0'
3
- end
@@ -1,23 +0,0 @@
1
- require 'cypress_dev/configuration'
2
-
3
- RSpec.describe CypressDev::Configuration do
4
- it 'has defaults' do
5
- CypressDev.configure { |config| config.reset }
6
-
7
- expect(CypressDev.configuration.cypress_folder).to eq('spec/cypress')
8
- expect(CypressDev.configuration.use_middleware?).to eq(true)
9
- expect(CypressDev.configuration.logger).to_not be_nil
10
- end
11
-
12
- it 'can be configured' do
13
- my_logger = Logger.new(STDOUT)
14
- CypressDev.configure do |config|
15
- config.cypress_folder = 'my/path'
16
- config.use_middleware = false
17
- config.logger = my_logger
18
- end
19
- expect(CypressDev.configuration.cypress_folder).to eq('my/path')
20
- expect(CypressDev.configuration.use_middleware?).to eq(false)
21
- expect(CypressDev.configuration.logger).to eq(my_logger)
22
- end
23
- end