Skip to content

Commit 7720cb8

Browse files
committed
Merge pull request #3 from mdmintz/example_logs
Add test logs to show what the logging system provides
2 parents 13126d5 + d8d71d9 commit 7720cb8

File tree

5 files changed

+159
-3
lines changed

5 files changed

+159
-3
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
### An open-source solution for reliable testing and business automation.
44

55
#### Features include:
6-
* Python wrappers for WebDriver to quickly create reliable scripts that run efficiently.
7-
* Built-in Nosetest & Pytest plugins for logging test data, results, and screenshots.
6+
* [Python wrappers](https://github.com/mdmintz/SeleniumBase/tree/master/seleniumbase/fixtures) for WebDriver to quickly create [reliable scripts](https://github.com/mdmintz/SeleniumBase/blob/master/examples/my_first_test.py) that run efficiently.
7+
* Built-in [Nosetest & Pytest plugins](https://github.com/mdmintz/SeleniumBase/tree/master/seleniumbase/plugins) for logging [test data, results, and screenshots](https://github.com/mdmintz/SeleniumBase/tree/master/examples/logs_for_test_fail).
88
* Simple integration with [Jenkins](http://jenkins-ci.org/), [Selenium Grid](http://docs.seleniumhq.org/projects/grid/), [MySQL](http://www.mysql.com/), [Docker](https://www.docker.com/), and [AWS](http://aws.amazon.com/).
99
* Customizable with command-line options and a global config file: [settings.py](https://github.com/mdmintz/SeleniumBase/blob/master/seleniumbase/config/settings.py).
1010

11-
*Trusted by the world's most promising companies, including HubSpot, Jana, and Veracode. Learn how HubSpot uses SeleniumBase by reading: [Automated Testing with Selenium](http://dev.hubspot.com/blog/bid/88880/Automated-Integration-Testing-with-Selenium-at-HubSpot).*
11+
*Trusted by the world's most promising companies, including [HubSpot](http://www.hubspot.com/), [Jana](http://jana.com/), and [Veracode](http://www.veracode.com/). Learn how HubSpot uses SeleniumBase by reading: [Automated Testing with Selenium](http://dev.hubspot.com/blog/bid/88880/Automated-Integration-Testing-with-Selenium-at-HubSpot).*
1212

1313

1414
### Part I: MAC SETUP INSTRUCTIONS
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The log files you see here were generated when test_fail.py ran and failed. You can expect to see similar logs for your tests/scripts if they run and fail when you have logging turned on (usage: —-with-testing_base). See the main ReadMe.md for more details. (With nosetests, you’ll want to add each of the following options separately: -—with-screenshots, —-with-page_source, and —-with-basic_test_info. With pytest, you’ll only need —-with-testing_base to have all of those log options turned on.)
2+
3+
Expected Log Files:
4+
basic_test_info.txt
5+
page_source.html
6+
screenshot.jpg
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Last_Page: http://xkcd.com/731/
2+
Browser: firefox
3+
Traceback: Traceback (most recent call last):
4+
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 331, in run
5+
testMethod()
6+
File "/Users/michael/github/SeleniumBase/examples/test_fail.py", line 11, in test_find_army_of_robots_on_xkcd_desert_island
7+
self.wait_for_element_visible("div#ARMY_OF_ROBOTS", timeout=0.5)
8+
File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/base_case.py", line 206, in wait_for_element_visible
9+
self.driver, selector, by, timeout)
10+
File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/page_actions.py", line 179, in wait_for_element_visible
11+
"Element %s was not visible in %s seconds!" % (selector, timeout))
12+
ElementNotVisibleException: Message: Element div#ARMY_OF_ROBOTS was not visible in 0.5 seconds!
13+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<base href="http://xkcd.com"></base>
2+
<!DOCTYPE html>
3+
<html xmlns="http://www.w3.org/1999/xhtml"><head>
4+
<link title="Default" href="/s/b0dcca.css" type="text/css" rel="stylesheet" />
5+
<title>xkcd: Desert Island</title>
6+
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
7+
<link type="image/x-icon" href="/s/919f27.ico" rel="shortcut icon" />
8+
<link type="image/x-icon" href="/s/919f27.ico" rel="icon" />
9+
<link href="/atom.xml" title="Atom 1.0" type="application/atom+xml" rel="alternate" />
10+
<link href="/rss.xml" title="RSS 2.0" type="application/rss+xml" rel="alternate" />
11+
<script async="" src="//www.google-analytics.com/analytics.js"></script><script>
12+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
13+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
14+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
15+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
16+
17+
ga('create', 'UA-25700708-7', 'auto');
18+
ga('send', 'pageview');
19+
</script>
20+
<script src="//xkcd.com/1350/jquery.min.js" type="text/javascript"></script>
21+
<script src="//xkcd.com/static/json2.js" type="text/javascript"></script>
22+
23+
</head>
24+
<body>
25+
<div id="topContainer">
26+
<div id="topLeft">
27+
<ul>
28+
<li><a href="/archive">Archive</a></li>
29+
<li><a href="http://what-if.xkcd.com">What If?</a></li>
30+
<li><a href="http://blag.xkcd.com">Blag</a></li>
31+
<li><a href="http://store.xkcd.com/">Store</a></li>
32+
<li><a href="/about" rel="author">About</a></li>
33+
</ul>
34+
</div>
35+
<div id="topRight">
36+
<div id="masthead">
37+
<span><a href="/"><img width="185" height="83" alt="xkcd.com logo" src="//imgs.xkcd.com/static/terrible_small_logo.png" /></a></span>
38+
<span id="slogan">A webcomic of romance,<br /> sarcasm, math, and language.</span>
39+
</div>
40+
<div id="news">
41+
Thing Explainer is available at: <a href="http://amzn.to/1GCXMJ5" title="Thing Explainer Amazon purchase link">Amazon</a>, <a href="http://www.barnesandnoble.com/w/thing-explainer-randall-munroe/1121864432?ean=9780544668256" title="Thing Explainer Barnes and Noble purchase link">Barnes &amp; Noble</a>, <a href="http://www.indiebound.org/book/9780544668256" title="Thing Explainer Indie Bound purchase link">Indie Bound</a>, <a href="http://www.hudsonbooksellers.com/thingexplainer" title="Thing Explainer Hudson purchase link">Hudson</a><br />
42+
<br />
43+
I'll be in <a href="http://www.andersonsbookshop.com/event/naperville-reads-randall-munroe" title="Napierville Reads event page">Naperville, IL</a> and <a href="https://www.eventbrite.ca/e/indigo-exclusive-randall-munroe-tickets-18694384407" title="EventBrite event page">Toronto, ON</a> (with <a href="http://www.qwantz.com/" title="Dinosaur Comics">Ryan North</a>!) next week.
44+
45+
</div>
46+
</div>
47+
<div class="bg box" id="bgLeft"></div>
48+
<div class="bg box" id="bgRight"></div>
49+
</div>
50+
<div class="box" id="middleContainer">
51+
52+
<div id="ctitle">Desert Island</div>
53+
<ul class="comicNav">
54+
<li><a href="/1/">|&lt;</a></li>
55+
<li><a accesskey="p" href="/730/" rel="prev">&lt; Prev</a></li>
56+
<li><a href="//c.xkcd.com/random/comic/">Random</a></li>
57+
<li><a accesskey="n" href="/732/" rel="next">Next &gt;</a></li>
58+
<li><a href="/">&gt;|</a></li>
59+
</ul>
60+
<div id="comic">
61+
<img alt="Desert Island" title="Telescopes and bathyscaphes and sonar probes of Scottish lakes, Tacoma Narrows bridge collapse explained with abstract phase-space maps, some x-ray slides, a music score, Minard's Napoleonic war: the most exciting new frontier is charting what's already here." src="//imgs.xkcd.com/comics/desert_island.png" />
62+
</div>
63+
<ul class="comicNav">
64+
<li><a href="/1/">|&lt;</a></li>
65+
<li><a accesskey="p" href="/730/" rel="prev">&lt; Prev</a></li>
66+
<li><a href="//c.xkcd.com/random/comic/">Random</a></li>
67+
<li><a accesskey="n" href="/732/" rel="next">Next &gt;</a></li>
68+
<li><a href="/">&gt;|</a></li>
69+
</ul>
70+
<br />
71+
Permanent link to this comic: http://xkcd.com/731/<br />
72+
Image URL (for hotlinking/embedding): http://imgs.xkcd.com/comics/desert_island.png
73+
<div style="display: none" id="transcript">[[A man sits writing in a diary on a desert island, only the sandy tip of which with a palm tree on it stands above the water. Beneath the surface is a kelp forest, some sharks, a stingray, a shipwreck, a submarine, several large jellyfish, a giant squid fighting a sperm whale, a crashed plane, some coral formations, a thermal vent emitting a plume of smoke surrounded by several annelids, and a snail.]]
74+
Man: Day 44: Still stranded, with nothing but flat empty water as far as the eye can see.
75+
76+
{{Title text: Telescopes and bathyscapes and sonar probes of Scottish lakes, Tacoma Narrows bridge collapse explained with abstract phase-space maps, some x-ray slides, a music score, Minard's Napoleonic war: the most exciting new frontier is charting what's already here.}}</div>
77+
<br />
78+
<hr width="80%" />
79+
<br />
80+
<a href="http://amzn.to/1GCXMJ5"><img border="0" src="//imgs.xkcd.com/store/te-pages-sb.png" /></a><br />
81+
</div>
82+
<div class="box" id="bottom">
83+
<img width="520" height="100" usemap="#comicmap" alt="Selected Comics" src="//imgs.xkcd.com/s/a899e84.jpg" />
84+
<map name="comicmap" id="comicmap">
85+
<area alt="Grownups" href="/150/" coords="0,0,100,100" shape="rect" />
86+
<area alt="Circuit Diagram" href="/730/" coords="104,0,204,100" shape="rect" />
87+
<area alt="Angular Momentum" href="/162/" coords="208,0,308,100" shape="rect" />
88+
<area alt="Self-Description" href="/688/" coords="312,0,412,100" shape="rect" />
89+
<area alt="Alternative Energy Revolution" href="/556/" coords="416,0,520,100" shape="rect" />
90+
</map>
91+
<div>
92+
<!--
93+
Search comic titles and transcripts:
94+
<script type="text/javascript" src="//www.google.com/jsapi"></script>
95+
<script type="text/javascript">google.load('search', '1');google.setOnLoadCallback(function() {google.search.CustomSearchControl.attachAutoCompletion('012652707207066138651:zudjtuwe28q',document.getElementById('q'),'cse-search-box');});</script>
96+
<form action="//www.google.com/cse" id="cse-search-box">
97+
<div>
98+
<input type="hidden" name="cx" value="012652707207066138651:zudjtuwe28q"/>
99+
<input type="hidden" name="ie" value="UTF-8"/>
100+
<input type="text" name="q" id="q" size="31"/>
101+
<input type="submit" name="sa" value="Search"/>
102+
</div>
103+
</form>
104+
<script type="text/javascript" src="//www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>
105+
-->
106+
<a href="/rss.xml">RSS Feed</a> - <a href="/atom.xml">Atom Feed</a>
107+
</div>
108+
<br />
109+
<div id="comicLinks">
110+
Comics I enjoy:<br />
111+
<a href="http://threewordphrase.com/">Three Word Phrase</a>,
112+
<a href="http://www.smbc-comics.com/">SMBC</a>,
113+
<a href="http://www.qwantz.com">Dinosaur Comics</a>,
114+
<a href="http://oglaf.com/">Oglaf</a> (nsfw),
115+
<a href="http://www.asofterworld.com">A Softer World</a>,
116+
<a href="http://buttersafe.com/">Buttersafe</a>,
117+
<a href="http://pbfcomics.com/">Perry Bible Fellowship</a>,
118+
<a href="http://questionablecontent.net/">Questionable Content</a>,
119+
<a href="http://www.buttercupfestival.com/">Buttercup Festival</a>,
120+
<a href="http://www.mspaintadventures.com/?s=6&amp;p=001901">Homestuck</a>,
121+
<a href="http://www.jspowerhour.com/">Junior Scientist Power Hour</a>
122+
</div>
123+
<p>Warning: this comic occasionally contains strong language (which may be unsuitable for children), unusual humor (which may be unsuitable for adults), and advanced mathematics (which may be unsuitable for liberal-arts majors).</p>
124+
<div id="footnote">BTC 1FhCLQK2ZXtCUQDtG98p6fVH7S6mxAsEey<br />We did not invent the algorithm. The algorithm consistently finds Jesus. The algorithm killed Jeeves. <br />The algorithm is banned in China. The algorithm is from Jersey. The algorithm constantly finds Jesus.<br />This is not the algorithm. This is close.</div>
125+
<div id="licenseText">
126+
<p>
127+
This work is licensed under a
128+
<a href="http://creativecommons.org/licenses/by-nc/2.5/">Creative Commons Attribution-NonCommercial 2.5 License</a>.
129+
</p><p>
130+
This means you're free to copy and share these comics (but not to sell them). <a href="/license.html" rel="license">More details</a>.</p>
131+
</div>
132+
</div>
133+
134+
135+
136+
137+
</body><!-- Layout by Ian Clasbey, davean, and chromakode --><canvas id="fxdriver-screenshot-canvas" style="display: none;" width="960" height="1943"></canvas></html>
575 KB
Loading

0 commit comments

Comments
 (0)