This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16097 from qdot/969587-variant-with-no-icc
Bug 969587 - Run variant customization with no icc
- Loading branch information
Showing
6 changed files
with
122 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,34 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
|
||
marionette('First Time Use >', function() { | ||
var assert = require('assert'); | ||
var FTU = 'app://communications.gaiamobile.org'; | ||
|
||
var FTU = require('./lib/ftu_test_lib').FTU; | ||
var client = marionette.client(); | ||
|
||
var clickThruPanel = function(panel_id, button_id) { | ||
if (panel_id == '#wifi') { | ||
// The wifi panel will bring up a screen to show it is scanning for | ||
// networks. Not waiting for this to clear will blow test timing and cause | ||
// things to fail. | ||
client.helper.waitForElementToDisappear('#loading-overlay'); | ||
} | ||
// waitForElement is used to make sure animations and page changes have | ||
// finished, and that the panel is displayed. | ||
client.helper.waitForElement(panel_id); | ||
if (button_id) { | ||
var button = client.waitForElement(button_id); | ||
button.click(); | ||
} | ||
}; | ||
var ftu = new FTU(client); | ||
|
||
test('FTU comes up on profile generation', function() { | ||
client.apps.switchToApp(FTU); | ||
ftu.waitForFTU(); | ||
}); | ||
|
||
test('FTU click thru', function() { | ||
client.apps.switchToApp(FTU); | ||
clickThruPanel('#languages', '#forward'); | ||
clickThruPanel('#wifi', '#forward'); | ||
clickThruPanel('#date_and_time', '#forward'); | ||
clickThruPanel('#geolocation', '#forward'); | ||
clickThruPanel('#import_contacts', '#forward'); | ||
clickThruPanel('#welcome_browser', '#forward'); | ||
clickThruPanel('#browser_privacy', '#forward'); | ||
clickThruPanel('#finish-screen', undefined); | ||
ftu.waitForFTU(); | ||
ftu.clickThruPanel('#languages', '#forward'); | ||
ftu.clickThruPanel('#wifi', '#forward'); | ||
ftu.clickThruPanel('#date_and_time', '#forward'); | ||
ftu.clickThruPanel('#geolocation', '#forward'); | ||
ftu.clickThruPanel('#import_contacts', '#forward'); | ||
ftu.clickThruPanel('#welcome_browser', '#forward'); | ||
ftu.clickThruPanel('#browser_privacy', '#forward'); | ||
ftu.clickThruPanel('#finish-screen', undefined); | ||
}); | ||
|
||
test('FTU Wifi Scanning Tests', function() { | ||
client.apps.switchToApp(FTU); | ||
clickThruPanel('#languages', '#forward'); | ||
clickThruPanel('#wifi', '#forward'); | ||
clickThruPanel('#date_and_time', '#back'); | ||
clickThruPanel('#wifi', undefined); | ||
ftu.waitForFTU(); | ||
ftu.clickThruPanel('#languages', '#forward'); | ||
ftu.clickThruPanel('#wifi', '#forward'); | ||
ftu.clickThruPanel('#date_and_time', '#back'); | ||
ftu.clickThruPanel('#wifi', undefined); | ||
}); | ||
|
||
}); |
36 changes: 36 additions & 0 deletions
36
apps/communications/ftu/test/marionette/lib/ftu_test_lib.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
|
||
function FTUHelper(client) { | ||
this.client = client; | ||
} | ||
|
||
FTUHelper.prototype = { | ||
client: null, | ||
FTU_URL: 'app://communications.gaiamobile.org', | ||
waitForFTU: function() { | ||
this.client.apps.switchToApp(this.FTU_URL); | ||
}, | ||
clickThruPanel: function(panel_id, button_id) { | ||
if (panel_id == '#wifi') { | ||
// The wifi panel will bring up a screen to show it is scanning for | ||
// networks. Not waiting for this to clear will blow test timing and cause | ||
// things to fail. | ||
this.client.helper.waitForElementToDisappear('#loading-overlay'); | ||
} | ||
// waitForElement is used to make sure animations and page changes have | ||
// finished, and that the panel is displayed. | ||
this.client.helper.waitForElement(panel_id); | ||
if (button_id) { | ||
var button = this.client.helper.waitForElement(button_id); | ||
button.click(); | ||
} | ||
}, | ||
close: function() { | ||
this.client.apps.close(this.FTU_URL); | ||
} | ||
}; | ||
|
||
module.exports = { | ||
FTU: FTUHelper | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
|
||
marionette('First Time Use > Single Variant Customization > ', function() { | ||
var assert = require('assert'); | ||
var FTU = require('./lib/ftu_test_lib').FTU; | ||
var client = marionette.client(); | ||
var ftu = new FTU(client); | ||
|
||
var browser_url = 'app://browser.gaiamobile.org'; | ||
|
||
// This test will need to be changed if we change default bookmarks in | ||
// build system. | ||
test('FTU runs customization when no ICCHelper available', function() { | ||
// wait for the ftu to come up, which means customization will have been run | ||
ftu.waitForFTU(); | ||
ftu.close(); | ||
// bring up browser | ||
client.apps.launch(browser_url); | ||
client.apps.switchToApp(browser_url); | ||
|
||
// Wait for the document body to know we're really 'launched'. | ||
client.helper.waitForElement('body'); | ||
|
||
// Bring up the bookmarks tab, make sure we have 2 bookmarks. Not the most | ||
// through of tests, but it'll do for now. | ||
client.findElement('#url-input').click(); | ||
client.findElement('#bookmarks-tab').click(); | ||
client.helper.waitForElement('#bookmarks > ul'); | ||
var links = client.findElements('#bookmarks > ul > li'); | ||
assert(links.length == 2, 'Not enough links in bookmarks! ' + links.length); | ||
}); | ||
|
||
}); |
13 changes: 13 additions & 0 deletions
13
apps/communications/ftu/test/unit/resources/default_bookmarks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"bookmarks": [ | ||
{ "title": "Test", | ||
"uri": "http://www.google.com", | ||
"iconUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC[truncated]" | ||
}, | ||
{ "title": "Also Test", | ||
"uri": "http://www.google.co.uk", | ||
"iconUri": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC[truncated]" | ||
} | ||
|
||
] | ||
} |