summaryrefslogtreecommitdiff
path: root/tests/robot/test_basic.robot
blob: d0074cd00124da69b3ba29597d4d36edeb05fdcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
*** Settings ***
Library         Selenium2Library  timeout=10  implicit_wait=0.5
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
    Page Should Contain  preferences

404 page
    Go To  http://localhost:11111/no-such-page
    Page Should Contain  Page not found
    Page Should Contain  Go to search page

About page
    Click Element  link=about
    Page Should Contain  Why use searx?
    Page Should Contain Element  link=search engines

Preferences page
    Click Element  link=preferences
    Page Should Contain  Preferences
    Page Should Contain  Default categories
    Page Should Contain  Currently used search engines
    Page Should Contain  dummy dummy
    Page Should Contain  general dummy

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 Preferences
    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 Preferences
    Page Should Contain  rólunk
    Page Should Contain  beállítások

Change method
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    Select From List  method  GET
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  method  GET
    Select From List  method  POST
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  method  POST

Change theme
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  theme  legacy
    Select From List  theme  oscar
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  theme  oscar

Change safesearch
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  safesearch  None
    Select From List  safesearch  Strict
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  safesearch  Strict

Change image proxy
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  image_proxy  Disabled
    Select From List  image_proxy  Enabled
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  image_proxy  Enabled

Change search language
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  language  Default language
    Select From List  language  Türkçe - tr-TR
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  language  Türkçe - tr-TR

Change autocomplete
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  autocomplete  -
    Select From List  autocomplete  google
    Submit Preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  autocomplete  google

Change allowed/disabled engines
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    Page Should Contain  Engine name
    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 Preferences
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    Page Should Contain  Engine name
    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 a plugin
    Page Should Contain  about
    Page Should Contain  preferences
    Go To  http://localhost:11111/preferences
    List Selection Should Be  theme  legacy
    Select From List  theme  oscar
    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 Preferences
    Go To  http://localhost:11111/preferences
    Page Should Contain  Plugins
    Click Link  Plugins
    Checkbox Should Be Selected  id=plugin_HTTPS_rewrite