UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

1 lines 10.3 kB
Ext.data.JsonP.lambdatest_integration({"guide":"<p><p><img src=\"guides/lambdatest_integration/images/128-Px-Coloured.png\" alt=\"\" width=\"748\" height=\"128\"></p></p>\n<div class='toc'>\n<p><strong>Contents</strong></p>\n<ol>\n<li><a href='#!/guide/lambdatest_integration-section-authentication'>Authentication</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-quick-testing'>Quick testing</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-finding-the-values-for-platform-and-browsername-capability'>Finding the values for platform and browserName capability</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-parallelization'>Parallelization</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-under-the-hood'>Under the hood</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-shared-tunnel'>Shared tunnel</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-conclusion'>Conclusion</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-see-also%3A'>See also:</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-buy-this-product'>Buy this product</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-support'>Support</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-see-also'>See also</a></li>\n<li><a href='#!/guide/lambdatest_integration-section-copyright-and-license'>COPYRIGHT AND LICENSE</a></li>\n</ol>\n</div>\n\n<h1 id='lambdatest_integration-section-integration-with-lambdatest-cloud-testing-infrastructure-'>Integration with LambdaTest cloud-testing infrastructure </h1>\n\n<p>Most of the web projects need to support all major browsers. When aiming for the full certainty about the quality of the product in every supported browser,\na logical step is to run the test suite in all those browsers. Counting Chrome, Firefox, Safari, Edge - thats at least 4x\nof the single test suite launch, so for the single-machine setup, the workload can quickly become extremely intense.</p>\n\n<p>One way to solve this bottleneck is to maintain a farm of virtual machines with various OS/browser combinations.\nThis can be tricky and will consume lots of your time and resources. Another, more elegant way is to use services\nproviding the same infrastructure in the cloud. Thanks to service such as <a href=\"https://lambdatest.com/\">LambdaTest</a> it is now very simple.</p>\n\n<h2 id='lambdatest_integration-section-authentication'>Authentication</h2>\n\n<p>When registering an account in LambdaTest, you will receive a username and an access token.\nLater in this guide we will refer to these as \"LambdaTest username\" and \"LambdaTest access token\" (or LambdaTest API key).</p>\n\n<h2 id='lambdatest_integration-section-quick-testing'>Quick testing</h2>\n\n<p>Assuming your local web server is configured to listen at host \"localhost\" on port 80, all you need to launch your test suite in the cloud\nis to sign up for the LambdaTest trial and run the following command:</p>\n\n<pre><code>__SIESTA_DIR__/bin/webdriver https://localhost/my/siesta/project/wrapper.html --lambdatest LT_USERNAME,LT_KEY \n--cap browserName=firefox --cap platform=windows\n</code></pre>\n\n<p>That's all, the only difference from a normal Siesta automated launch, is the <code>--lambdatest</code> option, which is a shortcut performing\na few additional actions. We'll examine what happens under the hood later in this guide.</p>\n\n<p>Note how we have specified the desired OS/browser combination using the <code>--cap</code> switch (it specifies remote webdriver capability).\nThere are LambdaTest specific capabilities (<a href=\"https://www.lambdatest.com/capabilities-generator/\">https://www.lambdatest.com/capabilities-generator/</a>) and generic Selenium capabilities\n(<a href=\"https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities\">https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities</a>). See also <a href=\"https://www.lambdatest.com/support/docs/selenium-automation-capabilities/\">this page</a> for more information.</p>\n\n<p>If your webserver listens on a different host (<code>mylocalhost</code> for example) then the <code>--lambdatest</code> option should look like:</p>\n\n<pre><code>--lambdatest LT_USERNAME,LT_KEY,mylocalhost\n</code></pre>\n\n<h2 id='lambdatest_integration-section-finding-the-values-for-platform-and-browsername-capability'>Finding the values for platform and browserName capability</h2>\n\n<p>Sometimes it can be tricky to find the value for the \"platform\" platform, Selenium documentation provides only the generic ones.</p>\n\n<p>In such case, use the LambdaTest online tool: <a href=\"https://www.lambdatest.com/capabilities-generator/\">https://www.lambdatest.com/capabilities-generator/</a>. You can choose\nthe desired OS/browser combination there and check what capabilities should be specified for that.</p>\n\n<h2 id='lambdatest_integration-section-parallelization'>Parallelization</h2>\n\n<p>When using cloud-based infrastructure, each test page is running inside the own VM, which guarantees the exclusive focus owning\nand allows us to run several test pages in parallel. Naturally, that speeds-up the test execution, by the number of parallel sessions\nwe can run.</p>\n\n<p>This can be done using the <code>--max-workers</code> option, that specifies the maximum number of parallel sessions.</p>\n\n<h2 id='lambdatest_integration-section-under-the-hood'>Under the hood</h2>\n\n<p>Let's examine what happens under the hood when we use the <code>--lambdatest</code> shortcut option. In fact, we don't have to use this shortcut\noption and can perform all the steps listed below manually.</p>\n\n<p>1) The first thing that happens is that Siesta establishes a local tunnel from your machine to the LambdaTest server, using the LambdaTest tunnel binaries.\nYou can do this step manually by using the batch file in the Siesta package:</p>\n\n<pre><code> __SIESTA_DIR__/bin/lt --user LT_USERNAME --key LT_API_KEY --allowHosts mylocalhost\n</code></pre>\n\n<p>When launched successfully, you should see the following text:</p>\n\n<pre><code>INFO Tunnel binary started on port :9090\nINFO Using ssh(over_22) :: connection mode\nINFO Launching tunnel\nINFO You can start testing now\nINFO Tunnel ID: 1445858\n</code></pre>\n\n<p>2) The <code>--host</code> option is set to point to the LambdaTest server, based on your username and access token:</p>\n\n<pre><code>--host=\"https://LT_USERNAME:LT_API_KEY@hub.lambdatest.com/wd/hub\"\n</code></pre>\n\n<p>To sum up, instead of using the <code>--lambdatest</code> shortcut option, we could:</p>\n\n<ul>\n<li><p>launch the tunnel manually:</p>\n\n<pre><code> __SIESTA_DIR__/bin/lt --user LT_USERNAME --key LT_API_KEY --allowHosts mylocalhost\n</code></pre></li>\n<li><p>specify the command as:</p>\n\n<pre><code> __SIESTA_DIR__/bin/webdriver https://localhost/my/siesta/project/wrapper.html \n --host=\"https://LT_USERNAME:LT_API_KEY@hub.lambdatest.com/wd/hub\" \n --cap browserName=Firefox --cap platform=\"Windows 7\" \n</code></pre></li>\n</ul>\n\n\n<p>For convenience, instead of setting the <code>--host</code> option manually, one can specify <code>--lambdatest-user</code> and <code>--lambdatest-key</code> options.</p>\n\n<pre><code> __SIESTA_DIR__/bin/webdriver https://localhost/my/siesta/project/wrapper.html \n --lambdatest-user=LT_USERNAME --lambdatest-key=LT_API_KEY\n --cap browserName=Firefox --cap platform=\"Windows 7\"\n</code></pre>\n\n<h2 id='lambdatest_integration-section-shared-tunnel'>Shared tunnel</h2>\n\n<p>To share the tunnel to LambdaTest between the tests launches (saves the tunnel up/down time, convenient during development), use the\n<code>--lambdatest_</code> option, which does the same things as <code>--lambdatest</code> but uses existing tunnel.</p>\n\n<p>Then you'll need to launch the tunnel manually:</p>\n\n<pre><code> __SIESTA_DIR__/bin/lt --user LT_USERNAME --key LT_API_KEY --allowHosts mylocalhost\n</code></pre>\n\n<h2 id='lambdatest_integration-section-conclusion'>Conclusion</h2>\n\n<p>As you can see, thanks to the excellent <a href=\"https://lambdatest.com\">LambdaTest</a> infrastructure, launching your tests in the cloud is as easy as specifying\none extra argument on the command line. The benefits of cloud testing are obvious - no need to waste time and resources setting up and maintaining your own VM farm, and additionally you can run your test suite in various browsers in parallel.</p>\n\n<h2 id='lambdatest_integration-section-see-also%3A'>See also:</h2>\n\n<p><a href=\"https://www.lambdatest.com/support/docs/javascript-with-selenium-running-javascript-automation-scripts-on-lambdatest-selenium-grid/\">https://www.lambdatest.com/support/docs/javascript-with-selenium-running-javascript-automation-scripts-on-lambdatest-selenium-grid/</a>\n<a href=\"https://www.lambdatest.com/capabilities-generator/\">https://www.lambdatest.com/capabilities-generator/</a></p>\n\n<h2 id='lambdatest_integration-section-buy-this-product'>Buy this product</h2>\n\n<p>Visit our store: <a href=\"https://bryntum.com/store/siesta\">https://bryntum.com/store/siesta</a></p>\n\n<h2 id='lambdatest_integration-section-support'>Support</h2>\n\n<p>Ask a question in our community forum: <a href=\"https://www.bryntum.com/forum/viewforum.php?f=20\">https://www.bryntum.com/forum/viewforum.php?f=20</a></p>\n\n<p>Subscribers can post expedited questions in Premium Forum: <a href=\"https://www.bryntum.com/forum/viewforum.php?f=21\">https://www.bryntum.com/forum/viewforum.php?f=21</a></p>\n\n<p>Please report any bugs through the web interface at <a href=\"https://www.assembla.com/spaces/bryntum/support/tickets\">https://www.assembla.com/spaces/bryntum/support/tickets</a></p>\n\n<h2 id='lambdatest_integration-section-see-also'>See also</h2>\n\n<p>Siesta web-page: <a href=\"https://bryntum.com/products/siesta\">https://bryntum.com/products/siesta</a></p>\n\n<p>Other Bryntum products: <a href=\"https://bryntum.com/products\">https://bryntum.com/products</a></p>\n\n<h2 id='lambdatest_integration-section-copyright-and-license'>COPYRIGHT AND LICENSE</h2>\n\n<p>Copyright (c) 2009-2022, Bryntum AB &amp; Nickolay Platonov</p>\n\n<p>All rights reserved.</p>\n","title":"LambdaTest integration"});