-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIfferent :base_url
for different sessions?
#570
Comments
Currently, no, but that could be a new feature. What is your use case? |
My use case is a monorepo with two projects - an Elixir/Phoenix API and LiveView site running on localhost:4000 and a React SPA running on localhost:3000. I want to test full "user flows" where customers use the SPA on 3000 and staff/admin use the LiveView site on 4000. These two apps use Graphql Subscriptions and LiveView so an action by a customer may make staff view update (with no interaction). Basically, i want to test full user stories spanning multiple realtime apps. |
Gotcha, that makes sense. Would something like this work for you? defmodule MyAppWeb.TwoAppFeatureTest do
use ExUnit.Case
use Wallaby.Feature
@spa_session [base_url: "http://localhost:3000"]
@admin_session [base_url: "http://localhost:4000"]
@sessions [@spa_session, @admin_session]
feature "stuff happens", %{sessions: [spa, admin]} do
spa |> login_user
admin |> login_admin
spa
|> visit("/some-path")
|> click(Query.button("Do Thing"))
admin
|> assert_text("some indicator that the user did a thing")
end
end |
Hey @mhanberg @peaceful-james , until there's a nicer API, I know there are work-arounds. I think I had a test where I needed something like that, and I leveraged the fact that it is possible to use Browser.visit/2 with absolute paths. I had the |
Thanks for the information, both of you. The application I wanted to do this for has been finished for months now and I am knee-deep in a new project. |
Is it possible to use different
:base_url
for different sessions?The text was updated successfully, but these errors were encountered: