mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2026-04-23 08:31:16 -04:00
fix rust shenanigins
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@ coverage/
|
||||
.npm
|
||||
.eslintcache
|
||||
*.tsbuildinfo
|
||||
/e2e-tests/target
|
||||
|
||||
@@ -62,7 +62,7 @@ FOSSFLOW_TEST_URL=http://localhost:8080 cargo test
|
||||
|
||||
- `test_homepage_loads` - Verifies the homepage loads and has basic React elements
|
||||
- `test_page_has_canvas` - Checks for the canvas element used for diagram drawing
|
||||
- `test_no_javascript_errors` - Checks browser console for severe JavaScript errors
|
||||
- `test_page_renders_without_crash` - Verifies the page fully renders with all key elements visible
|
||||
|
||||
## CI/CD
|
||||
|
||||
|
||||
@@ -31,8 +31,10 @@ Three basic tests to verify the application loads correctly:
|
||||
2. **test_page_has_canvas** - Verifies:
|
||||
- Canvas element exists (for isometric drawing)
|
||||
|
||||
3. **test_no_javascript_errors** - Verifies:
|
||||
- No severe console errors (warnings only, non-failing)
|
||||
3. **test_page_renders_without_crash** - Verifies:
|
||||
- Page fully renders without errors
|
||||
- All key elements are visible (body, root, canvas)
|
||||
- Page source is substantial (not blank/error page)
|
||||
|
||||
### CI/CD Integration
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ async fn test_page_has_canvas() -> Result<()> {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_no_javascript_errors() -> Result<()> {
|
||||
async fn test_page_renders_without_crash() -> Result<()> {
|
||||
let base_url = get_base_url();
|
||||
let webdriver_url = get_webdriver_url();
|
||||
|
||||
@@ -106,31 +106,25 @@ async fn test_no_javascript_errors() -> Result<()> {
|
||||
driver.goto(&base_url).await?;
|
||||
|
||||
// Wait for the page to fully load
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(3)).await;
|
||||
tokio::time::sleep(tokio::time::Duration::from_secs(5)).await;
|
||||
|
||||
// Get browser console logs
|
||||
let logs = driver.logs(LogType::Browser).await?;
|
||||
// Check multiple elements exist to ensure page rendered properly
|
||||
let body = driver.find(By::Tag("body")).await?;
|
||||
assert!(body.is_displayed().await?, "Body should be visible");
|
||||
|
||||
// Filter for severe errors
|
||||
let errors: Vec<_> = logs
|
||||
.iter()
|
||||
.filter(|log| log.level == "SEVERE")
|
||||
.collect();
|
||||
let root = driver.find(By::Id("root")).await?;
|
||||
assert!(root.is_displayed().await?, "Root element should be visible");
|
||||
|
||||
if !errors.is_empty() {
|
||||
println!("Console errors found:");
|
||||
for error in &errors {
|
||||
println!(" - {}", error.message);
|
||||
}
|
||||
}
|
||||
// Check for canvas (main drawing area)
|
||||
let canvas = driver.find(By::Tag("canvas")).await?;
|
||||
assert!(canvas.is_displayed().await?, "Canvas should be visible");
|
||||
|
||||
// We'll warn but not fail on console errors for now
|
||||
// as some third-party libraries may log warnings
|
||||
if errors.is_empty() {
|
||||
println!("✓ No severe console errors found");
|
||||
} else {
|
||||
println!("⚠ {} severe console error(s) found (not failing test)", errors.len());
|
||||
}
|
||||
// Verify we can get the page source (ensures no blank/error page)
|
||||
let source = driver.source().await?;
|
||||
assert!(source.len() > 1000, "Page source should be substantial (got {} bytes)", source.len());
|
||||
|
||||
println!("✓ Page rendered successfully without crashing");
|
||||
println!("✓ Page source size: {} bytes", source.len());
|
||||
|
||||
driver.quit().await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user