elixir-wallaby/wallaby

How Might A Developer New to Wallaby Understand 'page' In the Documentation?

stratigos opened this issue · 5 comments

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.16.1 (compiled with Erlang/OTP 24)

Operating system

Ubuntu 22.04

Browser

N/A

Driver

N/A

Correct Configuration

  • I confirm that I have Wallaby configured correctly.

Current behavior

I want to follow patterns in the documentation, but they use assignments and conditions that I cannot find associated definitions for. For example, page is unavailable, yet I have not found any documentation which describes what page is or how I can make it available in a test. The closest thing to a hint I have found is use of a Router helper to produce an @page param in one single example, though Route helpers is a deprecated feature of Phoenix. All other references to page Ive seen have no origin for it and use a local assign.

There are many examples such as this in the documentation:

page
|> find(css(".users"), & assert has?(&1, css(".user", count: 3)))
|> click(link("Next Page"))

Though is is not revealed what page is or how its defined.

I had thought that the docs were out of date and this is replaced with session, but many of those functions fail when session is passed in. Otherwise, Id just submit a patch to the documentation to replace page with session.

There are many patterns I want to use in the API docs, but I am unsure how to use them as they fail when I pass session into the same code instead of whatever page is.

Are the docs out of date and need updated? If so, can someone help me understand where I can find the major changes and help get the docs updated?

Am I reading the docs wrong or missing some key part to help me understand where page comes from? Ive read the docs tip to stern a few times and am still confused on how to get any example code that does not use session to work. Can someone point me to the piece of info in the docs that explains how to make this resource available in tests?

Additionally I dont think GitHub issues are the best place for these questions, but was prompted to open an issue for this from a maintainer.

Expected behavior

A developer new to Wallaby can copy paste examples out of the documentation and they work as expected.

Test Code & HTML

N/A - the code is in the current documentation.

Demonstration Project

No response

I'm pretty sure the docs are just inconsistent.

But they are just variable names, in your actual code you can name them whatever you want.

A PR to make the docs more consistent is welcome.

Additionally I dont think GitHub issues are the best place for these questions, but was prompted to open an issue for this from a maintainer.

I had said to open a GitHub discussion, but it doesn't really matter haha.

Thanks for clarifying, I now see how obvious the discussion tab is. I have been absent from GitHub for a few years and it has advanced beyond my previous expectations. Also I havent worked in Elixir in ~4-5 years, and suddenly find myself as a full time Elixir dev, and request some patience from the community without expectations ;-)

A PR to make the docs more consistent is welcome.

Cool, I will factor in some time in the next month or two to work on this!

Thanks, I will close the issue but please submit any doc PRs you'd like! They definitely could use some consistency and lots more examples