DEV: Improve performance of system test sign_in helper (#19579)

Previously, calling `sign_in` would cause the browser to be redirected to `/`, and would cause the Ember app to boot. We would then call `visit()`, causing the app to boot for a second time.

This commit adds a `redirect=false` option to the `/session/username/become` route. This avoids the unnecessary boot of the app, and leads to significantly faster system spec run times.

In local testing, this takes the full system-spec suite for chat from ~6min to ~4min.
This commit is contained in:
David Taylor
2022-12-22 16:03:27 +00:00
committed by GitHub
parent b11e7fb901
commit b1b53da71d
7 changed files with 13 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ module SystemHelpers
end
def sign_in(user)
visit "/session/#{user.encoded_username}/become"
visit "/session/#{user.encoded_username}/become.json?redirect=false"
end
def sign_out