insightsengineering / insightsengineering/teal

[Feature Request]: `TealAppDriver` gain a `get_tab_choices()` function

Open
#1,656 6 comments 0 reactions 0 assignees View on GitHub
core enhancement
Dominant language
R
Stars
263
Forks
59
Avg merge
5d 17h
Merged PRs (30d)
5

Description

### Feature description

`TealAppDriver` has a method `navigate_teal_tab()` it would be nice to have `get_tab_choices()` function as well - then I could have a generic test which is "load app and navigate through all the tabs to make sure there are no validation errors".

Also, could `TealAppDriver` be exported? It's great functionality - I can use ::: of course in the meantime.

Would something like this work for me for now:

```r
get_tab_choices <- function(app_driver) {
html <- app_driver$get_html(".teal-modules-tree a")
paste(html, collapse = "") |>
rvest::read_html() |>
rvest::html_elements("a") |>
rvest::html_text() |>
trimws()
}
```

I'm not sure the best value to put in `get_html` to make sure I capture all modules and nothing else.

Thanks

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct.

### Contribution Guidelines

- [x] I agree to follow this project's Contribution Guidelines.

### Security Policy

- [x] I agree to follow this project's Security Policy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.