You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li>Multiselect dropdown checkboxes do not respond when clicked.</li>
@@ -454,51 +477,42 @@ <h3 id="step-2-set-up-cypress">Step 2: Set up Cypress</h3>
454
477
$ npm install
455
478
</code></pre>
456
479
<h2id="writing-a-test">Writing a test</h2>
457
-
<p>See the <ahref="#wizard">Wizard</a> example to understand how to author tests for your interactive app. Specifically, note how the <code>@test</code> attribute and
458
-
the <code>run_tests()</code> function is used.</p>
459
-
<pre><codeclass="py">
460
-
@test
461
-
def test_wizard(t):
462
-
t.visit('/demo')
463
-
t.locate('step1').click()
464
-
t.locate('text').should('have.text', 'What is your name?')
465
-
t.locate('nickname').clear().type('Fred')
466
-
t.locate('step2').click()
467
-
t.locate('text').should('have.text', 'Hi Fred! How do you feel right now?')
468
-
t.locate('feeling').clear().type('quirky')
469
-
t.locate('step3').click()
470
-
t.locate('text').should('have.text', 'What a coincidence, Fred! I feel quirky too!')
471
-
472
-
473
-
if len(sys.argv) > 1 and sys.argv[1] == 'test':
474
-
run_tests()
475
-
else:
476
-
listen('/demo', main)
480
+
<p>See the <ahref="#wizard">Wizard</a> example to understand how to author tests for your interactive app. Specifically, note how the <code>@cypress</code> attribute is used. Refer to the <ahref="https://docs.cypress.io/api/api/table-of-contents.html">Cypress API</a> to learn how to author assertions.</p>
481
+
<pre><codeclass="py">from h2o_q import cypress
482
+
483
+
@cypress('Walk through the wizard')
484
+
def test_wizard(cy):
485
+
cy.visit('/demo')
486
+
cy.locate('step1').click()
487
+
cy.locate('text').should('have.text', 'What is your name?')
488
+
cy.locate('nickname').clear().type('Fred')
489
+
cy.locate('step2').click()
490
+
cy.locate('text').should('have.text', 'Hi Fred! How do you feel right now?')
491
+
cy.locate('feeling').clear().type('quirky')
492
+
cy.locate('step3').click()
493
+
cy.locate('text').should('have.text', 'What a coincidence, Fred! I feel quirky too!')
477
494
478
495
</code></pre>
479
-
<p>See <ahref="https://docs.cypress.io/guides/references/assertions.html#Common-Assertions">Assertions</a> to understand how the Cypress API works.</p>
480
496
<h2id="running-your-test">Running your test</h2>
481
-
<h3id="step-1-start-the-q-server-as-usual">Step 1: Start the Q server as usual</h3>
482
-
<pre><code>$ q
483
-
</code></pre>
484
-
<h3id="step-2-start-the-q-test-bridge">Step 2: Start the Q test bridge</h3>
485
-
<p>The Q test bridge is built into your Q server executable, and helps run your Python tests on Cypress.</p>
486
-
<p>In a new terminal window, run the Q executable with the <code>-cypress</code> command line argument.</p>
487
-
<pre><code>$ qd -cypress
488
-
</code></pre>
489
-
<p>Optionally, use the <code>-cypress-dir</code> and <code>-cypress-bridge-address</code> command line arguments if you need additional control over the test bridge (run <code>qd -help</code> for details).</p>
490
-
<h3id="step-3-run-your-test">Step 3: Run your test</h3>
491
-
<p>From your app's <code>venv</code>, run:</p>
492
-
<pre><code>$ python examples/wizard.py test
493
-
</code></pre>
494
-
<p>Running the above command translates your Python test to Javascript and sends it to the Q test bridge. You should now see your test executing in the terminal window that belongs your test bridge.</p>
495
-
<h3id="step-4-optional-explore-your-executed-tests">Step 4: (Optional) Explore your executed tests</h3>
496
-
<p>All your executed tests are stored in your <code>test/cypress/integration</code> directory. To view past results and re-run tests, simply launch Cypress like this:</p>
497
+
<h3id="step-1-start-the-cypress-test-runner">Step 1: Start the Cypress test runner</h3>
497
498
<pre><code>$ cd path/to/q
498
499
$ cd test
499
500
$ ./node_modules/.bin/cypress open
500
501
</code></pre>
501
-
<p>You can then use the Cypres user interface to browse and execute individual tests interactively.</p>
502
+
<h3id="step-2-start-the-q-server-as-usual">Step 2: Start the Q server as usual</h3>
503
+
<pre><code>$ ./qd
504
+
</code></pre>
505
+
<h3id="step-3-translate-your-python-tests-to-javascript">Step 3: Translate your Python tests to Javascript</h3>
506
+
<p>To translate your Python tests to Javascript, execute the Python module or file containing your tests like this:</p>
<p>The <code>CYPRESS_INTEGRATION_TEST_DIR</code> environment variable indicates where the Q SDK should write translated files to. This must be set to the <code>cypress/integration</code> directory.</p>
510
+
<p>Alternatively, you can set the <code>CYPRESS_INTEGRATION_TEST_DIR</code> environment variable in your shell (or IDE) to simplify running your test file:</p>
0 commit comments