evil_systems 0.1.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71fc1fd78c7e338e5869d1c31bf85054b5389e71ecfe3a5dcdfe43bd279c299f
4
- data.tar.gz: 7ca36addc253368985063423d77eec1c05205cee289ffb5fea3df3132be509fd
3
+ metadata.gz: a1800bf37ee2b05f01d152d6b81a394d2b3b46632db9698d4482aad091143cd4
4
+ data.tar.gz: 27f9e537d9812cf307ad5075555f98ec7a28a3eee53f662bbb508a2e3f67471a
5
5
  SHA512:
6
- metadata.gz: 13b529e27d3846283e0370beac109b6e3644bf111453df9a3929d00914849edc3e5ad172920d573120bd217b35a0e55ca27ed2a605a81330584dcc79a2e89e24
7
- data.tar.gz: f1f3cb51069f42250363350a3fd1dec2bc7b8d9a6dd980a7348c85ef1536f41573b49bb93a5d762e0a204f728db478878b0597b232014b2b669909172eca4b6d
6
+ metadata.gz: 0505da134fba919c92bc70892b41550ce81ca422ca14e0caf9efc60ed5ea449dddcff00854c039fd89a95ad4edb988bdff5b16cb4ef5799720d6296076365e14
7
+ data.tar.gz: 4a45024f2ec7bcae400a2804b39f5a87e4d73994ea419f795aa1dffdc8062ef257b95f9e229b77b5c9ad7646ffd46026a767e719dddb270a32860f42447f3a39
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 1.0.0
2
+
3
+ - 🚨 BREAKING CHANGE - Renamed `:cuprite` driver to
4
+ `:evil_cuprite` to avoid naming collision in Rails 7.
5
+ <https://github.com/ParamagicDev/evil_systems/pull/7>
6
+
7
+ - Added `wait_for_network_idle!`
8
+ - Added `:skip_task` to avoid rake tasks all together.
9
+ <https://github.com/evil_systems/pull/8>
10
+
11
+ - Updated test suite to Rails 7
12
+
13
+ ## 0.2.0
14
+
15
+ - Disable animations by default @julianrubisch <https://github.com/ParamagicDev/evil_systems/commit/cf72d1189c8bd8b72f130909f209f543a52aaf50>
16
+
17
+ ## 0.1.3
18
+
19
+ - Add Slowmo option
20
+
1
21
  ## 0.1.1
2
22
 
3
23
  - Fix readme issue
data/README.md CHANGED
@@ -69,7 +69,7 @@ require 'evil_systems'
69
69
  EvilSystems.initial_setup
70
70
 
71
71
  class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
72
- driven_by :cuprite
72
+ driven_by :evil_cuprite
73
73
 
74
74
  include EvilSystems::Helpers
75
75
  end
@@ -83,10 +83,10 @@ end
83
83
 
84
84
  ## Usage
85
85
 
86
- `EvilSystems.initial_setup` takes two keyword arguments, `:task`, and
87
- `silent`.
86
+ `EvilSystems.initial_setup` takes three keyword arguments, `:task`, and
87
+ `silent`, `skip_task`.
88
88
 
89
- Both arguments have to do with precompiling assets.
89
+ They all have to do with precompiling assets.
90
90
 
91
91
  `:silent` by default is set to `true` and will only tell you when assets
92
92
  are compiling, and how long the compilation took.
@@ -94,6 +94,8 @@ are compiling, and how long the compilation took.
94
94
  `:task` defaults to `assets:precompile`, System of a test uses
95
95
  `webpacker:compile`.
96
96
 
97
+ `:skip_task` when `true` says you dont want to run any Rake tasks. Default is `false`
98
+
97
99
  Example:
98
100
 
99
101
  ```rb
@@ -102,11 +104,11 @@ EvilSystems.initial_setup(task: "webpacker:compile", silent: false)
102
104
 
103
105
  ### Settings
104
106
 
105
- - [x] - Automatically registers a `:cuprite` driver if `Capybara::Cuprite`
107
+ - [x] - Automatically registers a `:evil_cuprite` driver if `Capybara::Cuprite`
106
108
  is defined.
107
109
 
108
110
  - [x] - Automatically sets Capybara's default and javascript driver to
109
- `:cuprite`
111
+ `:evil_cuprite`
110
112
 
111
113
  - [x] - Automatically sets `Capybara.app_host`
112
114
 
@@ -176,7 +178,10 @@ pause
176
178
 
177
179
  # Opens a Pry or IRB repl. Will use Pry if Pry is defined, fallsback
178
180
  # to debugging with IRB
179
- debug
181
+ debug binding
182
+
183
+ # waits to make sure theres no active connections.
184
+ wait_for_network_idle!
180
185
  ```
181
186
 
182
187
  ### Env Variables
@@ -189,6 +194,8 @@ ENV["CAPYBARA_ARTIFACTS"] # used for Capybara.save_path
189
194
  ENV["CHROME_URL"] # used for setting a remote chrome instance for Cuprite
190
195
  ENV["PROCESS_TIMEOUT"] # How long to wait before killing the process, default is 5 seconds
191
196
  ENV["CI"] # Whether or not to run Cuprite in headless mode, defaults to true.
197
+ ENV["SLOWMO"] # Delay in seconds before sending a command (default 0). Also see https://github.com/rubycdp/ferrum#customization
198
+ ENV["DISABLE_ANIMATION"] # Configure whether Capybara should render animations, default is true
192
199
  ```
193
200
 
194
201
  ## I don't want to use Cuprite.
@@ -18,5 +18,11 @@ module EvilSystems
18
18
 
19
19
  page.driver.pause
20
20
  end
21
+
22
+ # Convenience method to access the drivers `wait_for_network_idle`
23
+ # @see https://github.com/rubycdp/cuprite/blob/47d8949f30dea3d97dba70d8643abce861e0d652/README.md#network-traffic
24
+ def wait_for_network_idle!
25
+ page.driver.wait_for_network_idle
26
+ end
21
27
  end
22
28
  end
@@ -6,7 +6,7 @@ module EvilSystems
6
6
  # See https://github.com/rubycdp/cuprite
7
7
  module RegisterCuprite
8
8
  # Registers the Cuprite driver. Can be used via:
9
- # driven_by :cuprite, using: :chrome, screen_size: [1400, 1400]
9
+ # driven_by :evil_cuprite, using: :chrome, screen_size: [1400, 1400]
10
10
  # The initial setup prior to the class ApplicationSystemTestCase, runs before the entire test suite.
11
11
  # @return [void]
12
12
  def self.initial_setup
@@ -20,7 +20,7 @@ module EvilSystems
20
20
 
21
21
  remote_options = RemoteChrome.options
22
22
 
23
- ::Capybara.register_driver(:cuprite) do |app|
23
+ ::Capybara.register_driver(:evil_cuprite) do |app|
24
24
  ::Capybara::Cuprite::Driver.new(
25
25
  app,
26
26
  **{
@@ -28,6 +28,7 @@ module EvilSystems
28
28
  browser_options: RemoteChrome.connected? ? {"no-sandbox" => nil} : {},
29
29
  headless: ENV.fetch("CI", "true") == "true",
30
30
  process_timeout: process_timeout,
31
+ slowmo: ENV.fetch("SLOWMO", 0).to_f,
31
32
  inspector: true
32
33
  }.merge(remote_options)
33
34
  )
@@ -36,4 +37,4 @@ module EvilSystems
36
37
  end
37
38
  end
38
39
 
39
- Capybara.default_driver = Capybara.javascript_driver = :cuprite
40
+ Capybara.default_driver = Capybara.javascript_driver = :evil_cuprite
@@ -29,6 +29,9 @@ module EvilSystems
29
29
  # Make server listening on all hosts
30
30
  ::Capybara.server_host = "0.0.0.0"
31
31
 
32
+ # Silence puma
33
+ ::Capybara.server = :puma, {Silent: true}
34
+
32
35
  # Don't wait too long in `have_xyz` matchers
33
36
  ::Capybara.default_max_wait_time = 2
34
37
 
@@ -37,6 +40,9 @@ module EvilSystems
37
40
 
38
41
  # Where to store artifacts (e.g. screenshots, downloaded files, etc.)
39
42
  ::Capybara.save_path = ENV.fetch("CAPYBARA_ARTIFACTS", "./tmp/capybara")
43
+
44
+ # Disable animations in Capybara by default
45
+ ::Capybara.disable_animation = ENV.fetch("DISABLE_ANIMATION", "true") == "true"
40
46
  end
41
47
 
42
48
  private_class_method def self.prepend_session_to_capybara
@@ -1,3 +1,3 @@
1
1
  module EvilSystems
2
- VERSION = "0.1.1"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/evil_systems.rb CHANGED
@@ -11,9 +11,12 @@ module EvilSystems
11
11
  # @see Settings#initial_setup
12
12
  # @see RegisterCuprite#initial_setup
13
13
  # @see PrecompileAssets#initial_setup
14
- def self.initial_setup(task: "assets:precompile", silent: true)
14
+ def self.initial_setup(task: "assets:precompile", silent: true, skip_task: false)
15
15
  Settings.initial_setup
16
16
  RegisterCuprite.initial_setup
17
+
18
+ return if skip_task
19
+
17
20
  PrecompileAssets.initial_setup(task: task, silent: silent)
18
21
  end
19
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evil_systems
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ParamagicDev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-08 00:00:00.000000000 Z
11
+ date: 2022-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 1.0.0
55
- description:
55
+ description:
56
56
  email:
57
57
  - konnor5456@gmail.com
58
58
  executables: []
@@ -80,7 +80,7 @@ metadata:
80
80
  homepage_uri: https://github.com/paramagicdev/evil_systems
81
81
  source_code_uri: https://github.com/paramagicdev/evil_systems
82
82
  changelog_uri: https://github.com/paramagicdev/evil_systems/CHANGELOG.md
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -95,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.1.6
99
- signing_key:
98
+ rubygems_version: 3.3.3
99
+ signing_key:
100
100
  specification_version: 4
101
101
  summary: Fully integrated setup based on EvilMartians system of a test
102
102
  test_files: []