cypress-rails 0.2.0 → 0.3.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: af0f5454fad2f6123912ffa40ce321337d72b38a46f416137bff14175ca54afc
4
- data.tar.gz: 203880ed6ddba42e5e509ceda78561c1bde41b4df2edb5555f74a66f934a8351
3
+ metadata.gz: 6cbbbc003d33e8f71d926860e428093061ffddf5c10adf67e4da34f4a4a5a763
4
+ data.tar.gz: f9e5ce0881ccd57b8afa2d6b9839269f5999ac905cb3c2cd06d44db2a36a53ef
5
5
  SHA512:
6
- metadata.gz: 4ccc3764f1169131326d8b8d4a1a614526343dc3b9ba4d102ab009fdad3199f00b73a5fab05b282e346bd18a11f2564f257f355dd8a884b32147f80b5faa09ec
7
- data.tar.gz: 66023c5a4478c9a2ff6a8affd906808cc1a58322c9a09fc3c46031ace2dc26bc97eec3c1a2e4b30d727ce7d88814408c5e4609e8c5d08cb2de16167e0650a6d4
6
+ metadata.gz: d1568bc421e21b5a61d3f35a133fe5e0bafcbf7830164457ea37f4c3d9a1f0c8e194b0446d93912a816a29bf0dce2404c48f1d848f33bda152cc75d8ea7c28a9
7
+ data.tar.gz: 2408279b528acb1139dca550f19fae8cb5d4e5fb116d9eb26512c012d4549c44afe98d45ef29972aff96d3724c2afc63304e5c303cbe7f3f3d88668fbf590974
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.3.0
4
+
5
+ * Add a `CYPRESS_RAILS_BASE_PATH` option which will be appended to the
6
+ `CYPRESS_BASE_URL` option that cypress-rails sets when launching cypress
7
+ commands. Apps that set `baseUrl` to something other than "/" can set this env
8
+ var to match for consistent behavior (or else set it using Cypress.config in a
9
+ support file)
10
+
11
+ ## 0.2.0
12
+
13
+ * If `RAILS_ENV` has been explicitly set when the CLI or rake task is run,
14
+ respect that set value instead of overriding it to "test"
15
+
3
16
  ## 0.1.3
4
17
 
5
18
  * Improve behavior of SIGINT (Ctrl-C) so a traceback isn't printed and stdout
data/Gemfile.lock CHANGED
@@ -1,32 +1,32 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cypress-rails (0.2.0)
4
+ cypress-rails (0.3.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 (6.0.2.2)
12
- actionview (= 6.0.2.2)
13
- activesupport (= 6.0.2.2)
11
+ actionpack (6.0.3)
12
+ actionview (= 6.0.3)
13
+ activesupport (= 6.0.3)
14
14
  rack (~> 2.0, >= 2.0.8)
15
15
  rack-test (>= 0.6.3)
16
16
  rails-dom-testing (~> 2.0)
17
17
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.0.2.2)
19
- activesupport (= 6.0.2.2)
18
+ actionview (6.0.3)
19
+ activesupport (= 6.0.3)
20
20
  builder (~> 3.1)
21
21
  erubi (~> 1.4)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activesupport (6.0.2.2)
24
+ activesupport (6.0.3)
25
25
  concurrent-ruby (~> 1.0, >= 1.0.2)
26
26
  i18n (>= 0.7, < 2)
27
27
  minitest (~> 5.1)
28
28
  tzinfo (~> 1.1)
29
- zeitwerk (~> 2.2)
29
+ zeitwerk (~> 2.2, >= 2.2.2)
30
30
  ast (2.4.0)
31
31
  builder (3.2.4)
32
32
  concurrent-ruby (1.1.6)
@@ -45,7 +45,7 @@ GEM
45
45
  nokogiri (1.10.9)
46
46
  mini_portile2 (~> 2.4.0)
47
47
  parallel (1.19.1)
48
- parser (2.7.0.4)
48
+ parser (2.7.1.2)
49
49
  ast (~> 2.4.0)
50
50
  puma (4.3.3)
51
51
  nio4r (~> 2.0)
@@ -57,32 +57,34 @@ GEM
57
57
  nokogiri (>= 1.6)
58
58
  rails-html-sanitizer (1.3.0)
59
59
  loofah (~> 2.3)
60
- railties (6.0.2.2)
61
- actionpack (= 6.0.2.2)
62
- activesupport (= 6.0.2.2)
60
+ railties (6.0.3)
61
+ actionpack (= 6.0.3)
62
+ activesupport (= 6.0.3)
63
63
  method_source
64
64
  rake (>= 0.8.7)
65
65
  thor (>= 0.20.3, < 2.0)
66
66
  rainbow (3.0.0)
67
67
  rake (13.0.1)
68
- rubocop (0.79.0)
68
+ rexml (3.2.4)
69
+ rubocop (0.82.0)
69
70
  jaro_winkler (~> 1.5.1)
70
71
  parallel (~> 1.10)
71
72
  parser (>= 2.7.0.1)
72
73
  rainbow (>= 2.2.2, < 4.0)
74
+ rexml
73
75
  ruby-progressbar (~> 1.7)
74
- unicode-display_width (>= 1.4.0, < 1.7)
76
+ unicode-display_width (>= 1.4.0, < 2.0)
75
77
  rubocop-performance (1.5.2)
76
78
  rubocop (>= 0.71.0)
77
79
  ruby-progressbar (1.10.1)
78
- standard (0.2.1)
79
- rubocop (~> 0.79.0)
80
- rubocop-performance (~> 1.5.1)
80
+ standard (0.4.1)
81
+ rubocop (~> 0.82.0)
82
+ rubocop-performance (~> 1.5.2)
81
83
  thor (1.0.1)
82
84
  thread_safe (0.3.6)
83
85
  tzinfo (1.2.7)
84
86
  thread_safe (~> 0.1)
85
- unicode-display_width (1.6.1)
87
+ unicode-display_width (1.7.0)
86
88
  zeitwerk (2.3.0)
87
89
 
88
90
  PLATFORMS
data/README.md CHANGED
@@ -160,6 +160,10 @@ preferred environment variables project-wide using a tool like
160
160
  * **CYPRESS_RAILS_DIR** (default: `Dir.pwd`) the directory of your project
161
161
  * **CYPRESS_RAILS_PORT** (default: _a random available port_) the port to run
162
162
  the Rails test server on
163
+ * **CYPRESS_RAILS_BASE_PATH** (default: `"/"`) the base path for all Cypress's
164
+ requests to the app (e.g. via `cy.visit()`). If you've customized your
165
+ `baseUrl` setting (e.g. in `cypress.json`), you'll need to duplicate it with
166
+ this environment variable
163
167
  * **CYPRESS_RAILS_TRANSACTIONAL_SERVER** (default: `true`) when true, will start
164
168
  a transaction on all database connections before launching the server. In
165
169
  general this means anything done during `cypress open` or `cypress run` will
@@ -305,5 +309,12 @@ adopting Cypress and writing a bunch of browser tests for every application.
305
309
  But, if the above points sound like solutions to problems you experience, you
306
310
  might consider trying it out.
307
311
 
312
+ ## Code of Conduct
308
313
 
314
+ This project follows Test Double's [code of
315
+ conduct](https://testdouble.com/code-of-conduct) for all community interactions,
316
+ including (but not limited to) one-on-one communications, public posts/comments,
317
+ code reviews, pull requests, and GitHub issues. If violations occur, Test Double
318
+ will take any action they deem appropriate for the infraction, up to and
319
+ including blocking a user from the organization's repositories.
309
320
 
@@ -1,10 +1,11 @@
1
1
  require_relative "env"
2
2
 
3
3
  module CypressRails
4
- class Config < Struct.new(:dir, :port, :transactional_server, :cypress_cli_opts, keyword_init: true)
4
+ class Config < Struct.new(:dir, :port, :base_path, :transactional_server, :cypress_cli_opts, keyword_init: true)
5
5
  def initialize(
6
6
  dir: Env.fetch("CYPRESS_RAILS_DIR", default: Dir.pwd),
7
7
  port: Env.fetch("CYPRESS_RAILS_PORT"),
8
+ base_path: Env.fetch("CYPRESS_RAILS_BASE_PATH", default: "/"),
8
9
  transactional_server: Env.fetch("CYPRESS_RAILS_TRANSACTIONAL_SERVER", type: :boolean, default: true),
9
10
  cypress_cli_opts: Env.fetch("CYPRESS_RAILS_CYPRESS_OPTS", default: "")
10
11
  )
@@ -18,6 +19,7 @@ module CypressRails
18
19
  ============================
19
20
  CYPRESS_RAILS_DIR.....................#{dir.inspect}
20
21
  CYPRESS_RAILS_PORT....................#{port.inspect}
22
+ CYPRESS_RAILS_BASE_PATH...............#{base_path.inspect}
21
23
  CYPRESS_RAILS_TRANSACTIONAL_SERVER....#{transactional_server.inspect}
22
24
  CYPRESS_RAILS_CYPRESS_OPTS............#{cypress_cli_opts.inspect}
23
25
 
@@ -27,9 +27,12 @@ module CypressRails
27
27
 
28
28
  set_exit_hooks!(config)
29
29
 
30
- system <<~EXEC
31
- CYPRESS_BASE_URL=http://#{server.host}:#{server.port} "#{bin}" #{command} --project "#{config.dir}" #{config.cypress_cli_opts}
30
+ command = <<~EXEC
31
+ CYPRESS_BASE_URL="http://#{server.host}:#{server.port}#{config.base_path}" "#{bin}" #{command} --project "#{config.dir}" #{config.cypress_cli_opts}
32
32
  EXEC
33
+
34
+ puts "\nLaunching Cypress…\n$ #{command}\n"
35
+ system command
33
36
  end
34
37
 
35
38
  private
@@ -84,10 +84,6 @@ module CypressRails
84
84
  self
85
85
  end
86
86
 
87
- def base_url
88
- "http#{"s" if using_ssl?}://#{host}:#{port}"
89
- end
90
-
91
87
  private
92
88
 
93
89
  def middleware
@@ -1,3 +1,3 @@
1
1
  module CypressRails
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.0
4
+ version: 0.3.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: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties