Comments (4)
With the current version of the api you have to use the click_button
helper. click is designed to work on Nodes directly. In the next release you actually won't be able to call click without the module name (Node.click
) which should eliminate this confusion. Can you try again with the click_button
helper?
from wallaby.
@keathley when I try as you suggest, I'm getting...
esteem feature/user-authentication % mix test
** (CompileError) test/acceptance/user_signs_up_test.exs:12: undefined function click_button/2
(stdlib) lists.erl:1337: :lists.foreach/2
(stdlib) erl_eval.erl:669: :erl_eval.do_apply/6
11:45:43.518 [error] GenServer #PID<0.196.0> terminating
** (CompileError) test/acceptance/user_signs_up_test.exs:12: undefined function click_button/2
(stdlib) lists.erl:1337: :lists.foreach/2
(elixir) src/elixir_module.erl:101: :elixir_module.do_compile/5
(stdlib) erl_eval.erl:669: :erl_eval.do_apply/6
(elixir) src/elixir.erl:215: :elixir.erl_eval/3
(elixir) src/elixir.erl:203: :elixir.eval_forms/4
(elixir) src/elixir_compiler.erl:66: :elixir_compiler.eval_compilation/3
(elixir) src/elixir_lexical.erl:16: :elixir_lexical.run/3
(elixir) src/elixir.erl:215: :elixir.erl_eval/3
Have I used it correctly? Just took a look at the docs and click_button/2
definitely seems to exist
defmodule Esteem.UsertSignsUpTest do
use Esteem.AcceptanceCase, async: true
test "user signs up", %{session: session} do
session
|> visit("/")
|> fill_in("First name", with: "Luke")
|> fill_in("Last name", with: "Rollans")
|> fill_in("Email", with: "[email protected]")
|> fill_in("Password", with: "123456")
|> fill_in("Organisation name", with: "Marvellous Mutants")
|> click_button("Submit")
notice =
session
|> find(".alert.info")
|> text
assert notice == "Signed up successfully"
end
end
Here is my AcceptanceCase
module, just in case it helps
defmodule Esteem.AcceptanceCase do
use ExUnit.CaseTemplate
using do
quote do
use Wallaby.DSL
import Ecto.Model
import Ecto.Query, only: [from: 2]
import Esteem.Router.Helpers
end
end
setup tags do
:ok = Ecto.Adapters.SQL.Sandbox.checkout(Esteem.Repo)
unless tags[:async] do
Ecto.Adapters.SQL.Sandbox.mode(Esteem.Repo, {:shared, self()})
end
metadata = Phoenix.Ecto.SQL.Sandbox.metadata_for(Esteem.Repo, self())
{:ok, session} = Wallaby.start_session(metadata: metadata)
{:ok, session: session}
end
end
from wallaby.
Ah, I was using Wallaby 0.5.0
. click_button
was introduced in 0.6.0
from wallaby.
Glad you got it sorted. 👍
from wallaby.
Related Issues (20)
- Wallaby test issue HOT 1
- js_errors: false config is being ignored
- Is it possible to configure "headless: true | false" at session opening? HOT 2
- Chrome is activated but the test times out HOT 4
- Test cases fail randomely because of missing elements HOT 3
- `run_command.sh` improvements HOT 1
- Running wallaby `feature` tests in VS Code HOT 1
- Minor thing: change wording of docs --> browser / users are not the same. HOT 2
- Suggested Phoenix Configuration for Concurrent Feature Test Issues Warning HOT 1
- How Might A Developer New to Wallaby Understand 'page' In the Documentation? HOT 5
- Setup docs unclear when using Phoenix but not Ecto HOT 3
- Use external chromedriver server? HOT 8
- Debug output HOT 5
- Warning on Elixir 1.17.0-rc.1: `ExUnit.Case.register_test/4 is deprecated` HOT 3
- How to send API Requests in parallel? HOT 4
- Getting Selenium (Firefox & Safari) working in Wallaby (~> 0.30.x) HOT 1
- Unable to use Wallaby in release mode
- Feature request: Affordances for asserting on js console output HOT 2
- Wallaby and Ash: dev/test env differences for `on_mount` hooks passed to `ash_authentication_live_session` HOT 2
- ChromeDriver failing with invalid session id HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wallaby.