-
Notifications
You must be signed in to change notification settings - Fork 2
Dev RULESET_TEST_CASES
oasis edited this page Feb 11, 2026
·
1 revision
This document provides test cases and sample RuleSet URLs for testing the AutoProxy RuleSet functionality in Oasis.
File: Dev-Test-Rulesets-basic.txt
[AutoProxy 0.2.9]
! Title: Basic Test RuleSet
! Last Modified: 2026-01-30
! Homepage: https://github.com/example/test-ruleset
! Google domains
||google.com
||googleapis.com
||gstatic.com
! Social media
||facebook.com
||twitter.com
||instagram.com
! Video streaming
||youtube.com
||youtu.be
||vimeo.com
Expected Behavior:
- Should parse 9 domain rules
- All rules should be converted to wildcard patterns
- Example:
||google.com→*.google.com*
File: Dev-Test-Rulesets-mixed.txt
[AutoProxy 0.2.9]
! Title: Mixed Rule Types Test
! Description: Tests different AutoProxy rule formats
! Domain anchors
||example.com
||test.org
! URL anchors
|https://api.example.com/v1/
! Regex patterns
/^https?:\/\/.*\.cdn\.example\.com\//
/\.m3u8$/
! Wildcard patterns
*analytics*
*tracking*
! Keyword matches
ads
tracker
Expected Behavior:
- Domain anchors → wildcard patterns
- URL anchors → regex patterns
- Regex patterns → preserved as regex
- Wildcard patterns → wildcard type
- Keywords → wildcard patterns
File: Dev-Test-Rulesets-base64.txt
W0F1dG9Qcm94eSAwLjIuOV0KISBUaXRsZTogQmFzZTY0IFRlc3QgUnVsZVNldAohIExhc3QgTW9kaWZpZWQ6IDIwMjYtMDEtMzAKCnx8Z29vZ2xlLmNvbQp8fGZhY2Vib29rLmNvbQp8fHR3aXR0ZXIuY29tCnx8eW91dHViZS5jb20=
Decoded Content:
[AutoProxy 0.2.9]
! Title: Base64 Test RuleSet
! Last Modified: 2026-01-30
||google.com
||facebook.com
||twitter.com
||youtube.com
Expected Behavior:
- Should auto-detect Base64 encoding
- Should decode and parse correctly
- Should show 4 domain rules
File: Dev-Test-Rulesets-whitelist.txt
[AutoProxy 0.2.9]
! Title: Whitelist Test
! Blacklist rules
||blocked.com
||restricted.org
! Whitelist rules (should be skipped)
@@||allowed.com
@@||exception.org
Expected Behavior:
- Should parse 2 blacklist rules
- Should skip 2 whitelist rules (@@)
- Total rules in PAC: 2
File: Dev-Test-Rulesets-comments.txt
[AutoProxy 0.2.9]
! Title: Comments Test
! This is a comment
||example.com
! Another comment
! Multiple comment lines
||test.com
! Empty lines below
||demo.org
Expected Behavior:
- Should ignore all comment lines (starting with !)
- Should ignore empty lines
- Should parse 3 domain rules
File: Dev-Test-Rulesets-large.txt
Contains 1000+ rules for performance testing.
Expected Behavior:
- Should handle large files without freezing UI
- Should show loading indicator during fetch
- Should parse all rules correctly
- Should generate valid PAC script
Steps:
- Create a new Normal Rule
- Change Type to "Rule Set"
- Enter a test RuleSet URL
- Blur the input field
Expected:
- Loading icon appears immediately
- Content is fetched from URL
- Loading icon changes back to eye icon
- Click eye icon to view content
- Content is displayed in modal
Steps:
- Create a new Normal Rule with Type "Wildcard"
- Enter a RuleSet URL in the pattern field
- Change Type from "Wildcard" to "Rule Set"
Expected:
- Loading icon appears immediately
- Content is fetched automatically
- No need to blur input
Steps:
- Open RuleSet content modal (eye icon)
- Click "Manual Update" button
Expected:
- Loading spinner appears on button
- Content is re-fetched
- Last updated timestamp is refreshed
- Content in modal is updated
Steps:
- Add multiple RuleSet rules
- Export PAC script from dropdown menu
- Open exported PAC file
Expected:
- RuleSet rules are expanded into individual PAC conditions
- Each rule from RuleSet has its own
ifstatement - Proxy assignment matches the rule's proxyId
- PAC script is valid JavaScript
Steps:
- Enter an invalid URL (e.g.,
http://invalid-domain-12345.com/rules.txt) - Blur the input
Expected:
- Loading icon appears
- After timeout, loading icon disappears
- Error is stored in
rule.ruleSet.fetchError - User can still click eye icon to see previous content (if any)
# gfwlist (Base64 encoded)
https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
# Plain text format
https://raw.githubusercontent.com/example/rules/main/proxy-rules.txt
For local testing, you can create a simple HTTP server:
# Create test file
cat > test-ruleset.txt << 'EOF'
[AutoProxy 0.2.9]
! Test RuleSet
||google.com
||facebook.com
||twitter.com
EOF
# Start HTTP server (Python 3)
python3 -m http.server 8000
# Use URL in Oasis
http://localhost:8000/test-ruleset.txt- Loading icon rotates smoothly
- Loading icon appears on blur
- Loading icon appears on type change
- Eye icon is clickable during loading
- Eye icon is clickable after loading
- Modal shows correct content
- Last updated timestamp is displayed
- Manual update button works
- Base64 content is decoded
- Plain text content is parsed
- Comments are ignored
- Empty lines are ignored
- Whitelist rules are skipped
- Domain anchors are converted correctly
- Regex patterns are preserved
- URL anchors are converted to regex
- RuleSet rules are expanded
- Each rule generates a PAC condition
- Proxy assignment is correct
- PAC script is valid JavaScript
- PAC script works in browser
- Invalid URLs show error
- Network errors are handled
- Timeout errors are handled
- Error messages are stored
- Loading state clears on error
- Whitelist Rules: Currently skipped, not implemented
- IPv6 in AutoProxy: May need additional testing
- Special Characters: Some special characters in patterns may need escaping
- Support for whitelist rules (@@)
- Rule conflict detection
- Automatic update scheduling
- Rule statistics in modal
- Search/filter in RuleSet content modal