cypress_rails 0.6.0 → 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
  SHA1:
3
- metadata.gz: 70d8ba1c2c997e512573b35b6823f9b14f930262
4
- data.tar.gz: b75040d5e579711328d36e3691fc92aa9361505a
3
+ metadata.gz: ee86222f4365d8efd1ec8ffdb64f3b6065a0fa8b
4
+ data.tar.gz: ce0f3e7efc249c3fbae6ceb43ef151e3c49fae92
5
5
  SHA512:
6
- metadata.gz: 6481e794afc07e83d8786feccf7883b4cf9c8f35a8a156aae299dbe31d01fe2d42d1b332f3ca4da9e1f43b2faf67a5f031a403cd0d625c0a40b655d57ee0d280
7
- data.tar.gz: 2018f01916a2632972d136936679b39b7c8d15b90b49399d464d5a9af7ca2c73a2192443d352212cee4f5640cf4df3c1c34665b4f58a32341e9faecf13f12a06
6
+ metadata.gz: e58b1ef712868608bddf3a74c51eec2248b0cf2fd22f7ca788d5a7054bf0d3023ccce3c8209842a0c8ddbed2750c1cd5e7dcce0a6ef5d957e4eb697d390bceb7
7
+ data.tar.gz: b0fdf6f60eb4dc0349888644746ad6d700c5aaa63532a6b43805f123f84f20a58454778942d98715f6265f2c6de2a56df3cafc126fb0c9288bfb50c5547858b0
data/ChangeLog.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 0.7.0 / 2018-07-12
2
+
3
+ * add --browser option and pass the selected browser to the run method
4
+ if selected browser is chrome, don't record video
5
+
1
6
  ### 0.4.2 / 2018-05-25
2
7
 
3
8
  * add --record to cypress when CYPRESS_RECORD_KEY is present in #run method
@@ -6,7 +6,7 @@ require "cypress_rails/server"
6
6
 
7
7
  module CypressRails
8
8
  Config = Struct.new(
9
- :command, :cypress_bin_path, :host, :log_path, :tests_path, :healthcheck_url
9
+ :command, :cypress_bin_path, :host, :log_path, :tests_path, :healthcheck_url, :browser
10
10
  )
11
11
 
12
12
  class CLI < Thor
@@ -41,13 +41,20 @@ module CypressRails
41
41
  url to ping the server before running tests (you don't need the port, it will be injected)
42
42
  DESC
43
43
  aliases: %w(-u)
44
+ class_option :browser,
45
+ type: :string,
46
+ desc: <<~DESC,
47
+ which browser to use with test command, allowed values: chrome, electron
48
+ DESC
49
+ default: "chrome",
50
+ aliases: %w(-b)
44
51
 
45
52
  desc "test", "Run all tests in headless mode"
46
53
  def test
47
54
  server.start do |host, port|
48
55
  exit Runner.new(
49
56
  host: host, port: port, bin_path: config.cypress_bin_path, tests_path: config.tests_path
50
- ).run
57
+ ).run(config.browser)
51
58
  end
52
59
  end
53
60
 
@@ -69,7 +76,7 @@ module CypressRails
69
76
  def config
70
77
  @config ||= Config.new(
71
78
  *options.values_at(
72
- :command, :cypress_bin_path, :host, :log_path, :tests_path, :healthcheck_url
79
+ :command, :cypress_bin_path, :host, :log_path, :tests_path, :healthcheck_url, :browser
73
80
  )
74
81
  )
75
82
  end
@@ -10,9 +10,11 @@ module CypressRails
10
10
  @output = output
11
11
  end
12
12
 
13
- def run
13
+ def run(browser = "chrome")
14
14
  command = [bin_path, "run", "-P #{tests_path}"]
15
+ command << "--browser #{browser}" if %w(chrome electron).include?(browser)
15
16
  command << "--record" if ENV.fetch("CYPRESS_RECORD_KEY", false)
17
+ command << "--config video=false" if browser == "chrome"
16
18
  pid = Process.spawn(
17
19
  {
18
20
  "CYPRESS_app_host" => host,
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CypressRails
4
4
  # cypress_rails version
5
- VERSION = "0.6.0"
5
+ VERSION = "0.7.0"
6
6
  end
@@ -25,7 +25,7 @@ RSpec.describe CypressRails::Runner do
25
25
  bin_path: bin_path,
26
26
  tests_path: tests_path,
27
27
  output: w
28
- ).run
28
+ ).run("electron")
29
29
  end
30
30
  result = r.read
31
31
  expect(result).to match(/Visiting the root address/)
@@ -43,7 +43,7 @@ RSpec.describe CypressRails::Runner do
43
43
  bin_path: bin_path,
44
44
  tests_path: tests_path,
45
45
  output: w
46
- ).run
46
+ ).run("electron")
47
47
  end
48
48
  r.read
49
49
  r.close
@@ -63,7 +63,7 @@ RSpec.describe CypressRails::Runner do
63
63
  bin_path: bin_path,
64
64
  tests_path: tests_path,
65
65
  output: w
66
- ).run
66
+ ).run("electron")
67
67
  end
68
68
  result = r.read
69
69
  expect(result).to match(/Visiting the root address/)
@@ -81,7 +81,7 @@ RSpec.describe CypressRails::Runner do
81
81
  bin_path: bin_path,
82
82
  tests_path: tests_path,
83
83
  output: w
84
- ).run
84
+ ).run("electron")
85
85
  end
86
86
  r.read
87
87
  r.close
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.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Szymon Szeliga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-29 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor