@tag runnable: true
test “select a practice --core test”, %{session: session} do
login(session)
|> assert_has(css(".intro__title", text: “Scrum Essentials”))
|> find(css(".practice__title", count: :any), fn (form) ->
form
|> Enum.at(4)
|> IO.inspect()
|> click(css(".practice__title"))
end)
|> IO.inspect()
:timer.sleep(9000) # mouse hasn't move to the element we want to click on
end
The callback you pass to find/3 will return the element(s) that it finds. In your case, it looks like it returns 5 elements that have the class .practice__title.
So in your example, you have the element that you seem to want to click, but then you attempt to find that element again, inside of itself, which it obviously isn’t going to find.
I think what you want is this, which doesn’t require a find.
@tag runnable: true
test “select a practice --core test”, %{session: session} do
login(session)
|> assert_has(css(".intro__title", text: “Scrum Essentials”))
|> click(css(".practice__title", at: 4))
end


















