Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the e2e test failure in the integration tests (#751)
The root cause of the issue was that the chromote browser was unable to render the PDF file without a plugin with the following error in the terminal: ```r ── Error ('test-shinytest2-tm_file_viewer.R:84:3'): e2e - tm_file_viewer: Shows selected url ── Error in `app_wait_for_idle(self, private, duration = duration, timeout = timeout)`: An error occurred while waiting for Shiny to be stable Backtrace: ▆ 1. └─app_driver$click(selector = "[id= '6_anchor']") at test-shinytest2-tm_file_viewer.R:84:3 2. └─self$wait_for_idle() 3. └─shinytest2:::app_wait_for_idle(self, private, duration = duration, timeout = timeout) 4. └─shinytest2:::app_abort(self, private, "An error occurred while waiting for Shiny to be stable") 5. └─rlang::abort(..., app = self, call = call) ``` **Note that this test is a bit flaky, I was only able to reproduce the error a few times. Sometimes it passed without any error.** To reproduce this issue you can try the following: Please make sure you have the dev version of `teal`. ```r app_driver <- teal:::TealAppDriver$new( data = teal.data::teal_data(iris = iris), modules = teal.modules.general::tm_file_viewer( input_path = list( url = "https://fda.gov/files/drugs/published/Portable-Document-Format-Specifications.pdf" ) ) ) app_driver$open_url() app_driver$view() ``` ### The URL in the `app_driver$open_url()` works fine <img width="1718" alt="Screenshot 2024-05-10 at 3 45 48 PM" src="https://github.com/insightsengineering/teal.modules.general/assets/49812166/f4e559e8-a215-4fd7-a57d-8e6881b9244c"> ### The URL in the `app_driver$view()` shows the error `Couldn't load plugin.` <img width="664" alt="Screenshot 2024-05-10 at 3 46 00 PM" src="https://github.com/insightsengineering/teal.modules.general/assets/49812166/f2c4f37c-890c-4640-a05a-477804c14a68"> The fix is to use some other file format, here we use a `PNG` file to fix this. In the future, we should test all the files and make sure they work.
- Loading branch information