How to use testName method in differencify

Best JavaScript code snippet using differencify

customparameters.js

Source:customparameters.js Github

copy

Full Screen

1const path = require('path');2const Page = require('../core/page');3const params = require('../params');4const helper = require('../core/helper');5const cpe = require('./elements');6const util = require('./util');7const c = require('./constants');8class CustomParameters {9 constructor() {10 this.page1 = new Page();11 this.page2 = new Page();12 this.name = name;13 this.screenshotIndex = 0;14 this.parentDir = this.getParentDir(__dirname);15 }16 getParentDir(dir) {17 const tmp = dir.split('/');18 tmp.pop();19 return tmp.join('/');20 }21 async autoJoin(testName, args, meetingId, customParameter) {22 this.page1.logger('before init ', testName);23 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);24 await this.page1.screenshot(`${testName}`, `01-${testName}`);25 this.page1.logger('after init ', testName);26 await this.page1.waitForSelector('div[data-test="chatMessages"]', { timeout: 5000 });27 if (await this.page1.page.evaluate(util.getTestElement, cpe.audioModal) === false) {28 await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);29 this.page1.logger(testName, ' failed');30 return false;31 }32 const resp = await this.page1.page.evaluate(util.getTestElement, cpe.audioModal) === true;33 await this.page1.screenshot(`${testName}`, `02-success-${testName}`);34 this.page1.logger(testName, ' passed');35 return resp === true;36 }37 async listenOnlyMode(testName, args, meetingId, customParameter) {38 this.page1.logger('before init ', testName);39 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);40 await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);41 await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Attendee', moderatorPW: '' }, customParameter, testName);42 await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);43 this.page1.logger('after init ', testName);44 if (await this.page2.page.$('[data-test="audioModalHeader"]')) {45 await this.page2.screenshot(`${testName}`, `02-fail-${testName}`);46 this.page1.logger(testName, ' failed');47 return false;48 }49 await this.page1.page.waitFor(cpe.echoTestYesButton);50 await this.page1.screenshot(`${testName}`, `02-success-page1-${testName}`);51 await this.page2.page.waitFor(cpe.echoTestYesButton);52 await this.page2.screenshot(`${testName}`, `02-success-page2-${testName}`);53 const resp1 = await util.listenOnlyMode(this.page1);54 await this.page1.screenshot(`${testName}`, `03-success-page1-${testName}`);55 const resp2 = await util.listenOnlyMode(this.page2);56 await this.page2.screenshot(`${testName}`, `03-success-page2-${testName}`);57 this.page1.logger(testName, ' passed');58 return resp1 === true && resp2 === true;59 }60 async forceListenOnly(testName, args, meetingId, customParameter) {61 this.page2.logger('before init ', testName);62 await this.page2.init(args, meetingId, { ...params, fullName: 'Attendee', moderatorPW: '' }, customParameter, testName);63 await this.page2.screenshot(`${testName}`, `01-${testName}`);64 this.page2.logger('after init ', testName);65 if (await this.page2.page.$('[data-test="audioModalHeader"]')) {66 await this.page2.screenshot(`${testName}`, `02-fail-${testName}`);67 this.page2.logger(testName, ' failed');68 return false;69 }70 await this.page2.waitForSelector(cpe.audioNotification);71 await this.page2.screenshot(`${testName}`, `02-success-${testName}`);72 const resp = await util.forceListenOnly(this.page2);73 await this.page2.screenshot(`${testName}`, `03-success-${testName}`);74 this.page2.logger(testName, ' passed');75 return resp === true;76 }77 async skipCheck(testName, args, meetingId, customParameter) {78 this.page1.logger('before init ', testName);79 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);80 await this.page1.screenshot(`${testName}`, `01-${testName}`);81 this.page1.logger('after init ', testName);82 this.page1.logger('connecting with microphone');83 await this.page1.joinMicrophoneWithoutEchoTest();84 await this.page1.screenshot(`${testName}`, `02-${testName}`);85 await this.page1.elementRemoved('div[class^="connecting--"]');86 await this.page1.screenshot(`${testName}`, `03-${testName}`);87 this.page1.logger('before if condition');88 if (await this.page1.page.evaluate(util.countTestElements, cpe.echoTestYesButton) === true) {89 await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);90 this.page1.logger(testName, ' failed');91 return false;92 }93 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.echoTestYesButton) === false;94 await this.page1.screenshot(`${testName}`, `04-success-${testName}`);95 this.page1.logger(testName, ' passed');96 return resp === true;97 }98 async clientTitle(testName, args, meetingId, customParameter) {99 testName = 'clientTitle';100 this.page1.logger('before init ', testName);101 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);102 await this.page1.screenshot(`${testName}`, `01-${testName}`);103 this.page1.logger('after init ', testName);104 await this.page1.waitForSelector('button[aria-label="Microphone"]');105 await this.page1.screenshot(`${testName}`, `02-${testName}`);106 if (await !(await this.page1.page.title()).includes(c.docTitle)) {107 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);108 this.page1.logger(testName, ' failed');109 return false;110 }111 const resp = await (await this.page1.page.title()).includes(c.docTitle);112 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);113 this.page1.logger(testName, ' passed');114 return resp === true;115 }116 async askForFeedbackOnLogout(testName, args, meetingId, customParameter) {117 this.page1.logger('before init ', testName);118 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);119 await this.page1.screenshot(`${testName}`, `01-${testName}`);120 this.page1.logger('after init ', testName);121 await this.page1.closeAudioModal();122 await this.page1.screenshot(`${testName}`, `02-${testName}`);123 await this.page1.logoutFromMeeting();124 await this.page1.screenshot(`${testName}`, `03-${testName}`);125 await this.page1.waitForSelector(cpe.meetingEndedModal);126 await this.page1.screenshot(`${testName}`, `04-${testName}`);127 this.page1.logger('audio modal closed');128 if (await this.page1.page.evaluate(util.countTestElements, cpe.rating) === false) {129 await this.page1.screenshot(`${testName}`, `05-fail-${testName}`);130 this.page1.logger(testName, ' failed');131 return false;132 }133 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.rating) === true;134 await this.page1.screenshot(`${testName}`, `05-success-${testName}`);135 this.page1.logger(testName, ' passed');136 return resp === true;137 }138 async displayBrandingArea(testName, args, meetingId, customParameter) {139 this.page1.logger('before init ', testName);140 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);141 await this.page1.screenshot(`${testName}`, `01-${testName}`);142 this.page1.logger('after init ', testName);143 await this.page1.closeAudioModal();144 await this.page1.screenshot(`${testName}`, `02-${testName}`);145 this.page1.logger('audio modal closed');146 await this.page1.waitForSelector('div[data-test="userListContent"]');147 if (await this.page1.page.evaluate(util.countTestElements, cpe.brandingAreaLogo) === false) {148 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);149 this.page1.logger(testName, ' failed');150 return false;151 }152 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.brandingAreaLogo) === true;153 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);154 this.page1.logger(testName, ' passed');155 return resp === true;156 }157 async shortcuts(testName, args, meetingId, customParameter) {158 this.page1.logger('before init ', testName);159 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);160 await this.page1.screenshot(`${testName}`, `01-${testName}`);161 this.page1.logger('after init ', testName);162 await this.page1.closeAudioModal();163 await this.page1.screenshot(`${testName}`, `02-${testName}`);164 this.page1.logger('audio modal closed');165 await this.page1.waitForSelector('button[aria-label="Options"]');166 await this.page1.page.keyboard.down('Alt');167 await this.page1.page.keyboard.press('O');168 if (await this.page1.page.evaluate(util.getTestElement, cpe.verticalListOptions) === false) {169 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);170 this.page1.logger(testName, ' failed');171 return false;172 }173 const resp = await this.page1.page.evaluate(util.getTestElement, cpe.verticalListOptions) === true;174 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);175 this.page1.logger(testName, ' passed');176 return resp === true;177 }178 async enableScreensharing(testName, args, meetingId, customParameter) {179 this.page1.logger('before init ', testName);180 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);181 await this.page1.closeAudioModal();182 await this.page1.screenshot(`${testName}`, `01-${testName}`);183 this.page1.logger('after init ', testName);184 if (await this.page1.page.evaluate(util.getTestElement, cpe.screenShareButton) === false) {185 await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);186 this.page1.logger(testName, ' failed');187 return false;188 }189 const resp = await this.page1.page.evaluate(util.getTestElement, cpe.screenShareButton) === true;190 await this.page1.screenshot(`${testName}`, `02-success-${testName}`);191 this.page1.logger(testName, ' passed');192 return resp === true;193 }194 async enableVideo(testName, args, meetingId, customParameter) {195 this.page1.logger('before init ', testName);196 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);197 await this.page1.closeAudioModal();198 await this.page1.screenshot(`${testName}`, `01-${testName}`);199 this.page1.logger('after init ', testName);200 if (await this.page1.page.evaluate(util.getTestElement, cpe.shareWebcamButton) === false) {201 await this.page1.screenshot(`${testName}`, `02-fail-${testName}`);202 this.page1.logger(testName, ' failed');203 return false;204 }205 const resp = await this.page1.page.evaluate(util.getTestElement, cpe.shareWebcamButton) === true;206 await this.page1.screenshot(`${testName}`, `02-success-${testName}`);207 this.page1.logger(testName, ' passed');208 return resp === true;209 }210 async autoShareWebcam(testName, args, meetingId, customParameter) {211 this.page1.logger('before init ', testName);212 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator' }, customParameter, testName);213 await this.page1.screenshot(`${testName}`, `01-${testName}`);214 this.page1.logger('after init ', testName);215 await this.page1.closeAudioModal();216 await this.page1.screenshot(`${testName}`, `02-${testName}`);217 if (await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === true) {218 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);219 this.page1.logger(testName, ' failed');220 return false;221 }222 const resp = await this.page1.page.evaluate(util.getTestElement, cpe.webcamSettingsModal) === false;223 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);224 this.page1.logger(testName, ' passed');225 return resp === true;226 }227 async multiUserPenOnly(testName, args, meetingId, customParameter) {228 this.page1.logger('before init ', testName);229 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);230 await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Moderator2' }, customParameter, testName);231 await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);232 await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);233 this.page1.logger('after init ', testName);234 await this.page1.closeAudioModal();235 await this.page2.closeAudioModal();236 await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);237 await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);238 await this.page1.waitForSelector(cpe.multiUsersWhiteboard);239 await this.page1.click(cpe.multiUsersWhiteboard, true);240 await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);241 await this.page2.waitForSelector(cpe.tools);242 await this.page2.click(cpe.tools, true);243 await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);244 if (await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.childElementCount === 2)) {245 await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);246 this.page1.logger(testName, ' failed');247 return false;248 }249 const resp = await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.childElementCount === 1);250 await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);251 this.page1.logger(testName, ' passed');252 return resp === true;253 }254 async presenterTools(testName, args, meetingId, customParameter) {255 this.page1.logger('before init ', testName);256 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);257 await this.page1.screenshot(`${testName}`, `01-${testName}`);258 this.page1.logger('after init ', testName);259 await this.page1.closeAudioModal();260 await this.page1.screenshot(`${testName}`, `02-${testName}`);261 await this.page1.waitForSelector(cpe.tools);262 await this.page1.click(cpe.tools, true);263 await this.page1.screenshot(`${testName}`, `03-${testName}`);264 if (await this.page1.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 7)) {265 await this.page1.screenshot(`${testName}`, `04-fail-${testName}`);266 this.page1.logger(testName, ' failed');267 return false;268 }269 const resp = await this.page1.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 2);270 await this.page1.screenshot(`${testName}`, `04-success-${testName}`);271 this.page1.logger(testName, ' passed');272 return resp === true;273 }274 async multiUserTools(testName, args, meetingId, customParameter) {275 this.page1.logger('before init ', testName);276 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);277 await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Moderator2' }, customParameter, testName);278 await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);279 await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);280 this.page1.logger('after init ', testName);281 await this.page1.closeAudioModal();282 await this.page2.closeAudioModal();283 await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);284 await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);285 await this.page1.waitForSelector(cpe.multiUsersWhiteboard);286 await this.page1.click(cpe.multiUsersWhiteboard, true);287 await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);288 await this.page2.waitForSelector(cpe.tools);289 await this.page2.click(cpe.tools, true);290 await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);291 if (await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 7)) {292 await this.page2.screenshot(`${testName}`, `05-page2-fail-${testName}`);293 this.page1.logger(testName, ' failed');294 return false;295 }296 const resp = await this.page2.page.evaluate(async () => await document.querySelectorAll('[aria-label="Tools"]')[0].parentElement.querySelector('[class^="toolbarList--"]').childElementCount === 2);297 await this.page2.screenshot(`${testName}`, `05-page2-success-${testName}`);298 this.page1.logger(testName, ' passed');299 return resp === true;300 }301 async customStyle(testName, args, meetingId, customParameter) {302 this.page1.logger('before init ', testName);303 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);304 await this.page1.screenshot(`${testName}`, `01-${testName}`);305 this.page1.logger('after init ', testName);306 await this.page1.closeAudioModal();307 await this.page1.waitForSelector(cpe.whiteboard);308 await this.page1.screenshot(`${testName}`, `02-${testName}`);309 const isHidden = await this.page1.page.$eval('[class="presentationTitle--1LT79g"]', (elem) => {310 return elem.offsetHeight == 0311 });312 if (isHidden === false) {313 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);314 this.page1.logger(testName, ' failed');315 return false;316 } else if (isHidden === true) {317 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);318 const resp = isHidden;319 this.page1.logger(testName, ' passed');320 return resp === true;321 }322 }323 async customStyleUrl(testName, args, meetingId, customParameter) {324 this.page1.logger('before init ', testName);325 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);326 await this.page1.screenshot(`${testName}`, `01-${testName}`);327 this.page1.logger('after init ', testName);328 await this.page1.closeAudioModal();329 await this.page1.waitForSelector(cpe.whiteboard);330 await this.page1.screenshot(`${testName}`, `02-${testName}`); 331 const isHidden = await this.page1.page.$eval('[class="presentationTitle--1LT79g"]', (elem) => {332 return elem.offsetHeight == 0333 });334 if (isHidden === false) {335 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);336 this.page1.logger(testName, ' failed');337 return false;338 } else if (isHidden === true) {339 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);340 const resp = isHidden;341 this.page1.logger(testName, ' passed');342 return resp === true;343 }344 }345 async autoSwapLayout(testName, args, meetingId, customParameter) {346 this.page1.logger('before init ', testName);347 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);348 await this.page1.screenshot(`${testName}`, `01-${testName}`);349 this.page1.logger('after init ', testName);350 await this.page1.closeAudioModal();351 await this.page1.waitForSelector(cpe.container);352 await this.page1.screenshot(`${testName}`, `02-${testName}`);353 const isNotHidden = await this.page1.page.$eval(cpe.restorePresentation, (elem) => {354 return elem.offsetHeight !== 0355 });356 console.log(isNotHidden);357 if (isNotHidden === false) {358 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);359 this.page1.logger(testName, ' failed');360 return false;361 } else if (isNotHidden === true) {362 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);363 const resp = isNotHidden;364 this.page1.logger(testName, ' passed');365 return resp === true;366 }367 }368 async hidePresentation(testName, args, meetingId, customParameter) {369 this.page1.logger('before init ', testName);370 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);371 await this.page1.screenshot(`${testName}`, `01-${testName}`);372 this.page1.logger('after init ', testName);373 await this.page1.closeAudioModal();374 await this.page1.waitForSelector(cpe.actions);375 await this.page1.screenshot(`${testName}`, `02-${testName}`);376 if (await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === false) {377 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);378 this.page1.logger(testName, ' failed');379 return false;380 }381 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === true;382 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);383 this.page1.logger(testName, ' passed');384 return resp === true;385 }386 async bannerText(testName, args, meetingId, customParameter) {387 this.page1.logger('before init ', testName);388 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);389 await this.page1.screenshot(`${testName}`, `01-${testName}`);390 this.page1.logger('after init ', testName);391 await this.page1.closeAudioModal();392 await this.page1.waitForSelector(cpe.actions);393 await this.page1.screenshot(`${testName}`, `02-${testName}`);394 if (await this.page1.page.evaluate(util.countTestElements, cpe.notificationBar) === false) {395 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);396 this.page1.logger(testName, ' failed');397 return false;398 }399 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.notificationBar) === true;400 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);401 this.page1.logger(testName, ' passed');402 return resp === true;403 }404 async bannerColor(testName, args, meetingId, customParameter, colorToRGB) {405 this.page1.logger('before init ', testName);406 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);407 await this.page1.screenshot(`${testName}`, `01-${testName}`);408 this.page1.logger('after init ', testName);409 await this.page1.closeAudioModal();410 await this.page1.waitForSelector(cpe.notificationBar);411 await this.page1.screenshot(`${testName}`, `02-${testName}`);412 const notificationBarColor = await this.page1.page.$eval('div[class^="notificationsBar--"]', (elem) => {413 return getComputedStyle(elem).backgroundColor414 });415 console.log('colorToRGB => ', colorToRGB)416 console.log('notificationBarColor => ', notificationBarColor)417 if (notificationBarColor !== colorToRGB) {418 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);419 this.page1.logger(testName, ' failed');420 return false;421 } else if (notificationBarColor === colorToRGB) {422 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);423 this.page1.logger(testName, ' passed');424 return true;425 }426 }427 async hideAndSwapPresentation(testName, args, meetingId, customParameter) {428 this.page1.logger('before init ', testName);429 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);430 await this.page1.screenshot(`${testName}`, `01-${testName}`);431 this.page1.logger('after init ', testName);432 await this.page1.closeAudioModal();433 await this.page1.waitForSelector(cpe.container);434 if (await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === false && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === false) {435 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);436 this.page1.logger(testName, ' failed');437 return false;438 }439 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.restorePresentation) === true && await this.page1.page.evaluate(util.countTestElements, cpe.defaultContent) === true;440 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);441 this.page1.logger(testName, ' passed');442 return resp === true;443 }444 async showPublicChatOnLogin(testName, args, meetingId, customParameter) {445 this.page1.logger('before init ', testName);446 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);447 await this.page1.screenshot(`${testName}`, `01-${testName}`);448 this.page1.logger('after init ', testName);449 await this.page1.closeAudioModal();450 await this.page1.waitForSelector(cpe.container);451 if (await this.page1.page.evaluate(util.countTestElements, cpe.chat) === true) {452 await this.page1.screenshot(`${testName}`, `03-fail-${testName}`);453 this.page1.logger(testName, ' failed');454 return false;455 }456 const resp = await this.page1.page.evaluate(util.countTestElements, cpe.chat) === false;457 await this.page1.screenshot(`${testName}`, `03-success-${testName}`);458 this.page1.logger(testName, ' passed');459 return resp === true;460 }461 async forceRestorePresentationOnNewEvents(testName, args, meetingId, customParameter) {462 this.page1.logger('before init ', testName);463 await this.page1.init(args, meetingId, { ...params, fullName: 'Moderator1' }, customParameter, testName);464 await this.page2.init(args, this.page1.meetingId, { ...params, fullName: 'Viewer1', moderatorPW: '' }, customParameter, testName);465 await this.page1.screenshot(`${testName}`, `01-page1-${testName}`);466 await this.page2.screenshot(`${testName}`, `01-page2-${testName}`);467 this.page1.logger('after init ', testName);468 await this.page1.closeAudioModal();469 await this.page1.screenshot(`${testName}`, `02-page1-${testName}`);470 await this.page2.closeAudioModal();471 await this.page2.screenshot(`${testName}`, `02-page2-${testName}`);472 await this.page1.waitForSelector(cpe.container);473 await this.page2.waitForSelector(cpe.hidePresentation);474 await this.page2.click(cpe.hidePresentation, true);475 await this.page2.screenshot(`${testName}`, `03-page2-${testName}`);476 const zoomInCase = await util.zoomIn(this.page1);477 await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);478 await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);479 const zoomOutCase = await util.zoomOut(this.page1);480 await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);481 await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);482 const pollCase = await util.poll(this.page1);483 await this.page1.screenshot(`${testName}`, `03-page1-${testName}`);484 await this.page2.screenshot(`${testName}`, `04-page2-${testName}`);485 const previousSlideCase = await util.previousSlide(this.page1);486 await this.page1.screenshot(`${testName}`, `04-page1-${testName}`);487 await this.page2.screenshot(`${testName}`, `05-page2-${testName}`);488 const nextSlideCase = await util.nextSlide(this.page1);489 await this.page1.screenshot(`${testName}`, `05-page1-${testName}`);490 await this.page2.screenshot(`${testName}`, `06-page2-${testName}`);491 const annotationCase = await util.annotation(this.page1);492 await this.page1.screenshot(`${testName}`, `06-page1-${testName}`);493 await this.page2.screenshot(`${testName}`, `07-page2-${testName}`);494 if (zoomInCase === true && zoomOutCase === true && pollCase === true && previousSlideCase === true && nextSlideCase === true && annotationCase === true495 && await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === true) {496 await this.page2.screenshot(`${testName}`, `08-page2-fail-${testName}`);497 this.page1.logger(testName, ' failed');498 return false;499 }500 await this.page2.page.evaluate(util.countTestElements, cpe.restorePresentation) === false;501 await this.page2.screenshot(`${testName}`, `08-page2-success-${testName}`);502 this.page1.logger(testName, ' passed');503 return true;504 }505 async closePage(page) {506 page.close();507 }508 async close(page1, page2) {509 page1.close();510 page2.close();511 }512}...

Full Screen

Full Screen

multipleWrites.ts

Source:multipleWrites.ts Github

copy

Full Screen

1import test from 'ava'2import { createMagnetarInstance } from '../helpers/createMagnetarInstance'3import { pokedex, waitMs } from '@magnetarjs/test-utils'4import { firestoreDeepEqual } from '../helpers/firestoreDeepEqual'5{6 const testName = 'multiple writes (merge → merge) to the same record'7 test(testName, async (t) => {8 const { pokedexModule } = await createMagnetarInstance(testName, {9 insertDocs: { 'pokedex/1': pokedex(1) },10 })11 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))12 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))13 try {14 pokedexModule.doc('1').merge({ base: { HP: 9000 } })15 await pokedexModule.doc('1').merge({ base: { Attack: 50 } })16 } catch (error) {17 t.fail(JSON.stringify(error))18 }19 const expected = {20 id: 1,21 name: 'Bulbasaur',22 type: ['Grass', 'Poison'],23 base: {24 'HP': 9000,25 'Attack': 50,26 'Defense': 49,27 'SpAttack': 65,28 'SpDefense': 65,29 'Speed': 45,30 },31 }32 t.deepEqual(pokedexModule.doc('1').data, expected as any)33 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)34 })35}36{37 const testName = 'multiple writes (assign → assign) to the same record'38 test(testName, async (t) => {39 const { pokedexModule } = await createMagnetarInstance(testName, {40 insertDocs: { 'pokedex/1': pokedex(1) },41 })42 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))43 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))44 try {45 pokedexModule.doc('1').assign({ base: { HP: 9000 } })46 await pokedexModule.doc('1').assign({ base: { Attack: 50 } })47 } catch (error) {48 t.fail(JSON.stringify(error))49 }50 const expected = {51 id: 1,52 name: 'Bulbasaur',53 type: ['Grass', 'Poison'],54 base: { Attack: 50 },55 }56 t.deepEqual(pokedexModule.doc('1').data, expected as any)57 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)58 })59}60{61 const testName = 'multiple writes (replace → replace) to the same record'62 test(testName, async (t) => {63 const { pokedexModule } = await createMagnetarInstance(testName, {64 insertDocs: { 'pokedex/1': pokedex(1) },65 })66 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))67 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))68 try {69 pokedexModule.doc('1').replace({ base: { HP: 9000 } })70 await pokedexModule.doc('1').replace({ base: { Attack: 50 } })71 } catch (error) {72 t.fail(JSON.stringify(error))73 }74 const expected = { base: { Attack: 50 } }75 t.deepEqual(pokedexModule.doc('1').data, expected as any)76 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)77 })78}79{80 const testName = 'multiple writes (insert → insert) to the same record'81 test(testName, async (t) => {82 const { pokedexModule } = await createMagnetarInstance(testName)83 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)84 t.deepEqual(pokedexModule.doc('1').data, undefined)85 try {86 pokedexModule.doc('1').insert(pokedex(2))87 await pokedexModule.doc('1').insert(pokedex(3))88 } catch (error) {89 t.fail(JSON.stringify(error))90 }91 const expected = pokedex(3)92 t.deepEqual(pokedexModule.doc('1').data, expected as any)93 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)94 })95}96{97 const testName = 'multiple writes (deleteProp → merge) to the same record'98 test(testName, async (t) => {99 const { pokedexModule } = await createMagnetarInstance(testName, {100 insertDocs: { 'pokedex/1': pokedex(1) },101 })102 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))103 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))104 try {105 pokedexModule.doc('1').deleteProp('base')106 await pokedexModule.doc('1').merge({ base: { Attack: 50 } })107 } catch (error) {108 t.fail(JSON.stringify(error))109 }110 const expected = {111 id: 1,112 name: 'Bulbasaur',113 type: ['Grass', 'Poison'],114 base: { Attack: 50 },115 }116 t.deepEqual(pokedexModule.doc('1').data, expected as any)117 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)118 })119}120{121 const testName = 'multiple writes (assign → merge) to the same record'122 test(testName, async (t) => {123 const { pokedexModule } = await createMagnetarInstance(testName, {124 insertDocs: { 'pokedex/1': pokedex(1) },125 })126 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))127 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))128 try {129 pokedexModule.doc('1').assign({ base: { HP: 9000 } })130 await pokedexModule.doc('1').merge({ base: { Attack: 50 } })131 } catch (error) {132 t.fail(JSON.stringify(error))133 }134 const expected = {135 id: 1,136 name: 'Bulbasaur',137 type: ['Grass', 'Poison'],138 base: { HP: 9000, Attack: 50 },139 }140 t.deepEqual(pokedexModule.doc('1').data, expected as any)141 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)142 })143}144{145 const testName = 'multiple writes (replace → merge) to the same record'146 test(testName, async (t) => {147 const { pokedexModule } = await createMagnetarInstance(testName, {148 insertDocs: { 'pokedex/1': pokedex(1) },149 })150 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))151 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))152 try {153 pokedexModule.doc('1').replace({ base: { HP: 9000 } })154 await pokedexModule.doc('1').merge({ base: { Attack: 50 } })155 } catch (error) {156 t.fail(JSON.stringify(error))157 }158 const expected = { base: { HP: 9000, Attack: 50 } }159 t.deepEqual(pokedexModule.doc('1').data, expected as any)160 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)161 })162}163{164 const testName = 'multiple writes (insert → merge) to the same record'165 test(testName, async (t) => {166 const { pokedexModule } = await createMagnetarInstance(testName)167 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)168 t.deepEqual(pokedexModule.doc('1').data, undefined)169 try {170 pokedexModule.doc('1').insert(pokedex(1))171 await pokedexModule.doc('1').merge({ base: { HP: 9000 } })172 } catch (error) {173 t.fail(JSON.stringify(error))174 }175 const expected = {176 id: 1,177 name: 'Bulbasaur',178 type: ['Grass', 'Poison'],179 base: {180 'HP': 9000,181 'Attack': 49,182 'Defense': 49,183 'SpAttack': 65,184 'SpDefense': 65,185 'Speed': 45,186 },187 }188 t.deepEqual(pokedexModule.doc('1').data, expected as any)189 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)190 })191}192{193 const testName = 'multiple writes (deleteProp → assign) to the same record'194 test(testName, async (t) => {195 const { pokedexModule } = await createMagnetarInstance(testName, {196 insertDocs: { 'pokedex/1': pokedex(1) },197 })198 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))199 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))200 try {201 pokedexModule.doc('1').deleteProp('base')202 await pokedexModule.doc('1').assign({ base: { Attack: 50 } })203 } catch (error) {204 t.fail(JSON.stringify(error))205 }206 const expected = {207 id: 1,208 name: 'Bulbasaur',209 type: ['Grass', 'Poison'],210 base: { Attack: 50 },211 }212 t.deepEqual(pokedexModule.doc('1').data, expected as any)213 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)214 })215}216{217 const testName = 'multiple writes (merge → assign) to the same record'218 test(testName, async (t) => {219 const { pokedexModule } = await createMagnetarInstance(testName, {220 insertDocs: { 'pokedex/1': pokedex(1) },221 })222 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))223 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))224 try {225 pokedexModule.doc('1').merge({ base: { HP: 9000 } })226 await pokedexModule.doc('1').assign({ base: { Attack: 50 } })227 } catch (error) {228 t.fail(JSON.stringify(error))229 }230 const expected = {231 id: 1,232 name: 'Bulbasaur',233 type: ['Grass', 'Poison'],234 base: { Attack: 50 },235 }236 t.deepEqual(pokedexModule.doc('1').data, expected as any)237 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)238 })239}240{241 const testName = 'multiple writes (replace → assign) to the same record'242 test(testName, async (t) => {243 const { pokedexModule } = await createMagnetarInstance(testName, {244 insertDocs: { 'pokedex/1': pokedex(1) },245 })246 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))247 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))248 try {249 pokedexModule.doc('1').replace({ base: { HP: 9000, Defense: 49 } })250 await pokedexModule.doc('1').assign({ base: { Attack: 50 } })251 } catch (error) {252 t.fail(JSON.stringify(error))253 }254 const expected = { base: { Attack: 50 } }255 t.deepEqual(pokedexModule.doc('1').data, expected as any)256 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)257 })258}259{260 const testName = 'multiple writes (insert → assign) to the same record'261 test(testName, async (t) => {262 const { pokedexModule } = await createMagnetarInstance(testName)263 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)264 t.deepEqual(pokedexModule.doc('1').data, undefined)265 try {266 pokedexModule.doc('1').insert(pokedex(1))267 await pokedexModule.doc('1').assign({ base: { HP: 9000 } })268 } catch (error) {269 t.fail(JSON.stringify(error))270 }271 const expected = {272 id: 1,273 name: 'Bulbasaur',274 type: ['Grass', 'Poison'],275 base: { HP: 9000 },276 }277 t.deepEqual(pokedexModule.doc('1').data, expected as any)278 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)279 })280}281{282 const testName = 'multiple writes (merge → replace) to the same record'283 test(testName, async (t) => {284 const { pokedexModule } = await createMagnetarInstance(testName, {285 insertDocs: { 'pokedex/1': pokedex(1) },286 })287 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))288 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))289 try {290 pokedexModule.doc('1').merge({ base: { HP: 9000 } })291 await pokedexModule.doc('1').replace({ base: { Attack: 50 } })292 } catch (error) {293 t.fail(JSON.stringify(error))294 }295 const expected = { base: { Attack: 50 } }296 t.deepEqual(pokedexModule.doc('1').data, expected as any)297 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)298 })299}300{301 const testName = 'multiple writes (deleteProp → replace) to the same record'302 test(testName, async (t) => {303 const { pokedexModule } = await createMagnetarInstance(testName, {304 insertDocs: { 'pokedex/1': pokedex(1) },305 })306 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))307 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))308 try {309 pokedexModule.doc('1').deleteProp('base')310 await pokedexModule.doc('1').replace({ base: { Attack: 50 } })311 } catch (error) {312 t.fail(JSON.stringify(error))313 }314 const expected = { base: { Attack: 50 } }315 t.deepEqual(pokedexModule.doc('1').data, expected as any)316 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)317 })318}319{320 const testName = 'multiple writes (assign → replace) to the same record'321 test(testName, async (t) => {322 const { pokedexModule } = await createMagnetarInstance(testName, {323 insertDocs: { 'pokedex/1': pokedex(1) },324 })325 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))326 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))327 try {328 pokedexModule.doc('1').assign({ base: { HP: 9000 } })329 await pokedexModule.doc('1').replace({ base: { Attack: 50 } })330 } catch (error) {331 t.fail(JSON.stringify(error))332 }333 const expected = { base: { Attack: 50 } }334 t.deepEqual(pokedexModule.doc('1').data, expected as any)335 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)336 })337}338{339 const testName = 'multiple writes (insert → replace) to the same record'340 test(testName, async (t) => {341 const { pokedexModule } = await createMagnetarInstance(testName)342 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)343 t.deepEqual(pokedexModule.doc('1').data, undefined)344 try {345 pokedexModule.doc('1').insert(pokedex(1))346 await pokedexModule.doc('1').replace({ base: { HP: 9000 } })347 } catch (error) {348 t.fail(JSON.stringify(error))349 }350 const expected = { base: { HP: 9000 } }351 t.deepEqual(pokedexModule.doc('1').data, expected as any)352 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)353 })354}355{356 const testName = 'multiple writes (replace → deleteProp) to the same record'357 test(testName, async (t) => {358 const { pokedexModule } = await createMagnetarInstance(testName, {359 insertDocs: { 'pokedex/1': pokedex(1) },360 })361 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))362 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))363 try {364 pokedexModule.doc('1').replace({ base: { HP: 9000 } })365 await pokedexModule.doc('1').deleteProp('base')366 } catch (error) {367 t.fail(JSON.stringify(error))368 }369 const expected = {}370 t.deepEqual(pokedexModule.doc('1').data, expected as any)371 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)372 })373}374{375 const testName = 'multiple writes (merge → deleteProp) to the same record'376 test(testName, async (t) => {377 const { pokedexModule } = await createMagnetarInstance(testName, {378 insertDocs: { 'pokedex/1': pokedex(1) },379 })380 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))381 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))382 try {383 pokedexModule.doc('1').merge({ base: { HP: 9000 } })384 await pokedexModule.doc('1').deleteProp('base')385 } catch (error) {386 t.fail(JSON.stringify(error))387 }388 const expected = {389 id: 1,390 name: 'Bulbasaur',391 type: ['Grass', 'Poison'],392 }393 t.deepEqual(pokedexModule.doc('1').data, expected as any)394 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)395 })396}397{398 const testName = 'multiple writes (assign → deleteProp) to the same record'399 test(testName, async (t) => {400 const { pokedexModule } = await createMagnetarInstance(testName, {401 insertDocs: { 'pokedex/1': pokedex(1) },402 })403 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))404 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))405 try {406 pokedexModule.doc('1').assign({ base: { HP: 9000 } })407 await pokedexModule.doc('1').deleteProp('base')408 } catch (error) {409 t.fail(JSON.stringify(error))410 }411 const expected = {412 id: 1,413 name: 'Bulbasaur',414 type: ['Grass', 'Poison'],415 }416 t.deepEqual(pokedexModule.doc('1').data, expected as any)417 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)418 })419}420{421 const testName = 'multiple writes (insert → deleteProp) to the same record'422 test(testName, async (t) => {423 const { pokedexModule } = await createMagnetarInstance(testName)424 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)425 t.deepEqual(pokedexModule.doc('1').data, undefined)426 try {427 pokedexModule.doc('1').insert(pokedex(1))428 await pokedexModule.doc('1').deleteProp('base')429 } catch (error) {430 t.fail(JSON.stringify(error))431 }432 const expected = {433 id: 1,434 name: 'Bulbasaur',435 type: ['Grass', 'Poison'],436 }437 t.deepEqual(pokedexModule.doc('1').data, expected as any)438 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)439 })440}441{442 const testName = 'multiple writes (replace → delete) to the same record'443 test(testName, async (t) => {444 const { pokedexModule } = await createMagnetarInstance(testName, {445 insertDocs: { 'pokedex/1': pokedex(1) },446 })447 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))448 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))449 try {450 pokedexModule.doc('1').replace({ base: { HP: 9000 } })451 await pokedexModule.doc('1').delete()452 } catch (error) {453 t.fail(JSON.stringify(error))454 }455 t.deepEqual(pokedexModule.doc('1').data, undefined)456 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)457 })458}459{460 const testName = 'multiple writes (merge → delete) to the same record'461 test(testName, async (t) => {462 const { pokedexModule } = await createMagnetarInstance(testName, {463 insertDocs: { 'pokedex/1': pokedex(1) },464 })465 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))466 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))467 try {468 pokedexModule.doc('1').merge({ base: { HP: 9000 } })469 await pokedexModule.doc('1').delete()470 } catch (error) {471 t.fail(JSON.stringify(error))472 }473 t.deepEqual(pokedexModule.doc('1').data, undefined)474 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)475 })476}477{478 const testName = 'multiple writes (assign → delete) to the same record'479 test(testName, async (t) => {480 const { pokedexModule } = await createMagnetarInstance(testName, {481 insertDocs: { 'pokedex/1': pokedex(1) },482 })483 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))484 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))485 try {486 pokedexModule.doc('1').assign({ base: { HP: 9000 } })487 await pokedexModule.doc('1').delete()488 } catch (error) {489 t.fail(JSON.stringify(error))490 }491 t.deepEqual(pokedexModule.doc('1').data, undefined)492 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)493 })494}495{496 const testName = 'multiple writes (insert → delete) to the same record'497 test(testName, async (t) => {498 const { pokedexModule } = await createMagnetarInstance(testName)499 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)500 t.deepEqual(pokedexModule.doc('1').data, undefined)501 try {502 pokedexModule.doc('1').insert(pokedex(1))503 await pokedexModule.doc('1').delete()504 } catch (error) {505 t.fail(JSON.stringify(error))506 }507 t.deepEqual(pokedexModule.doc('1').data, undefined)508 await firestoreDeepEqual(t, testName, 'pokedex/1', undefined)509 })510}511{512 const testName = 'timing of multiple writes (merge → merge) to the same record'513 test(testName, async (t) => {514 const { pokedexModule } = await createMagnetarInstance(testName, {515 insertDocs: { 'pokedex/1': pokedex(1) },516 })517 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))518 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))519 const all: Promise<any>[] = []520 const debounce = 1000521 let complete = 0522 let timeoutResolve:any = null523 let timeoutReject:any = null524 function testComplete () {525 complete++526 if (complete === (all.length - 1)) {527 if (timeoutResolve) {528 timeoutResolve()529 }530 }531 }532 // Give some time for previous mutations to be flushed.533 await new Promise((resolve) => {534 setTimeout(() => {535 resolve(true)536 }, 2000)537 })538 // Time the merges. Watch for early completion and merges that take too long.539 all.push(new Promise((resolve, reject) => {540 timeoutResolve = resolve541 timeoutReject = reject542 // Check for early completion543 setTimeout(() => {544 if (complete) {545 reject(new Error(complete + ' tests completed before the debounce time'))546 }547 }, debounce)548 // Check for transactions that take too long.549 setTimeout(() => {550 reject(new Error('timeout - tests completed: ' + complete))551 }, debounce + 500)552 }))553 try {554 all.push(pokedexModule.doc('1').merge({ base: { HP: 9000 } }).then(testComplete))555 all.push(pokedexModule.doc('1').merge({ base: { Attack: 50 } }).then(testComplete))556 } catch (error) {557 t.fail(JSON.stringify(error))558 if (timeoutReject) {559 timeoutReject(error)560 }561 }562 await Promise.all(all)563 const expected = {564 id: 1,565 name: 'Bulbasaur',566 type: ['Grass', 'Poison'],567 base: {568 'HP': 9000,569 'Attack': 50,570 'Defense': 49,571 'SpAttack': 65,572 'SpDefense': 65,573 'Speed': 45,574 },575 }576 t.deepEqual(pokedexModule.doc('1').data, expected as any)577 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)578 })579}580{581 const testName = 'timing of multiple writes with custom debounce (merge → merge) to the same record'582 test(testName, async (t) => {583 const { pokedexModule } = await createMagnetarInstance(testName, {584 insertDocs: { 'pokedex/1': pokedex(1) },585 })586 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))587 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))588 const all: Promise<any>[] = []589 const debounce = 5000590 let complete = 0591 let timeoutResolve:any = null592 let timeoutReject:any = null593 function testComplete () {594 complete++595 if (complete === (all.length - 1)) {596 if (timeoutResolve) {597 timeoutResolve()598 }599 }600 }601 // Give some time for previous mutations to be flushed.602 await new Promise((resolve) => {603 setTimeout(() => {604 resolve(true)605 }, 2000)606 })607 // Time the merges. Watch for early completion and merges that take too long.608 all.push(new Promise((resolve, reject) => {609 timeoutResolve = resolve610 timeoutReject = reject611 // Check for early completion612 setTimeout(() => {613 if (complete) {614 reject(new Error(complete + ' tests completed before the debounce time'))615 }616 }, debounce)617 // Check for transactions that take too long.618 setTimeout(() => {619 reject(new Error('timeout - tests completed: ' + complete))620 }, debounce + 500)621 }))622 try {623 all.push(pokedexModule.doc('1').merge({ base: { HP: 9000 } }, { syncDebounceMs: debounce }).then(testComplete))624 all.push(pokedexModule.doc('1').merge({ base: { Attack: 50 } }, { syncDebounceMs: debounce }).then(testComplete))625 } catch (error) {626 t.fail(JSON.stringify(error))627 if (timeoutReject) {628 timeoutReject(error)629 }630 }631 await Promise.all(all)632 const expected = {633 id: 1,634 name: 'Bulbasaur',635 type: ['Grass', 'Poison'],636 base: {637 'HP': 9000,638 'Attack': 50,639 'Defense': 49,640 'SpAttack': 65,641 'SpDefense': 65,642 'Speed': 45,643 },644 }645 t.deepEqual(pokedexModule.doc('1').data, expected as any)646 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)647 })648}649{650 const testName = 'timing of multiple writes with various custom debounce (merge → merge) to the same record'651 test(testName, async (t) => {652 const { pokedexModule } = await createMagnetarInstance(testName, {653 insertDocs: { 'pokedex/1': pokedex(1) },654 })655 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))656 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))657 const all: Promise<any>[] = []658 const debounce = 2000659 let complete = 0660 let timeoutResolve:any = null661 let timeoutReject:any = null662 function testComplete () {663 complete++664 if (complete === (all.length - 1)) {665 if (timeoutResolve) {666 timeoutResolve()667 }668 }669 }670 // Give some time for previous mutations to be flushed.671 await new Promise((resolve) => {672 setTimeout(() => {673 resolve(true)674 }, 2000)675 })676 // Time the merges. Watch for early completion and merges that take too long.677 all.push(new Promise((resolve, reject) => {678 timeoutResolve = resolve679 timeoutReject = reject680 // Check for early completion681 setTimeout(() => {682 if (complete) {683 reject(new Error(complete + ' tests completed before the debounce time'))684 }685 }, debounce)686 // Check for transactions that take too long.687 setTimeout(() => {688 reject(new Error('timeout - tests completed: ' + complete))689 }, debounce + 500)690 }))691 // The syncDebounceMs time of the last merge should be the actual debounce time used.692 try {693 all.push(pokedexModule.doc('1').merge({ base: { HP: 9000 } }, { syncDebounceMs: debounce + 2000 }).then(testComplete))694 all.push(pokedexModule.doc('1').merge({ base: { Attack: 50 } }, { syncDebounceMs: debounce + 1000 }).then(testComplete))695 all.push(pokedexModule.doc('1').merge({ base: { Defense: 55 } }, { syncDebounceMs: debounce + 3000 }).then(testComplete))696 all.push(pokedexModule.doc('1').merge({ base: { Speed: 46 } }, { syncDebounceMs: debounce }).then(testComplete))697 } catch (error) {698 t.fail(JSON.stringify(error))699 if (timeoutReject) {700 timeoutReject(error)701 }702 }703 await Promise.all(all)704 const expected = {705 id: 1,706 name: 'Bulbasaur',707 type: ['Grass', 'Poison'],708 base: {709 'HP': 9000,710 'Attack': 50,711 'Defense': 55,712 'SpAttack': 65,713 'SpDefense': 65,714 'Speed': 46,715 },716 }717 t.deepEqual(pokedexModule.doc('1').data, expected as any)718 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)719 })720}721{722 const testName = 'timing of multiple writes with various custom debounces including 0ms (merge → merge) to the same record'723 test(testName, async (t) => {724 const { pokedexModule } = await createMagnetarInstance(testName, {725 insertDocs: { 'pokedex/1': pokedex(1) },726 })727 await firestoreDeepEqual(t, testName, 'pokedex/1', pokedex(1))728 t.deepEqual(pokedexModule.doc('1').data, pokedex(1))729 const all: Promise<any>[] = []730 const debounce = 0731 let complete = 0732 let timeoutResolve:any = null733 let timeoutReject:any = null734 function testComplete () {735 complete++736 if (complete === (all.length - 1)) {737 if (timeoutResolve) {738 timeoutResolve()739 }740 }741 }742 // Give some time for previous mutations to be flushed.743 await new Promise((resolve) => {744 setTimeout(() => {745 resolve(true)746 }, 2000)747 })748 // Time the merges. Watch for early completion and merges that take too long.749 all.push(new Promise((resolve, reject) => {750 timeoutResolve = resolve751 timeoutReject = reject752 // Check for early completion753 setTimeout(() => {754 if (complete) {755 reject(new Error(complete + ' tests completed before the debounce time'))756 }757 }, debounce)758 // Check for transactions that take too long.759 setTimeout(() => {760 reject(new Error('timeout - tests completed: ' + complete))761 }, debounce + 500)762 }))763 // The syncDebounceMs time of the last merge should be the actual debounce time used.764 try {765 all.push(pokedexModule.doc('1').merge({ base: { HP: 9000 } }, { syncDebounceMs: debounce + 2000 }).then(testComplete))766 all.push(pokedexModule.doc('1').merge({ base: { Attack: 50 } }, { syncDebounceMs: debounce + 1000 }).then(testComplete))767 all.push(pokedexModule.doc('1').merge({ base: { Defense: 55 } }, { syncDebounceMs: debounce + 3000 }).then(testComplete))768 all.push(pokedexModule.doc('1').merge({ base: { Speed: 46 } }, { syncDebounceMs: debounce }).then(testComplete))769 } catch (error) {770 t.fail(JSON.stringify(error))771 if (timeoutReject) {772 timeoutReject(error)773 }774 }775 await Promise.all(all)776 const expected = {777 id: 1,778 name: 'Bulbasaur',779 type: ['Grass', 'Poison'],780 base: {781 'HP': 9000,782 'Attack': 50,783 'Defense': 55,784 'SpAttack': 65,785 'SpDefense': 65,786 'Speed': 46,787 },788 }789 t.deepEqual(pokedexModule.doc('1').data, expected as any)790 await firestoreDeepEqual(t, testName, 'pokedex/1', expected as any)791 })...

Full Screen

Full Screen

notifications.js

Source:notifications.js Github

copy

Full Screen

1const path = require('path');2const MultiUsers = require('../user/multiusers');3const Page = require('../core/page');4const params = require('../params');5const util = require('./util');6const utilScreenShare = require('../screenshare/util'); // utils imported from screenshare folder7const ne = require('./elements');8const pe = require('../presentation/elements');9const we = require('../whiteboard/elements');10class Notifications extends MultiUsers {11 constructor() {12 super('notifications');13 this.page1 = new Page();14 this.page2 = new Page();15 this.page3 = new Page();16 this.page4 = new Page();17 }18 async init(meetingId) {19 await this.page1.init(Page.getArgs(), meetingId, { ...params, fullName: 'User1' });20 await this.page1.closeAudioModal();21 await this.page2.init(Page.getArgs(), this.page1.meetingId, { ...params, fullName: 'User2' });22 await this.page2.closeAudioModal();23 }24 async initUser3(arg, meetingId) {25 await this.page3.init(arg, meetingId, { ...params, fullName: 'User3' });26 }27 async initUser4() {28 await this.page4.init(Page.getArgs(), this.page3.meetingId, { ...params, fullName: 'User' }, undefined, undefined);29 }30 // Save Settings toast notification31 async saveSettingsNotification(testName) {32 await this.init(undefined);33 await this.page1.screenshot(`${testName}`, `01-page01-initialized-${testName}`);34 await util.popupMenu(this.page1);35 await this.page1.screenshot(`${testName}`, `02-page01-popupMenu-${testName}`);36 await util.saveSettings(this.page1);37 await this.page1.screenshot(`${testName}`, `03-page01-save-settings-${testName}`);38 const resp = await util.getLastToastValue(this.page1) === ne.savedSettingsToast;39 await this.page1.screenshot(`${testName}`, `04-page01-saved-Settings-toast-${testName}`);40 return resp === true;41 }42 // Public chat toast notification43 async publicChatNotification(testName) {44 await this.init(undefined);45 await this.page1.screenshot(`${testName}`, `01-page01-initialized-${testName}`);46 await util.popupMenu(this.page1);47 await this.page1.screenshot(`${testName}`, `02-page01-popup-menu-${testName}`);48 await util.enableChatPopup(this.page1);49 await this.page1.screenshot(`${testName}`, `03-page01-setting-popup-option-${testName}`);50 await util.saveSettings(this.page1);51 await this.page1.screenshot(`${testName}`, `04-page01-applied-settings-${testName}`);52 const expectedToastValue = await util.publicChatMessageToast(this.page1, this.page2);53 await this.page1.screenshot(`${testName}`, `05-page01-public-chat-message-sent-${testName}`);54 await this.page1.waitForSelector(ne.smallToastMsg);55 await this.page1.waitForSelector(ne.hasUnreadMessages);56 const lastToast = await util.getOtherToastValue(this.page1);57 await this.page1.screenshot(`${testName}`, `06-page01-public-chat-toast-${testName}`);58 return expectedToastValue === lastToast;59 }60 // Private chat toast notification61 async privateChatNotification(testName) {62 await this.init(undefined);63 await this.page1.screenshot(`${testName}`, `01-page01-initialized-${testName}`);64 await util.popupMenu(this.page1);65 await this.page1.screenshot(`${testName}`, `02-page01-popup-menu-${testName}`);66 await util.enableChatPopup(this.page1);67 await this.page1.screenshot(`${testName}`, `03-page01-setting-popup-option-${testName}`);68 await util.saveSettings(this.page1);69 await this.page1.screenshot(`${testName}`, `04-page01-applied-settings-${testName}`);70 const expectedToastValue = await util.privateChatMessageToast(this.page2);71 await this.page1.screenshot(`${testName}`, `05-page01-private-chat-message-sent-${testName}`);72 await this.page1.waitForSelector(ne.smallToastMsg);73 await this.page1.waitForSelector(ne.hasUnreadMessages);74 const lastToast = await util.getOtherToastValue(this.page1);75 await this.page1.screenshot(`${testName}`, `06-page01-public-chat-toast-${testName}`);76 return expectedToastValue === lastToast;77 }78 // User join toast notification79 async userJoinNotification(page) {80 await util.popupMenu(page);81 await util.enableUserJoinPopup(page);82 await util.saveSettings(page);83 }84 async getUserJoinPopupResponse(testName) {85 await this.initUser3(Page.getArgs(), undefined);86 await this.page3.screenshot(`${testName}`, `01-page03-initialized-${testName}`);87 await this.page3.closeAudioModal();88 await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`);89 await this.userJoinNotification(this.page3);90 await this.page3.screenshot(`${testName}`, `03-page03-after-user-join-notification-activation-${testName}`);91 await this.initUser4();92 await this.page4.closeAudioModal();93 await this.page3.waitForSelector(ne.smallToastMsg);94 try {95 await this.page3.page.waitForFunction(96 'document.querySelector("body").innerText.includes("User joined the session")',97 );98 await this.page3.screenshot(`${testName}`, `04-page03-user-join-toast-${testName}`);99 return true;100 } catch (e) {101 console.log(e);102 return false;103 }104 }105 // File upload notification106 async fileUploaderNotification(testName) {107 await this.initUser3(Page.getArgs(), undefined);108 await this.page3.screenshot(`${testName}`, `01-page03-initialized-${testName}`);109 await this.page3.closeAudioModal();110 await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`);111 await util.uploadFileMenu(this.page3);112 await this.page3.screenshot(`${testName}`, `03-page03-upload-file-menu-${testName}`);113 await this.page3.waitForSelector(pe.fileUpload);114 const fileUpload = await this.page3.page.$(pe.fileUpload);115 await fileUpload.uploadFile(path.join(__dirname, '../media/DifferentSizes.pdf'));116 await this.page3.page.waitForFunction(117 'document.querySelector("body").innerText.includes("To be uploaded ...")',118 );119 await this.page3.page.waitForSelector(pe.upload);120 await this.page3.page.click(pe.upload);121 await this.page3.page.waitForFunction(122 'document.querySelector("body").innerText.includes("Converting file")',123 );124 await this.page3.screenshot(`${testName}`, `04-page03-file-uploaded-and-ready-${testName}`);125 await this.page3.waitForSelector(ne.smallToastMsg);126 await this.page3.waitForSelector(we.whiteboard);127 await this.page3.screenshot(`${testName}`, `05-page03-presentation-changed-${testName}`);128 try {129 await this.page3.page.waitForFunction(130 'document.querySelector("body").innerText.includes("Current presentation")',131 );132 await this.page3.screenshot(`${testName}`, `06-page03-presentation-change-toast-${testName}`);133 return true;134 } catch (e) {135 console.log(e);136 return false;137 }138 }139 // Publish Poll Results notification140 async publishPollResults(testName) {141 await this.initUser3(Page.getArgs(), undefined);142 await this.page3.screenshot(`${testName}`, `01-page03-initialized-${testName}`);143 await this.page3.closeAudioModal();144 await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`);145 await this.page3.waitForSelector(we.whiteboard);146 await util.startPoll(this.page3);147 await this.page3.screenshot(`${testName}`, `03-page03-started-poll-${testName}`);148 await this.page3.waitForSelector(ne.smallToastMsg);149 const resp = await util.getLastToastValue(this.page3);150 await this.page3.screenshot(`${testName}`, `04-page03-poll-toast-${testName}`);151 return resp;152 }153 async audioNotification(testName) {154 await this.initUser3(Page.getArgsWithAudio(), undefined);155 await this.page3.screenshot(`${testName}`, `01-page03-initialized-${testName}`);156 await this.page3.joinMicrophone();157 await this.page3.screenshot(`${testName}`, `02-page03-joined-microphone-${testName}`);158 const resp = await util.getLastToastValue(this.page3) === ne.joinAudioToast;159 await this.page3.screenshot(`${testName}`, `03-page03-audio-toast-${testName}`);160 return resp === true;161 }162 async screenshareToast(testName) {163 await this.initUser3(Page.getArgs(), undefined);164 await this.page3.screenshot(`${testName}`, `01-page03-initialized-${testName}`);165 await this.page3.closeAudioModal();166 await this.page3.screenshot(`${testName}`, `02-page03-audio-modal-closed-${testName}`);167 await utilScreenShare.startScreenshare(this.page3);168 await this.page3.screenshot(`${testName}`, `03-page03-screenshare-started-${testName}`);169 const response = await util.getLastToastValue(this.page3);170 await this.page3.screenshot(`${testName}`, `04-page03-screenshare-toast-${testName}`);171 return response;172 }173 async closePages() {174 await this.page3.close();175 await this.page4.close();176 }177}...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify');2var testName = differencify.testName;3console.log(testName());4var differencify = require('differencify');5var testName = differencify.testName;6console.log(testName('test'));7var differencify = require('differencify');8var testName = differencify.testName;9console.log(testName('test', 'test'));10var differencify = require('differencify');11var testName = differencify.testName;12console.log(testName('test', 'test', 'test'));13var differencify = require('differencify');14var testName = differencify.testName;15console.log(testName('test', 'test', 'test', 'test'));16var differencify = require('differencify');17var testName = differencify.testName;18console.log(testName('test', 'test', 'test', 'test', 'test'));19var differencify = require('differencify');20var testName = differencify.testName;21console.log(testName('test', 'test', 'test', 'test', 'test', 'test'));22var differencify = require('differencify');23var testName = differencify.testName;24console.log(testName('test', 'test', 'test', 'test', 'test', 'test', 'test'));25var differencify = require('differencify');26var testName = differencify.testName;27console.log(testName('test', 'test', 'test', 'test',

Full Screen

Using AI Code Generation

copy

Full Screen

1var testName = require('differencify').testName;2var test = testName(__filename);3var test = require('differencify').test;4test(__filename, function () {5});6var testName = require('differencify').testName;7var test = testName(__filename);8var test = require('differencify').test;9test(__filename, function () {10});

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify');2var testName = differencify.testName;3var assert = require('assert');4describe('Test differencify', function() {5 it('test1', function() {6 assert.equal(testName(), 'test1');7 });8});9var differencify = require('differencify');10var testName = differencify.testName;11var assert = require('assert');12describe('Test differencify', function() {13 it('test2', function() {14 assert.equal(testName(), 'test2');15 });16});17var differencify = require('differencify');18var testName = differencify.testName;19var assert = require('assert');20describe('Test differencify', function() {21 it('test3', function() {22 assert.equal(testName(), 'test3');23 });24});25var differencify = require('differencify');26var testName = differencify.testName;27var assert = require('assert');28describe('Test differencify', function() {29 it('test4', function() {30 assert.equal(testName(), 'test4');31 });32});33var differencify = require('differencify');34var testName = differencify.testName;35var assert = require('assert');36describe('Test differencify', function() {37 it('test5', function() {38 assert.equal(testName(), 'test5');39 });40});41var differencify = require('differencify');42var testName = differencify.testName;43var assert = require('assert');44describe('Test differencify', function() {45 it('test6', function() {46 assert.equal(testName(), 'test6');47 });48});49var differencify = require('differencify');50var testName = differencify.testName;51var assert = require('assert');52describe('

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify')2var name = testName('testName')3var differencify = require('differencify')4var name = testName()5var differencify = require('differencify')6var name = testName('testName', 'testName')7var differencify = require('differencify')8var name = testName('testName', 'testName')9var differencify = require('differencify')10var name = testName('testName', 'testName')11var differencify = require('differencify')12var name = testName('testName', 'testName')13var differencify = require('differencify')14var name = testName('testName', 'testName')15var differencify = require('differencify')16var name = testName('testName', 'testName')17var differencify = require('differencify')18var name = testName('testName', 'testName')19console.log(name

Full Screen

Using AI Code Generation

copy

Full Screen

1const differencify = require('differencify');2const testName = differencify.getTestName(__filename);3const config = {4};5const diff = differencify.init(config);6const differencify = require('differencify');7const testName = differencify.getTestName(__filename);8const config = {9};10const diff = differencify.init(config);11const differencify = require('differencify');12const testName = differencify.getTestName(__filename);13const config = {14};15const diff = differencify.init(config);16const differencify = require('differencify');17const testName = differencify.getTestName(__filename);18const config = {19};20const diff = differencify.init(config);21const differencify = require('differencify');22const testName = differencify.getTestName(__filename);23const config = {24};25const diff = differencify.init(config);26const differencify = require('differencify');27const testName = differencify.getTestName(__filename);28const config = {29};30const diff = differencify.init(config);31const differencify = require('differencify');32const testName = differencify.getTestName(__filename);33const config = {34};35const diff = differencify.init(config);36const differencify = require('differencify');37const testName = differencify.getTestName(__filename);38const config = {39};40const diff = differencify.init(config);41const differencify = require('differencify');42const testName = differencify.getTestName(__filename);43const config = {44};45const diff = differencify.init(config);46const differencify = require('differencify');47const testName = differencify.getTestName(__filename);48const config = {

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify');2var testName = differencify.testName;3testName('testName', function() {4});5var differencify = require('differencify');6var testImage = differencify.testImage;7testImage('testImage', function() {8});9var differencify = require('differencify');10var testImages = differencify.testImages;11testImages('testImages', function() {12});13var differencify = require('differencify');14var testImages = differencify.testImages;15testImages('testImages', function() {16});17var differencify = require('differencify');18var testImages = differencify.testImages;19testImages('testImages', function() {20});21var differencify = require('differencify');22var testImages = differencify.testImages;23testImages('testImages', function() {24});25var differencify = require('differencify');26var testImages = differencify.testImages;27testImages('testImages', function() {28});29var differencify = require('differencify');30var testImages = differencify.testImages;31testImages('testImages', function() {32});33var differencify = require('differencify');34var testImages = differencify.testImages;35testImages('testImages', function() {

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify');2differencify.testName('testName');3differencify.testName('testName', {diff: {threshold: 0.1}});4var differencify = require('differencify');5differencify.testName('testName');6differencify.testName('testName', {diff: {threshold: 0.1}});7var differencify = require('differencify');8differencify.testName('testName');9differencify.testName('testName', {diff: {threshold: 0.1}});10var differencify = require('differencify');11differencify.testName('testName');12differencify.testName('testName', {diff: {threshold: 0.1}});13var differencify = require('differencify');14differencify.testName('testName');15differencify.testName('testName', {diff: {threshold: 0.1}});16var differencify = require('differencify');17differencify.testName('testName');18differencify.testName('testName', {diff: {threshold: 0.1}});19var differencify = require('differencify');20differencify.testName('testName');21differencify.testName('testName', {diff: {threshold: 0.1}});22var differencify = require('differencify');23differencify.testName('testName');24differencify.testName('testName', {diff: {threshold: 0.1}});25var differencify = require('differenc

Full Screen

Using AI Code Generation

copy

Full Screen

1var differencify = require('differencify');2var testName = differencify.testName;3testName("test name");4var differencify = require('differencify');5var testName = differencify.testName;6testName("test name", "testName");7var differencify = require('differencify');8var testName = differencify.testName;9testName("test name", "testName", "test-name");10var differencify = require('differencify');11var testName = differencify.testName;12testName("test name", "testName", "test-name", "test_name");13var differencify = require('differencify');14var testName = differencify.testName;15testName("test name", "testName", "test-name", "test_name", "testName");16var differencify = require('differencify');17var testName = differencify.testName;18testName("test name", "testName", "test-name", "test_name", "testName", "testname");19var differencify = require('differencify');20var testName = differencify.testName;21testName("test name", "testName", "test-name", "test_name", "testName", "testname", "testname");22var differencify = require('differencify');

Full Screen

Using AI Code Generation

copy

Full Screen

1const differencify = require('differencify')2const testName = differencify.getTestName(__filename)3console.log(testName)4const differencify = require('differencify')5const testName = differencify.getTestName(__filename)6console.log(testName)7const differencify = require('differencify')8const testName = differencify.getTestName(__filename)9const test = require('differencify').test10test(testName, async (page) => {11})12const differencify = require('differencify')13const testName = differencify.getTestName(__filename)14const test = require('differencify').test15test(testName, async (page) => {16})17const differencify = require('differencify')18const testName = differencify.getTestName(__filename)19const test = require('differencify').test20test(testName, async (page) => {21})22const differencify = require('differencify')23const testName = differencify.getTestName(__filename)24const test = require('differencify').test25test(testName, async (page) => {26})

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 differencify 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