Rails 6 has parallel testing enabled by default, each test worker running under its own port.
This means, setting a server_port doesn't work anymore.
Edit: Just realized this Gem is dead :-)
Since I found nothing yet to replace CapybaraEmail, I monkey patched the deliver_later method from with test/application_system_test_case.rb:
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
…
# Monkey patch to always deliver mails immediately, needed for CapybaraEmail to work
class ActionMailer::MessageDelivery
def deliver_later
deliver_now
end
end
end