cypress-rails 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24eb8b9afcb78821b2291a9f649aa23289be2de7b7e301aa04bbc521af73f5d6
4
- data.tar.gz: 76d178ce43355d9072d400101bf7e2166e84124e20e406b785b1d3983a5c7f5e
3
+ metadata.gz: 2b5037ac29bfc53baf2b770242635353028792d2577b8468d848973272da2f76
4
+ data.tar.gz: 38da1e00388f74e87cd54ffd8e74ace953fc1ee2f69d231e83dd00a02eb04935
5
5
  SHA512:
6
- metadata.gz: de8f996a5e27aa4788c5fcf496b6c48d486261b343bb914ed0a55399c1560499642cf9413faa39bad17db08cb29fda94d91ecb4ec03539ae7a495380ef8d4d2b
7
- data.tar.gz: c12bdc03096784182c2aa048e96386e8ce3ca8742eed24d1c1b0a0dcbcf438270f53a1d07d721d17eee85d9b950633d705760a519a7441811a9c5f6a0da23529
6
+ metadata.gz: f6ba80e9f20f20bbac8a861f4f27cd5279a6d9b658a2331e9e10ccc8d4d8dbb425c18140ebebfd3f12fe314cb21678ce9b18be8d18aa16e54778b483eef66ee6
7
+ data.tar.gz: 465bd36d2bf6f42ee12c17bdeb38c465ad84168c98f984bfb1c050d1843b8c45305615a4c6c3f82b929a86281f2febbffab0905cd65b7c6456ae3184d52952de
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.7.0
4
+ git
5
+ * Add a `CYPRESS_RAILS_CYPRESS_DIR` option for cases where
6
+ the cypress tests live outside the CYPRESS_RAILS_DIR [#159](https://github.com/testdouble/cypress-rails/pull/159)
7
+
3
8
  ## 0.6.1
4
9
 
5
10
  * Fix a deprecation warning in Rails
data/Gemfile.lock CHANGED
@@ -1,74 +1,103 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cypress-rails (0.6.1)
4
+ cypress-rails (0.7.0)
5
5
  puma (>= 3.8.0)
6
6
  railties (>= 5.2.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (7.0.6)
12
- actionview (= 7.0.6)
13
- activesupport (= 7.0.6)
14
- rack (~> 2.0, >= 2.2.4)
11
+ actionpack (7.1.3)
12
+ actionview (= 7.1.3)
13
+ activesupport (= 7.1.3)
14
+ nokogiri (>= 1.8.5)
15
+ racc
16
+ rack (>= 2.2.4)
17
+ rack-session (>= 1.0.1)
15
18
  rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (7.0.6)
19
- activesupport (= 7.0.6)
19
+ rails-dom-testing (~> 2.2)
20
+ rails-html-sanitizer (~> 1.6)
21
+ actionview (7.1.3)
22
+ activesupport (= 7.1.3)
20
23
  builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (7.0.6)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activesupport (7.1.3)
28
+ base64
29
+ bigdecimal
25
30
  concurrent-ruby (~> 1.0, >= 1.0.2)
31
+ connection_pool (>= 2.2.5)
32
+ drb
26
33
  i18n (>= 1.6, < 2)
27
34
  minitest (>= 5.1)
35
+ mutex_m
28
36
  tzinfo (~> 2.0)
29
37
  ast (2.4.2)
38
+ base64 (0.2.0)
39
+ bigdecimal (3.1.6)
30
40
  builder (3.2.4)
31
- concurrent-ruby (1.2.2)
41
+ concurrent-ruby (1.2.3)
42
+ connection_pool (2.4.1)
32
43
  crass (1.0.6)
44
+ drb (2.2.0)
45
+ ruby2_keywords
33
46
  erubi (1.12.0)
34
47
  i18n (1.14.1)
35
48
  concurrent-ruby (~> 1.0)
36
- loofah (2.21.3)
49
+ io-console (0.7.2)
50
+ irb (1.11.2)
51
+ rdoc
52
+ reline (>= 0.4.2)
53
+ loofah (2.22.0)
37
54
  crass (~> 1.0.2)
38
55
  nokogiri (>= 1.12.0)
39
- method_source (1.0.0)
40
- mini_portile2 (2.8.2)
56
+ mini_portile2 (2.8.5)
41
57
  minitest (5.15.0)
42
- nio4r (2.5.9)
43
- nokogiri (1.15.3)
58
+ mutex_m (0.2.0)
59
+ nio4r (2.7.0)
60
+ nokogiri (1.16.2)
44
61
  mini_portile2 (~> 2.8.2)
45
62
  racc (~> 1.4)
46
63
  parallel (1.22.1)
47
64
  parser (3.1.2.0)
48
65
  ast (~> 2.4.1)
49
- puma (6.3.0)
66
+ psych (5.1.2)
67
+ stringio
68
+ puma (6.4.2)
50
69
  nio4r (~> 2.0)
51
- racc (1.7.1)
52
- rack (2.2.7)
70
+ racc (1.7.3)
71
+ rack (3.0.9)
72
+ rack-session (2.0.0)
73
+ rack (>= 3.0.0)
53
74
  rack-test (2.1.0)
54
75
  rack (>= 1.3)
55
- rails-dom-testing (2.1.1)
76
+ rackup (2.1.0)
77
+ rack (>= 3)
78
+ webrick (~> 1.8)
79
+ rails-dom-testing (2.2.0)
56
80
  activesupport (>= 5.0.0)
57
81
  minitest
58
82
  nokogiri (>= 1.6)
59
83
  rails-html-sanitizer (1.6.0)
60
84
  loofah (~> 2.21)
61
85
  nokogiri (~> 1.14)
62
- railties (7.0.6)
63
- actionpack (= 7.0.6)
64
- activesupport (= 7.0.6)
65
- method_source
86
+ railties (7.1.3)
87
+ actionpack (= 7.1.3)
88
+ activesupport (= 7.1.3)
89
+ irb
90
+ rackup (>= 1.0.0)
66
91
  rake (>= 12.2)
67
- thor (~> 1.0)
68
- zeitwerk (~> 2.5)
92
+ thor (~> 1.0, >= 1.2.2)
93
+ zeitwerk (~> 2.6)
69
94
  rainbow (3.1.1)
70
95
  rake (13.0.6)
96
+ rdoc (6.6.2)
97
+ psych (>= 4.0.0)
71
98
  regexp_parser (2.4.0)
99
+ reline (0.4.2)
100
+ io-console (~> 0.5)
72
101
  rexml (3.2.5)
73
102
  rubocop (1.29.1)
74
103
  parallel (~> 1.10)
@@ -85,14 +114,17 @@ GEM
85
114
  rubocop (>= 1.7.0, < 2.0)
86
115
  rubocop-ast (>= 0.4.0)
87
116
  ruby-progressbar (1.11.0)
117
+ ruby2_keywords (0.0.5)
88
118
  standard (1.12.1)
89
119
  rubocop (= 1.29.1)
90
120
  rubocop-performance (= 1.13.3)
91
- thor (1.2.2)
121
+ stringio (3.1.0)
122
+ thor (1.3.0)
92
123
  tzinfo (2.0.6)
93
124
  concurrent-ruby (~> 1.0)
94
125
  unicode-display_width (2.1.0)
95
- zeitwerk (2.6.8)
126
+ webrick (1.8.1)
127
+ zeitwerk (2.6.13)
96
128
 
97
129
  PLATFORMS
98
130
  ruby
data/README.md CHANGED
@@ -155,7 +155,8 @@ preferred environment variables project-wide using a tool like
155
155
  [dotenv](https://github.com/bkeepers/dotenv).
156
156
 
157
157
 
158
- * **CYPRESS_RAILS_DIR** (default: `Dir.pwd`) the directory of your project
158
+ * **CYPRESS_RAILS_DIR** (default: `Dir.pwd`) the directory of your Rails project
159
+ * **CYPRESS_RAILS_CYPRESS_DIR** (default: _same value as `rails_dir`_) the directory of your Cypress project
159
160
  * **CYPRESS_RAILS_HOST** (default: `"127.0.0.1"`) the hostname to bind to
160
161
  * **CYPRESS_RAILS_PORT** (default: _a random available port_) the port to run
161
162
  the Rails test server on
data/exe/cypress-rails CHANGED
@@ -3,7 +3,7 @@
3
3
  ENV["RAILS_ENV"] ||= "test"
4
4
  require "pathname"
5
5
  require "cypress-rails"
6
- require Pathname.new(CypressRails::Config.new.dir).join("config/environment")
6
+ require Pathname.new(CypressRails::Config.new.rails_dir).join("config/environment")
7
7
 
8
8
  command = ARGV[0]
9
9
  case command
@@ -2,17 +2,19 @@ require_relative "env"
2
2
 
3
3
  module CypressRails
4
4
  class Config
5
- attr_accessor :dir, :host, :port, :base_path, :transactional_server, :cypress_cli_opts
5
+ attr_accessor :rails_dir, :cypress_dir, :host, :port, :base_path, :transactional_server, :cypress_cli_opts
6
6
 
7
7
  def initialize(
8
- dir: Env.fetch("CYPRESS_RAILS_DIR", default: Dir.pwd),
8
+ rails_dir: Env.fetch("CYPRESS_RAILS_DIR", default: Dir.pwd),
9
+ cypress_dir: Env.fetch("CYPRESS_RAILS_CYPRESS_DIR", default: rails_dir),
9
10
  host: Env.fetch("CYPRESS_RAILS_HOST", default: "127.0.0.1"),
10
11
  port: Env.fetch("CYPRESS_RAILS_PORT"),
11
12
  base_path: Env.fetch("CYPRESS_RAILS_BASE_PATH", default: "/"),
12
13
  transactional_server: Env.fetch("CYPRESS_RAILS_TRANSACTIONAL_SERVER", type: :boolean, default: true),
13
14
  cypress_cli_opts: Env.fetch("CYPRESS_RAILS_CYPRESS_OPTS", default: "")
14
15
  )
15
- @dir = dir
16
+ @rails_dir = rails_dir
17
+ @cypress_dir = cypress_dir
16
18
  @host = host
17
19
  @port = port
18
20
  @base_path = base_path
@@ -25,7 +27,8 @@ module CypressRails
25
27
 
26
28
  cypress-rails configuration:
27
29
  ============================
28
- CYPRESS_RAILS_DIR.....................#{dir.inspect}
30
+ CYPRESS_RAILS_DIR.....................#{rails_dir.inspect}
31
+ CYPRESS_RAILS_CYPRESS_DIR.............#{cypress_dir.inspect}
29
32
  CYPRESS_RAILS_HOST....................#{host.inspect}
30
33
  CYPRESS_RAILS_PORT....................#{port.inspect}
31
34
  CYPRESS_RAILS_BASE_PATH...............#{base_path.inspect}
@@ -4,8 +4,8 @@ module CypressRails
4
4
  class FindsBin
5
5
  LOCAL_PATH = "node_modules/.bin/cypress"
6
6
 
7
- def call(dir = Dir.pwd)
8
- local_path = Pathname.new(dir).join(LOCAL_PATH)
7
+ def call(cypress_dir = Dir.pwd)
8
+ local_path = Pathname.new(cypress_dir).join(LOCAL_PATH)
9
9
  if File.exist?(local_path)
10
10
  local_path
11
11
  else
@@ -19,8 +19,8 @@ module CypressRails
19
19
  })
20
20
  JS
21
21
 
22
- def call(dir = Dir.pwd)
23
- config_path = File.join(dir, "cypress.config.js")
22
+ def call(cypress_dir = Config.new.cypress_dir)
23
+ config_path = File.join(cypress_dir, "cypress.config.js")
24
24
  if !File.exist?(config_path)
25
25
  File.write(config_path, DEFAULT_CONFIG)
26
26
  puts "Cypress config initialized in `#{config_path}'"
@@ -24,12 +24,12 @@ module CypressRails
24
24
  port: config.port,
25
25
  transactional_server: config.transactional_server
26
26
  )
27
- bin = @finds_bin.call(config.dir)
27
+ bin = @finds_bin.call(config.cypress_dir)
28
28
 
29
29
  set_exit_hooks!(config)
30
30
 
31
31
  command = <<~EXEC
32
- CYPRESS_BASE_URL="http://#{server.host}:#{server.port}#{config.base_path}" "#{bin}" #{command} --project "#{config.dir}" #{config.cypress_cli_opts}
32
+ CYPRESS_BASE_URL="http://#{server.host}:#{server.port}#{config.base_path}" "#{bin}" #{command} --project "#{config.cypress_dir}" #{config.cypress_cli_opts}
33
33
  EXEC
34
34
 
35
35
  puts "\nLaunching Cypress…\n$ #{command}\n"
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.6.1"
2
+ VERSION = "0.7.0"
3
3
  end
data/script/test CHANGED
@@ -15,5 +15,7 @@ echo "---> Running tests"
15
15
  bundle exec rake
16
16
  ./script/test_example_app
17
17
 
18
+ bundle exec rake test
19
+
18
20
  echo "---> Job's done!"
19
21
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cypress-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-12 00:00:00.000000000 Z
11
+ date: 2024-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
- rubygems_version: 3.4.14
162
+ rubygems_version: 3.5.4
163
163
  signing_key:
164
164
  specification_version: 4
165
165
  summary: Helps you write Cypress tests of your Rails app