bullet-train-co / magic_test

MIT License
440 stars 23 forks source link

RSpec requirement ? #67

Closed alsted closed 2 years ago

alsted commented 2 years ago

Hello I'm fairly new to Rails and system tests so the following might be totally obvious :)

Does magic_test only work for Rspec tests?

From reviwing https://github.com/bullet-train-co/magic_test/blob/main/lib/magic_test/engine.rb it seems that if Rspec is not defined magic_test wont configure correctly?

The somewhat longer request: I got Capybara running for system tests in docker using mini_test and to my best of knowledge solving all issues mentioned in #21 . I can write system mini_tests and run them headless in the docker image screenshots in tmp and all.

When adding in magic_test my mini_tests runs as before, but i get some errors from running magic_test in the docker image:

`Frame number: 0/27

From: /bundle/vendor/ruby/3.0.0/gems/magic_test-0.0.9/lib/magic_test/support.rb:84 MagicTest::Support#magic_test:
78: def magic_test
79:   return unless ENV["MAGIC_TEST"].present?
80:   empty_cache
81:   @test_lines_written = 0
82:   begin
83:     magic_test_pry_hook
=> 84:     binding.pry
85:   rescue
86:     retry
87:   end
88: end
Frame number: 1/27
Frame type: block
From: /app/test/system/basics_test.rb:7 BasicsTest#test_getting_started:
4: test "getting started" do
5:   visit root_url
6: 
=> 7:   magic_test
8: end

` Any chance of a qualified guess what causes this issue?

alsted commented 2 years ago

Im closing this issue to open an other as i have solved everything here. No RSpec requirement, that was just me not looing in the gem.spec. The pry binding issue is solved in docker by: tty: true stdin_open: true

So no i have a docker image that binds on pry for magic_test.