Skip to content

Commit 56d9190

Browse files
committed
Extract system test setup to system_helper
Defining these classes in abstract_unit makes running all Action Pack tests slower because they have to download/setup browsers for system tests (even if the tests being run never end up using the system test classes). This commit moves the system test class definitions into a helper which is only included in the two test files that use them. This will make running non-system Action Pack test files much much faster.
1 parent 1eac7f2 commit 56d9190

File tree

5 files changed

+20
-16
lines changed

5 files changed

+20
-16
lines changed

actionpack/test/abstract_unit.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -515,20 +515,4 @@ def assert_header_value(expected, header)
515515
end
516516
end
517517

518-
class DrivenByRackTest < ActionDispatch::SystemTestCase
519-
driven_by :rack_test
520-
end
521-
522-
class DrivenBySeleniumWithChrome < ActionDispatch::SystemTestCase
523-
driven_by :selenium, using: :chrome
524-
end
525-
526-
class DrivenBySeleniumWithHeadlessChrome < ActionDispatch::SystemTestCase
527-
driven_by :selenium, using: :headless_chrome
528-
end
529-
530-
class DrivenBySeleniumWithHeadlessFirefox < ActionDispatch::SystemTestCase
531-
driven_by :selenium, using: :headless_firefox
532-
end
533-
534518
require_relative "../../tools/test_common"

actionpack/test/dispatch/system_testing/driver_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require "abstract_unit"
4+
require "support/system_helper"
45
require "action_dispatch/system_testing/driver"
56
require "selenium/webdriver"
67

actionpack/test/dispatch/system_testing/screenshot_helper_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require "abstract_unit"
4+
require "support/system_helper"
45
require "action_dispatch/system_testing/test_helpers/screenshot_helper"
56
require "capybara/dsl"
67
require "selenium/webdriver"

actionpack/test/dispatch/system_testing/system_test_case_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require "abstract_unit"
4+
require "support/system_helper"
45
require "selenium/webdriver"
56

67
class SetDriverToRackTestTest < DrivenByRackTest
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# frozen_string_literal: true
2+
3+
class DrivenByRackTest < ActionDispatch::SystemTestCase
4+
driven_by :rack_test
5+
end
6+
7+
class DrivenBySeleniumWithChrome < ActionDispatch::SystemTestCase
8+
driven_by :selenium, using: :chrome
9+
end
10+
11+
class DrivenBySeleniumWithHeadlessChrome < ActionDispatch::SystemTestCase
12+
driven_by :selenium, using: :headless_chrome
13+
end
14+
15+
class DrivenBySeleniumWithHeadlessFirefox < ActionDispatch::SystemTestCase
16+
driven_by :selenium, using: :headless_firefox
17+
end

0 commit comments

Comments
 (0)