Calabash-android with Crosswalk v10.39.235.15
Calabash-android with Crosswalk v10.39.235.15
我正在开发一个包含以下技术的测试环境:
Jenkins、Genymotion 和 calabash-android。
我使用 ionic 构建了一个简单的待办事项应用程序 - 事实上,它是本指南的一部分 (http://ionicframework.com/docs/guide/installation.html)。
然后我为 calabash_android 编写了一个简单的功能,并附带了一些步骤来测试这个应用程序。
专题文件:
Feature: Todo's & Projects
Scenario: I can create a new todo under a project
Given I wait for 5 seconds
When I press button with id "new__task"
Then I see field with id "#input__text"
Then I enter text "This is a test" into input with id "#input__text"
When I press button with id2 "create__task"
Then I see id "task__1"
Then I take a screenshot
Scenario: I can create a new project
Given I wait for 5 seconds
When I swipe left
Then I see button with id "#new__project"
步数:
require 'calabash-android/calabash_steps'
When(/^I press button with id "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#new__task'")
touch("CordovaWebView css:'#new__task'")
end
Then(/^I see field with id "(.*?)"$/) do |fieldid|
query("CordovaWebView css:'#input__text'")
end
Then(/^I enter text "(.*?)" into input with id "(.*?)"$/) do |text, fieldid|
query("CordovaWebView css:'#input__text'")
enter_text("CordovaWebView css:'#input__text'", "This is a test")
end
When(/^I press button with id2 "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#create__task'")
touch("CordovaWebView css:'#create__task'")
end
Then(/^I see id "(.*?)"$/) do |fieldid|
query("CordovaWebView css:'#task__1'")
end
Then(/^I see button with id "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#new__project'")
touch("CordovaWebView css:'#new__project'")
end
当我运行这个的时候,它就成功了。所有步骤都通过,两个场景都通过,一切都很好。
如果我然后使用 "ionic browser add crosswalk" 添加人行横道,我 运行 会遇到一些问题。
我写的这些步骤停止工作,因为 "CordovaWebView" 不再存在。我预料到了这一点,因为人行横道将所有内容都嵌入了它自己的视图中。
问题是我无法查询该视图。当我使用 calabash-android 控制台启动新的人行横道应用程序时,我可以 "query("")" - 这显示了大约 9 个不同的视图,其中一个是 "XWalkCordovaView".但是,如果我随后将步骤中的 "CordovaWebView" 替换为 "XWalkCordovaView" - 这些步骤仍然会失败。事实上,像这样查询 XWalkCordovaView: "query("XWalkCordovaView css:''") 没有给我任何帮助,而如果我在非人行横道应用程序中使用 CordovaWebView 这样做,我得到所有 css 页面上的元素(符合预期)。
我真的不能/不能/测试应用程序。但是我需要人行横道来优化和测试 x86 架构。
那么...如何在 CrosswalkCordova 视图中成功查询和操作元素?我找对地方了吗?似乎没有人知道,我用谷歌搜索了很多次,最上面的结果总是 github 用户询问是否支持人行横道 "natively"(不支持)。
如有任何帮助,我们将不胜感激。
我不熟悉 Cordova 堆栈,但我正在和我的一位负责 Calabash 的同事@Xamarin 交谈Android。
这是相关 GitHub 问题的摘录。 Crosswalk support #507
Examining the widget gave the following results:
irb(main):006:0> query "org.apache.cordova.CordovaWebView", :getClass
[
[0] "org.apache.cordova.CordovaWebView"
]
irb(main):007:0> query "org.apache.cordova.CordovaWebView", :getClass, :getSuperclass
[
[0] "org.xwalk.core.XWalkView"
]
irb(main):008:0> query "org.apache.cordova.CordovaWebView", :getClass, :getSuperclass, :getSuperclass
[
[0] "android.widget.FrameLayout"
]
We can see that the widget does not inherit form
android.webkit.WebView, and it is therefore not recognised as a valid
WebView. We do not plan to work around this for now, pull requests are
always welcome.
Calabash-Android 0.5.6(今天发布)引入了 crosswalk support。当您更新 Calabash-Android.
时,您的查询应该有效
我正在开发一个包含以下技术的测试环境: Jenkins、Genymotion 和 calabash-android。 我使用 ionic 构建了一个简单的待办事项应用程序 - 事实上,它是本指南的一部分 (http://ionicframework.com/docs/guide/installation.html)。 然后我为 calabash_android 编写了一个简单的功能,并附带了一些步骤来测试这个应用程序。
专题文件:
Feature: Todo's & Projects
Scenario: I can create a new todo under a project
Given I wait for 5 seconds
When I press button with id "new__task"
Then I see field with id "#input__text"
Then I enter text "This is a test" into input with id "#input__text"
When I press button with id2 "create__task"
Then I see id "task__1"
Then I take a screenshot
Scenario: I can create a new project
Given I wait for 5 seconds
When I swipe left
Then I see button with id "#new__project"
步数:
require 'calabash-android/calabash_steps'
When(/^I press button with id "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#new__task'")
touch("CordovaWebView css:'#new__task'")
end
Then(/^I see field with id "(.*?)"$/) do |fieldid|
query("CordovaWebView css:'#input__text'")
end
Then(/^I enter text "(.*?)" into input with id "(.*?)"$/) do |text, fieldid|
query("CordovaWebView css:'#input__text'")
enter_text("CordovaWebView css:'#input__text'", "This is a test")
end
When(/^I press button with id2 "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#create__task'")
touch("CordovaWebView css:'#create__task'")
end
Then(/^I see id "(.*?)"$/) do |fieldid|
query("CordovaWebView css:'#task__1'")
end
Then(/^I see button with id "(.*?)"$/) do |buttonid|
query("CordovaWebView css:'#new__project'")
touch("CordovaWebView css:'#new__project'")
end
当我运行这个的时候,它就成功了。所有步骤都通过,两个场景都通过,一切都很好。
如果我然后使用 "ionic browser add crosswalk" 添加人行横道,我 运行 会遇到一些问题。
我写的这些步骤停止工作,因为 "CordovaWebView" 不再存在。我预料到了这一点,因为人行横道将所有内容都嵌入了它自己的视图中。
问题是我无法查询该视图。当我使用 calabash-android 控制台启动新的人行横道应用程序时,我可以 "query("")" - 这显示了大约 9 个不同的视图,其中一个是 "XWalkCordovaView".但是,如果我随后将步骤中的 "CordovaWebView" 替换为 "XWalkCordovaView" - 这些步骤仍然会失败。事实上,像这样查询 XWalkCordovaView: "query("XWalkCordovaView css:''") 没有给我任何帮助,而如果我在非人行横道应用程序中使用 CordovaWebView 这样做,我得到所有 css 页面上的元素(符合预期)。
我真的不能/不能/测试应用程序。但是我需要人行横道来优化和测试 x86 架构。
那么...如何在 CrosswalkCordova 视图中成功查询和操作元素?我找对地方了吗?似乎没有人知道,我用谷歌搜索了很多次,最上面的结果总是 github 用户询问是否支持人行横道 "natively"(不支持)。
如有任何帮助,我们将不胜感激。
我不熟悉 Cordova 堆栈,但我正在和我的一位负责 Calabash 的同事@Xamarin 交谈Android。
这是相关 GitHub 问题的摘录。 Crosswalk support #507
Examining the widget gave the following results:
irb(main):006:0> query "org.apache.cordova.CordovaWebView", :getClass
[
[0] "org.apache.cordova.CordovaWebView"
]
irb(main):007:0> query "org.apache.cordova.CordovaWebView", :getClass, :getSuperclass
[
[0] "org.xwalk.core.XWalkView"
]
irb(main):008:0> query "org.apache.cordova.CordovaWebView", :getClass, :getSuperclass, :getSuperclass
[
[0] "android.widget.FrameLayout"
]
We can see that the widget does not inherit form android.webkit.WebView, and it is therefore not recognised as a valid WebView. We do not plan to work around this for now, pull requests are always welcome.
Calabash-Android 0.5.6(今天发布)引入了 crosswalk support。当您更新 Calabash-Android.
时,您的查询应该有效