How to use ice method in wpt

Best JavaScript code snippet using wpt

ice_settings.js

Source:ice_settings.js Github

copy

Full Screen

1/* global Contacts */2/* global ICEData */3/* global ConfirmDialog */4/**5 * ICE Settings view. In charge of selecting6 * the contacts for emergency and keeping sync7 * the datastore to share those contacts with8 * dialer and lockscreen.9 */10'use strict';11var contacts = window.contacts || {};12contacts.ICE = (function() {13 var iceSettingsPanel,14 iceSettingsHeader,15 iceContactItems = [],16 iceContactCheckboxes = [],17 iceContactButtons = [],18 iceScreenInitialized = false,19 currentICETarget;20 /**21 * Redraws the ICE contact list. This is not an expensive22 * operation since we have a maximun of 2 contacts.23 * The first time executed will attach listeners for the24 * frame ui.25 */26 var init = function ice_init() {27 if (iceScreenInitialized) {28 return;29 }30 // ICE DOM elements31 iceSettingsPanel = document.getElementById('ice-settings');32 iceSettingsHeader = document.getElementById('ice-settings-header');33 iceContactItems.push(document.getElementById('ice-contacts-1-switch'));34 iceContactItems.push(document.getElementById('ice-contacts-2-switch'));35 iceContactCheckboxes.push(iceContactItems[0]36 .querySelector('[name="ice-contact-1-enabled"]'));37 iceContactCheckboxes.push(iceContactItems[1]38 .querySelector('[name="ice-contact-2-enabled"]'));39 iceContactButtons.push(document.getElementById('select-ice-contact-1'));40 iceContactButtons.push(document.getElementById('select-ice-contact-2'));41 iceContactButtons[0].dataset.contactId = '';42 iceContactButtons[1].dataset.contactId = '';43 // ICE Events handlers44 iceSettingsHeader.addEventListener('action', function(){45 contacts.Settings.navigation.back();46 });47 // All the controls do the same, just modifications on the48 // specific order.49 iceContactItems.forEach(function(item, index) {50 item.addEventListener('click', function(i) {51 return function(evt) {52 var localIceContacts = ICEData.iceContacts;53 var wasActive = iceContactCheckboxes[i].checked;54 iceContactCheckboxes[i].checked = !wasActive;55 iceContactItems[i].setAttribute('aria-checked', !wasActive);56 if (wasActive) {57 resetIceGroupState(i);58 if (localIceContacts[i] && localIceContacts[i].id) {59 setICEContact(null, i, !wasActive);60 }61 }62 else {63 iceContactButtons[i].disabled = false;64 }65 };66 }(index));67 });68 iceContactButtons.forEach(function(element){69 element.addEventListener('click', function(evt) {70 showSelectList(evt.target.id);71 });72 // Bug 1071064 If users clicked on disabled button, the switch was checked73 element.parentNode.addEventListener('click', (evt) => {74 evt.stopPropagation();75 });76 });77 iceScreenInitialized = true;78 };79 function reloadButtonsState(cb) {80 ICEData.load().then(retrieveContactData.bind(null, cb));81 }82 function retrieveContactData(cb) {83 var iceContactsData = [];84 var iceContactsIds = ICEData.iceContacts;85 var numRetrievedContacts = 0;86 iceContactsIds.forEach(function(iceContact, index) {87 contacts.List.getContactById(iceContact.id, function(cindex, contact) {88 var theContact = {89 active: iceContactsIds[cindex].active,90 mozContact: contact91 };92 iceContactsData[cindex] = theContact;93 numRetrievedContacts++;94 if (numRetrievedContacts === 2) {95 setButtonsState(iceContactsData, cb);96 }97 }.bind(null, index));98 });99 }100 function refresh(done) {101 if (!iceScreenInitialized) {102 init();103 }104 reloadButtonsState(done);105 }106 /**107 * Given an object representing the internal state108 * fills the UI elements.109 * @params iceContactsIds (Array) list of contacts and state110 */111 function setButtonsState(iceContactsData, done) {112 iceContactsData.forEach(setIceButtonState);113 typeof done === 'function' && done();114 }115 function setIceButtonState(iceContactData, index) {116 if (!iceContactData) {117 return;118 }119 if (iceContactData.mozContact) {120 var iceContact = iceContactData.mozContact;121 var givenName = (Array.isArray(iceContact.givenName) &&122 iceContact.givenName[0]) || '';123 var familyName = (Array.isArray(iceContact.familyName) &&124 iceContact.familyName[0]) || '';125 var display = [givenName, familyName];126 var iceLabel = display.join(' ').trim();127 // If contact has no name we the first tel number will be used128 if (!iceLabel) {129 if (Array.isArray(iceContact.tel) && iceContact.tel[0]) {130 iceLabel = iceContact.tel[0].value.trim();131 }132 }133 buildIceContactUI(index, iceLabel, iceContact.id,134 iceContactData.active);135 }136 else {137 resetIceGroupState(index);138 }139 }140 function buildIceContactUI(index, label, contactId, active) {141 iceContactCheckboxes[index].checked = active;142 iceContactButtons[index].disabled = !active;143 var bdi = document.createElement('bdi');144 bdi.classList.add('ice-contact');145 bdi.textContent = label;146 iceContactButtons[index].innerHTML = '';147 iceContactButtons[index].appendChild(bdi);148 iceContactButtons[index].dataset.contactId = contactId;149 }150 function resetIceGroupState(index) {151 iceContactCheckboxes[index].checked = false;152 iceContactButtons[index].disabled = true;153 iceContactButtons[index].innerHTML = '';154 iceContactButtons[index].dataset.contactId = '';155 iceContactButtons[index].setAttribute('data-l10n-id', 'ICESelectContact');156 }157 function resetIceGroupStates() {158 for(var j = 0; j < iceContactCheckboxes.length; j++) {159 resetIceGroupState(j);160 }161 }162 function goBack() {163 contacts.List.clearClickHandlers();164 contacts.List.handleClick(Contacts.showContactDetail);165 Contacts.setNormalHeader();166 var hasICESet = ICEData.iceContacts.find(function(x) {167 return x.active === true;168 });169 if (!hasICESet) {170 resetIceGroupStates();171 }172 if (contacts.Search && contacts.Search.isInSearchMode()) {173 contacts.Search.exitSearchMode();174 }175 contacts.Settings.navigation.back(() => {176 hasICESet && contacts.List.toggleICEGroup(true);177 });178 }179 /**180 * Given a contact id, saves it internally. Also restores the contact181 * list default handler.182 * In case of not valid contact it will display a message on the screen183 * indicating the cause of the error.184 * @param id (string) contact id185 */186 function selectICEHandler(id) {187 checkContact(id).then(function() {188 setICEContact(id, currentICETarget, true, goBack);189 }, function error(l10nId) {190 var dismiss = {191 title: 'ok',192 callback: function() {193 ConfirmDialog.hide();194 }195 };196 Contacts.confirmDialog(null, l10nId || 'ICEUnknownError', dismiss);197 });198 }199 /**200 * Will perform a series of checks to validate the selected201 * contact as a valid ICE contact202 * @param id (string) contact id203 * @return (Promise) fulfilled if contact is valid204 */205 function checkContact(id) {206 return ICEData.load().then(function() {207 return contactNotICE(id).then(contactNotAllowed);208 });209 }210 /**211 * Checks if a contacts is already set as ICE212 * @param id (string) contact id213 * @return (Promise) fulfilled if contact is not repeated,214 * rejected otherwise215 */216 function contactNotICE(id) {217 return new Promise(function(resolve, reject) {218 var isICE = ICEData.iceContacts.some(function(x) {219 return x.id === id;220 });221 if (isICE) {222 reject('ICERepeatedContact');223 } else {224 resolve(id);225 }226 });227 }228 /**229 * Filter to avoid selecting contacts as ICE if they don't have a phone number230 * or they are a Facebook contact231 * @param id (String) contact id232 * @returns (Promise) Fulfilled if contact has phone233 */234 function contactNotAllowed(id) {235 return new Promise(function(resolve, reject) {236 contacts.List.getContactById(id, function(contact, isFBContact) {237 if(Array.isArray(contact.tel) && contact.tel[0] &&238 contact.tel[0].value && contact.tel[0].value.trim()) {239 resolve(id);240 }241 else if (isFBContact) {242 reject('ICEFacebookContactNotAllowed');243 } else {244 reject('ICEContactNoNumber');245 }246 });247 });248 }249 /**250 * We are using the contact list to choose a contact as ICE. For doing251 * this, we need to setup our own click handler.252 * @para target (HTMLButton) Button click to select an ICE contact253 */254 function showSelectList(target) {255 contacts.List.toggleICEGroup(false);256 Contacts.setCancelableHeader(goBack, 'selectContact');257 contacts.Settings.navigation.go('view-contacts-list', 'right-left');258 currentICETarget = target === 'select-ice-contact-1' ? 0 : 1;259 contacts.List.clearClickHandlers();260 contacts.List.handleClick(selectICEHandler);261 }262 /**263 * Set the values for ICE contacts, both in local and in the264 * datastore265 * @param id (string) contact id266 * @param pos (int) current position (0,1)267 * @param active (boolean) ice contact is active or not268 * @param cb (function) callback when ready269 */270 function setICEContact(id, pos, active, cb) {271 ICEData.setICEContact(id, pos, active).then(function() {272 // Only reload contact info in case there is a change in the contact273 if (id === iceContactButtons[pos].dataset.contactId) {274 return;275 }276 contacts.List.getContactById(id, function(contact) {277 var theContact = {278 active: active,279 mozContact: contact280 };281 var iceContactData = [];282 if (pos === 0) {283 iceContactData[1] = null;284 }285 else {286 iceContactData[0] = null;287 }288 iceContactData[pos] = theContact;289 setButtonsState(iceContactData);290 typeof cb === 'function' && cb();291 });292 });293 }294 function reset() {295 iceScreenInitialized = false;296 iceContactItems = [];297 iceContactCheckboxes = [];298 iceContactButtons = [];299 currentICETarget = null;300 }301 return {302 init: init,303 refresh: refresh,304 reset: reset,305 get initialized() { return iceScreenInitialized; }306 };...

Full Screen

Full Screen

adapter.js

Source:adapter.js Github

copy

Full Screen

1var RTCPeerConnection = null;2var getUserMedia = null;3var attachMediaStream = null;4var reattachMediaStream = null;5var webrtcDetectedBrowser = null;6var webrtcDetectedVersion = null;7function trace(text) {8 // This function is used for logging.9 if (text[text.length - 1] == '\n') {10 text = text.substring(0, text.length - 1);11 }12 console.log((performance.now() / 1000).toFixed(3) + ": " + text);13}14function maybeFixConfiguration(pcConfig) {15 if (pcConfig == null) {16 return;17 }18 for (var i = 0; i < pcConfig.iceServers.length; i++) {19 if (pcConfig.iceServers[i].hasOwnProperty('urls')){20 pcConfig.iceServers[i]['url'] = pcConfig.iceServers[i]['urls'];21 delete pcConfig.iceServers[i]['urls'];22 }23 }24}25if (navigator.mozGetUserMedia) {26 console.log("This appears to be Firefox");27 webrtcDetectedBrowser = "firefox";28 webrtcDetectedVersion =29 parseInt(navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1], 10);30 // The RTCPeerConnection object.31 var RTCPeerConnection = function(pcConfig, pcConstraints) {32 // .urls is not supported in FF yet.33 maybeFixConfiguration(pcConfig);34 return new mozRTCPeerConnection(pcConfig, pcConstraints);35 }36 // The RTCSessionDescription object.37 RTCSessionDescription = mozRTCSessionDescription;38 // The RTCIceCandidate object.39 RTCIceCandidate = mozRTCIceCandidate;40 // Get UserMedia (only difference is the prefix).41 // Code from Adam Barth.42 getUserMedia = navigator.mozGetUserMedia.bind(navigator);43 navigator.getUserMedia = getUserMedia;44 // Creates iceServer from the url for FF.45 createIceServer = function(url, username, password) {46 var iceServer = null;47 var url_parts = url.split(':');48 if (url_parts[0].indexOf('stun') === 0) {49 // Create iceServer with stun url.50 iceServer = { 'url': url };51 } else if (url_parts[0].indexOf('turn') === 0) {52 if (webrtcDetectedVersion < 27) {53 // Create iceServer with turn url.54 // Ignore the transport parameter from TURN url for FF version <=27.55 var turn_url_parts = url.split("?");56 // Return null for createIceServer if transport=tcp.57 if (turn_url_parts.length === 1 ||58 turn_url_parts[1].indexOf('transport=udp') === 0) {59 iceServer = {'url': turn_url_parts[0],60 'credential': password,61 'username': username};62 }63 } else {64 // FF 27 and above supports transport parameters in TURN url,65 // So passing in the full url to create iceServer.66 iceServer = {'url': url,67 'credential': password,68 'username': username};69 }70 }71 return iceServer;72 };73 createIceServers = function(urls, username, password) {74 var iceServers = [];75 // Use .url for FireFox.76 for (i = 0; i < urls.length; i++) {77 var iceServer = createIceServer(urls[i],78 username,79 password);80 if (iceServer !== null) {81 iceServers.push(iceServer);82 }83 }84 return iceServers;85 }86 // Attach a media stream to an element.87 attachMediaStream = function(element, stream) {88 console.log("Attaching media stream");89 element.mozSrcObject = stream;90 element.play();91 };92 reattachMediaStream = function(to, from) {93 console.log("Reattaching media stream");94 to.mozSrcObject = from.mozSrcObject;95 to.play();96 };97 // Fake get{Video,Audio}Tracks98 if (!MediaStream.prototype.getVideoTracks) {99 MediaStream.prototype.getVideoTracks = function() {100 return [];101 };102 }103 if (!MediaStream.prototype.getAudioTracks) {104 MediaStream.prototype.getAudioTracks = function() {105 return [];106 };107 }108} else if (navigator.webkitGetUserMedia) {109 console.log("This appears to be Chrome");110 webrtcDetectedBrowser = "chrome";111 webrtcDetectedVersion =112 parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10);113 // Creates iceServer from the url for Chrome M33 and earlier.114 createIceServer = function(url, username, password) {115 var iceServer = null;116 var url_parts = url.split(':');117 if (url_parts[0].indexOf('stun') === 0) {118 // Create iceServer with stun url.119 iceServer = { 'url': url };120 } else if (url_parts[0].indexOf('turn') === 0) {121 // Chrome M28 & above uses below TURN format.122 iceServer = {'url': url,123 'credential': password,124 'username': username};125 }126 return iceServer;127 };128 // Creates iceServers from the urls for Chrome M34 and above.129 createIceServers = function(urls, username, password) {130 var iceServers = [];131 if (webrtcDetectedVersion >= 34) {132 // .urls is supported since Chrome M34.133 iceServers = {'urls': urls,134 'credential': password,135 'username': username };136 } else {137 for (i = 0; i < urls.length; i++) {138 var iceServer = createIceServer(urls[i],139 username,140 password);141 if (iceServer !== null) {142 iceServers.push(iceServer);143 }144 }145 }146 return iceServers;147 };148 // The RTCPeerConnection object.149 var RTCPeerConnection = function(pcConfig, pcConstraints) {150 // .urls is supported since Chrome M34.151 if (webrtcDetectedVersion < 34) {152 maybeFixConfiguration(pcConfig);153 }154 return new webkitRTCPeerConnection(pcConfig, pcConstraints);155 }156 // Get UserMedia (only difference is the prefix).157 // Code from Adam Barth.158 getUserMedia = navigator.webkitGetUserMedia.bind(navigator);159 navigator.getUserMedia = getUserMedia;160 // Attach a media stream to an element.161 attachMediaStream = function(element, stream) {162 if (typeof element.srcObject !== 'undefined') {163 element.srcObject = stream;164 } else if (typeof element.mozSrcObject !== 'undefined') {165 element.mozSrcObject = stream;166 } else if (typeof element.src !== 'undefined') {167 element.src = URL.createObjectURL(stream);168 } else {169 console.log('Error attaching stream to element.');170 }171 };172 reattachMediaStream = function(to, from) {173 to.src = from.src;174 };175} else {176 console.log("Browser does not appear to be WebRTC-capable");...

Full Screen

Full Screen

combineReducers.js

Source:combineReducers.js Github

copy

Full Screen

1/* -------------------------------------------------------------------------- */2/* COMBINE REDUCER */3/* -------------------------------------------------------------------------- */4const redux = require("redux");5const createStore = redux.createStore;6// add dependency for combining reducers7const combineReducers = redux.combineReducers;8/* -------------------------------------------------------------------------- */9/* 3) Action */10/* -------------------------------------------------------------------------- */11const BUY_CAKE = "BUY_CAKE";12const BUY_ICECREAM = "BUY_ICECREAM";13// action creator14const buyCake = () => {15 return {16 type: BUY_CAKE,17 };18};19const buyIceCream = () => {20 return {21 type: BUY_ICECREAM,22 };23};24/* -------------------------------------------------------------------------- */25/* 4) Reducer */26/* -------------------------------------------------------------------------- */27// initial states28const cakeInitialState = {29 numberOfCakes: 10,30};31const iceCreamInitialState = {32 numberOfIceCreams: 20,33};34const cakeReducer = (state = cakeInitialState, action) => {35 switch (action.type) {36 case BUY_CAKE:37 return {38 ...state,39 numberOfCakes: state.numberOfCakes - 1,40 };41 default:42 return state;43 }44};45const iceCreamReducer = (state = iceCreamInitialState, action) => {46 switch (action.type) {47 case BUY_ICECREAM:48 return {49 ...state,50 numberOfIceCreams: state.numberOfIceCreams - 1,51 };52 default:53 return state;54 }55};56/* -------------------------------------------------------------------------- */57// combine all reducers in root reducer58const rootReducer = combineReducers({59 cake: cakeReducer,60 iceCream: iceCreamReducer,61});62// pass reducer as created Store parameter63const store = createStore(rootReducer);64const currentState = () => {65 console.log("current State", store.getState());66};67const unsubscribe = store.subscribe(() => {68 console.log("Subscribe State Updates", store.getState());69});70currentState();71// dispatch72store.dispatch(buyCake());73store.dispatch(buyCake());74store.dispatch(buyCake());75store.dispatch(buyIceCream());76store.dispatch(buyIceCream());77store.dispatch(buyIceCream());78/* 79current State { cake: { numberOfCakes: 10 }, iceCream: { numberOfIceCreams: 20 } }80Subscribe State Updates { cake: { numberOfCakes: 9 }, iceCream: { numberOfIceCreams: 20 } }81Subscribe State Updates { cake: { numberOfCakes: 8 }, iceCream: { numberOfIceCreams: 20 } }82Subscribe State Updates { cake: { numberOfCakes: 7 }, iceCream: { numberOfIceCreams: 20 } }83Subscribe State Updates { cake: { numberOfCakes: 7 }, iceCream: { numberOfIceCreams: 19 } }84Subscribe State Updates { cake: { numberOfCakes: 7 }, iceCream: { numberOfIceCreams: 18 } }85Subscribe State Updates { cake: { numberOfCakes: 7 }, iceCream: { numberOfIceCreams: 17 } }86current State { cake: { numberOfCakes: 7 }, iceCream: { numberOfIceCreams: 17 } }87*/88unsubscribe();...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2wptools.page('Albert Einstein').then(function(page) {3 return page.getWikiText();4}).then(function(text) {5 console.log(text);6});7var wptools = require('wptools');8wptools.page('Albert Einstein').then(function(page) {9 return page.getWikiText();10}).then(function(text) {11 console.log(text);12});13var wptools = require('wptools');14wptools.page('Albert Einstein').then(function(page) {15 return page.getWikiText();16}).then(function(text) {17 console.log(text);18});19var wptools = require('wptools');20wptools.page('Albert Einstein').then(function(page) {21 return page.getWikiText();22}).then(function(text) {23 console.log(text);24});25var wptools = require('wptools');26wptools.page('Albert Einstein').then(function(page) {27 return page.getWikiText();28}).then(function(text) {29 console.log(text);30});31var wptools = require('wptools');32wptools.page('Albert Einstein').then(function(page) {33 return page.getWikiText();34}).then(function(text) {35 console.log(text);36});37var wptools = require('wptools');38wptools.page('Albert Einstein').then(function(page) {39 return page.getWikiText();40}).then(function(text) {41 console.log(text);42});43var wptools = require('wptools');44wptools.page('Albert Einstein').then(function(page) {45 return page.getWikiText();46}).then(function(text) {47 console.log(text);48});49var wptools = require('wptools');50wptools.page('Albert

Full Screen

Using AI Code Generation

copy

Full Screen

1var ice = require('wptoolkit').ice;2 console.log(data);3});4var ice = require('wptoolkit').ice;5 console.log(data);6});7var ice = require('wptoolkit').ice;8 console.log(data);9});10var ice = require('wptoolkit').ice;11 console.log(data);12});13var ice = require('wptoolkit').ice;14 console.log(data);15});16var ice = require('wptoolkit').ice;17 console.log(data);18});19var ice = require('wptoolkit').ice;20 console.log(data);21});22var ice = require('wptoolkit').ice;23 console.log(data);24});25var ice = require('wptoolkit').ice;26 console.log(data);27});28var ice = require('wptoolkit').ice;29 console.log(data);30});

Full Screen

Using AI Code Generation

copy

Full Screen

1var ice = require('wptoolkit').ice,2 wptoolkit = require('wptoolkit');3ice.getIceServers(function(iceServers) {4 iceServers = wptoolkit.ice.filterIceServers(iceServers, 'stun', 3478);5 console.log(iceServers);6});7var ice = require('wptoolkit').ice;8ice.getIceServers(function(iceServers) {9 iceServers = ice.filterIceServers(iceServers, 'stun', 3478);10 console.log(iceServers);11});12var ice = require('wptoolkit').ice,13 iceServers = ice.getIceServersSync();14iceServers = ice.filterIceServers(iceServers, 'stun', 3478);15console.log(iceServers);16var ice = require('wptoolkit').ice,17 wptoolkit = require('wptoolkit');18ice.getIceServers(function(iceServers) {19 iceServers = wptoolkit.ice.filterIceServers(iceServers, 'stun', 3478);20 console.log(iceServers);21});22var ice = require('wptoolkit').ice;23ice.getIceServers(function(iceServers) {24 iceServers = ice.filterIceServers(iceServers, 'stun', 3478);25 console.log(iceServers);26});27var ice = require('wptoolkit').ice,28 iceServers = ice.getIceServersSync();29iceServers = ice.filterIceServers(iceServers, 'stun', 3478);30console.log(iceServers);31var ice = require('wptoolkit').ice,32 wptoolkit = require('wptoolkit');33ice.getIceServers(function(iceServers) {34 iceServers = wptoolkit.ice.filterIceServers(iceServers, 'stun', 3478);35 console.log(iceServers);36});37var ice = require('wptoolkit').ice;38ice.getIceServers(function(iceServers) {39 iceServers = ice.filterIceServers(iceServers, 'stun', 3478);40 console.log(iceServers);41});42var ice = require('wptoolkit').ice,43 iceServers = ice.getIceServersSync();44iceServers = ice.filterIceServers(

Full Screen

Using AI Code Generation

copy

Full Screen

1var ice = require('wptoolkit').ice;2ice.init();3ice.on('ready', function() {4 console.log('ice is ready');5 ice.set('test', 'test');6 ice.get('test', function(data) {7 console.log('test: ' + data);8 });9});10ice.on('error', function(err) {11 console.log('ice error: ' + err);12});13{14 "dependencies": {15 }16}17var ice = wptoolkit.ice;18ice.init();19ice.on('ready', function() {20 console.log('ice is ready');21 ice.set('test', 'test');22 ice.get('test', function(data) {23 console.log('test: ' + data);24 });25});26ice.on('error', function(err) {27 console.log('ice error: ' + err);28});29var ice = wptoolkit.ice;30ice.init();31ice.on('ready', function() {32 console.log('ice is ready');33 ice.set('test', 'test');34 ice.get('test', function(data) {35 console.log('test: ' + data);36 });37});38ice.on('error', function(err) {39 console.log('

Full Screen

Using AI Code Generation

copy

Full Screen

1var ice = require('wptoolkit').ice;2var data = {3};4 if (err) {5 console.log(err);6 } else {7 console.log(res);8 }9});10var ice = require('wptoolkit').ice;11ice.listen(8080, function(err) {12 if (err) {13 console.log(err);14 } else {15 console.log('started');16 }17});18ice.on('test', function(data, callback) {19 console.log(data);20 callback(null, 'done');21});22var ice = require('wptoolkit').ice;23ice.listen(8080, function(err) {24 if (err) {25 console.log(err);26 } else {27 console.log('started');28 }29});30ice.on('test', function(data, callback) {31 console.log(data);32 callback(null, 'done');33});34ice.on('test2', function(data, callback) {35 console.log(data);36 callback(null, 'done');37});38var ice = require('wptoolkit').ice;39ice.listen(8080, function(err) {40 if (err) {41 console.log(err);42 } else {43 console.log('started');44 }45});46ice.on('test', function(data, callback) {47 console.log(data);48 callback(null, 'done');49});50ice.on('test2', function(data, callback) {51 console.log(data);52 callback(null, 'done');53});54ice.on('test3', function(data, callback) {55 console.log(data);56 callback(null, 'done');57});58var ice = require('wptoolkit').ice;59ice.listen(8080, function(err) {60 if (err) {61 console.log(err);62 } else {63 console.log('started');64 }65});66ice.on('test', function

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful