Skip to content

Commit 2656a5d

Browse files
authored
Merge pull request #344 from seleniumbase/fix-pytest-html-reports
Fix pytest html reports on Windows
2 parents cc71259 + ee4be08 commit 2656a5d

File tree

7 files changed

+24
-20
lines changed

7 files changed

+24
-20
lines changed

examples/my_first_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
class MyTestClass(BaseCase):
55

66
def test_basic(self):
7-
self.open("https://xkcd.com/353/") # Navigate browser to page
8-
self.assert_element('img[alt="Python"]') # Assert element on page
9-
self.click('a[rel="license"]') # Click element on page
10-
self.assert_text("free to copy", "div center") # Assert text in area
7+
self.open("https://xkcd.com/353/")
8+
self.assert_element('img[alt="Python"]')
9+
self.click('a[rel="license"]')
10+
self.assert_text("free to copy and reuse")
1111
self.open("https://xkcd.com/1481/")
12-
title = self.get_attribute("#comic img", "title") # Get an attribute
12+
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)
14-
self.click("link=Blag") # Click on link
14+
self.click("link=Blag")
1515
self.assert_text("The blag of the webcomic", "h2")
16-
self.update_text("input#s", "Robots!\n") # Type text
16+
self.update_text("input#s", "Robots!\n")
1717
self.assert_text("Hooray robots!", "#content")
1818
self.open("https://xkcd.com/1319/")
1919
self.assert_exact_text("Automation", "#ctitle")

help_docs/happy_customers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
#### Some organizations that've grown their automation with SeleniumBase include:
2-
* [HubSpot](http://www.hubspot.com/)
3-
* [Veracode](http://www.veracode.com/)
2+
* [HubSpot](https://www.hubspot.com/)
3+
* [Veracode](https://www.veracode.com/)
44
* [CA Technologies](https://www.ca.com/)
55
* [Broadcom](https://www.broadcom.com/)
66
* [iboss](https://www.iboss.com/)
7-
* [MIT](http://web.mit.edu/)
7+
* [MIT](https://web.mit.edu/)
88
* [Akamai](https://www.akamai.com/)
9-
* [VMware](http://www.vmware.com/)
10-
* [Jana](http://jana.com/)
9+
* [VMware](https://www.vmware.com/)
10+
* [Jana](https://www.linkedin.com/company/jana)
1111
* [Raid The Room](http://raidtheroom.com/)
12-
* [Harvard Medical School](http://hms.harvard.edu/)
12+
* [Harvard Medical School](https://hms.harvard.edu/)
1313
* And more...
1414

1515
**Case Study** (*HubSpot*):
1616

1717
In addition to using SeleniumBase for testing the UI of their content management system, HubSpot used SeleniumBase to automate the migration of website pages from one content management system to another, which saved them over one million US dollars and a significant amount of time.
1818

19-
Learn how HubSpot uses SeleniumBase for website testing by reading: [Automated Testing with Selenium](http://dev.hubspot.com/blog/bid/88880/Automated-Integration-Testing-with-Selenium-at-HubSpot#hs_cos_wrapper_name)
19+
Learn how HubSpot uses SeleniumBase for website testing by reading: [Automated Testing with Selenium](https://dev.hubspot.com/blog/bid/88880/Automated-Integration-Testing-with-Selenium-at-HubSpot#hs_cos_wrapper_name)
2020

21-
For more reading about automation at HubSpot, see: [The Classic "QA Team" is Obsolete](http://product.hubspot.com/blog/the-classic-qa-team-is-obsolete#hs_cos_wrapper_name)
21+
For more reading about automation at HubSpot, see: [The Classic "QA Team" is Obsolete](https://product.hubspot.com/blog/the-classic-qa-team-is-obsolete#hs_cos_wrapper_name)

integrations/node_js/my_first_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def test_basic(self):
77
self.open("https://xkcd.com/353/")
88
self.assert_element('img[alt="Python"]')
99
self.click('a[rel="license"]')
10-
self.assert_text("free to copy", "div center")
10+
self.assert_text("free to copy and reuse")
1111
self.open("https://xkcd.com/1481/")
1212
title = self.get_attribute("#comic img", "title")
1313
self.assert_true("86,400 seconds per day" in title)

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pytest>=4.6.4;python_version<"3"
1515
pytest>=5.0.1;python_version>="3"
1616
pytest-cov>=2.7.1
1717
pytest-forked>=1.0.2
18-
pytest-html>=1.21.1
18+
pytest-html==1.20.0
1919
pytest-metadata>=1.8.0
2020
pytest-ordering>=0.6
2121
pytest-rerunfailures>=7.0

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def main():
8282
data.append(' self.open("https://xkcd.com/353/")')
8383
data.append(" self.assert_element('img[alt=\"Python\"]')")
8484
data.append(" self.click('a[rel=\"license\"]')")
85-
data.append(' self.assert_text("free to copy", "div center")')
85+
data.append(' self.assert_text("free to copy and reuse")')
8686
data.append(' self.open("https://xkcd.com/1481/")')
8787
data.append(
8888
" title = self.get_attribute(\"#comic img\", \"title\")")

seleniumbase/fixtures/js_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ def post_messenger_error_message(driver, message, msg_dur):
526526

527527

528528
def highlight_with_js_2(driver, message, selector, o_bs, msg_dur):
529+
if selector == "html":
530+
selector = "body"
529531
script = ("""document.querySelector('%s').style =
530532
'box-shadow: 0px 0px 6px 6px rgba(128, 128, 128, 0.5)';"""
531533
% selector)
@@ -560,6 +562,8 @@ def highlight_with_js_2(driver, message, selector, o_bs, msg_dur):
560562

561563

562564
def highlight_with_jquery_2(driver, message, selector, o_bs, msg_dur):
565+
if selector == "html":
566+
selector = "body"
563567
script = """jQuery('%s').css('box-shadow',
564568
'0px 0px 6px 6px rgba(128, 128, 128, 0.5)');""" % selector
565569
safe_execute_script(driver, script)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.25.2',
20+
version='1.25.3',
2121
description='Reliable Browser Automation & Testing Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',
@@ -68,7 +68,7 @@
6868
'pytest>=4.6.4', # Keep at >=4.6.4 for Python 2 compatibility
6969
'pytest-cov>=2.7.1',
7070
'pytest-forked>=1.0.2',
71-
'pytest-html>=1.21.1',
71+
'pytest-html==1.20.0', # Keep at 1.20.0 (later versions have errors)
7272
'pytest-metadata>=1.8.0',
7373
'pytest-ordering>=0.6',
7474
'pytest-rerunfailures>=7.0',

0 commit comments

Comments
 (0)