decidim-dev 0.27.8 → 0.28.0.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/commands/decidim/dummy_resources/create_dummy_resource.rb +0 -1
- data/app/events/decidim/dummy_resources/dummy_resource_event.rb +10 -0
- data/app/jobs/decidim/dummy_resources/hide_all_created_by_author_job.rb +13 -0
- data/app/models/decidim/dummy_resources/application_record.rb +9 -0
- data/app/models/decidim/dummy_resources/coauthorable_dummy_resource.rb +10 -0
- data/app/models/decidim/dummy_resources/dummy_resource.rb +93 -0
- data/app/models/decidim/dummy_resources/nested_dummy_resource.rb +10 -0
- data/app/packs/src/decidim/dev/accessibility.js +3 -3
- data/app/packs/src/decidim/dev/test/custom_map_factory.js +1 -1
- data/app/packs/stylesheets/decidim/dev/_accessibility.scss +24 -24
- data/app/packs/stylesheets/decidim/dev/_map.scss +10 -0
- data/app/packs/stylesheets/decidim/dev.scss +1 -0
- data/app/presenters/decidim/dummy_resources/official_author_presenter.rb +33 -0
- data/app/serializers/decidim/dummy_resources/dummy_serializer.rb +21 -0
- data/app/views/decidim/dummy_resources/dummy_resources/show.html.erb +22 -12
- data/config/locales/ar.yml +0 -1
- data/config/locales/bg.yml +0 -9
- data/config/locales/de.yml +1 -1
- data/config/locales/el.yml +0 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/es-MX.yml +1 -1
- data/config/locales/es-PY.yml +1 -1
- data/config/locales/eu.yml +3 -3
- data/config/locales/gl.yml +0 -1
- data/config/locales/hu.yml +2 -3
- data/config/locales/id-ID.yml +0 -1
- data/config/locales/it.yml +0 -1
- data/config/locales/lv.yml +0 -1
- data/config/locales/nl.yml +0 -1
- data/config/locales/no.yml +0 -1
- data/config/locales/pl.yml +0 -9
- data/config/locales/pt-BR.yml +0 -9
- data/config/locales/pt.yml +0 -1
- data/config/locales/ru.yml +0 -1
- data/config/locales/sk.yml +0 -1
- data/config/locales/sv.yml +0 -1
- data/config/locales/tr-TR.yml +0 -1
- data/config/locales/zh-CN.yml +0 -1
- data/config/rubocop/disabled.yml +11 -0
- data/config/rubocop/faker.yml +480 -0
- data/config/rubocop/rails.yml +105 -0
- data/config/rubocop/rspec.yml +69 -0
- data/config/rubocop/ruby.yml +1207 -0
- data/lib/decidim/dev/assets/import_participatory_space_private_users.csv +2 -2
- data/lib/decidim/dev/assets/import_participatory_space_private_users_invalid_col_sep.csv +2 -0
- data/lib/decidim/dev/assets/import_participatory_space_private_users_nok.csv +2 -2
- data/lib/decidim/dev/assets/import_participatory_space_private_users_with_bom.csv +1 -1
- data/lib/decidim/dev/assets/iso-8859-15.md +1 -1
- data/lib/decidim/dev/assets/participatory_text.md +4 -2
- data/lib/decidim/dev/assets/verify_user_groups.csv +22 -22
- data/lib/decidim/dev/engine.rb +4 -3
- data/lib/decidim/dev/test/factories.rb +3 -5
- data/lib/decidim/dev/test/form_to_param_shared_examples.rb +1 -1
- data/lib/decidim/dev/test/promoted_participatory_processes_shared_examples.rb +9 -9
- data/lib/decidim/dev/test/rspec_support/accessibility_examples.rb +119 -1
- data/lib/decidim/dev/test/rspec_support/attachment_helpers.rb +2 -2
- data/lib/decidim/dev/test/rspec_support/bullet.rb +32 -0
- data/lib/decidim/dev/test/rspec_support/capybara.rb +26 -25
- data/lib/decidim/dev/test/rspec_support/cell_matchers.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/component.rb +1 -311
- data/lib/decidim/dev/test/rspec_support/component_context.rb +10 -10
- data/lib/decidim/dev/test/rspec_support/confirmation_helpers.rb +18 -14
- data/lib/decidim/dev/test/rspec_support/data_consent.rb +2 -2
- data/lib/decidim/dev/test/rspec_support/dynamic_attach.rb +19 -4
- data/lib/decidim/dev/test/rspec_support/editor_context.rb +35 -0
- data/lib/decidim/dev/test/rspec_support/engine_examples.rb +15 -0
- data/lib/decidim/dev/test/rspec_support/filters.rb +11 -0
- data/lib/decidim/dev/test/rspec_support/forms_validations.rb +20 -0
- data/lib/decidim/dev/test/rspec_support/geocoder.rb +3 -3
- data/lib/decidim/dev/test/rspec_support/helpers.rb +187 -34
- data/lib/decidim/dev/test/rspec_support/imports_controller_shared_examples.rb +11 -11
- data/lib/decidim/dev/test/rspec_support/tom_select.rb +26 -0
- data/lib/decidim/dev/test/rspec_support/translation_helpers.rb +8 -8
- data/lib/decidim/dev/test/rspec_support/warden.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/webmock.rb +1 -1
- data/lib/decidim/dev/test/rspec_support/webpacker.rb +4 -22
- data/lib/decidim/dev/test/spec_helper.rb +14 -3
- data/lib/decidim/dev/test/w3c_rspec_validators_overrides.rb +1 -5
- data/lib/decidim/dev/version.rb +1 -1
- data/lib/decidim/dev.rb +9 -0
- data/lib/decidim/dummy_resources/admin.rb +8 -0
- data/lib/decidim/dummy_resources/admin_engine.rb +43 -0
- data/lib/decidim/dummy_resources/component.rb +94 -0
- data/lib/decidim/dummy_resources/engine.rb +28 -0
- data/lib/decidim/dummy_resources.rb +20 -0
- data/lib/tasks/lighthouse_report.rake +29 -7
- data/rubocop-decidim.yml +13 -0
- metadata +119 -81
- data/config/locales/he-IL.yml +0 -1
- data/decidim-dev.gemspec +0 -57
- data/lib/decidim/dev/test/rspec_support/capybara_data_picker.rb +0 -36
- data/lib/decidim/dev/test/rspec_support/capybara_scopes_picker.rb +0 -92
- data/lib/decidim/dev/test/rspec_support/concurrency.rb +0 -23
- data/lib/decidim/dev/test/rspec_support/decidim_sanitization.rb +0 -5
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
john.doe@example.org;John Doe
|
2
|
+
jane.doe@example.org;Jane Doe
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
john.doe@example.org;John Doe (Roe)
|
2
|
+
jane.doe@example.org;Jane Doe
|
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
john.doe@example.org;John Doe
|
@@ -1,3 +1,5 @@
|
|
1
|
+
<!-- markdown-lint-disable-file single-h1 -->
|
2
|
+
|
1
3
|
# The great title for a new law
|
2
4
|
|
3
5
|
## A co-creation process to create creative creations
|
@@ -27,8 +29,8 @@ When an organization finishes a co-creation process, the accountability process
|
|
27
29
|
blah, blah, blah...
|
28
30
|
|
29
31
|
1. one
|
30
|
-
|
31
|
-
|
32
|
+
1. two
|
33
|
+
1. three
|
32
34
|
|
33
35
|
### Following up accounted results
|
34
36
|
|
@@ -1,22 +1,22 @@
|
|
1
|
-
Email
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
1
|
+
Email;;;;;;
|
2
|
+
acme@example.org;;;;;;
|
3
|
+
;;;;;;
|
4
|
+
;;;;;;
|
5
|
+
;;;;;;
|
6
|
+
;;;;;;
|
7
|
+
;;;;;;
|
8
|
+
;;;;;;
|
9
|
+
;;;;;;
|
10
|
+
;;;;;;
|
11
|
+
;;;;;;
|
12
|
+
;;;;;;
|
13
|
+
;;;;;;
|
14
|
+
;;;;;;
|
15
|
+
;;;;;;
|
16
|
+
;;;;;;
|
17
|
+
;;;;;;
|
18
|
+
;;;;;;
|
19
|
+
;;;;;;
|
20
|
+
;;;;;;
|
21
|
+
;;;;;;
|
22
|
+
;;;;;;
|
data/lib/decidim/dev/engine.rb
CHANGED
@@ -8,9 +8,10 @@ module Decidim
|
|
8
8
|
engine_name "decidim_dev"
|
9
9
|
|
10
10
|
initializer "decidim_dev.tools" do
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
# Disable if the boost performance mode is enabled
|
12
|
+
next if Rails.application.config.try(:boost_performance)
|
13
|
+
|
14
|
+
ActiveSupport.on_load(:action_controller) { include Decidim::Dev::NeedsDevelopmentTools }
|
14
15
|
end
|
15
16
|
|
16
17
|
initializer "decidim_dev.webpacker.assets_path" do
|
@@ -1,12 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "decidim/components/namer"
|
4
|
+
|
3
5
|
FactoryBot.define do
|
4
6
|
factory :dummy_component, parent: :component do
|
5
|
-
|
6
|
-
skip_injection { false }
|
7
|
-
end
|
8
|
-
|
9
|
-
name { generate_component_name(participatory_space.organization.available_locales, :dummy, skip_injection: skip_injection) }
|
7
|
+
name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :surveys).i18n_name }
|
10
8
|
manifest_name { :dummy }
|
11
9
|
end
|
12
10
|
end
|
@@ -9,14 +9,14 @@ shared_examples "with promoted participatory processes and groups" do
|
|
9
9
|
it "includes promoted participatory processes and groups placing groups in first place" do
|
10
10
|
create(
|
11
11
|
:participatory_process_group,
|
12
|
-
organization:
|
12
|
+
organization:
|
13
13
|
)
|
14
14
|
|
15
15
|
unpromoted_process = create(
|
16
16
|
:participatory_process,
|
17
17
|
:with_steps,
|
18
18
|
:published,
|
19
|
-
organization:
|
19
|
+
organization:
|
20
20
|
)
|
21
21
|
unpromoted_process.active_step.update!(end_date: Time.current.advance(days: 1))
|
22
22
|
|
@@ -25,14 +25,14 @@ shared_examples "with promoted participatory processes and groups" do
|
|
25
25
|
:with_steps,
|
26
26
|
:published,
|
27
27
|
:promoted,
|
28
|
-
organization:
|
28
|
+
organization:
|
29
29
|
)
|
30
30
|
promoted_process.active_step.update!(end_date: Time.current.advance(days: 2))
|
31
31
|
|
32
32
|
promoted_group = create(
|
33
33
|
:participatory_process_group,
|
34
34
|
:promoted,
|
35
|
-
organization:
|
35
|
+
organization:
|
36
36
|
)
|
37
37
|
|
38
38
|
_external_promoted_group = create(
|
@@ -51,14 +51,14 @@ shared_examples "with promoted participatory processes and groups" do
|
|
51
51
|
:with_steps,
|
52
52
|
:unpublished,
|
53
53
|
:promoted,
|
54
|
-
organization:
|
54
|
+
organization:
|
55
55
|
)
|
56
56
|
|
57
57
|
create(
|
58
58
|
:participatory_process,
|
59
59
|
:with_steps,
|
60
60
|
:unpublished,
|
61
|
-
organization:
|
61
|
+
organization:
|
62
62
|
)
|
63
63
|
|
64
64
|
last =
|
@@ -67,7 +67,7 @@ shared_examples "with promoted participatory processes and groups" do
|
|
67
67
|
:with_steps,
|
68
68
|
:published,
|
69
69
|
:promoted,
|
70
|
-
organization:
|
70
|
+
organization:
|
71
71
|
)
|
72
72
|
|
73
73
|
last.active_step.update!(end_date: nil)
|
@@ -78,7 +78,7 @@ shared_examples "with promoted participatory processes and groups" do
|
|
78
78
|
:with_steps,
|
79
79
|
:published,
|
80
80
|
:promoted,
|
81
|
-
organization
|
81
|
+
organization:,
|
82
82
|
end_date: Time.current.advance(days: 10)
|
83
83
|
)
|
84
84
|
|
@@ -90,7 +90,7 @@ shared_examples "with promoted participatory processes and groups" do
|
|
90
90
|
:with_steps,
|
91
91
|
:published,
|
92
92
|
:promoted,
|
93
|
-
organization
|
93
|
+
organization:,
|
94
94
|
end_date: Time.current.advance(days: 8)
|
95
95
|
)
|
96
96
|
|
@@ -1,5 +1,123 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
module AxeMatchers
|
4
|
+
def self.axe_version
|
5
|
+
@axe_version ||= begin
|
6
|
+
package = JSON.load_file(Rails.root.join("node_modules/axe-core/package.json"))
|
7
|
+
package["version"]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.axe_mainline_version
|
12
|
+
@axe_mainline_version ||= axe_version.split(".")[0..1].join(".")
|
13
|
+
end
|
14
|
+
|
15
|
+
class ResultFormatter
|
16
|
+
def initialize(result)
|
17
|
+
@result = result
|
18
|
+
@violations = result["violations"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def format
|
22
|
+
<<~MESSAGE
|
23
|
+
|
24
|
+
Found #{violations.count} accessibility #{violations.count == 1 ? "violation" : "violations"}:
|
25
|
+
|
26
|
+
#{violation_messages.join("\n")}
|
27
|
+
MESSAGE
|
28
|
+
end
|
29
|
+
|
30
|
+
def violation_messages
|
31
|
+
violations.each_with_index.map do |violation, index|
|
32
|
+
nodes = violation["nodes"]
|
33
|
+
[
|
34
|
+
"#{index + 1}) #{violation["id"]}: #{violation["help"]} (#{violation["impact"]})",
|
35
|
+
indent_lines(violation["helpUrl"], 1),
|
36
|
+
indent_lines("The following #{nodes.length} #{nodes.length == 1 ? "node" : "nodes"} violate this rule:", 1),
|
37
|
+
"",
|
38
|
+
indent_lines(node_messages_for(nodes), 2),
|
39
|
+
""
|
40
|
+
]
|
41
|
+
end.flatten
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
attr_reader :result, :violations
|
47
|
+
|
48
|
+
def indent_lines(lines, indent_level = 1)
|
49
|
+
indent = " " * indent_level
|
50
|
+
Array(lines).flatten.map { |line| line.length.positive? ? "#{indent}#{line}" : "" }.join("\n")
|
51
|
+
end
|
52
|
+
|
53
|
+
def node_messages_for(nodes)
|
54
|
+
nodes.map do |node|
|
55
|
+
[
|
56
|
+
"Selector: #{Array(node["target"]).join(", ")}",
|
57
|
+
("HTML: #{node["html"].gsub(/^\s*|\n*/, "")}" unless node["html"].nil?),
|
58
|
+
fix(node["all"], "Fix all of the following:"),
|
59
|
+
fix(node["none"], "Fix all of the following:"),
|
60
|
+
fix(node["any"], "Fix any of the following:")
|
61
|
+
].compact.presence.tap { |messages| messages&.push("") }
|
62
|
+
end.compact
|
63
|
+
end
|
64
|
+
|
65
|
+
def fix(checks, message)
|
66
|
+
valid_checks = checks.compact
|
67
|
+
[
|
68
|
+
(message unless valid_checks.empty?),
|
69
|
+
*valid_checks.map { |check| "- #{check["message"]}" }
|
70
|
+
].compact
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class BeAxeClean
|
75
|
+
def matches?(page)
|
76
|
+
@results = execute_axe(page)
|
77
|
+
results["violations"].count.zero?
|
78
|
+
end
|
79
|
+
|
80
|
+
def failure_message
|
81
|
+
ResultFormatter.new(results).format
|
82
|
+
end
|
83
|
+
|
84
|
+
def failure_message_when_negated
|
85
|
+
"Expected to find accessibility violations. None were detected."
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
attr_reader :results
|
91
|
+
|
92
|
+
def execute_axe(page)
|
93
|
+
load_axe(page)
|
94
|
+
|
95
|
+
script = <<-JS
|
96
|
+
var callback = arguments[arguments.length - 1];
|
97
|
+
var context = document;
|
98
|
+
var options = {};
|
99
|
+
axe.run(context, options).then(res => JSON.parse(JSON.stringify(res))).then(callback);
|
100
|
+
JS
|
101
|
+
page = page.driver if page.respond_to?("driver")
|
102
|
+
page = page.browser if page.respond_to?("browser") && !page.browser.is_a?(::Symbol)
|
103
|
+
page.execute_async_script(script)
|
104
|
+
end
|
105
|
+
|
106
|
+
def load_axe(page)
|
107
|
+
jslib = Rails.root.join("node_modules/axe-core/axe.min.js")
|
108
|
+
page.execute_script jslib.read
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def be_axe_clean
|
113
|
+
BeAxeClean.new
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
RSpec.configure do |config|
|
118
|
+
config.include AxeMatchers
|
119
|
+
end
|
120
|
+
|
3
121
|
shared_examples_for "accessible page" do
|
4
122
|
it "passes accessibility tests" do
|
5
123
|
expect(page).to be_axe_clean
|
@@ -7,7 +125,7 @@ shared_examples_for "accessible page" do
|
|
7
125
|
|
8
126
|
it "passes HTML validation" do
|
9
127
|
# Capybara is stripping the doctype out of the HTML which is required for
|
10
|
-
# the validation. If it
|
128
|
+
# the validation. If it does not exist, add it there.
|
11
129
|
html = page.source
|
12
130
|
html = "<!DOCTYPE html>\n#{html}" unless html.strip.match?(/^<!DOCTYPE/i)
|
13
131
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bullet"
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
Decidim::ApplicationJob.include(Bullet::ActiveJob) if defined?(Bullet::ActiveJob)
|
7
|
+
|
8
|
+
Rails.application.config.after_initialize do
|
9
|
+
Bullet.enable = Decidim::Env.new("DECIDIM_BULLET_ENABLED", "true").present?
|
10
|
+
Bullet.rails_logger = true
|
11
|
+
Bullet.raise = true
|
12
|
+
Bullet.stacktrace_includes = %w(decidim-)
|
13
|
+
|
14
|
+
# Detect N+1 queries
|
15
|
+
Bullet.n_plus_one_query_enable = Decidim::Env.new("DECIDIM_BULLET_N_PLUS_ONE", "false").present?
|
16
|
+
# Detect eager-loaded associations which are not used
|
17
|
+
Bullet.unused_eager_loading_enable = Decidim::Env.new("DECIDIM_BULLET_UNUSED_EAGER", "false").present?
|
18
|
+
# Detect unnecessary COUNT queries which could be avoided with a counter_cache
|
19
|
+
Bullet.counter_cache_enable = Decidim::Env.new("DECIDIM_BULLET_COUNTER_CACHE", "true").present?
|
20
|
+
end
|
21
|
+
|
22
|
+
if Bullet.enable?
|
23
|
+
config.before(:each) do
|
24
|
+
Bullet.start_request
|
25
|
+
end
|
26
|
+
|
27
|
+
config.after(:each) do
|
28
|
+
Bullet.perform_out_of_channel_notifications if Bullet.notification?
|
29
|
+
Bullet.end_request
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -6,7 +6,7 @@ module Decidim
|
|
6
6
|
# Helpers meant to be used only during capybara test runs.
|
7
7
|
module CapybaraTestHelpers
|
8
8
|
def switch_to_host(host = "lvh.me")
|
9
|
-
raise "
|
9
|
+
raise "Cannot switch to a custom host unless it really exists. Use `whatever.lvh.me` as a workaround." unless /lvh\.me$/.match?(host)
|
10
10
|
|
11
11
|
app_host = (host ? "#{protocol}://#{host}" : nil)
|
12
12
|
Capybara.app_host = app_host
|
@@ -28,12 +28,22 @@ module Decidim
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
1.step do
|
32
|
+
port = rand(5000..6999)
|
33
|
+
begin
|
34
|
+
Socket.tcp("127.0.0.1", port, connect_timeout: 5).close
|
35
|
+
rescue Errno::ECONNREFUSED
|
36
|
+
# When connection is refused, the port is available for use.
|
37
|
+
Capybara.server_port = port
|
38
|
+
break
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
31
42
|
Capybara.register_driver :headless_chrome do |app|
|
32
|
-
options =
|
43
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
44
|
+
options.args << "--explicitly-allowed-ports=#{Capybara.server_port}"
|
33
45
|
options.args << "--headless"
|
34
46
|
options.args << "--no-sandbox"
|
35
|
-
# Do not limit browser resources
|
36
|
-
options.args << "--disable-dev-shm-usage"
|
37
47
|
options.args << if ENV["BIG_SCREEN_SIZE"].present?
|
38
48
|
"--window-size=1920,3000"
|
39
49
|
else
|
@@ -43,27 +53,20 @@ Capybara.register_driver :headless_chrome do |app|
|
|
43
53
|
Capybara::Selenium::Driver.new(
|
44
54
|
app,
|
45
55
|
browser: :chrome,
|
46
|
-
|
56
|
+
options:
|
47
57
|
)
|
48
58
|
end
|
49
59
|
|
50
|
-
|
51
|
-
port = rand(5000..6999)
|
52
|
-
begin
|
53
|
-
Socket.tcp("127.0.0.1", port, connect_timeout: 5).close
|
54
|
-
warn "Port #{port} is already in use, trying another one."
|
55
|
-
rescue Errno::ECONNREFUSED
|
56
|
-
# When connection is refused, the port is available for use.
|
57
|
-
Capybara.server_port = port
|
58
|
-
break
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
60
|
+
# In order to work with PWA apps, Chrome cannot be run in headless mode, and requires
|
62
61
|
# setting up special prefs and flags
|
63
62
|
Capybara.register_driver :pwa_chrome do |app|
|
64
|
-
options =
|
63
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
64
|
+
options.args << "--explicitly-allowed-ports=#{Capybara.server_port}"
|
65
|
+
# If we have a headless browser things like the offline navigation feature stop working,
|
66
|
+
# so we need to have have a headful/recapitated (aka not headless) browser for these specs
|
67
|
+
# options.args << "--headless"
|
65
68
|
options.args << "--no-sandbox"
|
66
|
-
#
|
69
|
+
# Do not limit browser resources
|
67
70
|
options.args << "--disable-dev-shm-usage"
|
68
71
|
# Add pwa.lvh.me host as a secure origin
|
69
72
|
options.args << "--unsafely-treat-insecure-origin-as-secure=http://pwa.lvh.me:#{Capybara.server_port}"
|
@@ -82,22 +85,20 @@ Capybara.register_driver :pwa_chrome do |app|
|
|
82
85
|
Capybara::Selenium::Driver.new(
|
83
86
|
app,
|
84
87
|
browser: :chrome,
|
85
|
-
|
88
|
+
options:
|
86
89
|
)
|
87
90
|
end
|
88
91
|
|
89
92
|
Capybara.register_driver :iphone do |app|
|
90
|
-
options =
|
93
|
+
options = Selenium::WebDriver::Chrome::Options.new
|
91
94
|
options.args << "--headless"
|
92
95
|
options.args << "--no-sandbox"
|
93
|
-
# Do not limit browser resources
|
94
|
-
options.args << "--disable-dev-shm-usage"
|
95
96
|
options.add_emulation(device_name: "iPhone 6")
|
96
97
|
|
97
98
|
Capybara::Selenium::Driver.new(
|
98
99
|
app,
|
99
100
|
browser: :chrome,
|
100
|
-
|
101
|
+
options:
|
101
102
|
)
|
102
103
|
end
|
103
104
|
|
@@ -129,7 +130,7 @@ RSpec.configure do |config|
|
|
129
130
|
domain = ".#{domain}" unless domain == "localhost"
|
130
131
|
page.driver.browser.execute_cdp(
|
131
132
|
"Network.setCookie",
|
132
|
-
domain
|
133
|
+
domain:,
|
133
134
|
name: Decidim.consent_cookie_name,
|
134
135
|
value: { essential: true }.to_json,
|
135
136
|
path: "/",
|