You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This directory contains integration tests that crawl real websites to verify SmartCrawler's complete functionality in real-world scenarios, including domain-level duplicate filtering.
4
+
5
+
## Prerequisites
6
+
7
+
Before running these tests, you need to have a WebDriver server running:
8
+
9
+
### Option 1: GeckoDriver (Firefox) - Recommended
10
+
```bash
11
+
# Install geckodriver and start it
12
+
geckodriver
13
+
```
14
+
15
+
### Option 2: ChromeDriver
16
+
```bash
17
+
# Download ChromeDriver and start it on port 4444
18
+
chromedriver --port=4444
19
+
```
20
+
21
+
### Option 3: Docker
22
+
```bash
23
+
# Run Chrome in headless mode with WebDriver
24
+
docker run -d -p 4444:4444 selenium/standalone-chrome:latest
25
+
```
26
+
27
+
## Running the Tests
28
+
29
+
The real-world tests are ignored by default to prevent them from running during normal development. To run them explicitly:
30
+
31
+
```bash
32
+
# Run all real-world tests (they run serially to avoid WebDriver conflicts)
33
+
cargo test real_world -- --ignored
34
+
35
+
# Run a specific test
36
+
cargo test test_hacker_news_submissions -- --ignored
37
+
cargo test test_mykin_ai_team_member -- --ignored
38
+
39
+
# Test WebDriver connection
40
+
cargo test test_webdriver_connection -- --ignored
41
+
```
42
+
43
+
### Serial Execution
44
+
45
+
**Important**: Real-world tests are configured to run serially (one at a time) using the `serial_test` crate. This prevents WebDriver session conflicts that occur when multiple tests try to use the same WebDriver port (4444) simultaneously.
46
+
47
+
The `#[serial]` attribute ensures that:
48
+
- Tests won't interfere with each other's WebDriver sessions
49
+
- Each test gets exclusive access to the WebDriver instance
50
+
- Tests are more reliable and predictable
51
+
52
+
## Test Descriptions
53
+
54
+
### `test_hacker_news_submissions`
55
+
-**URL**: https://news.ycombinator.com/
56
+
-**Purpose**: Verifies the complete SmartCrawler pipeline including domain-level duplicate filtering
57
+
-**Pipeline**: Full 3-phase crawling with link discovery, root URL prioritization, and duplicate analysis
58
+
-**Path**: `html body center table tbody tr td table tbody tr.athing.submission td.title`
59
+
-**Expected**: Exactly 30 elements matching this path (including filtered duplicates)
60
+
-**Features Tested**: Link discovery, domain duplicate detection, filtered content identification
61
+
62
+
### `test_mykin_ai_team_member`
63
+
-**URL**: https://mykin.ai/company
64
+
-**Purpose**: Verifies the complete SmartCrawler pipeline on a modern web framework
65
+
-**Pipeline**: Full 3-phase crawling with link discovery, root URL prioritization, and duplicate analysis
0 commit comments