Closed AaronSofaer closed 9 years ago
to back a query out you have to use the query
command. so:
query .foo:
-- current query is .foo
do stuff under .foo
query #bar:
-- current query is .foo #bar
do stuff under .foo #bar
query .foo:
-- query is set back to .foo
do stuff under .foo again
I have a spec that ends with the following text:
query div.user-update: after text 'Payment Type' exists query div.user-update-row:nth-of-type(3): click selector 'button[class="button small secondary"]' after text 'Trial' exists query ul.dropdown-menu-items: click selector 'input[name="trial"]' after text 'Invoice' doesNotExist
When I run this, I get the following failing result:
"div.user-update div.user-update-row:nth-of-type(3) ul.dropdown-menu-items" contains text "Invoice"
This is clearly wrong; I've backed out of the ul.dropdown-menu-items query level and should only be querying two levels deep instead of 3.
The full spec is:
-- Batch Editing 2 Subscriptions -- https://plangrid.testrail.net/index.php?/cases/view/5681 -- assertions
visit https://gridboy-test.herokuapp.com/login:
-- assertion 1: Login is successful
query form.form: fill 'input[id="username"]' 'qaadmin@plangrid.com' fill 'input[id="password"]' 'k33p0nbuilding' click selector 'button[type="submit"]' query div.user_logout: after text 'QA Admin' exists
-- assertion 2: Successfully navigates to batch page
query ul.navigation: click selector 'a[href="/batch"]' --navigates page query div#batchView:
after text 'Bulk Add' exists
-- assertion 3: Text field appears
-- assertion 4: 2 users are added to the batch
-- assertion 5: can engage the Edit Subscription button
query div.user-update: after text 'Submit change for 2 records' exists
-- assertions 6, 7, 8: can open and select plan type
query div.user-update: after text 'Payment Type' exists query div.user-update-row:nth-of-type(3): click selector 'button[class="button small secondary"]' after text 'Trial' exists query ul.dropdown-menu-items: click selector 'input[name="trial"]' after text 'Invoice' doesNotExist
capture png 'C5681_screenshot'