Commit 5635e791 by Gabriel Falcao

pushing docs

parent f136c9f7
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<meta name="description" content="Instructions to install lettuce in your computer, requires python and maybe git." /> <meta name="description" content="Instructions to install lettuce in your computer, requires python and maybe git." />
<meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Installing"/ > <meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Installing"/ >
<meta name="author" content="Gabriel Falcão" /> <meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap-responsive.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.main.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.main.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.grey.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/lettuce.docs.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/pygments.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="http://localhost:4000/favicon.png" type="image/x-icon" /> <link rel="shortcut icon" href="http://falcao.it/lettuce/favicon.png" type="image/x-icon" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
...@@ -22,19 +22,32 @@ ...@@ -22,19 +22,32 @@
<div id="sidebar"> <div id="sidebar">
<ul> <ul>
<li ><a href="http://localhost:4000"><i class="icon icon-home"></i> <span>Welcome</span></a></li> <li ><a href="http://falcao.it/lettuce"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
<li class="submenu open tutorial">
<a href="#"><i class="icon icon-th-list"></i> <span>Tutorial</span> <span class="label">4</span></a>
<ul>
<li ><a href="http://falcao.it/lettuce/Tutorial/simple.html">Writing your very first test</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/tables.html">Introducing Step Tables</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html">calling steps from inside other steps</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/multiline.html">Multi-line strings</a></li>
</ul>
</li>
<li class="submenu open introduction"> <li class="submenu open introduction">
<a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">2</span></a> <a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">3</span></a>
<ul> <ul>
<li ><a href="http://localhost:4000/Introduction/introduction-overview.html">Overview</a></li><li class="active"><a href="http://localhost:4000/Introduction/introduction-installing.html">Installing</a></li> <li class="active"><a href="http://falcao.it/lettuce/Introduction/installing.html">Installing</a></li><li ><a href="http://falcao.it/lettuce/Introduction/overview.html">Overview</a></li><li ><a href="http://falcao.it/lettuce/Introduction/what-the-feature.html">What The Feature</a></li>
</ul> </ul>
</li> </li>
<li style="padding: 5px; text-align: right">
<iframe style="border: 0; margin: 0; padding: 0;" src="https://www.gittip.com/gabrielfalcao/widget.html" width="48pt" height="22pt"></iframe>
</li>
</ul> </ul>
</div> </div>
<div id="content"> <div id="content">
<div id="content-header"> <div id="content-header">
...@@ -44,10 +57,10 @@ ...@@ -44,10 +57,10 @@
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a> <a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
<span class="divider">/</span> <span class="divider">/</span>
<a href="http://localhost:4000/Introduction/introduction-installing.html">Introduction</a> <a href="http://falcao.it/lettuce/Introduction/installing.html">Introduction</a>
<span class="divider">/</span> <span class="divider">/</span>
<a href="http://localhost:4000/Introduction/introduction-installing.html" class="current">Installing</a> <a href="http://falcao.it/lettuce/Introduction/installing.html" class="current">Installing</a>
</div> </div>
<div class="container-fluid doc-contents"> <div class="container-fluid doc-contents">
<div class="row-fluid"> <div class="row-fluid">
...@@ -92,15 +105,15 @@ bleeding edge version of Lettuce by taking the git HEAD</p> ...@@ -92,15 +105,15 @@ bleeding edge version of Lettuce by taking the git HEAD</p>
</div> </div>
</div> </div>
</div> </div>
<script src="http://localhost:4000/media/js/excanvas.min.js"></script> <script src="http://falcao.it/lettuce/media/js/excanvas.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.ui.custom.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.ui.custom.js"></script>
<script src="http://localhost:4000/media/js/bootstrap.min.js"></script> <script src="http://falcao.it/lettuce/media/js/bootstrap.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.resize.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.resize.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.peity.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.peity.min.js"></script>
<script src="http://localhost:4000/media/js/fullcalendar.min.js"></script> <script src="http://falcao.it/lettuce/media/js/fullcalendar.min.js"></script>
<script src="http://localhost:4000/media/js/unicorn.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.js"></script>
<script src="http://localhost:4000/media/js/unicorn.dashboard.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.dashboard.js"></script>
</body> </body>
</html> </html>
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<meta name="description" content="Overview of lettuce, how it works and what is its purpose" /> <meta name="description" content="Overview of lettuce, how it works and what is its purpose" />
<meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Overview"/ > <meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Overview"/ >
<meta name="author" content="Gabriel Falcão" /> <meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap-responsive.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.main.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.main.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.grey.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/lettuce.docs.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/pygments.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="http://localhost:4000/favicon.png" type="image/x-icon" /> <link rel="shortcut icon" href="http://falcao.it/lettuce/favicon.png" type="image/x-icon" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
...@@ -22,19 +22,32 @@ ...@@ -22,19 +22,32 @@
<div id="sidebar"> <div id="sidebar">
<ul> <ul>
<li ><a href="http://localhost:4000"><i class="icon icon-home"></i> <span>Welcome</span></a></li> <li ><a href="http://falcao.it/lettuce"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
<li class="submenu open tutorial">
<a href="#"><i class="icon icon-th-list"></i> <span>Tutorial</span> <span class="label">4</span></a>
<ul>
<li ><a href="http://falcao.it/lettuce/Tutorial/simple.html">Writing your very first test</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/tables.html">Introducing Step Tables</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html">calling steps from inside other steps</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/multiline.html">Multi-line strings</a></li>
</ul>
</li>
<li class="submenu open introduction"> <li class="submenu open introduction">
<a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">2</span></a> <a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">3</span></a>
<ul> <ul>
<li class="active"><a href="http://localhost:4000/Introduction/introduction-overview.html">Overview</a></li><li ><a href="http://localhost:4000/Introduction/introduction-installing.html">Installing</a></li> <li ><a href="http://falcao.it/lettuce/Introduction/installing.html">Installing</a></li><li class="active"><a href="http://falcao.it/lettuce/Introduction/overview.html">Overview</a></li><li ><a href="http://falcao.it/lettuce/Introduction/what-the-feature.html">What The Feature</a></li>
</ul> </ul>
</li> </li>
<li style="padding: 5px; text-align: right">
<iframe style="border: 0; margin: 0; padding: 0;" src="https://www.gittip.com/gabrielfalcao/widget.html" width="48pt" height="22pt"></iframe>
</li>
</ul> </ul>
</div> </div>
<div id="content"> <div id="content">
<div id="content-header"> <div id="content-header">
...@@ -44,10 +57,10 @@ ...@@ -44,10 +57,10 @@
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a> <a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
<span class="divider">/</span> <span class="divider">/</span>
<a href="http://localhost:4000/Introduction/introduction-overview.html">Introduction</a> <a href="http://falcao.it/lettuce/Introduction/overview.html">Introduction</a>
<span class="divider">/</span> <span class="divider">/</span>
<a href="http://localhost:4000/Introduction/introduction-overview.html" class="current">Overview</a> <a href="http://falcao.it/lettuce/Introduction/overview.html" class="current">Overview</a>
</div> </div>
<div class="container-fluid doc-contents"> <div class="container-fluid doc-contents">
<div class="row-fluid"> <div class="row-fluid">
...@@ -95,15 +108,15 @@ Hands on!</p> ...@@ -95,15 +108,15 @@ Hands on!</p>
</div> </div>
</div> </div>
</div> </div>
<script src="http://localhost:4000/media/js/excanvas.min.js"></script> <script src="http://falcao.it/lettuce/media/js/excanvas.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.ui.custom.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.ui.custom.js"></script>
<script src="http://localhost:4000/media/js/bootstrap.min.js"></script> <script src="http://falcao.it/lettuce/media/js/bootstrap.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.resize.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.resize.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.peity.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.peity.min.js"></script>
<script src="http://localhost:4000/media/js/fullcalendar.min.js"></script> <script src="http://falcao.it/lettuce/media/js/fullcalendar.min.js"></script>
<script src="http://localhost:4000/media/js/unicorn.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.js"></script>
<script src="http://localhost:4000/media/js/unicorn.dashboard.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.dashboard.js"></script>
</body> </body>
</html> </html>
server: prepare
@printf "\033[1;32mjekyll --url http://localhost:4000\033[0m\n"
@jekyll --url http://localhost:4000
prepare:
@printf "\033[1;31mCleaning up current site...\033[0m"
@rm -rf _site/*
@printf "\033[1;31mOK\033[0m\n"
deploy: prepare
@printf "\033[1;32mjekyll --no-server --no-auto\033[0m\n"
@jekyll --no-server --no-auto
quick: deploy
<!DOCTYPE html>
<html lang="en">
<head>
<title>calling steps from inside other steps - Lettuce Documentation</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Instructions to install lettuce in your computer, requires python and maybe git." />
<meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,calling steps from inside other steps"/ >
<meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.main.css" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="http://falcao.it/lettuce/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="http://falcao.it/lettuce/favicon.png" type="image/x-icon" />
</head>
<body>
<div id="header">
<h1><a href="./dashboard.html">calling steps from inside other steps</a></h1>
</div>
<div id="sidebar">
<ul>
<li ><a href="http://falcao.it/lettuce"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
<li class="submenu open tutorial">
<a href="#"><i class="icon icon-th-list"></i> <span>Tutorial</span> <span class="label">4</span></a>
<ul>
<li ><a href="http://falcao.it/lettuce/Tutorial/simple.html">Writing your very first test</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/tables.html">Introducing Step Tables</a></li><li class="active"><a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html">calling steps from inside other steps</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/multiline.html">Multi-line strings</a></li>
</ul>
</li>
<li class="submenu open introduction">
<a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">3</span></a>
<ul>
<li ><a href="http://falcao.it/lettuce/Introduction/installing.html">Installing</a></li><li ><a href="http://falcao.it/lettuce/Introduction/overview.html">Overview</a></li><li ><a href="http://falcao.it/lettuce/Introduction/what-the-feature.html">What The Feature</a></li>
</ul>
</li>
<li style="padding: 5px; text-align: right">
<iframe style="border: 0; margin: 0; padding: 0;" src="https://www.gittip.com/gabrielfalcao/widget.html" width="48pt" height="22pt"></iframe>
</li>
</ul>
</div>
<div id="content">
<div id="content-header">
<h1>calling steps from inside other steps</h1>
</div>
<div id="breadcrumb">
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
<span class="divider">/</span>
<a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html">Tutorial</a>
<span class="divider">/</span>
<a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html" class="current">calling steps from inside other steps</a>
</div>
<div class="container-fluid doc-contents">
<div class="row-fluid">
<div class="span12">
<h1>calling steps from step definitions</h1>
<p>Our tests should be as expressive as possible. However, we also want to
re-use steps that we&#39;ve seen before. With the tools we&#39;ve used so far,
you could end up with seriously long step definitions.</p>
<div class="highlight"><pre><span class="k">Scenario:</span><span class="nf"> Logged-in user does something cool.</span>
<span class="k"> Given </span><span class="nf">I go to the home page</span>
<span class="nf"> </span><span class="k">And </span><span class="nf">I click the login button</span>
<span class="nf"> </span><span class="k">And </span><span class="nf">I fill in username:floppy password:banana</span>
<span class="nf"> </span><span class="k">And </span><span class="nf">I click &quot;</span><span class="s">Login</span><span class="nf">&quot;</span>
<span class="nf"> </span><span class="k">When </span><span class="nf">I finally do something interesting</span>
<span class="nf"> </span><span class="k">Then </span><span class="nf">I&#39;m already too bored to care.</span>
</pre></div>
<p>In this case, we probably had a test case (maybe several) for which it
was actually valuable to express how the user interacted with the login
form. That&#39;s where we got the step definitions for our login sequence.
When the login form isn&#39;t especially interesting any more, however,
these steps are just noise. We&#39;d really like to be able to define
something like this without duplicating our step definitions.</p>
<div class="highlight"><pre><span class="k">Scenario:</span><span class="nf"> Logged-in user does something cool.</span>
<span class="k"> Given </span><span class="nf">I am logged in</span>
<span class="nf"> </span><span class="k">When </span><span class="nf">I do something interesting</span>
<span class="nf"> </span><span class="k">Then </span><span class="nf">The world becomes a better place</span>
</pre></div>
<p>Lettuce affords you the ability to write such a &quot;step of steps&quot; with a
set of helpers matching each of the grammar terms <code>Given</code>, <code>When</code> and
<code>Then</code>. You could accomplish the above like so.</p>
<div class="highlight"><pre><span class="nd">@step</span><span class="p">(</span><span class="s">&#39;I am logged in&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">is_logged_in</span><span class="p">(</span><span class="n">step</span><span class="p">):</span>
<span class="n">step</span><span class="o">.</span><span class="n">given</span><span class="p">(</span><span class="s">&#39;I go to the home page&#39;</span><span class="p">)</span>
<span class="n">step</span><span class="o">.</span><span class="n">given</span><span class="p">(</span><span class="s">&#39;I click the login button&#39;</span><span class="p">)</span>
<span class="c"># ... and so on.</span>
</pre></div>
<h2>running blocks of steps</h2>
<p>It is sometimes even desirable to run blocks of steps, copy-and-pasted
directly from Feature specifications. The <code>Step.behave_as</code> method lets
you do this, and you can use <code>str.format</code> to fill in parameters
dynamically. For example, we can write the above step definition like
so:</p>
<div class="highlight"><pre><span class="nd">@step</span><span class="p">(</span><span class="s">&#39;I am logged in&#39;</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">is_logged_in</span><span class="p">(</span><span class="n">step</span><span class="p">):</span>
<span class="n">step</span><span class="o">.</span><span class="n">behave_as</span><span class="p">(</span><span class="s">&quot;&quot;&quot;</span>
<span class="s"> Given I go to the home page</span>
<span class="s"> And I click the login button</span>
<span class="s"> And I fill in username:{user} password:{pass}</span>
<span class="s"> And I click &quot;Login&quot;</span>
<span class="s"> &quot;&quot;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">user</span><span class="o">=</span><span class="s">&#39;floppy&#39;</span><span class="p">,</span> <span class="k">pass</span><span class="o">=</span><span class="s">&#39;banana&#39;</span><span class="p">))</span>
</pre></div>
<p>This can be combined with step argument capture for step definitions
that are both expressive and DRY.</p>
</div>
</div>
</div>
<script src="http://falcao.it/lettuce/media/js/excanvas.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/jquery.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/jquery.ui.custom.js"></script>
<script src="http://falcao.it/lettuce/media/js/bootstrap.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/jquery.flot.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/jquery.flot.resize.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/jquery.peity.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/fullcalendar.min.js"></script>
<script src="http://falcao.it/lettuce/media/js/unicorn.js"></script>
<script src="http://falcao.it/lettuce/media/js/unicorn.dashboard.js"></script>
</body>
</html>
safe: false
auto: true
server: true
server_port: 4000
baseurl: /
permalink: /:categories/:title.html
url: http://falcao.it/lettuce
keywords: Lettuce, BDD, Python, Cucumber, Django, Sure
pygments: true
future: true
exclude: [Makefile]
{% if site.safe and site.JB.analytics.provider and page.JB.analytics != false %}
{% case site.JB.analytics.provider %}
{% when "google" %}
{% include JB/analytics-providers/google %}
{% when "getclicky" %}
{% include JB/analytics-providers/getclicky %}
{% when "mixpanel" %}
{% include JB/analytics-providers/mixpanel %}
{% when "custom" %}
{% include custom/analytics %}
{% endcase %}
{% endif %}
\ No newline at end of file
<script type="text/javascript">
var clicky_site_ids = clicky_site_ids || [];
clicky_site_ids.push({{ site.JB.analytics.getclicky.site_id }});
(function() {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = '//static.getclicky.com/js';
( document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0] ).appendChild( s );
})();
</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/{{ site.JB.analytics.getclicky.site_id }}ns.gif" /></p></noscript>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.JB.analytics.google.tracking_id }}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
\ No newline at end of file
<script type="text/javascript">
var mpq = [];
mpq.push(["init", "{{ site.JB.analytics.mixpanel.token}}"]);
(function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";
b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+
"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];
a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push(
[f].concat(Array.prototype.slice.call(arguments,0)))}};d=["init","track","track_links",
"track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<
d.length;c++){mpq[d[c]]=e(d[c])}})();
</script>
\ No newline at end of file
{% comment %}<!--
The categories_list include is a listing helper for categories.
Usage:
1) assign the 'categories_list' variable to a valid array of tags.
2) include JB/categories_list
example:
<ul>
{% assign categories_list = site.categories %}
{% include JB/categories_list %}
</ul>
Notes:
Categories can be either a Hash of Category objects (hashes) or an Array of category-names (strings).
The encapsulating 'if' statement checks whether categories_list is a Hash or Array.
site.categories is a Hash while page.categories is an array.
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}
{% if site.JB.categories_list.provider == "custom" %}
{% include custom/categories_list %}
{% else %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">
{{ category | join: "/" }} <span>{{ site.categories[category].size }}</span>
</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category[0] }}-ref">
{{ category[0] | join: "/" }} <span>{{ category[1].size }}</span>
</a></li>
{% endfor %}
{% endif %}
{% endif %}
{% assign categories_list = nil %}
\ No newline at end of file
{% if site.JB.comments.provider and page.comments != false %}
{% case site.JB.comments.provider %}
{% when "disqus" %}
{% include JB/comments-providers/disqus %}
{% when "livefyre" %}
{% include JB/comments-providers/livefyre %}
{% when "intensedebate" %}
{% include JB/comments-providers/intensedebate %}
{% when "facebook" %}
{% include JB/comments-providers/facebook %}
{% when "custom" %}
{% include custom/comments %}
{% endcase %}
{% endif %}
\ No newline at end of file
<div id="disqus_thread"></div>
<script type="text/javascript">
{% if site.safe == false %}var disqus_developer = 1;{% endif %}
var disqus_shortname = '{{ site.JB.comments.disqus.short_name }}'; // required: replace example with your forum shortname
{% if page.wordpress_id %}var disqus_identifier = '{{page.wordpress_id}} {{site.production_url}}/?p={{page.wordpress_id}}';{% endif %}
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={{ site.JB.comments.facebook.appid }}";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="{{ site.production_url }}" data-num-posts="{{ site.JB.comments.facebook.num_posts }}" data-width="{{ site.JB.comments.facebook.width }}" data-colorscheme="{{ site.JB.comments.facebook.colorscheme }}"></div>
\ No newline at end of file
<script>
var idcomments_acct = '{{ site.JB.comments.intensedebate.account }}';
var idcomments_post_id;
var idcomments_post_url;
</script>
<script type="text/javascript" src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script>
<script type='text/javascript' src='http://zor.livefyre.com/wjs/v1.0/javascripts/livefyre_init.js'></script>
<script type='text/javascript'>
var fyre = LF({
site_id: {{ site.JB.comments.livefyre.site_id }}
});
</script>
\ No newline at end of file
{% comment%}<!--
The liquid_raw helper is a way to display raw liquid code, as opposed to parsing it.
Normally you'd use Liquid's built in 'raw' tag.
The problem is GitHub Jekyll does not support the current Liquid release.
GitHub Jekyll supports the deprecated 'literal' tag.
Using one will break the other if you plan to deploy to GitHub pages.
see: https://github.com/mojombo/jekyll/issues/425
Since I don't want to mess with Liquid versions, I'll just rewrite the way I
intend to give liquid examples. It's not an elegant by any means:
Usage:
1) Define a 'text' variable with the block of liquid code you intend to display.
2) Pass the text variable to include JB/liquid_raw
example:
{% capture text %}|.% for tag in tags_list %.|
<li><a href="|.{ site.var.tags_path }.||.{ tag[0] }.|-ref">|.{ tag[0] }.| <span>|.{tag[1].size}.|</span></a></li>
|.% endfor %.|
|.% assign tags_list = null %.|{% endcapture %}
{% include JB/liquid_raw %}
As seen here, you must use "|." and ".|" as opening and closing brackets.
-->{% endcomment%}
{% if site.JB.liquid_raw.provider == "custom" %}
{% include custom/liquid_raw %}
{% else %}
<pre><code>{{text | replace:"|.", "&#123;" | replace:".|", "&#125;" | replace:">", "&gt;" | replace:"<", "&lt;" }}</code></pre>
{% endif %}
{% assign text = nil %}
\ No newline at end of file
{% comment %}<!--
The pages_list include is a listing helper.
Usage:
1) assign the 'pages_list' variable to a valid array of pages or posts.
2) include JB/pages_list
example:
<ul>
{% assign pages_list = site.pages %}
{% include JB/pages_list %}
</ul>
Grouping: (optional):
assign the 'group' variable to constrain the list to only pages/posts
in the given group. Note you must define the group manually in the page/post
meta-data to use this feature.
Grouping is mainly helpful for non-post pages.
If you want to group posts, it's easier/better to tag them, then pass the tagged posts array.
i.e. site.tags.cool_tag (this returns an array of posts tagged: cool_tag)
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}
{% if site.JB.pages_list.provider == "custom" %}
{% include custom/pages_list %}
{% else %}
{% for node in pages_list %}
{% if node.title != null %}
{% if group == null or group == node.group %}
{% if page.url == node.url %}
<li class="active"><a href="{{ BASE_PATH }}{{node.url}}" class="active">{{node.title}}</a></li>
{% else %}
<li><a href="{{ BASE_PATH }}{{node.url}}">{{node.title}}</a></li>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% assign pages_list = nil %}
{% assign group = nil %}
\ No newline at end of file
{% comment %}<!--
Collate_posts helper. Collated posts by year and month.
Usage:
1) assign the 'posts_collate' variable to a valid array of posts.
2) include JB/posts_collate
example:
{% assign posts_collate = site.posts %}
{% include JB/posts_collate %}
Ordering:
Posts are displayed in reverse chronological order.
For normal chronological order:
1) Change the for loop to this:
=> 'for post in site.posts reversed'
2) Next make sure to change 'post.previous.date' to:
=> 'post.next.date'
-->{% endcomment %}
{% if site.JB.posts_collate.provider == "custom" %}
{% include custom/posts_collate %}
{% else %}
{% for post in posts_collate %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<h2>{{this_year}}</h2>
<h3>{{this_month}}</h3>
<ul>
{% endif %}
<li><span>{{ post.date | date: "%B %e, %Y" }}</span> &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != next_year %}
</ul>
<h2>{{next_year}}</h2>
<h3>{{next_month}}</h3>
<ul>
{% else %}
{% if this_month != next_month %}
</ul>
<h3>{{next_month}}</h3>
<ul>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% assign posts_collate = nil %}
\ No newline at end of file
{% capture jbcache %}
<!--
- Dynamically set liquid variables for working with URLs/paths
-->
{% if site.JB.setup.provider == "custom" %}
{% include custom/setup %}
{% else %}
{% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
{% assign BASE_PATH = site.JB.BASE_PATH %}
{% assign HOME_PATH = site.JB.BASE_PATH %}
{% else %}
{% assign BASE_PATH = nil %}
{% assign HOME_PATH = "/" %}
{% endif %}
{% if site.JB.ASSET_PATH %}
{% assign ASSET_PATH = site.JB.ASSET_PATH %}
{% else %}
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %}
{% endif %}
{% endif %}
{% endcapture %}{% assign jbcache = nil %}
\ No newline at end of file
{% if site.safe and site.JB.sharing.provider and page.JB.sharing != false %}
{% case site.JB.sharing.provider %}
{% when "custom" %}
{% include custom/sharing %}
{% endcase %}
{% endif %}
\ No newline at end of file
{% comment %}<!--
The tags_list include is a listing helper for tags.
Usage:
1) assign the 'tags_list' variable to a valid array of tags.
2) include JB/tags_list
example:
<ul>
{% assign tags_list = site.tags %}
{% include JB/tags_list %}
</ul>
Notes:
Tags can be either a Hash of tag objects (hashes) or an Array of tag-names (strings).
The encapsulating 'if' statement checks whether tags_list is a Hash or Array.
site.tags is a Hash while page.tags is an array.
This helper can be seen in use at: ../_layouts/default.html
-->{% endcomment %}
{% if site.JB.tags_list.provider == "custom" %}
{% include custom/tags_list %}
{% else %}
{% if tags_list.first[0] == null %}
{% for tag in tags_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag }}-ref">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
{% endfor %}
{% else %}
{% for tag in tags_list %}
<li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag[0] }}-ref">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
{% endfor %}
{% endif %}
{% endif %}
{% assign tags_list = nil %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
{% if page.description %}<meta name="description" content="{{ page.description }}">{% endif %}
<meta name="author" content="{{ site.author.name }}">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="{{ ASSET_PATH }}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="{{ ASSET_PATH }}/css/style.css?body=1" rel="stylesheet" type="text/css" media="all">
<!-- Le fav and touch icons -->
<!-- Update these with your own images
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
-->
</head>
<body>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="{{ HOME_PATH }}">{{ site.title }}</a>
<ul class="nav">
{% assign pages_list = site.pages %}
{% assign group = 'navigation' %}
{% include JB/pages_list %}
</ul>
</div>
</div>
</div>
<div class="container">
<div class="content">
{{ content }}
</div>
<footer>
<p>&copy; {{ site.author.name }} 2012
with help from <a href="http://jekyllbootstrap.com" target="_blank" title="The Definitive Jekyll Blogging Framework">Jekyll Bootstrap</a>
and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
</p>
</footer>
</div> <!-- /container -->
{% include JB/analytics %}
</body>
</html>
<div class="page-header">
<h1>{{ page.title }} {% if page.tagline %} <small>{{ page.tagline }}</small>{% endif %}</h1>
</div>
<div class="row">
<div class="span12">
{{ content }}
</div>
</div>
<div class="page-header">
<h1>{{ page.title }} <small>Supporting tagline</small></h1>
</div>
<div class="row">
<div class="span8">
{{ content }}
<hr>
<div class="pagination">
<ul>
{% if page.previous %}
<li class="prev"><a href="{{ BASE_PATH }}{{ page.previous.url }}" title="{{ page.previous.title }}">&larr; Previous</a></li>
{% else %}
<li class="prev disabled"><a>&larr; Previous</a></li>
{% endif %}
<li><a href="{{ BASE_PATH }}{{ site.JB.archive_path }}">Archive</a></li>
{% if page.next %}
<li class="next"><a href="{{ BASE_PATH }}{{ page.next.url }}" title="{{ page.next.title }}">Next &rarr;</a></li>
{% else %}
<li class="next disabled"><a>Next &rarr;</a>
{% endif %}
</ul>
</div>
<hr>
{% include JB/comments %}
</div>
<div class="span4">
<h4>Published</h4>
<div class="date"><span>{{ page.date | date_to_long_string }}</span></div>
{% unless page.tags == empty %}
<h4>Tags</h4>
<ul class="tag_box">
{% assign tags_list = page.tags %}
{% include JB/tags_list %}
</ul>
{% endunless %}
</div>
</div>
theme :
name : twitter
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<title>{{ page.title }} - Lettuce Documentation</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="{{ page.description }}" />
<meta name="keywords" content="{{ site.keywords }},{{ page.keywords }}"/ >
<meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="{{ site.url }}/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="{{ site.url }}/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="{{ site.url }}/media/css/unicorn.main.css" />
<link rel="stylesheet" href="{{ site.url }}/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="{{ site.url }}/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="{{ site.url }}/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="{{ site.url }}/favicon.png" type="image/x-icon" />
</head>
<body>
<div id="header">
<h1><a href="./dashboard.html">{{ page.title }}</a></h1>
</div>
<div id="sidebar">
<ul>
<li {% if page.url == "/index.html" %} class="active"{% endif %}><a href="{{ site.url }}"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
{% assign categories_list = site.categories %}
{% for category in categories_list %}
{% assign category_name = category[0] %}
{% assign category_slug = category_name | slug %}
<li class="submenu open {{ category_slug }}">
<a href="#"><i class="icon icon-th-list"></i> <span>{{ category_name }}</span> <span class="label">{{ site.categories[category_name].size] }}</span></a>
<ul>
{% for post in category[1] %}<li {% if page.url == post.url %} class="active"{% endif %}><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
<div id="content">
<div id="content-header">
<h1>{{ page.title }}</h1>
</div>
<div id="breadcrumb">
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
{% if page.category %}
<span class="divider">/</span>
<a href="{{ site.url }}{{ page.url }}">{{ page.category }}</a>
{% endif %}
<span class="divider">/</span>
<a href="{{ site.url }}{{ page.url }}" class="current">{{ page.title }}</a>
</div>
<div class="container-fluid doc-contents">
<div class="row-fluid">
<div class="span12">
{{ content }}
</div>
</div>
</div>
<script src="{{ site.url }}/media/js/excanvas.min.js"></script>
<script src="{{ site.url }}/media/js/jquery.min.js"></script>
<script src="{{ site.url }}/media/js/jquery.ui.custom.js"></script>
<script src="{{ site.url }}/media/js/bootstrap.min.js"></script>
<script src="{{ site.url }}/media/js/jquery.flot.min.js"></script>
<script src="{{ site.url }}/media/js/jquery.flot.resize.min.js"></script>
<script src="{{ site.url }}/media/js/jquery.peity.min.js"></script>
<script src="{{ site.url }}/media/js/fullcalendar.min.js"></script>
<script src="{{ site.url }}/media/js/unicorn.js"></script>
<script src="{{ site.url }}/media/js/unicorn.dashboard.js"></script>
</body>
</html>
---
layout: default
title: Installing
keywords: Installing
category: Introduction
description: Instructions to install lettuce in your computer, requires python and maybe git.
---
# Installing Lettuce
You can install the stable verstion lettuce through
[pip](http://pypi.python.org/pypi/pip) or install the development
version through [git](http://en.wikipedia.org/wiki/Git_(software))
## Stable version
```console
user@machine:~$ [sudo] pip install lettuce
```
## Development version
If you're a more adventurous developer, you can use the
bleeding edge version of Lettuce by taking the git HEAD
If you want so, you have basically 2 options:
### Build and install the egg from sources
Good for those that just want to use the latest features
```console
user@machine:~$ git clone git://github.com/gabrielfalcao/lettuce.git
user@machine:~$ cd lettuce
user@machine:~/lettuce$ python setup.py install
```
### Use the latest code to contribute with lettuce's codebase
If it is your case, I strongly recommend a sandbox:
#### 1. Fetch the code
```console
user@machine:~/Projects$ git clone git://github.com/gabrielfalcao/lettuce.git
```
#### 2. Add to your PYTHONPATH
```console
user@machine:~/Projects$ echo "export PYTHONPATH=$HOME/Projects/lettuce:$PYTHONPATH" >> $HOME/.bashrc
```
3. Open a new terminal and enjoy!
---
layout: default
title: Overview
keywords: Overview
category: Introduction
description: Overview of lettuce, how it works and what is its purpose
---
# Overview of Behavior-driven development
Behaviour-driven development is a very good approach for maintaining
the workflow plain, so you only spend time with what really matters:
business value. The common BDD approach basically consists in:
* writing some unit tests
* running these tests
* making these tests fail
* writing code
* making the code pass these tests (green status)
This is a very awesome practice, since you can build huge and reliable
software without fearing the future. You don’t need to worry if those
millions of lines of code won’t make sense in 10 years, as long as
they keep passing the tests. Despite BDD, other kind of tests are very
important and usually follow a similar workflow: functional,
integration and acceptance.
Nevertheless, BDD brings new perspectives to you, one of them is the
outside-in testing development. With this approach you can build your
software starting with the most external layer, and go deeper until
reach unitary tests. Introducing Lettuce
Lettuce is a very simple BDD tool based on the Cucumber, which
currently has many more features than Lettuce.
Lettuce aims the most common tasks on BDD and it focus specially on
those that make BDD so fun :)
# Lettuce pragma
Provide to the developers the ability of describing features in a natural language, by creating one or more scenarios
Each scenario has one possible behaviour of the feature you want to implement. To make the scenarios run python code, it is necessary to define steps.
Hands on!
This documentation will drive you through all the Lettuce features. When you feel a bit comfortable, go to the first part of the tutorial, or go further on the reference.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Overview - Lettuce Documentation</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="Overview of lettuce, how it works and what is its purpose" />
<meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Overview"/ >
<meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.main.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="http://localhost:4000/favicon.png" type="image/x-icon" />
</head>
<body>
<div id="header">
<h1><a href="./dashboard.html">Overview</a></h1>
</div>
<div id="sidebar">
<ul>
<li ><a href="http://localhost:4000"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
<li class="submenu open introduction">
<a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">2</span></a>
<ul>
<li ><a href="http://localhost:4000/Introduction/introduction-overview.html">Overview</a></li><li ><a href="http://localhost:4000/Introduction/introduction-installing.html">Installing</a></li>
</ul>
</li>
</ul>
</div>
<div id="content">
<div id="content-header">
<h1>Overview</h1>
</div>
<div id="breadcrumb">
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
<span class="divider">/</span>
<a href="http://localhost:4000/introduction-overview.html">lessons</a>
<span class="divider">/</span>
<a href="http://localhost:4000/introduction-overview.html" class="current">Overview</a>
</div>
<div class="container-fluid doc-contents">
<div class="row-fluid">
<div class="span12">
<h1>Overview of Behavior-driven development</h1>
<p>Behaviour-driven development is a very good approach for maintaining
the workflow plain, so you only spend time with what really matters:
business value. The common BDD approach basically consists in:</p>
<ul>
<li>writing some unit tests</li>
<li>running these tests</li>
<li>making these tests fail</li>
<li>writing code</li>
<li>making the code pass these tests (green status)</li>
</ul>
<p>This is a very awesome practice, since you can build huge and reliable
software without fearing the future. You don’t need to worry if those
millions of lines of code won’t make sense in 10 years, as long as
they keep passing the tests. Despite BDD, other kind of tests are very
important and usually follow a similar workflow: functional,
integration and acceptance.</p>
<p>Nevertheless, BDD brings new perspectives to you, one of them is the
outside-in testing development. With this approach you can build your
software starting with the most external layer, and go deeper until
reach unitary tests. Introducing Lettuce</p>
<p>Lettuce is a very simple BDD tool based on the Cucumber, which
currently has many more features than Lettuce.</p>
<p>Lettuce aims the most common tasks on BDD and it focus specially on
those that make BDD so fun :)</p>
<h1>Lettuce pragma</h1>
<p>Provide to the developers the ability of describing features in a natural language, by creating one or more scenarios
Each scenario has one possible behaviour of the feature you want to implement. To make the scenarios run python code, it is necessary to define steps.
Hands on!</p>
<p>This documentation will drive you through all the Lettuce features. When you feel a bit comfortable, go to the first part of the tutorial, or go further on the reference.</p>
</div>
</div>
</div>
<script src="http://localhost:4000/media/js/excanvas.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.ui.custom.js"></script>
<script src="http://localhost:4000/media/js/bootstrap.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.resize.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.peity.min.js"></script>
<script src="http://localhost:4000/media/js/fullcalendar.min.js"></script>
<script src="http://localhost:4000/media/js/unicorn.js"></script>
<script src="http://localhost:4000/media/js/unicorn.dashboard.js"></script>
</body>
</html>
This source diff could not be displayed because it is too large. You can view the blob instead.
.doc-contents {font-size: 14px;}
.doc-contents h1 {font-size: 28px; font-weight: bold;}
.doc-contents h2 {font-size: 24px; font-weight: bold;}
.doc-contents h3 {font-size: 20px; font-weight: bold;}
.doc-contents h4 {font-size: 18px; font-weight: bold;}
.doc-contents h5 {font-size: 18px; font-weight: normal;}
.doc-contents h6 {font-size: 18px; font-weight: normal; text-transform: italic;}
.doc-contents .row-fluid { margin: 0; }
.doc-contents.container-fluid .row-fluid:first-child {
margin-top: 5px;
}
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
\ No newline at end of file
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
body {
background-color: #444444;
}
#header {
box-shadow: 0 1px 0 #333333;
background-color: #333333;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#3F3F3F), to(#222222));
background-image: -webkit-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -moz-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -ms-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -o-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: linear-gradient(top, #3F3F3F 0%, #222222 100%);
border-bottom: 1px solid #555555;
}
#search input[type=text], #search button {
background-color: #222222;
}
#search input[type=text]:focus {
color: #777777;
}
#sidebar > ul {
border-top: 1px solid #393939;
border-bottom: 1px solid #4E4E4E;
}
#sidebar > ul > li {
border-top: 1px solid #4E4E4E;
border-bottom: 1px solid #393939;
}
#sidebar > ul > li.active {
background-color: #3a3a3a;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#333333), to(#3F3F3F));
background-image: -webkit-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -moz-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -ms-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -o-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: linear-gradient(top, #333333 0%, #3F3F3F 100%);
}
#sidebar > ul > li.open.submenu > a {
border-bottom: 1px solid #393939;
}
#sidebar > ul > li.open.active.submenu > a {
border-bottom: 1px solid #2A2A2A;
}
#sidebar > ul > li > a > .label {
background-color: #333333;
}
#sidebar > ul > li > a:hover {
background-color: #4A4A4A;
}
#sidebar > ul ul {
border-top: 1px solid #4E4E4E;
background-color: #2A2A2A;
}
#sidebar > ul ul li a {
border-top: 1px solid #333333;
border-bottom: 1px solid #202020;
}
#sidebar > ul ul li a:hover, #sidebar > ul ul li.active a {
color: #CCCCCC;
background-color: #272727;
}
.dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover {
background-color: #444444;
}
@media (max-width: 480px) {
#sidebar > a {
background-image: -moz-linear-gradient(top, #464646 0%, #404040 100%);
border-bottom: 1px solid #6e6e6e;
}
#sidebar > ul {
background-color: #444444;
}
}
@media (min-width: 481px) and (max-width: 767px) {
#sidebar > ul ul:before {
border-right: 7px solid rgba(0, 0, 0, 0.2);
}
#sidebar > ul ul:after {
border-right: 6px solid #222222;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
// === Prepare peity charts === //
unicorn.peity();
// === Prepare the chart data ===/
var sin = [], cos = [];
for (var i = 0; i < 14; i += 0.5) {
sin.push([i, Math.sin(i)]);
cos.push([i, Math.cos(i)]);
}
// === Make chart === //
var plot = $.plot($(".chart"),
[ { data: sin, label: "sin(x)", color: "#BA1E20"}, { data: cos, label: "cos(x)",color: "#459D1C" } ], {
series: {
lines: { show: true },
points: { show: true }
},
grid: { hoverable: true, clickable: true },
yaxis: { min: -1.6, max: 1.6 }
});
// === Point hover in chart === //
var previousPoint = null;
$(".chart").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$('#tooltip').fadeOut(200,function(){
$(this).remove();
});
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
unicorn.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y);
}
} else {
$('#tooltip').fadeOut(200,function(){
$(this).remove();
});
previousPoint = null;
}
});
// === Calendar === //
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('.calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true,
events: [
{
title: 'All day event',
start: new Date(y, m, 1)
},
{
title: 'Long event',
start: new Date(y, m, 5),
end: new Date(y, m, 8)
},
{
id: 999,
title: 'Repeating event',
start: new Date(y, m, 2, 16, 0),
end: new Date(y, m, 3, 18, 0),
allDay: false
},
{
id: 999,
title: 'Repeating event',
start: new Date(y, m, 9, 16, 0),
end: new Date(y, m, 10, 18, 0),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, 14, 12, 0),
end: new Date(y, m, 15, 14, 0),
allDay: false
},
{
title: 'Birthday PARTY',
start: new Date(y, m, 18),
end: new Date(y, m, 20),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 27),
end: new Date(y, m, 29),
url: 'http://www.google.com'
}
]
});
});
unicorn = {
// === Peity charts === //
peity: function(){
$.fn.peity.defaults.line = {
strokeWidth: 1,
delimeter: ",",
height: 24,
max: null,
min: 0,
width: 50
};
$.fn.peity.defaults.bar = {
delimeter: ",",
height: 24,
max: null,
min: 0,
width: 50
};
$(".peity_line_good span").peity("line", {
colour: "#B1FFA9",
strokeColour: "#459D1C"
});
$(".peity_line_bad span").peity("line", {
colour: "#FFC4C7",
strokeColour: "#BA1E20"
});
$(".peity_line_neutral span").peity("line", {
colour: "#CCCCCC",
strokeColour: "#757575"
});
$(".peity_bar_good span").peity("bar", {
colour: "#459D1C"
});
$(".peity_bar_bad span").peity("bar", {
colour: "#BA1E20"
});
$(".peity_bar_neutral span").peity("bar", {
colour: "#757575"
});
},
// === Tooltip for flot charts === //
flot_tooltip: function(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
top: y + 5,
left: x + 5
}).appendTo("body").fadeIn(200);
}
}
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
// === Sidebar navigation === //
$('.submenu > a').click(function(e)
{
e.preventDefault();
var submenu = $(this).siblings('ul');
var li = $(this).parents('li');
var submenus = $('#sidebar li.submenu ul');
var submenus_parents = $('#sidebar li.submenu');
if(li.hasClass('open'))
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenu.slideUp();
} else {
submenu.fadeOut(250);
}
li.removeClass('open');
} else
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenus.slideUp();
submenu.slideDown();
} else {
submenus.fadeOut(250);
submenu.fadeIn(250);
}
submenus_parents.removeClass('open');
li.addClass('open');
}
});
var ul = $('#sidebar > ul');
$('#sidebar > a').click(function(e)
{
e.preventDefault();
var sidebar = $('#sidebar');
if(sidebar.hasClass('open'))
{
sidebar.removeClass('open');
ul.slideUp(250);
} else
{
sidebar.addClass('open');
ul.slideDown(250);
}
});
// === Resize window related === //
$(window).resize(function()
{
if($(window).width() > 479)
{
ul.css({'display':'block'});
$('#content-header .btn-group').css({width:'auto'});
}
if($(window).width() < 479)
{
ul.css({'display':'none'});
fix_position();
}
if($(window).width() > 768)
{
$('#user-nav > ul').css({width:'auto',margin:'0'});
$('#content-header .btn-group').css({width:'auto'});
}
});
if($(window).width() < 468)
{
ul.css({'display':'none'});
fix_position();
}
if($(window).width() > 479)
{
$('#content-header .btn-group').css({width:'auto'});
ul.css({'display':'block'});
}
// === Tooltips === //
$('.tip').tooltip();
$('.tip-left').tooltip({ placement: 'left' });
$('.tip-right').tooltip({ placement: 'right' });
$('.tip-top').tooltip({ placement: 'top' });
$('.tip-bottom').tooltip({ placement: 'bottom' });
// === Search input typeahead === //
$('#search input[type=text]').typeahead({
source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'],
items: 4
});
// === Fixes the position of buttons group in content header and top user navigation === //
function fix_position()
{
var uwidth = $('#user-nav > ul').width();
$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});
var cwidth = $('#content-header .btn-group').width();
$('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});
}
// === Style switcher === //
$('#style-switcher i').click(function()
{
if($(this).hasClass('open'))
{
$(this).parent().animate({marginRight:'-=190'});
$(this).removeClass('open');
} else
{
$(this).parent().animate({marginRight:'+=190'});
$(this).addClass('open');
}
$(this).toggleClass('icon-arrow-left');
$(this).toggleClass('icon-arrow-right');
});
$('#style-switcher a').click(function()
{
var style = $(this).attr('href').replace('#','');
$('.skin-color').attr('href','css/unicorn.'+style+'.css');
$(this).siblings('a').css({'border-color':'transparent'});
$(this).css({'border-color':'#aaaaaa'});
});
});
This source diff could not be displayed because it is too large. You can view the blob instead.
.doc-contents {font-size: 14px;}
.doc-contents h1 {font-size: 28px; font-weight: bold;}
.doc-contents h2 {font-size: 24px; font-weight: bold;}
.doc-contents h3 {font-size: 20px; font-weight: bold;}
.doc-contents h4 {font-size: 18px; font-weight: bold;}
.doc-contents h5 {font-size: 18px; font-weight: normal;}
.doc-contents h6 {font-size: 18px; font-weight: normal; text-transform: italic;}
.doc-contents .row-fluid { margin: 0; }
.doc-contents.container-fluid .row-fluid:first-child {
margin-top: 5px;
}
.highlight { background: #ffffff; }
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */
.highlight .o { font-weight: bold } /* Operator */
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #999999 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { font-weight: bold } /* Keyword.Constant */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #009999 } /* Literal.Number */
.highlight .s { color: #d14 } /* Literal.String */
.highlight .na { color: #008080 } /* Name.Attribute */
.highlight .nb { color: #0086B3 } /* Name.Builtin */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
.highlight .no { color: #008080 } /* Name.Constant */
.highlight .ni { color: #800080 } /* Name.Entity */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
.highlight .nn { color: #555555 } /* Name.Namespace */
.highlight .nt { color: #000080 } /* Name.Tag */
.highlight .nv { color: #008080 } /* Name.Variable */
.highlight .ow { font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mf { color: #009999 } /* Literal.Number.Float */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
.highlight .sc { color: #d14 } /* Literal.String.Char */
.highlight .sd { color: #d14 } /* Literal.String.Doc */
.highlight .s2 { color: #d14 } /* Literal.String.Double */
.highlight .se { color: #d14 } /* Literal.String.Escape */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
.highlight .si { color: #d14 } /* Literal.String.Interpol */
.highlight .sx { color: #d14 } /* Literal.String.Other */
.highlight .sr { color: #009926 } /* Literal.String.Regex */
.highlight .s1 { color: #d14 } /* Literal.String.Single */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #008080 } /* Name.Variable.Class */
.highlight .vg { color: #008080 } /* Name.Variable.Global */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
\ No newline at end of file
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
body {
background-color: #444444;
}
#header {
box-shadow: 0 1px 0 #333333;
background-color: #333333;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#3F3F3F), to(#222222));
background-image: -webkit-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -moz-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -ms-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: -o-linear-gradient(top, #3F3F3F 0%, #222222 100%);
background-image: linear-gradient(top, #3F3F3F 0%, #222222 100%);
border-bottom: 1px solid #555555;
}
#search input[type=text], #search button {
background-color: #222222;
}
#search input[type=text]:focus {
color: #777777;
}
#sidebar > ul {
border-top: 1px solid #393939;
border-bottom: 1px solid #4E4E4E;
}
#sidebar > ul > li {
border-top: 1px solid #4E4E4E;
border-bottom: 1px solid #393939;
}
#sidebar > ul > li.active {
background-color: #3a3a3a;
background-image: -webkit-gradient(linear, 0 0%, 0 100%, from(#333333), to(#3F3F3F));
background-image: -webkit-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -moz-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -ms-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: -o-linear-gradient(top, #333333 0%, #3F3F3F 100%);
background-image: linear-gradient(top, #333333 0%, #3F3F3F 100%);
}
#sidebar > ul > li.open.submenu > a {
border-bottom: 1px solid #393939;
}
#sidebar > ul > li.open.active.submenu > a {
border-bottom: 1px solid #2A2A2A;
}
#sidebar > ul > li > a > .label {
background-color: #333333;
}
#sidebar > ul > li > a:hover {
background-color: #4A4A4A;
}
#sidebar > ul ul {
border-top: 1px solid #4E4E4E;
background-color: #2A2A2A;
}
#sidebar > ul ul li a {
border-top: 1px solid #333333;
border-bottom: 1px solid #202020;
}
#sidebar > ul ul li a:hover, #sidebar > ul ul li.active a {
color: #CCCCCC;
background-color: #272727;
}
.dropdown-menu li a:hover, .dropdown-menu .active a, .dropdown-menu .active a:hover {
background-color: #444444;
}
@media (max-width: 480px) {
#sidebar > a {
background-image: -moz-linear-gradient(top, #464646 0%, #404040 100%);
border-bottom: 1px solid #6e6e6e;
}
#sidebar > ul {
background-color: #444444;
}
}
@media (min-width: 481px) and (max-width: 767px) {
#sidebar > ul ul:before {
border-right: 7px solid rgba(0, 0, 0, 0.2);
}
#sidebar > ul ul:after {
border-right: 6px solid #222222;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
// === Prepare peity charts === //
unicorn.peity();
// === Prepare the chart data ===/
var sin = [], cos = [];
for (var i = 0; i < 14; i += 0.5) {
sin.push([i, Math.sin(i)]);
cos.push([i, Math.cos(i)]);
}
// === Make chart === //
var plot = $.plot($(".chart"),
[ { data: sin, label: "sin(x)", color: "#BA1E20"}, { data: cos, label: "cos(x)",color: "#459D1C" } ], {
series: {
lines: { show: true },
points: { show: true }
},
grid: { hoverable: true, clickable: true },
yaxis: { min: -1.6, max: 1.6 }
});
// === Point hover in chart === //
var previousPoint = null;
$(".chart").bind("plothover", function (event, pos, item) {
if (item) {
if (previousPoint != item.dataIndex) {
previousPoint = item.dataIndex;
$('#tooltip').fadeOut(200,function(){
$(this).remove();
});
var x = item.datapoint[0].toFixed(2),
y = item.datapoint[1].toFixed(2);
unicorn.flot_tooltip(item.pageX, item.pageY,item.series.label + " of " + x + " = " + y);
}
} else {
$('#tooltip').fadeOut(200,function(){
$(this).remove();
});
previousPoint = null;
}
});
// === Calendar === //
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('.calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'month,basicWeek,basicDay'
},
editable: true,
events: [
{
title: 'All day event',
start: new Date(y, m, 1)
},
{
title: 'Long event',
start: new Date(y, m, 5),
end: new Date(y, m, 8)
},
{
id: 999,
title: 'Repeating event',
start: new Date(y, m, 2, 16, 0),
end: new Date(y, m, 3, 18, 0),
allDay: false
},
{
id: 999,
title: 'Repeating event',
start: new Date(y, m, 9, 16, 0),
end: new Date(y, m, 10, 18, 0),
allDay: false
},
{
title: 'Lunch',
start: new Date(y, m, 14, 12, 0),
end: new Date(y, m, 15, 14, 0),
allDay: false
},
{
title: 'Birthday PARTY',
start: new Date(y, m, 18),
end: new Date(y, m, 20),
allDay: false
},
{
title: 'Click for Google',
start: new Date(y, m, 27),
end: new Date(y, m, 29),
url: 'http://www.google.com'
}
]
});
});
unicorn = {
// === Peity charts === //
peity: function(){
$.fn.peity.defaults.line = {
strokeWidth: 1,
delimeter: ",",
height: 24,
max: null,
min: 0,
width: 50
};
$.fn.peity.defaults.bar = {
delimeter: ",",
height: 24,
max: null,
min: 0,
width: 50
};
$(".peity_line_good span").peity("line", {
colour: "#B1FFA9",
strokeColour: "#459D1C"
});
$(".peity_line_bad span").peity("line", {
colour: "#FFC4C7",
strokeColour: "#BA1E20"
});
$(".peity_line_neutral span").peity("line", {
colour: "#CCCCCC",
strokeColour: "#757575"
});
$(".peity_bar_good span").peity("bar", {
colour: "#459D1C"
});
$(".peity_bar_bad span").peity("bar", {
colour: "#BA1E20"
});
$(".peity_bar_neutral span").peity("bar", {
colour: "#757575"
});
},
// === Tooltip for flot charts === //
flot_tooltip: function(x, y, contents) {
$('<div id="tooltip">' + contents + '</div>').css( {
top: y + 5,
left: x + 5
}).appendTo("body").fadeIn(200);
}
}
/**
* Unicorn Admin Template
* Diablo9983 -> diablo9983@gmail.com
**/
$(document).ready(function(){
// === Sidebar navigation === //
$('.submenu > a').click(function(e)
{
e.preventDefault();
var submenu = $(this).siblings('ul');
var li = $(this).parents('li');
var submenus = $('#sidebar li.submenu ul');
var submenus_parents = $('#sidebar li.submenu');
if(li.hasClass('open'))
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenu.slideUp();
} else {
submenu.fadeOut(250);
}
li.removeClass('open');
} else
{
if(($(window).width() > 768) || ($(window).width() < 479)) {
submenus.slideUp();
submenu.slideDown();
} else {
submenus.fadeOut(250);
submenu.fadeIn(250);
}
submenus_parents.removeClass('open');
li.addClass('open');
}
});
var ul = $('#sidebar > ul');
$('#sidebar > a').click(function(e)
{
e.preventDefault();
var sidebar = $('#sidebar');
if(sidebar.hasClass('open'))
{
sidebar.removeClass('open');
ul.slideUp(250);
} else
{
sidebar.addClass('open');
ul.slideDown(250);
}
});
// === Resize window related === //
$(window).resize(function()
{
if($(window).width() > 479)
{
ul.css({'display':'block'});
$('#content-header .btn-group').css({width:'auto'});
}
if($(window).width() < 479)
{
ul.css({'display':'none'});
fix_position();
}
if($(window).width() > 768)
{
$('#user-nav > ul').css({width:'auto',margin:'0'});
$('#content-header .btn-group').css({width:'auto'});
}
});
if($(window).width() < 468)
{
ul.css({'display':'none'});
fix_position();
}
if($(window).width() > 479)
{
$('#content-header .btn-group').css({width:'auto'});
ul.css({'display':'block'});
}
// === Tooltips === //
$('.tip').tooltip();
$('.tip-left').tooltip({ placement: 'left' });
$('.tip-right').tooltip({ placement: 'right' });
$('.tip-top').tooltip({ placement: 'top' });
$('.tip-bottom').tooltip({ placement: 'bottom' });
// === Search input typeahead === //
$('#search input[type=text]').typeahead({
source: ['Dashboard','Form elements','Common Elements','Validation','Wizard','Buttons','Icons','Interface elements','Support','Calendar','Gallery','Reports','Charts','Graphs','Widgets'],
items: 4
});
// === Fixes the position of buttons group in content header and top user navigation === //
function fix_position()
{
var uwidth = $('#user-nav > ul').width();
$('#user-nav > ul').css({width:uwidth,'margin-left':'-' + uwidth / 2 + 'px'});
var cwidth = $('#content-header .btn-group').width();
$('#content-header .btn-group').css({width:cwidth,'margin-left':'-' + uwidth / 2 + 'px'});
}
// === Style switcher === //
$('#style-switcher i').click(function()
{
if($(this).hasClass('open'))
{
$(this).parent().animate({marginRight:'-=190'});
$(this).removeClass('open');
} else
{
$(this).parent().animate({marginRight:'+=190'});
$(this).addClass('open');
}
$(this).toggleClass('icon-arrow-left');
$(this).toggleClass('icon-arrow-right');
});
$('#style-switcher a').click(function()
{
var style = $(this).attr('href').replace('#','');
$('.skin-color').attr('href','css/unicorn.'+style+'.css');
$(this).siblings('a').css({'border-color':'transparent'});
$(this).css({'border-color':'#aaaaaa'});
});
});
...@@ -7,13 +7,13 @@ ...@@ -7,13 +7,13 @@
<meta name="description" content="Lettuce is a behavior-driven development framework for python based on Cucumber. It supports over 15 languages and integrates with Django really well." /> <meta name="description" content="Lettuce is a behavior-driven development framework for python based on Cucumber. It supports over 15 languages and integrates with Django really well." />
<meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Introduction, Nutshell"/ > <meta name="keywords" content="Lettuce, BDD, Python, Cucumber, Django, Sure,Introduction, Nutshell"/ >
<meta name="author" content="Gabriel Falcão" /> <meta name="author" content="Gabriel Falcão" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/bootstrap-responsive.min.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.main.css" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.main.css" />
<link rel="stylesheet" href="http://localhost:4000/media/css/unicorn.grey.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/unicorn.grey.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/lettuce.docs.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/lettuce.docs.css" class="skin-color" />
<link rel="stylesheet" href="http://localhost:4000/media/css/pygments.css" class="skin-color" /> <link rel="stylesheet" href="http://falcao.it/lettuce/media/css/pygments.css" class="skin-color" />
<link rel="shortcut icon" href="http://localhost:4000/favicon.png" type="image/x-icon" /> <link rel="shortcut icon" href="http://falcao.it/lettuce/favicon.png" type="image/x-icon" />
</head> </head>
<body> <body>
<div id="header"> <div id="header">
...@@ -22,19 +22,32 @@ ...@@ -22,19 +22,32 @@
<div id="sidebar"> <div id="sidebar">
<ul> <ul>
<li class="active"><a href="http://localhost:4000"><i class="icon icon-home"></i> <span>Welcome</span></a></li> <li class="active"><a href="http://falcao.it/lettuce"><i class="icon icon-home"></i> <span>Welcome</span></a></li>
<li class="submenu open tutorial">
<a href="#"><i class="icon icon-th-list"></i> <span>Tutorial</span> <span class="label">4</span></a>
<ul>
<li ><a href="http://falcao.it/lettuce/Tutorial/simple.html">Writing your very first test</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/tables.html">Introducing Step Tables</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/steps-from-step-definitions.html">calling steps from inside other steps</a></li><li ><a href="http://falcao.it/lettuce/Tutorial/multiline.html">Multi-line strings</a></li>
</ul>
</li>
<li class="submenu open introduction"> <li class="submenu open introduction">
<a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">2</span></a> <a href="#"><i class="icon icon-th-list"></i> <span>Introduction</span> <span class="label">3</span></a>
<ul> <ul>
<li ><a href="http://localhost:4000/Introduction/introduction-overview.html">Overview</a></li><li ><a href="http://localhost:4000/Introduction/introduction-installing.html">Installing</a></li> <li ><a href="http://falcao.it/lettuce/Introduction/installing.html">Installing</a></li><li ><a href="http://falcao.it/lettuce/Introduction/overview.html">Overview</a></li><li ><a href="http://falcao.it/lettuce/Introduction/what-the-feature.html">What The Feature</a></li>
</ul> </ul>
</li> </li>
<li style="padding: 5px; text-align: right">
<iframe style="border: 0; margin: 0; padding: 0;" src="https://www.gittip.com/gabrielfalcao/widget.html" width="48pt" height="22pt"></iframe>
</li>
</ul> </ul>
</div> </div>
<div id="content"> <div id="content">
<div id="content-header"> <div id="content-header">
...@@ -44,7 +57,7 @@ ...@@ -44,7 +57,7 @@
<a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a> <a href="#" title="Lettuce Documentation" class="tip-bottom"><i class="icon-home"></i> Lettuce Documentation</a>
<span class="divider">/</span> <span class="divider">/</span>
<a href="http://localhost:4000/index.html" class="current">Welcome</a> <a href="http://falcao.it/lettuce/index.html" class="current">Welcome</a>
</div> </div>
<div class="container-fluid doc-contents"> <div class="container-fluid doc-contents">
<div class="row-fluid"> <div class="row-fluid">
...@@ -87,15 +100,15 @@ ...@@ -87,15 +100,15 @@
</div> </div>
</div> </div>
</div> </div>
<script src="http://localhost:4000/media/js/excanvas.min.js"></script> <script src="http://falcao.it/lettuce/media/js/excanvas.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.ui.custom.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.ui.custom.js"></script>
<script src="http://localhost:4000/media/js/bootstrap.min.js"></script> <script src="http://falcao.it/lettuce/media/js/bootstrap.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.flot.resize.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.flot.resize.min.js"></script>
<script src="http://localhost:4000/media/js/jquery.peity.min.js"></script> <script src="http://falcao.it/lettuce/media/js/jquery.peity.min.js"></script>
<script src="http://localhost:4000/media/js/fullcalendar.min.js"></script> <script src="http://falcao.it/lettuce/media/js/fullcalendar.min.js"></script>
<script src="http://localhost:4000/media/js/unicorn.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.js"></script>
<script src="http://localhost:4000/media/js/unicorn.dashboard.js"></script> <script src="http://falcao.it/lettuce/media/js/unicorn.dashboard.js"></script>
</body> </body>
</html> </html>
---
layout: default
title: Welcome
keywords: Introduction, Nutshell
description: Lettuce is a behavior-driven development framework for python based on Cucumber. It supports over 15 languages and integrates with Django really well.
---
# Lettuce in a nutshell
## 1 - install it
```console
user@machine:~$ [sudo] pip install lettuce
```
## 2 - describe your first feature
```ruby
Feature: Manipulate strings
In order to have some fun
As a programming beginner
I want to manipulate strings
Scenario: Uppercased strings
Given I have the string "lettuce leaves"
When I put it in upper case
Then I see the string is "LETTUCE LEAVES"
```
## 3 - define its steps
```python
from lettuce import *
@step('I have the string "(.*)"')
def have_the_string(step, string):
world.string = string
@step('I put it in upper case')
def put_it_in_upper(step):
world.string = world.string.upper()
@step('I see the string is "(.*)"')
def see_the_string_is(step, expected):
assert world.string == expected, \
"Got %s" % world.string
```
## 4 - watch it pass
```console
user@machine:~/Projects/my-project$ lettuce features/
```
---
layout: default
title: Overview
keywords: Overview
category : lessons
tags : [intro, beginner, jekyll, tutorial]
description: Overview of lettuce, how it works and what is its purpose
---
# Overview of Behavior-driven development
Behaviour-driven development is a very good approach for maintaining
the workflow plain, so you only spend time with what really matters:
business value. The common BDD approach basically consists in:
* writing some unit tests
* running these tests
* making these tests fail
* writing code
* making the code pass these tests (green status)
This is a very awesome practice, since you can build huge and reliable
software without fearing the future. You don’t need to worry if those
millions of lines of code won’t make sense in 10 years, as long as
they keep passing the tests. Despite BDD, other kind of tests are very
important and usually follow a similar workflow: functional,
integration and acceptance.
Nevertheless, BDD brings new perspectives to you, one of them is the
outside-in testing development. With this approach you can build your
software starting with the most external layer, and go deeper until
reach unitary tests. Introducing Lettuce
Lettuce is a very simple BDD tool based on the Cucumber, which
currently has many more features than Lettuce.
Lettuce aims the most common tasks on BDD and it focus specially on
those that make BDD so fun :)
# Lettuce pragma
Provide to the developers the ability of describing features in a natural language, by creating one or more scenarios
Each scenario has one possible behaviour of the feature you want to implement. To make the scenarios run python code, it is necessary to define steps.
Hands on!
This documentation will drive you through all the Lettuce features. When you feel a bit comfortable, go to the first part of the tutorial, or go further on the reference.
<h1>scenario outlines</h1>
<p>On our first <a href="http://falcao.it/lettuce/Tutorial/simple.html">description file</a>,
<code>zero.feature</code>, all scenarios were similar. This made us repeat most of
the text again and again.</p>
<p><strong>Isn&#39;t there a better way to deal with this - when several scenarios
are almost equal and only some values change?</strong></p>
<p>Yes, there is! :) You just need to use scenarios outlines.</p>
<p>An example is shown below:</p>
<div class="highlight"><pre><span class="k">Feature:</span><span class="nf"> Compute factorial</span>
<span class="nf"> In order to play with Lettuce</span>
<span class="nf"> As beginners</span>
<span class="nf"> We&#39;ll implement factorial</span>
<span class="nf"> </span><span class="k">Scenario Outline:</span><span class="nf"> Factorials [0-4]</span>
<span class="k"> Given </span><span class="nf">I have the number </span><span class="nv">&lt;number&gt;</span><span class="nf"></span>
<span class="nf"> </span><span class="k">When </span><span class="nf">I compute its factorial</span>
<span class="nf"> </span><span class="k">Then </span><span class="nf">I see the number </span><span class="nv">&lt;result&gt;</span><span class="nf"></span>
<span class="nf"> </span><span class="k">Examples:</span>
<span class="k"> |</span><span class="nv"> number</span><span class="k"> |</span><span class="nv"> result</span><span class="k"> |</span><span class="nf"></span>
<span class="k"> |</span><span class="s"> 0</span><span class="k"> |</span><span class="s"> 1</span><span class="k"> |</span><span class="nf"></span>
<span class="k"> |</span><span class="s"> 1</span><span class="k"> |</span><span class="s"> 1</span><span class="k"> |</span><span class="nf"></span>
<span class="k"> |</span><span class="s"> 2</span><span class="k"> |</span><span class="s"> 2</span><span class="k"> |</span><span class="nf"></span>
<span class="k"> |</span><span class="s"> 3</span><span class="k"> |</span><span class="s"> 6</span><span class="k"> |</span><span class="nf"></span>
<span class="k"> |</span><span class="s"> 4</span><span class="k"> |</span><span class="s"> 24</span><span class="k"> |</span>
</pre></div>
<p>This way, you will only need to provide the values that really change,
reducing &quot;copy &amp; paste&quot; work and making your tests more clear.</p>
<p><img src="http://falcao.it/lettuce/images/tutorial/screenshot7.png" alt="image"></p>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment