I am working on a testing environment that consists of the following technologies: Jenkins, Genymotion and calabash-android. Using ionic, I have a built a simple todo app - in fact it's the one found as part of this guide (http://ionicframework.com/docs/guide/installation.html). I have then written a simple feature for calabash_android, and accompanying steps, to test this app.
Feature file:
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"
Steps:
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
When I run this, it succeeds. All the steps pass, both scenarios pass, everything's great.
If I then add crosswalk using "ionic browser add crosswalk", i run into some issues.
These steps I've written stop working, because "CordovaWebView" no longer exists. I expect this, since crosswalk embeds everything in it's own view.
The problem is that I can't query that view. When I launch the new crosswalk'd app with calabash-android console, I can "query("")" - This shows about 9 different views, the one of interest being "XWalkCordovaView". However if I then substitute "CordovaWebView" in my steps with "XWalkCordovaView" - The steps still fail. Indeed, querying XWalkCordovaView like so: "query("XWalkCordovaView css:''") gives me nothing, whereas if I do that in the noncrosswalk app, with CordovaWebView, i get all the css elements on the page (as expected).
I can't really /not/ test the app. But I need crosswalk for the optimisations and ability to test on x86 architecture.
So...how do I successfully query and manipulate elements within the CrosswalkCordova view? Am I looking in the right place? No one seems to know, I've googled many times and the top result is always a github user asking if crosswalk is supported "natively" (which it's not).
Any help would be appreciated.