You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.1 Pick browser head instances and select a random on each test
varNeck=require('neck');describe("my browser tests",function(){before(function(done){varself=this;// Get head-browser if availableNeck.Heads.pick('browser').then(function(Browser){self.Browser=Browser;// Get all Browser instancesreturnBrowser.all();}).then(function(browsers){self.browsers=browsers;}).done(done);});// Now that we got All Browser instances, let's open a tab on a random to run testsit("login",function(done){browsers.random().open('https://www.findhit.com/').then(function(tab){expect(tab.title).to.be.equal('findhit');returntab.eval('injectSomeVariable = "YOLO Fag, code faster";');}).then(function(tab){returntab.input('#login','username');}).then(function(tab){returntab.input('#pass','my precious');}).then(function(tab){returntab.submit('#login_form');}).then(function(tab){expect(tab.title).to.be.equal('My Network');}).then(function(tab){// Until we get support from `findhit-promise` to// fire an event when a promise chain is ended, we must close tabsreturntab.close();}).done(done);});it("login",function(done){// Another test, another tabbrowsers.random().open('https://www.findhit.com/about').then(function(tab){// Another test, just to POC}).then(function(tab){// Until we get support from `findhit-promise` to// fire an event when a promise chain is ended, we must close tabsreturntab.close();}).done(done);});});
1.2 Get filter Browser instances that match a device (iPhone on this case)
varNeck=require('neck');describe("my iPhone browser tests",function(){before(function(done){varself=this;// Get head-browser if availableNeck.Heads.pick('browser').then(function(Browser){self.Browser=Browser;// Return all instancesreturnBrowser.pick({// All variables above are optional, if none is specified, it will result same as `.all()`device: 'iPhone',// 'Samsung', 'HTC', ..., undefined// platform: 'iOS', // 'Windows', 'Mac OS', 'Android', ..., undefined// engine: 'webkit', // 'gecko', ..., undefined// app: 'Chrome', // 'Firefox', 'Safari', ..., undefined});}).then(function(browsers){if(!browsers||!browsers.length){thrownewError("there aren't iPhone instances available :(");}self.browsers=browsers;}).done(done);});// ... test units ...});