I'm trying to get started with Jasmine inside TiShadow. In my app I have a listview and when I click a listview a new controller is created and a new window is shown. Now I want to check if this click is working.
My spec looks like this:
// Create a test suite describe("test1", function() { var Alloy = require("alloy"); var $; beforeEach(function() { $ = Alloy.createController("index"); }); describe("can create and destroy", function() { it("show request window", function() { $.__views.btn_requests.fireEvent("click"); waits(500); runs(function () { //$ = Alloy.createController("requests"); // will create a 2nd window //expect(??).toBe(true); // what do I need to check }); }); }); });The click is working and its opening the request window. But what can I check now to see if the new window is visible AND how can I access the elements from this window.
Alloy.createController("request");will open a second window so I don't want to call it inside my spec because its called by the btn_button inside my app.
App consists of:
- index.js/xml/tss (listview with itemclick that calls createController("request")
- request.js/xml/tss (just a window)
Alloy project, TiShadow to deploy and test it, Android, Ti SDK 3.4.1