plangrid / specford

Integration Bot from the future
0 stars 0 forks source link

Assertions not dropping out of queries when backed out of whitespace #6

Closed AaronSofaer closed 9 years ago

AaronSofaer commented 9 years ago

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

click selector 'button[class="button medium primary"]'
after selector 'textarea' exists

-- assertion 4: 2 users are added to the batch

fill 'textarea' 'qatester+5681a@plangrid.com, qatester+5681b@plangrid.com'
click selector 'button[class="button primary small"]'
after text 'Tester Pat' exists  
text 'Frumious Bandersnatch' exists -- These are the names of the two accounts that were added

-- assertion 5: can engage the Edit Subscription button

query div.button-group:
    click selector 'button[class="button medium secondary"]:nth-of-type(3)'

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-field:
    click selector 'button[class="button small secondary"]'
after text 'Hammer' exists
click selector 'input[name="nailgun"]'

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'

robrobbins commented 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