summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorMatej Cotman <cotman.matej@gmail.com>2014-01-25 18:07:57 +0100
committerMatej Cotman <cotman.matej@gmail.com>2014-01-29 04:58:10 +0100
commit6624dd51f5cd789c69e380c39815da956ea8df58 (patch)
treec549f59af9fb977c7518196e8d5be395819fe53b /searx
parentdb825d42267ff8ca64c9dfe4978325b3d9fc7d1b (diff)
downloadsearxng-6624dd51f5cd789c69e380c39815da956ea8df58.tar.gz
searxng-6624dd51f5cd789c69e380c39815da956ea8df58.zip
add robot tests
Diffstat (limited to 'searx')
-rw-r--r--searx/engines/dummy.py6
-rw-r--r--searx/settings_robot.yml111
-rw-r--r--searx/tests/robot/test_basic.robot36
3 files changed, 50 insertions, 103 deletions
diff --git a/searx/engines/dummy.py b/searx/engines/dummy.py
new file mode 100644
index 000000000..4586760a0
--- /dev/null
+++ b/searx/engines/dummy.py
@@ -0,0 +1,6 @@
+def request(query, params):
+ return params
+
+
+def response(resp):
+ return []
diff --git a/searx/settings_robot.yml b/searx/settings_robot.yml
index f7f2fa903..98944a811 100644
--- a/searx/settings_robot.yml
+++ b/searx/settings_robot.yml
@@ -6,109 +6,14 @@ server:
base_url: False
engines:
- - name : wikipedia
- engine : mediawiki
- url : https://en.wikipedia.org/
- number_of_results : 1
-
- - name : bing
- engine : bing
- locale : en-US
-
- - name : currency
- engine : currency_convert
+ - name : general_dummy
+ engine : dummy
categories : general
- - name : deviantart
- engine : deviantart
- categories : images
-
- - name : ddg definitions
- engine : duckduckgo_definitions
-
- - name : duckduckgo
- engine : duckduckgo
- locale : en-us
-
- - name : filecrop
- engine : filecrop
- categories : files
-
- - name : flickr
- engine : flickr
- categories : images
-
- - name : github
- engine : github
- categories : it
-
- - name : google
- engine : json_engine
- search_url : https://ajax.googleapis.com/ajax/services/search/web?v=2.0&start=0&rsz=large&safe=off&filter=off&q={query}
- categories : general
- url_query : /responseData/results/unescapedUrl
- content_query : /responseData/results/content
- title_query : /responseData/results/titleNoFormatting
-
- - name : google images
- engine : google_images
- categories : images
-
- - name : piratebay
- engine : piratebay
- categories : videos, music, files
-
- - name : soundcloud
- engine : soundcloud
- categories : music
-
- - name : stackoverflow
- engine : stackoverflow
- categories : it
-
- - name : startpage
- engine : startpage
- base_url : 'https://startpage.com/'
- search_url : 'https://startpage.com/do/search'
-
- - name : ixquick
- engine : startpage
- base_url : 'https://www.ixquick.com/'
- search_url : 'https://www.ixquick.com/do/search'
-
- - name : twitter
- engine : twitter
- categories : social media
-
- - name : urbandictionary
- engine : xpath
- search_url : http://www.urbandictionary.com/define.php?term={query}
- url_xpath : //div[@class="word"]//a/@href
- title_xpath : //div[@class="word"]//a
- content_xpath : //div[@class="definition"]
-
- - name : yahoo
- engine : xpath
- search_url : http://search.yahoo.com/search?p={query}
- results_xpath : //div[@class="res"]
- url_xpath : .//h3/a/@href
- title_xpath : .//h3/a
- content_xpath : .//div[@class="abstr"]
- suggestion_xpath : //div[@id="satat"]//a
-
- - name : youtube
- engine : youtube
- categories : videos
-
- - name : dailymotion
- engine : dailymotion
- locale : en_US
- categories : videos
+ - name : dummy_dummy
+ engine : dummy
+ categories : dummy
- - name : vimeo
- engine : vimeo
- categories : videos
- results_xpath : //div[@id="browse_content"]/ol/li
- url_xpath : ./a/@href
- title_xpath : ./a/div[@class="data"]/p[@class="title"]/text()
- content_xpath : ./a/img/@src
+locales:
+ en : English
+ hu : Magyar
diff --git a/searx/tests/robot/test_basic.robot b/searx/tests/robot/test_basic.robot
index 9f68d6693..9fff7540b 100644
--- a/searx/tests/robot/test_basic.robot
+++ b/searx/tests/robot/test_basic.robot
@@ -9,3 +9,39 @@ Front page
Page Should Contain about
Page Should Contain preferences
+About page
+ Click Element link=about
+ Page Should Contain Why use Searx?
+ Page Should Contain Element link=search engines
+
+Engines page
+ Go To http://localhost:11111/engines
+ Page Should Contain Currently used search engines
+ Page Should Contain dummy_dummy
+ Page Should Contain general_dummy
+
+Preferences page
+ Click Element link=preferences
+ Page Should Contain Preferences
+ Page Should Contain Default categories
+
+Switch category
+ Go To http://localhost:11111/preferences
+ Page Should Contain Checkbox category_general
+ Page Should Contain Checkbox category_dummy
+ Click Element xpath=//*[.="general"]
+ Click Element xpath=//*[.="dummy"]
+ Submit Form id=search_form
+ Location Should Be http://localhost:11111/
+ Checkbox Should Not Be Selected category_general
+ Checkbox Should Be Selected category_dummy
+
+Change language
+ Page Should Contain about
+ Page Should Contain preferences
+ Go To http://localhost:11111/preferences
+ Select From List locale hu
+ Submit Form id=search_form
+ Location Should Be http://localhost:11111/
+ Page Should Contain rólunk
+ Page Should Contain beállítások