Skip to content

Instantly share code, notes, and snippets.

View daleharvey's full-sized avatar

Dale Harvey daleharvey

View GitHub Profile
function startTest() {
console.log('Starting', browser);
var opts = {
browserName: browser,
tunnelTimeout: testTimeout,
'max-duration': 60 * 30,
'command-timeout': 599,
'idle-timeout': 599
tldr; My Saucelabs tests timeout somewhere between 4 and 5 minutes
My test opens a webpage, and polls that page for a variable every 10 seconds until the variable indicates the test is complete, the test runs fine in selenium server for an indefinite period of time, when I connect to saucelabs via sauceconnect, it times out between 4 and 5 minutes with no indication of an error
https://saucelabs.com/tests/b28a53b2770e49e8bbcd25130187984e is the saucelabs test run report
https://travis-ci.org/daleharvey/pouchdb/jobs/19566086 is an example of a test running on travis (the behaviour is the same running travis or locally, so it definitely not a travis issue)
The code that runs the test is
var opts = {
NOPROFILE?=0
profile: a whole bunch of dependencies
TEST: profile
stuff
BUILD: profile
otherstuff
var reset = this.client.findElement('#search-reset');
if (reset.length) {
reset.click();
}
[SEARCH] STARTING SYNC FROM 0
[SEARCH] I GOT SOMETHING { operation: 'clear' }
[SEARCH] AT undefined
[SEARCH] I GOT SOMETHING { revisionId: '{e18c595b-5e17-f343-aaf9-d426963c0873}',
operation: 'done' }
[SEARCH] AT {e18c595b-5e17-f343-aaf9-d426963c0873}
[SEARCH] SYNC DONE AT {e18c595b-5e17-f343-aaf9-d426963c0873}
[SEARCH] ON CHANGE { '0': undefined }
[SEARCH] STARTING SYNC FROM {e18c595b-5e17-f343-aaf9-d426963c0873}
[SEARCH] I GOT SOMETHING { revisionId: '{e18c595b-5e17-f343-aaf9-d426963c0873}',
// My code
editPlace: function(url, fun) {
var self = this;
var rev = this.dataStore.revisionId;
return new Promise(function(resolve) {
self.dataStore.get(url).then(function(place) {
fun(place, function(newPlace) {
console.log('ATTEMPTING TO SAVE', self.dataStore.revisionId, rev);
if (self.dataStore.revisionId !== rev) {
(marionette): CALLBACK GOT: { name: 'JavaScriptError',
type: 'JavaScriptError',
message: '(17) TypeError: window.wrappedJSONObject is undefined\nRemote Stack:\nexecute_script @undefined, line undefined\ninline javascript, line 0\nsrc: "let __marionetteFunc = function(){return (function () { window.wrappedJSONObject.SimPinDialog.show(); }.apply(this, arguments));};__marionetteFunc.apply(null, __marionetteParams);"' } undefined
.. do bower stuff
mkdir docs/static/css
./node_modules/.bin/lessc docs/static/less/pouchdb/pouchdb.less > docs/static/css/pouchdb.css
cd docs
jekyll -w build
client.executeScript(function(path) {
var script = document.createElement("script");
var callback = function() {
console.log('>>> APPARENTLY LOADED? \n');
};
script.type = "text/javascript";
script.src = path;
script.addEventListener('load', callback);
console.log('>>> LOADING: ' + path + '\n');
document.head.appendChild(script);
[marionette log] >> in sim_dialog_test.js: loading js/mock_simslot.js
[marionette log] >> in js/mock_simslot.js: LOADED
[marionette log] >> in js/mock_simslot.js: MockSIMSlot is function
[marionette log] >> in js/mock_simslot.js: window.MockSIMSlot is function
[marionette log] >> in js/mock_simslot.js: document.title is SYSTEM
[marionette log] >> in sim_dialog_test.js: loaded js/mock_simslot.js
[marionette log] >> in sim_dialog_test.js: window.MockSIMSlot is undefined