Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
68
gaia/apps/search/test/marionette/suggestions_test.js
Executable file
68
gaia/apps/search/test/marionette/suggestions_test.js
Executable file
|
|
@ -0,0 +1,68 @@
|
|||
'use strict';
|
||||
|
||||
var Rocketbar = require('../../../system/test/marionette/lib/rocketbar.js');
|
||||
var Server = require('../../../../shared/test/integration/server');
|
||||
|
||||
marionette('Search - Suggestions Test', function() {
|
||||
|
||||
var client = marionette.client({
|
||||
profile: require(__dirname + '/client_options.js'),
|
||||
desiredCapabilities: { raisesAccessibilityExceptions: false }
|
||||
});
|
||||
var home, search, rocketbar, system, server;
|
||||
|
||||
var providers;
|
||||
|
||||
suiteSetup(function(done) {
|
||||
Server.create(__dirname + '/fixtures/', function(err, _server) {
|
||||
server = _server;
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
setup(function() {
|
||||
home = client.loader.getAppClass('homescreen');
|
||||
system = client.loader.getAppClass('system');
|
||||
search = client.loader.getAppClass('search');
|
||||
rocketbar = new Rocketbar(client);
|
||||
system.waitForFullyLoaded();
|
||||
|
||||
providers = {
|
||||
version: search.searchDataVersion(),
|
||||
providers: {
|
||||
'first': {
|
||||
title: 'first',
|
||||
searchUrl: server.url('sample.html'),
|
||||
suggestUrl: server.url('suggestions_one.json')
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
client.settings.set('search.suggestions.enabled', true);
|
||||
client.settings.set('search.cache', providers);
|
||||
client.settings.set('search.provider', 'first');
|
||||
});
|
||||
|
||||
test('Test suggestions', function() {
|
||||
|
||||
home.waitForLaunch();
|
||||
rocketbar.homescreenFocus();
|
||||
|
||||
search.triggerFirstRun(rocketbar);
|
||||
rocketbar.enterText('sometext');
|
||||
search.goToResults();
|
||||
|
||||
// Ensure we get 2 results (hardcoded in the provider results)
|
||||
client.waitFor(function() {
|
||||
return client.findElements(search.Selectors.suggestions).length === 2;
|
||||
});
|
||||
|
||||
// Ensure clicking on a result opens the browser correctly
|
||||
var first = client.helper.waitForElement('#suggestions li');
|
||||
first.click();
|
||||
|
||||
client.switchToFrame();
|
||||
rocketbar.switchToBrowserFrame(providers.providers.first.searchUrl);
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue