Skip to content

Commit b8ef5ef

Browse files
authored
Merge pull request #399 from seleniumbase/fix-issue-with-custom-settings-file
Fix issue with custom settings file usage
2 parents e47adb4 + bea81a7 commit b8ef5ef

File tree

4 files changed

+300
-211
lines changed

4 files changed

+300
-211
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_3.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1+
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_f3.png" title="SeleniumBase" align="center" height="120">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

33
[<img src="https://img.shields.io/github/release/seleniumbase/SeleniumBase.svg" alt=" " />](https://github.com/seleniumbase/SeleniumBase/releases) [<img src="https://dev.azure.com/seleniumbase/seleniumbase/_apis/build/status/seleniumbase.SeleniumBase?branchName=master" alt=" " />](https://dev.azure.com/seleniumbase/seleniumbase/_build/latest?definitionId=1&branchName=master) [<img src="https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master" alt=" " />](https://travis-ci.org/seleniumbase/SeleniumBase) [<img src="https://badges.gitter.im/seleniumbase/SeleniumBase.svg" alt=" " />](https://gitter.im/seleniumbase/SeleniumBase) [<img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" alt=" " />](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [<img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg" alt=" " />](https://github.com/seleniumbase/SeleniumBase/stargazers)
44

5-
Reliable Automation & Testing with [WebDriver APIs](https://www.seleniumhq.org/) & [pytest](https://docs.pytest.org/en/latest/).
5+
Reliable Automated Testing with [Selenium WebDriver](https://www.seleniumhq.org/) & [pytest](https://docs.pytest.org/en/latest/). SeleniumBase includes tools for [visual testing](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md), [automation-assisted validation](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md), and [user onboarding](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
66

77
<img src="https://cdn2.hubspot.net/hubfs/100006/sb_demo_mode.gif" title="SeleniumBase" height="236"><br />
8-
(<i>Above: [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) from [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) running in Demo Mode.</i>)<br />
8+
(<i>Try running [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) from [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) in Demo Mode.</i>)<br />
99
```
1010
pytest my_first_test.py --demo
1111
```
1212

13-
SeleniumBase includes tools for [visual testing](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/visual_testing/ReadMe.md), [assisted validation](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md), and [user onboarding](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
14-
15-
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/sb_logo_d.png" title="SeleniumBase" align="center" height="155">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
13+
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/super_logo_3.png" title="SeleniumBase" height="48">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
1614

1715
## <img src="https://cdn2.hubspot.net/hubfs/100006/images/super_square_logo_3a.png" title="SeleniumBase" height="32"> Get Started:
1816

help_docs/method_summary.md

Lines changed: 66 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,21 @@ self.get(url)
1414

1515
self.visit(url)
1616

17-
self.click(selector, by=By.CSS_SELECTOR,
18-
timeout=settings.SMALL_TIMEOUT, delay=0)
17+
self.click(selector, by=By.CSS_SELECTOR, timeout=None, delay=0)
1918

20-
self.slow_click(selector, by=By.CSS_SELECTOR,
21-
timeout=settings.SMALL_TIMEOUT)
19+
self.slow_click(selector, by=By.CSS_SELECTOR, timeout=None)
2220

23-
self.double_click(selector, by=By.CSS_SELECTOR,
24-
timeout=settings.SMALL_TIMEOUT)
21+
self.double_click(selector, by=By.CSS_SELECTOR, timeout=None)
2522

26-
self.click_chain(selectors_list, by=By.CSS_SELECTOR,
27-
timeout=settings.SMALL_TIMEOUT, spacing=0)
23+
self.click_chain(selectors_list, by=By.CSS_SELECTOR, timeout=None, spacing=0)
2824

29-
self.type(selector, text, by=By.CSS_SELECTOR,
30-
timeout=settings.SMALL_TIMEOUT, retry=False)
25+
self.type(selector, text, by=By.CSS_SELECTOR, timeout=None, retry=False)
3126

32-
self.update_text(selector, new_value, by=By.CSS_SELECTOR,
33-
timeout=settings.SMALL_TIMEOUT, retry=False)
27+
self.update_text(selector, new_value, by=By.CSS_SELECTOR, timeout=None, retry=False)
3428

35-
self.add_text(selector, text, by=By.CSS_SELECTOR,
36-
timeout=settings.SMALL_TIMEOUT)
29+
self.add_text(selector, text, by=By.CSS_SELECTOR, timeout=None)
3730

38-
self.send_keys(selector, text, by=By.CSS_SELECTOR,
39-
timeout=settings.SMALL_TIMEOUT)
31+
self.send_keys(selector, text, by=By.CSS_SELECTOR, timeout=None)
4032

4133
self.submit(selector, by=By.CSS_SELECTOR)
4234

@@ -76,34 +68,29 @@ self.get_link_text_attribute(link_text, attribute, hard_fail)
7668

7769
self.get_partial_link_text_attribute(link_text, attribute, hard_fail)
7870

79-
self.click_link_text(link_text, timeout=settings.SMALL_TIMEOUT)
71+
self.click_link_text(link_text, timeout=None)
8072

81-
self.click_link(link_text, timeout=settings.SMALL_TIMEOUT)
73+
self.click_link(link_text, timeout=None)
8274

83-
self.click_partial_link_text(partial_link_text, timeout=settings.SMALL_TIMEOUT)
75+
self.click_partial_link_text(partial_link_text, timeout=None)
8476

85-
self.get_text(selector, by=By.CSS_SELECTOR, timeout=settings.SMALL_TIMEOUT)
77+
self.get_text(selector, by=By.CSS_SELECTOR, timeout=None)
8678

87-
self.get_attribute(selector, attribute, by=By.CSS_SELECTOR,
88-
timeout=settings.SMALL_TIMEOUT)
79+
self.get_attribute(selector, attribute, by=By.CSS_SELECTOR, timeout=None)
8980

90-
self.set_attribute(selector, attribute, value, by=By.CSS_SELECTOR,
91-
timeout=settings.SMALL_TIMEOUT)
81+
self.set_attribute(selector, attribute, value, by=By.CSS_SELECTOR, timeout=None)
9282

9383
self.set_attributes(selector, attribute, value, by=By.CSS_SELECTOR)
9484

9585
self.set_attribute_all(selector, attribute, value, by=By.CSS_SELECTOR)
9686

97-
self.remove_attribute(selector, attribute, by=By.CSS_SELECTOR,
98-
timeout=settings.SMALL_TIMEOUT)
87+
self.remove_attribute(selector, attribute, by=By.CSS_SELECTOR, timeout=None)
9988

10089
self.remove_attributes(selector, attribute, by=By.CSS_SELECTOR)
10190

102-
self.get_property_value(selector, property, by=By.CSS_SELECTOR,
103-
timeout=settings.SMALL_TIMEOUT)
91+
self.get_property_value(selector, property, by=By.CSS_SELECTOR, timeout=None)
10492

105-
self.get_image_url(selector, by=By.CSS_SELECTOR,
106-
timeout=settings.SMALL_TIMEOUT)
93+
self.get_image_url(selector, by=By.CSS_SELECTOR, timeout=None)
10794

10895
self.find_elements(selector, by=By.CSS_SELECTOR, limit=0)
10996

@@ -121,41 +108,41 @@ self.hover_on_element(selector, by=By.CSS_SELECTOR)
121108

122109
self.hover_and_click(hover_selector, click_selector,
123110
hover_by=By.CSS_SELECTOR, click_by=By.CSS_SELECTOR,
124-
timeout=settings.SMALL_TIMEOUT)
111+
timeout=None)
125112

126113
self.hover_and_double_click(hover_selector, click_selector,
127114
hover_by=By.CSS_SELECTOR, click_by=By.CSS_SELECTOR,
128-
timeout=settings.SMALL_TIMEOUT)
115+
timeout=None)
129116

130117
self.select_option_by_text(dropdown_selector, option,
131118
dropdown_by=By.CSS_SELECTOR,
132-
timeout=settings.SMALL_TIMEOUT)
119+
timeout=None)
133120

134121
self.select_option_by_index(dropdown_selector, option,
135122
dropdown_by=By.CSS_SELECTOR,
136-
timeout=settings.SMALL_TIMEOUT)
123+
timeout=None)
137124

138125
self.select_option_by_value(dropdown_selector, option,
139126
dropdown_by=By.CSS_SELECTOR,
140-
timeout=settings.SMALL_TIMEOUT)
127+
timeout=None)
141128

142129
self.execute_script(script)
143130

144-
self.execute_async_script(script, timeout=settings.EXTREME_TIMEOUT)
131+
self.execute_async_script(script, timeout=None)
145132

146133
self.safe_execute_script(script)
147134

148135
self.set_window_size(width, height)
149136

150137
self.maximize_window()
151138

152-
self.switch_to_frame(frame, timeout=settings.SMALL_TIMEOUT)
139+
self.switch_to_frame(frame, timeout=None)
153140

154141
self.switch_to_default_content()
155142

156143
self.open_new_window(switch_to=True)
157144

158-
self.switch_to_window(window, timeout=settings.SMALL_TIMEOUT)
145+
self.switch_to_window(window, timeout=None)
159146

160147
self.switch_to_default_window()
161148

@@ -168,9 +155,9 @@ self.switch_to_default_driver()
168155

169156
self.save_screenshot(name, folder=None)
170157

171-
self.wait_for_ready_state_complete(timeout=settings.EXTREME_TIMEOUT)
158+
self.wait_for_ready_state_complete(timeout=None)
172159

173-
self.wait_for_angularjs(timeout=settings.LARGE_TIMEOUT)
160+
self.wait_for_angularjs(timeout=None)
174161

175162
self.activate_jquery()
176163

@@ -222,8 +209,7 @@ self.print_unique_links_with_status_codes()
222209

223210
self.create_folder(folder)
224211

225-
self.choose_file(selector, file_path, by=By.CSS_SELECTOR,
226-
timeout=settings.SMALL_TIMEOUT)
212+
self.choose_file(selector, file_path, by=By.CSS_SELECTOR, timeout=None)
227213

228214
self.save_element_as_image_file(selector, file_name, folder=None)
229215

@@ -259,14 +245,11 @@ self.convert_xpath_to_css(xpath)
259245

260246
self.convert_to_css_selector(selector, by)
261247

262-
self.set_value(selector, new_value, by=By.CSS_SELECTOR,
263-
timeout=settings.SMALL_TIMEOUT)
248+
self.set_value(selector, new_value, by=By.CSS_SELECTOR, timeout=None)
264249

265-
self.js_update_text(selector, new_value, by=By.CSS_SELECTOR,
266-
timeout=settings.LARGE_TIMEOUT)
250+
self.js_update_text(selector, new_value, by=By.CSS_SELECTOR, timeout=None)
267251

268-
self.jquery_update_text(selector, new_value, by=By.CSS_SELECTOR,
269-
timeout=settings.SMALL_TIMEOUT)
252+
self.jquery_update_text(selector, new_value, by=By.CSS_SELECTOR, timeout=None)
270253

271254
########
272255

@@ -324,122 +307,95 @@ self.generate_traffic_chain(pages, loops=1)
324307

325308
########
326309

327-
self.wait_for_element_present(selector, by=By.CSS_SELECTOR,
328-
timeout=settings.LARGE_TIMEOUT)
310+
self.wait_for_element_present(selector, by=By.CSS_SELECTOR, timeout=None)
329311

330-
self.wait_for_element_visible(selector, by=By.CSS_SELECTOR,
331-
timeout=settings.LARGE_TIMEOUT)
312+
self.wait_for_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
332313

333-
self.wait_for_element(selector, by=By.CSS_SELECTOR,
334-
timeout=settings.LARGE_TIMEOUT)
314+
self.wait_for_element(selector, by=By.CSS_SELECTOR, timeout=None)
335315

336-
self.get_element(selector, by=By.CSS_SELECTOR,
337-
timeout=settings.LARGE_TIMEOUT)
316+
self.get_element(selector, by=By.CSS_SELECTOR, timeout=None)
338317

339-
self.assert_element_present(selector, by=By.CSS_SELECTOR,
340-
timeout=settings.SMALL_TIMEOUT)
318+
self.assert_element_present(selector, by=By.CSS_SELECTOR, timeout=None)
341319

342-
self.find_element(selector, by=By.CSS_SELECTOR,
343-
timeout=settings.LARGE_TIMEOUT)
320+
self.find_element(selector, by=By.CSS_SELECTOR, timeout=None)
344321

345-
self.assert_element(selector, by=By.CSS_SELECTOR,
346-
timeout=settings.SMALL_TIMEOUT)
322+
self.assert_element(selector, by=By.CSS_SELECTOR, timeout=None)
347323

348-
self.assert_element_visible(selector, by=By.CSS_SELECTOR,
349-
timeout=settings.SMALL_TIMEOUT)
324+
self.assert_element_visible(selector, by=By.CSS_SELECTOR, timeout=None)
350325

351326
########
352327

353-
self.wait_for_text_visible(text, selector="html", by=By.CSS_SELECTOR,
354-
timeout=settings.LARGE_TIMEOUT)
328+
self.wait_for_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
355329

356-
self.wait_for_exact_text_visible(text, selector="html", by=By.CSS_SELECTOR,
357-
timeout=settings.LARGE_TIMEOUT)
330+
self.wait_for_exact_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
358331

359-
self.wait_for_text(text, selector="html", by=By.CSS_SELECTOR,
360-
timeout=settings.LARGE_TIMEOUT)
332+
self.wait_for_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
361333

362-
self.find_text(text, selector="html", by=By.CSS_SELECTOR,
363-
timeout=settings.LARGE_TIMEOUT)
334+
self.find_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
364335

365-
self.assert_text_visible(text, selector="html", by=By.CSS_SELECTOR,
366-
timeout=settings.SMALL_TIMEOUT)
336+
self.assert_text_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
367337

368-
self.assert_text(text, selector="html", by=By.CSS_SELECTOR,
369-
timeout=settings.SMALL_TIMEOUT)
338+
self.assert_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
370339

371-
self.assert_exact_text(text, selector="html", by=By.CSS_SELECTOR,
372-
timeout=settings.SMALL_TIMEOUT)
340+
self.assert_exact_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
373341

374342
########
375343

376-
self.wait_for_link_text_present(link_text, timeout=settings.SMALL_TIMEOUT)
344+
self.wait_for_link_text_present(link_text, timeout=None)
377345

378-
self.wait_for_partial_link_text_present(link_text,
379-
timeout=settings.SMALL_TIMEOUT)
346+
self.wait_for_partial_link_text_present(link_text, timeout=None)
380347

381-
self.wait_for_link_text_visible(link_text, timeout=settings.LARGE_TIMEOUT)
348+
self.wait_for_link_text_visible(link_text, timeout=None)
382349

383-
self.wait_for_link_text(link_text, timeout=settings.LARGE_TIMEOUT)
350+
self.wait_for_link_text(link_text, timeout=None)
384351

385-
self.find_link_text(link_text, timeout=settings.LARGE_TIMEOUT)
352+
self.find_link_text(link_text, timeout=None)
386353

387-
self.assert_link_text(link_text, timeout=settings.SMALL_TIMEOUT)
354+
self.assert_link_text(link_text, timeout=None)
388355

389356
########
390357

391-
self.wait_for_partial_link_text(partial_link_text,
392-
timeout=settings.LARGE_TIMEOUT)
358+
self.wait_for_partial_link_text(partial_link_text, timeout=None)
393359

394-
self.find_partial_link_text(partial_link_text,
395-
timeout=settings.LARGE_TIMEOUT)
360+
self.find_partial_link_text(partial_link_text, timeout=None)
396361

397-
self.assert_partial_link_text(partial_link_text,
398-
timeout=settings.SMALL_TIMEOUT)
362+
self.assert_partial_link_text(partial_link_text, timeout=None)
399363

400364
########
401365

402-
self.wait_for_element_absent(selector, by=By.CSS_SELECTOR,
403-
timeout=settings.LARGE_TIMEOUT)
366+
self.wait_for_element_absent(selector, by=By.CSS_SELECTOR, timeout=None)
404367

405-
self.assert_element_absent(selector, by=By.CSS_SELECTOR,
406-
timeout=settings.SMALL_TIMEOUT)
368+
self.assert_element_absent(selector, by=By.CSS_SELECTOR, timeout=None)
407369

408370
########
409371

410-
self.wait_for_element_not_visible(selector, by=By.CSS_SELECTOR,
411-
timeout=settings.LARGE_TIMEOUT)
372+
self.wait_for_element_not_visible(selector, by=By.CSS_SELECTOR, timeout=None)
412373

413-
self.assert_element_not_visible(selector, by=By.CSS_SELECTOR,
414-
timeout=settings.SMALL_TIMEOUT)
374+
self.assert_element_not_visible(selector, by=By.CSS_SELECTOR, timeout=None)
415375

416376
########
417377

418-
self.wait_for_text_not_visible(text, selector="html", by=By.CSS_SELECTOR,
419-
timeout=settings.LARGE_TIMEOUT)
378+
self.wait_for_text_not_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
420379

421-
self.assert_text_not_visible(text, selector="html", by=By.CSS_SELECTOR,
422-
timeout=settings.SMALL_TIMEOUT)
380+
self.assert_text_not_visible(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
423381

424382
########
425383

426-
self.wait_for_and_accept_alert(timeout=settings.LARGE_TIMEOUT)
384+
self.wait_for_and_accept_alert(timeout=None)
427385

428-
self.wait_for_and_dismiss_alert(timeout=settings.LARGE_TIMEOUT)
386+
self.wait_for_and_dismiss_alert(timeout=None)
429387

430-
self.wait_for_and_switch_to_alert(timeout=settings.LARGE_TIMEOUT)
388+
self.wait_for_and_switch_to_alert(timeout=None)
431389

432390
########
433391

434392
self.check_window(name="default", level=0, baseline=False)
435393

436394
########
437395

438-
self.delayed_assert_element(selector, by=By.CSS_SELECTOR,
439-
timeout=settings.MINI_TIMEOUT)
396+
self.delayed_assert_element(selector, by=By.CSS_SELECTOR, timeout=None)
440397

441-
self.delayed_assert_text(text, selector="html", by=By.CSS_SELECTOR,
442-
timeout=settings.MINI_TIMEOUT)
398+
self.delayed_assert_text(text, selector="html", by=By.CSS_SELECTOR, timeout=None)
443399

444400
self.process_delayed_asserts()
445401
```

0 commit comments

Comments
 (0)