integration-tests-rails 1.0.1 → 1.0.2

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: 84c4035ac9b688b71a79030ebcd59a4d2bef7a8593a83c3ebf2f5c03fb9ee60a
4
- data.tar.gz: b454d46902e74f75b0d9c3679742c2698e1df3876fd17a7b364517b97f558044
3
+ metadata.gz: 12ec9fa8a5503ba21d04c3700fee04a00413b072a1adb9918fb75714c3e92c8d
4
+ data.tar.gz: 50c08830a21433430b183ae184df578656108d8ca2257317034f686638d6e619
5
5
  SHA512:
6
- metadata.gz: c09e828485249c348941d7985873e1b943a0a153a47a52686550a50cdea0c02619aa0a2a74fc4b771705b769a7595df2e67de1523968043a89f0ee401b5b4c09
7
- data.tar.gz: fd35f0e92786ba0a15b5b811a10e5a64b15ab5ff4d908b68f8987243d39057017c925369881f12174060cbc6f2ac5a51e1fda3eb8e6aa84e42e2bfbb3bee5895
6
+ metadata.gz: 9ac0c50347e0bfd28fae19f6495fa61ce1977a863929ed99885ed7c1c0b34c1627a3a5fc82dc9a010ba6c6fcf1cb11340191a7e57a1c31862401581759873ad7
7
+ data.tar.gz: 3ac047eb7ff7c4da5698b9ea90eb9b0f4e5dedf8f0b5992423a87a582a830b70f339cf3d0309232cf3d0a554a8e2a1fce979e97d8910cf9d07263a75d2879691
data/README.md CHANGED
@@ -90,8 +90,6 @@ DEFAULT_HTML_CONTENT = <<~HTML.squish
90
90
  <meta name="turbo-visit-control" content="reload">
91
91
  <%= csrf_meta_tags %>
92
92
  <%= csp_meta_tag %>
93
- <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
94
- <%= stylesheet_link_tag 'custom', "data-turbo-track": "reload" %>
95
93
  <%= javascript_importmap_tags %>
96
94
  </head>
97
95
  <body>
@@ -100,7 +98,11 @@ DEFAULT_HTML_CONTENT = <<~HTML.squish
100
98
  HTML
101
99
  ```
102
100
 
103
- Since vendored JavaScript are not included by default, additional tags may be required to load them. For example, if there exists a `custom_code.js` file in `app/javascript` and `vendor.min.js` file in `app/assets/javascripts/plugins`:
101
+ Since vendored JavaScript are not included by default, additional tags may be required to load them. Stylesheets can also be loaded if needed. For example, files can be included as follows:
102
+ - `custom_code.js` file in `app/javascript`
103
+ - `vendor.min.js` file in `app/assets/javascripts/plugins`
104
+ - `app.css` file in `app/assets/stylesheets`
105
+ - `custom.css` file in `app/assets/stylesheets`
104
106
 
105
107
  ```ruby
106
108
  <<~HTML.squish
@@ -112,8 +114,10 @@ Since vendored JavaScript are not included by default, additional tags may be re
112
114
  <meta name="turbo-visit-control" content="reload">
113
115
  <%= csrf_meta_tags %>
114
116
  <%= csp_meta_tag %>
117
+
115
118
  <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
116
119
  <%= stylesheet_link_tag 'custom', "data-turbo-track": "reload" %>
120
+
117
121
  <%= javascript_importmap_tags %>
118
122
 
119
123
  <script type="module">
@@ -198,6 +202,47 @@ Refer to [Cuprite](https://github.com/rubycdp/cuprite) and [Capybara](https://gi
198
202
 
199
203
  After the tests (successful, failed or cancelled), coverage reports will be generated in `coverage/javascript` by default.
200
204
 
205
+ ## Example Setups
206
+
207
+ ### Using Docker Desktop
208
+
209
+ If you want to use the [Alpine Chrome](https://hub.docker.com/r/zenika/alpine-chrome) image, this is definitely possible.
210
+
211
+ Open Docker Desktop, Settings, Resources then Network. Check the Enable host networking option then Apply.
212
+
213
+ Your docker compose file may contain this entry:
214
+
215
+ ```yaml
216
+ # compose.yml
217
+
218
+ services:
219
+ chrome:
220
+ image: zenika/alpine-chrome:latest
221
+ network_mode: host
222
+ command: >
223
+ --no-sandbox
224
+ --disable-dev-shm-usage
225
+ --disable-gpu
226
+ --disable-web-security
227
+ --remote-debugging-address=0.0.0.0
228
+ --remote-debugging-port=9222
229
+ --headless
230
+ shm_size: 2gb
231
+ ```
232
+
233
+ Setting up the gem:
234
+
235
+ ```ruby
236
+ # capybara_helper.rb
237
+
238
+ IntegrationTestsRails.setup do |config|
239
+ config.chrome_url = 'ws://localhost:9222'
240
+ config.remote = true
241
+ config.server_host = '0.0.0.0'
242
+ config.server_port = 9888
243
+ end
244
+ ```
245
+
201
246
  ## Contributing
202
247
 
203
248
  1. Fork the repository.
@@ -12,9 +12,13 @@ module IntegrationTestsRails
12
12
  <meta name="turbo-visit-control" content="reload">
13
13
  <%= csrf_meta_tags %>
14
14
  <%= csp_meta_tag %>
15
- <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
16
- <%= stylesheet_link_tag 'custom', "data-turbo-track": "reload" %>
15
+
16
+ <!-- If there are stylesheets to include, include them here for testing. -->
17
+ <!-- E.g. The line below loads a stylesheet file located in app/assets/stylesheets/app.css -->
18
+ <%#= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
19
+
17
20
  <%= javascript_importmap_tags %>
21
+
18
22
  <!-- If there are JavaScript libraries not globally available, include them here for testing.-->
19
23
  <!-- E.g. The block below shows how to import a JavaScript module and attach it to the window object. -->
20
24
  <!-- The file is located in app/javascripts/libs/my_library.js -->
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IntegrationTestsRails
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: integration-tests-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tien