luckyframework / luckyframework/lucky_flow
Add more element assertions for clearer specs
Nobody has claimed this yet.
- Dominant language
- Crystal
- Stars
- 55
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
In many of my specs where I write `flow.el("@flow-id", text: "my text")`, I find myself forgetting to write `.should be_on_page`. Often I remember because my test shows a false-positive but I've found places where I didn't remember after looking back at some of my specs. The reason that this gives false positives is because it is lazily resolving the element.
Every time I supply text to the `#el` call, and I would assume the majority of time most people do, is to make this assertion. I think it makes sense to add assertions to make this more explicit.
## Ideas
- [x] `flow.el("@flow-id").should have_text("my text")`
- [ ] `flow.el("@flow-id").should have_value("my value")`
- [ ] `flow.el("@flow-id").should be_disabled`
This would avoid the lazy loading but also make expectations more explicit. This is easier to accomplish in ruby rspec tests because they could translate that to a method on the element called `#has_text?` but we will have to explicitly make those Spec expectations.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the `flow.el`/`#el` entry point and how Crystal spec expectations are currently implemented. Review the existing `have_text` behavior, then determine how `have_value` and `be_disabled` should be represented and tested. Done means the proposed element assertions avoid accidental lazy false positives and have coverage for the requested cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- crystal
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100