2013-07-07 64 views
2

在身旁我葫蘆的測試功能,在流動的中間是正確的奧德我添加四種已知的號碼,如我如何檢查的UITableView行使用蠡

  • xxxx1111
  • xxxx2222
  • xxxx4444
  • xxxx3333

一個又一個的順序。(像用戶保存自己的信用卡號碼),並在最後的視圖我將它們顯示在UITableView中,每行包含一個數字,如xxxxxx1111。此表視圖顯示根據最舊到最新排序的數字我想驗證它。我應該如何使用葫蘆做到這一點?

回答

1

我試過了,現在它適用於我。我在_steps.rb文件

Then /^I see cell label "([^"]*)" row num (\d+) in section (\d+)$/ do |cellLabel, row, section| 
###### diff cells with labels in table, vertically orderd ###### 
## E.g. Then I see cell label "abc" row num 1 in section 0 

res = query("label marked:'#{cellLabel}' parent tableViewCell indexPath:#{row},#{section}").empty? 

if (res) 
screenshot_and_raise "There is no cell label with text #{cellLabel} in indexpath #{row},#{section}" 
end 

end 

聲明一個步驟定義和部分使用它蠡特徵文件中像

  • 然後我看到電池標籤「xxxx1111」行NUM 0 0
  • 然後我看到細胞標記「xxxx2222」行號碼1中的段0
  • 然後我看到細胞標記物「xxxx4444」行號碼2中的段0
  • 然後我看到細胞標記物「xxxx3333」行號碼3在第0

希望這對別人有用:)