gpt4 book ai didi

android - Calabash Android 如何从 TextViews 获取数据并进行比较

转载 作者:行者123 更新时间:2023-11-29 20:49:15 24 4
gpt4 key购买 nike

我有三个 Textview,我想比较两个 Textview 的数据与第三个的差异。我正在使用下面的代码,但它对我不起作用。请帮我解决这个问题。

Then /^I checked "([^\"]*)" transactions count  with first TextView "([^\"]*)" second TextView "([^\"]*)"$/ do |nid,rid,vid|


totalReceivedCount=query("TextView id:'#{rid}'", :text).first.to_i
totalReturnedCount=query("TextView iid:'#{vid}'", :text).first.to_i
totalSummaryCount=query("TextView id:'#{nid}'", :text).first.to_i

unless totalSummaryTransactionCount == totalReceivedCount - totalReturnedCount
fail "Total not equal"
end
end

最佳答案

Then /^I compared "([^\"]*)" Text "([^\"]*)" void "([^\"]*)"$/ do |id1,id2,id3|

n1 = query("TextView id:'#{id1}'", :text).first.to_i
n2 = query("TextView id:'#{id2}'", :text).first.to_i
n3 = query("TextView id:'#{id3}'", :text).first.to_i
n4=n2-n3

if n1 == n4
puts "Success Logic"
else
puts " Logic"
end
end

关于android - Calabash Android 如何从 TextViews 获取数据并进行比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29597472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com