DEV: introduces `pause_test` system tests helper (#19378)
This helper is intended only for dev purposes. It allows you to pause a test while still being able to interact with the browser. Usage: ``` it "works" do visit("/") pause_test expect(page).to have_css(".foo") end ```
This commit is contained in:
parent
22cae0022a
commit
ae40965896
|
@ -1,6 +1,16 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
require "highline/import"
|
||||||
|
|
||||||
module SystemHelpers
|
module SystemHelpers
|
||||||
|
def pause_test
|
||||||
|
result =
|
||||||
|
ask(
|
||||||
|
"\n\e[33mTest paused, press enter to resume, type `d` and press enter to start debugger.\e[0m",
|
||||||
|
)
|
||||||
|
byebug if result == "d" # rubocop:disable Lint/Debugger
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
def sign_in(user)
|
def sign_in(user)
|
||||||
visit "/session/#{user.encoded_username}/become"
|
visit "/session/#{user.encoded_username}/become"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue