on master help sign in
add robot tests
commit6624dd51f5cd789c69e380c39815da956ea8df58 authorMatej Cotman <cotman.matej@gmail.com> dateSat 25 Jan 2014, 18:07 (13 years ago) parentdb825d4
4 files changed+67−103
.travis.yml+17 searx/engines/dummy.py+6 searx/settings_robot.yml+8−103 searx/tests/robot/test_basic.robot+36
.travis.ymlnew file+17
@@ -0,0 +1,17 @@
1+language: python
2+python:
3+ - "2.7"
4+before_install:
5+ - "export DISPLAY=:99.0"
6+ - "sh -e /etc/init.d/xvfb start"
7+install:
8+ - "make"
9+script:
10+ - "make tests"
11+ - "make robot"
12+notifications:
13+ irc:
14+ channels:
15+ - "irc.freenode.org#searx"
16+ template:
17+ - "%{repository}/#%{build_number}/%{branch} (%{author}): %{message} %{build_url}"
searx/engines/dummy.pynew file+6
@@ -0,0 +1,6 @@
1+def request(query, params):
2+ return params
3+
4+
5+def response(resp):
6+ return []
searx/settings_robot.yml+8−103
@@ -6,109 +6,14 @@ server:
66 base_url: False
77
88engines:
9− - name : wikipedia
10− engine : mediawiki
11− url : https://en.wikipedia.org/
12− number_of_results : 1
13−
14− - name : bing
15− engine : bing
16− locale : en-US
17−
18− - name : currency
19− engine : currency_convert
9+ - name : general_dummy
10+ engine : dummy
2011 categories : general
2112
22− - name : deviantart
23− engine : deviantart
24− categories : images
25−
26− - name : ddg definitions
27− engine : duckduckgo_definitions
28−
29− - name : duckduckgo
30− engine : duckduckgo
31− locale : en-us
32−
33− - name : filecrop
34− engine : filecrop
35− categories : files
36−
37− - name : flickr
38− engine : flickr
39− categories : images
40−
41− - name : github
42− engine : github
43− categories : it
44−
45− - name : google
46− engine : json_engine
47− search_url : https://ajax.googleapis.com/ajax/services/search/web?v=2.0&start=0&rsz=large&safe=off&filter=off&q={query}
48− categories : general
49− url_query : /responseData/results/unescapedUrl
50− content_query : /responseData/results/content
51− title_query : /responseData/results/titleNoFormatting
52−
53− - name : google images
54− engine : google_images
55− categories : images
56−
57− - name : piratebay
58− engine : piratebay
59− categories : videos, music, files
60−
61− - name : soundcloud
62− engine : soundcloud
63− categories : music
64−
65− - name : stackoverflow
66− engine : stackoverflow
67− categories : it
68−
69− - name : startpage
70− engine : startpage
71− base_url : 'https://startpage.com/'
72− search_url : 'https://startpage.com/do/search'
73−
74− - name : ixquick
75− engine : startpage
76− base_url : 'https://www.ixquick.com/'
77− search_url : 'https://www.ixquick.com/do/search'
78−
79− - name : twitter
80− engine : twitter
81− categories : social media
82−
83− - name : urbandictionary
84− engine : xpath
85− search_url : http://www.urbandictionary.com/define.php?term={query}
86− url_xpath : //div[@class="word"]//a/@href
87− title_xpath : //div[@class="word"]//a
88− content_xpath : //div[@class="definition"]
89−
90− - name : yahoo
91− engine : xpath
92− search_url : http://search.yahoo.com/search?p={query}
93− results_xpath : //div[@class="res"]
94− url_xpath : .//h3/a/@href
95− title_xpath : .//h3/a
96− content_xpath : .//div[@class="abstr"]
97− suggestion_xpath : //div[@id="satat"]//a
98−
99− - name : youtube
100− engine : youtube
101− categories : videos
102−
103− - name : dailymotion
104− engine : dailymotion
105− locale : en_US
106− categories : videos
13+ - name : dummy_dummy
14+ engine : dummy
15+ categories : dummy
10716
108− - name : vimeo
109− engine : vimeo
110− categories : videos
111− results_xpath : //div[@id="browse_content"]/ol/li
112− url_xpath : ./a/@href
113− title_xpath : ./a/div[@class="data"]/p[@class="title"]/text()
114− content_xpath : ./a/img/@src
17+locales:
18+ en : English
19+ hu : Magyar
searx/tests/robot/test_basic.robot+36
@@ -9,3 +9,39 @@ Front page
99 Page Should Contain about
1010 Page Should Contain preferences
1111
12+About page
13+ Click Element link=about
14+ Page Should Contain Why use Searx?
15+ Page Should Contain Element link=search engines
16+
17+Engines page
18+ Go To http://localhost:11111/engines
19+ Page Should Contain Currently used search engines
20+ Page Should Contain dummy_dummy
21+ Page Should Contain general_dummy
22+
23+Preferences page
24+ Click Element link=preferences
25+ Page Should Contain Preferences
26+ Page Should Contain Default categories
27+
28+Switch category
29+ Go To http://localhost:11111/preferences
30+ Page Should Contain Checkbox category_general
31+ Page Should Contain Checkbox category_dummy
32+ Click Element xpath=//*[.="general"]
33+ Click Element xpath=//*[.="dummy"]
34+ Submit Form id=search_form
35+ Location Should Be http://localhost:11111/
36+ Checkbox Should Not Be Selected category_general
37+ Checkbox Should Be Selected category_dummy
38+
39+Change language
40+ Page Should Contain about
41+ Page Should Contain preferences
42+ Go To http://localhost:11111/preferences
43+ Select From List locale hu
44+ Submit Form id=search_form
45+ Location Should Be http://localhost:11111/
46+ Page Should Contain rólunk
47+ Page Should Contain beállítások