Skip to content

Add test logs to show what the logging system provides #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
### An open-source solution for reliable testing and business automation.

#### Features include:
* Python wrappers for WebDriver to quickly create reliable scripts that run efficiently.
* Built-in Nosetest & Pytest plugins for logging test data, results, and screenshots.
* [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.
* 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).
* 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/).
* Customizable with command-line options and a global config file: [settings.py](https://github.com/mdmintz/SeleniumBase/blob/master/seleniumbase/config/settings.py).

*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).*
*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).*


### Part I: MAC SETUP INSTRUCTIONS
Expand Down
6 changes: 6 additions & 0 deletions examples/logs_for_test_fail/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
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.)

Expected Log Files:
basic_test_info.txt
page_source.html
screenshot.jpg
13 changes: 13 additions & 0 deletions examples/logs_for_test_fail/basic_test_info.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Last_Page: http://xkcd.com/731/
Browser: firefox
Traceback: Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 331, in run
testMethod()
File "/Users/michael/github/SeleniumBase/examples/test_fail.py", line 11, in test_find_army_of_robots_on_xkcd_desert_island
self.wait_for_element_visible("div#ARMY_OF_ROBOTS", timeout=0.5)
File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/base_case.py", line 206, in wait_for_element_visible
self.driver, selector, by, timeout)
File "/Users/michael/github/SeleniumBase/seleniumbase/fixtures/page_actions.py", line 179, in wait_for_element_visible
"Element %s was not visible in %s seconds!" % (selector, timeout))
ElementNotVisibleException: Message: Element div#ARMY_OF_ROBOTS was not visible in 0.5 seconds!

137 changes: 137 additions & 0 deletions examples/logs_for_test_fail/page_source.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<base href="http://xkcd.com"></base>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<link title="Default" href="/s/b0dcca.css" type="text/css" rel="stylesheet" />
<title>xkcd: Desert Island</title>
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<link type="image/x-icon" href="/s/919f27.ico" rel="shortcut icon" />
<link type="image/x-icon" href="/s/919f27.ico" rel="icon" />
<link href="/atom.xml" title="Atom 1.0" type="application/atom+xml" rel="alternate" />
<link href="/rss.xml" title="RSS 2.0" type="application/rss+xml" rel="alternate" />
<script async="" src="//www.google-analytics.com/analytics.js"></script><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-25700708-7', 'auto');
ga('send', 'pageview');
</script>
<script src="//xkcd.com/1350/jquery.min.js" type="text/javascript"></script>
<script src="//xkcd.com/static/json2.js" type="text/javascript"></script>

</head>
<body>
<div id="topContainer">
<div id="topLeft">
<ul>
<li><a href="/archive">Archive</a></li>
<li><a href="http://what-if.xkcd.com">What If?</a></li>
<li><a href="http://blag.xkcd.com">Blag</a></li>
<li><a href="http://store.xkcd.com/">Store</a></li>
<li><a href="/about" rel="author">About</a></li>
</ul>
</div>
<div id="topRight">
<div id="masthead">
<span><a href="/"><img width="185" height="83" alt="xkcd.com logo" src="//imgs.xkcd.com/static/terrible_small_logo.png" /></a></span>
<span id="slogan">A webcomic of romance,<br /> sarcasm, math, and language.</span>
</div>
<div id="news">
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 />
<br />
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.

</div>
</div>
<div class="bg box" id="bgLeft"></div>
<div class="bg box" id="bgRight"></div>
</div>
<div class="box" id="middleContainer">

<div id="ctitle">Desert Island</div>
<ul class="comicNav">
<li><a href="/1/">|&lt;</a></li>
<li><a accesskey="p" href="/730/" rel="prev">&lt; Prev</a></li>
<li><a href="//c.xkcd.com/random/comic/">Random</a></li>
<li><a accesskey="n" href="/732/" rel="next">Next &gt;</a></li>
<li><a href="/">&gt;|</a></li>
</ul>
<div id="comic">
<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" />
</div>
<ul class="comicNav">
<li><a href="/1/">|&lt;</a></li>
<li><a accesskey="p" href="/730/" rel="prev">&lt; Prev</a></li>
<li><a href="//c.xkcd.com/random/comic/">Random</a></li>
<li><a accesskey="n" href="/732/" rel="next">Next &gt;</a></li>
<li><a href="/">&gt;|</a></li>
</ul>
<br />
Permanent link to this comic: http://xkcd.com/731/<br />
Image URL (for hotlinking/embedding): http://imgs.xkcd.com/comics/desert_island.png
<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.]]
Man: Day 44: Still stranded, with nothing but flat empty water as far as the eye can see.

{{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>
<br />
<hr width="80%" />
<br />
<a href="http://amzn.to/1GCXMJ5"><img border="0" src="//imgs.xkcd.com/store/te-pages-sb.png" /></a><br />
</div>
<div class="box" id="bottom">
<img width="520" height="100" usemap="#comicmap" alt="Selected Comics" src="//imgs.xkcd.com/s/a899e84.jpg" />
<map name="comicmap" id="comicmap">
<area alt="Grownups" href="/150/" coords="0,0,100,100" shape="rect" />
<area alt="Circuit Diagram" href="/730/" coords="104,0,204,100" shape="rect" />
<area alt="Angular Momentum" href="/162/" coords="208,0,308,100" shape="rect" />
<area alt="Self-Description" href="/688/" coords="312,0,412,100" shape="rect" />
<area alt="Alternative Energy Revolution" href="/556/" coords="416,0,520,100" shape="rect" />
</map>
<div>
<!--
Search comic titles and transcripts:
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript">google.load('search', '1');google.setOnLoadCallback(function() {google.search.CustomSearchControl.attachAutoCompletion('012652707207066138651:zudjtuwe28q',document.getElementById('q'),'cse-search-box');});</script>
<form action="//www.google.com/cse" id="cse-search-box">
<div>
<input type="hidden" name="cx" value="012652707207066138651:zudjtuwe28q"/>
<input type="hidden" name="ie" value="UTF-8"/>
<input type="text" name="q" id="q" size="31"/>
<input type="submit" name="sa" value="Search"/>
</div>
</form>
<script type="text/javascript" src="//www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>
-->
<a href="/rss.xml">RSS Feed</a> - <a href="/atom.xml">Atom Feed</a>
</div>
<br />
<div id="comicLinks">
Comics I enjoy:<br />
<a href="http://threewordphrase.com/">Three Word Phrase</a>,
<a href="http://www.smbc-comics.com/">SMBC</a>,
<a href="http://www.qwantz.com">Dinosaur Comics</a>,
<a href="http://oglaf.com/">Oglaf</a> (nsfw),
<a href="http://www.asofterworld.com">A Softer World</a>,
<a href="http://buttersafe.com/">Buttersafe</a>,
<a href="http://pbfcomics.com/">Perry Bible Fellowship</a>,
<a href="http://questionablecontent.net/">Questionable Content</a>,
<a href="http://www.buttercupfestival.com/">Buttercup Festival</a>,
<a href="http://www.mspaintadventures.com/?s=6&amp;p=001901">Homestuck</a>,
<a href="http://www.jspowerhour.com/">Junior Scientist Power Hour</a>
</div>
<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>
<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>
<div id="licenseText">
<p>
This work is licensed under a
<a href="http://creativecommons.org/licenses/by-nc/2.5/">Creative Commons Attribution-NonCommercial 2.5 License</a>.
</p><p>
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>
</div>
</div>




</body><!-- Layout by Ian Clasbey, davean, and chromakode --><canvas id="fxdriver-screenshot-canvas" style="display: none;" width="960" height="1943"></canvas></html>
Binary file added examples/logs_for_test_fail/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.