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 +4 -4
- data/ChangeLog.md +5 -0
- data/lib/cypress_rails/cli.rb +10 -3
- data/lib/cypress_rails/runner.rb +3 -1
- data/lib/cypress_rails/version.rb +1 -1
- data/spec/cypress_rails/runner_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee86222f4365d8efd1ec8ffdb64f3b6065a0fa8b
|
4
|
+
data.tar.gz: ce0f3e7efc249c3fbae6ceb43ef151e3c49fae92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e58b1ef712868608bddf3a74c51eec2248b0cf2fd22f7ca788d5a7054bf0d3023ccce3c8209842a0c8ddbed2750c1cd5e7dcce0a6ef5d957e4eb697d390bceb7
|
7
|
+
data.tar.gz: b0fdf6f60eb4dc0349888644746ad6d700c5aaa63532a6b43805f123f84f20a58454778942d98715f6265f2c6de2a56df3cafc126fb0c9288bfb50c5547858b0
|
data/ChangeLog.md
CHANGED
data/lib/cypress_rails/cli.rb
CHANGED
@@ -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
|
data/lib/cypress_rails/runner.rb
CHANGED
@@ -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,
|
@@ -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.
|
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-
|
11
|
+
date: 2018-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|