diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/robot/test_basic.robot | 44 | ||||
| -rw-r--r-- | tests/unit/engines/test_kickass.py | 26 |
2 files changed, 33 insertions, 37 deletions
diff --git a/tests/robot/test_basic.robot b/tests/robot/test_basic.robot index ab41265a0..a466a095c 100644 --- a/tests/robot/test_basic.robot +++ b/tests/robot/test_basic.robot @@ -4,6 +4,14 @@ Test Setup Open Browser http://localhost:11111/ Test Teardown Close All Browsers +*** Keywords *** +Submit Preferences + Set Selenium Speed 2 seconds + Submit Form id=search_form + Location Should Be http://localhost:11111/ + Set Selenium Speed 0 seconds + + *** Test Cases *** Front page Page Should Contain about @@ -33,8 +41,7 @@ Switch category 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/ + Submit Preferences Checkbox Should Not Be Selected category_general Checkbox Should Be Selected category_dummy @@ -43,8 +50,7 @@ Change language 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/ + Submit Preferences Page Should Contain rólunk Page Should Contain beállítások @@ -53,13 +59,11 @@ Change method Page Should Contain preferences Go To http://localhost:11111/preferences Select From List method GET - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be method GET Select From List method POST - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be method POST @@ -69,8 +73,7 @@ Change theme Go To http://localhost:11111/preferences List Selection Should Be theme legacy Select From List theme oscar - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be theme oscar @@ -80,8 +83,7 @@ Change safesearch Go To http://localhost:11111/preferences List Selection Should Be safesearch None Select From List safesearch Strict - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be safesearch Strict @@ -91,8 +93,7 @@ Change image proxy Go To http://localhost:11111/preferences List Selection Should Be image_proxy Disabled Select From List image_proxy Enabled - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be image_proxy Enabled @@ -102,8 +103,7 @@ Change search language Go To http://localhost:11111/preferences List Selection Should Be language Automatic Select From List language Turkish (Turkey) - tr_TR - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be language Turkish (Turkey) - tr_TR @@ -113,8 +113,7 @@ Change autocomplete Go To http://localhost:11111/preferences List Selection Should Be autocomplete - Select From List autocomplete google - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be autocomplete google @@ -126,8 +125,7 @@ Change allowed/disabled engines Element Should Contain xpath=//label[@class="deny"][@for='engine_dummy_dummy_dummy'] Block Element Should Contain xpath=//label[@class="deny"][@for='engine_general_general_dummy'] Block Click Element xpath=//label[@class="deny"][@for='engine_general_general_dummy'] - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Page Should Contain about Page Should Contain preferences Go To http://localhost:11111/preferences @@ -141,16 +139,14 @@ Block a plugin Go To http://localhost:11111/preferences List Selection Should Be theme legacy Select From List theme oscar - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences List Selection Should Be theme oscar Page Should Contain Plugins Click Link Plugins Checkbox Should Not Be Selected id=plugin_HTTPS_rewrite Click Element xpath=//label[@for='plugin_HTTPS_rewrite'] - Submit Form id=search_form - Location Should Be http://localhost:11111/ + Submit Preferences Go To http://localhost:11111/preferences Page Should Contain Plugins Click Link Plugins diff --git a/tests/unit/engines/test_kickass.py b/tests/unit/engines/test_kickass.py index 4cfcaa63c..96c17911c 100644 --- a/tests/unit/engines/test_kickass.py +++ b/tests/unit/engines/test_kickass.py @@ -14,7 +14,7 @@ class TestKickassEngine(SearxTestCase): params = kickass.request(query, dicto) self.assertIn('url', params) self.assertIn(query, params['url']) - self.assertIn('kickass.to', params['url']) + self.assertIn('kickass.cd', params['url']) self.assertFalse(params['verify']) def test_response(self): @@ -84,7 +84,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">449 <span>bytes</span></td> + <td class="nobr center">449 bytes</td> <td class="center">4</td> <td class="center">2 years</td> <td class="green center">10</td> @@ -97,7 +97,7 @@ class TestKickassEngine(SearxTestCase): self.assertEqual(type(results), list) self.assertEqual(len(results), 1) self.assertEqual(results[0]['title'], 'This should be the title') - self.assertEqual(results[0]['url'], 'https://kickass.to/url.html') + self.assertEqual(results[0]['url'], 'https://kickass.cd/url.html') self.assertEqual(results[0]['content'], 'Posted by riri in Other > Unsorted') self.assertEqual(results[0]['seed'], 10) self.assertEqual(results[0]['leech'], 1) @@ -191,7 +191,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">1 <span>KB</span></td> + <td class="nobr center">1 KiB</td> <td class="center">4</td> <td class="center">2 years</td> <td class="green center">10</td> @@ -235,7 +235,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">1 <span>MB</span></td> + <td class="nobr center">1 MiB</td> <td class="center">4</td> <td class="center">2 years</td> <td class="green center">9</td> @@ -279,7 +279,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">1 <span>GB</span></td> + <td class="nobr center">1 GiB</td> <td class="center">4</td> <td class="center">2 years</td> <td class="green center">8</td> @@ -323,7 +323,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">1 <span>TB</span></td> + <td class="nobr center">1 TiB</td> <td class="center">4</td> <td class="center">2 years</td> <td class="green center">7</td> @@ -367,7 +367,7 @@ class TestKickassEngine(SearxTestCase): </span> </div> </td> - <td class="nobr center">z <span>bytes</span></td> + <td class="nobr center">z bytes</td> <td class="center">r</td> <td class="center">2 years</td> <td class="green center">a</td> @@ -380,17 +380,17 @@ class TestKickassEngine(SearxTestCase): self.assertEqual(type(results), list) self.assertEqual(len(results), 5) self.assertEqual(results[0]['title'], 'This should be the title') - self.assertEqual(results[0]['url'], 'https://kickass.to/url.html') + self.assertEqual(results[0]['url'], 'https://kickass.cd/url.html') self.assertEqual(results[0]['content'], 'Posted by riri in Other > Unsorted') self.assertEqual(results[0]['seed'], 10) self.assertEqual(results[0]['leech'], 1) self.assertEqual(results[0]['files'], 4) self.assertEqual(results[0]['magnetlink'], 'magnet:?xt=urn:btih:MAGNETURL&dn=test') self.assertEqual(results[0]['torrentfile'], 'http://torcache.net/torrent/53917.torrent?title=test') - self.assertEqual(results[0]['filesize'], 1024) - self.assertEqual(results[1]['filesize'], 1048576) - self.assertEqual(results[2]['filesize'], 1073741824) - self.assertEqual(results[3]['filesize'], 1099511627776) + self.assertEqual(results[0]['filesize'], 1000) + self.assertEqual(results[1]['filesize'], 1000000) + self.assertEqual(results[2]['filesize'], 1000000000) + self.assertEqual(results[3]['filesize'], 1000000000000) self.assertEqual(results[4]['seed'], 0) self.assertEqual(results[4]['leech'], 0) self.assertEqual(results[4]['files'], None) |