filesystem_panel.rs
1 use std::time::Duration; 2 3 use crate::actor::Actor; 4 use crate::locators::filesystem; 5 6 pub async fn run(actor: &Actor) -> crate::actor::Result { 7 // Panel is visible with heading and both storage sections 8 actor.expect(filesystem::root()).to_be_visible().await?; 9 actor.expect(filesystem::heading()).to_be_visible().await?; 10 actor.expect(filesystem::sd_section()).to_be_visible().await?; 11 actor.expect(filesystem::littlefs_section()).to_be_visible().await?; 12 13 // "Add file..." label is visible (SD upload trigger) 14 actor.expect(filesystem::add_file_label()).to_be_visible().await?; 15 16 // Wait for files to load (skeleton should disappear) 17 actor 18 .expect(filesystem::file_row("data.csv")) 19 .with_timeout(Duration::from_secs(15)) 20 .to_be_visible() 21 .await?; 22 23 // CSV file is clickable for preview 24 actor.locate(filesystem::file_row("data.csv")).await.click(None).await?; 25 actor 26 .expect(filesystem::csv_preview_dialog()) 27 .with_timeout(Duration::from_secs(5)) 28 .to_be_visible() 29 .await?; 30 31 // Preview dialog has a close button 32 actor.expect(filesystem::preview_close()).to_be_visible().await?; 33 actor.locate(filesystem::preview_close()).await.click(None).await?; 34 actor.expect(filesystem::csv_preview_dialog()).not().to_be_visible().await?; 35 36 Ok(()) 37 }