How to use startSession method in Appium Base Driver

Best JavaScript code snippet using appium-base-driver

store.js

Source:store.js Github

copy

Full Screen

1import { writable, derived } from 'svelte/store';2import RecipesHomeWrapper from 'components/molecules/RecipesHomeWrapper.svelte';3import RecipesWrapper from 'components/molecules/RecipesWrapper.svelte';4import RecipesSteps from 'components/molecules/RecipesSteps.svelte';5import ModalRecipes from 'components/molecules/ModalRecipes.svelte';6export const images = writable({7 home: {8 id: 'SelectRecipe',9 cp: RecipesHomeWrapper,10 startSession: false,11 url: 'https://ik.imagekit.io/CookingAssistant/CHOOSE_RECIPE_SCREEN_vifCA6IlK1H.png',12 active: true,13 clickableOverlay: {14 overlay: 'recipesWrapper',15 select: {16 actionId: 'CatalanCream',17 },18 },19 },20 recipes: [21 {22 id: 'CatalanCream',23 cp: RecipesWrapper,24 startSession: false,25 name: 'Catalana Creame',26 overview: [27 {28 id: 'RecipeOverview_2P',29 cp: RecipesWrapper,30 TTSDuration: '2 hours 25minutes',31 TTSrecommendations: 'start the recipe or to adjust the portions',32 startSession: false,33 url: 'https://ik.imagekit.io/CookingAssistant/2_PORTION_SCREEN_6WYr3CD1c_C.png',34 active: false,35 clickableOverlay: {36 overlay: 'clickOverlay3',37 select: {38 actionId: 'CatalanCream_Step_1',39 },40 next: {41 actionId: 'CatalanCream_Step_1',42 },43 prev: {44 actionId: 'SelectRecipe',45 },46 add: {47 actionId: 'RecipeOverview_3P',48 },49 decr: {50 actionId: 'RecipeOverview_2P',51 },52 cancel: {53 actionId: 'ModalCancelRecipe',54 },55 },56 },57 {58 id: 'RecipeOverview_3P',59 cp: RecipesWrapper,60 TTSrecommendations: 'start the recipe or to adjust the portions',61 TTSDuration: '2 hours 25minutes',62 startSession: false,63 url: 'https://ik.imagekit.io/CookingAssistant/3_PORTION_SCREEN_1__q643ODANEfg.png',64 active: false,65 clickableOverlay: {66 overlay: 'clickOverlay3',67 select: {68 actionId: 'CatalanCream_Step_1',69 },70 next: {71 actionId: 'CatalanCream_Step_1',72 },73 prev: {74 actionId: 'SelectRecipe',75 },76 add: {77 actionId: 'RecipeOverview_4P',78 },79 decr: {80 actionId: 'RecipeOverview_2P',81 },82 cancel: {83 actionId: 'ModalCancelRecipe',84 },85 },86 },87 {88 id: 'RecipeOverview_4P',89 cp: RecipesWrapper,90 url: 'https://ik.imagekit.io/CookingAssistant/4_PORTION_SCREEN_ZUTATEN_4yKZtYX9k_0d.png',91 active: false,92 startSession: false,93 TTSrecommendations: 'start the recipe or to adjust the portions',94 TTSDuration: '2 hours 25minutes',95 clickableOverlay: {96 overlay: 'clickOverlay3',97 select: {98 actionId: 'CatalanCream_Step_1',99 },100 next: {101 actionId: 'CatalanCream_Step_1',102 },103 prev: {104 actionId: 'SelectRecipe',105 },106 add: {107 actionId: 'RecipeOverview_5P',108 },109 decr: {110 actionId: 'RecipeOverview_3P',111 },112 cancel: {113 actionId: 'ModalCancelRecipe',114 },115 },116 },117 {118 id: 'RecipeOverview_5P',119 cp: RecipesWrapper,120 startSession: false,121 TTSDuration: '2 hours 25minutes',122 TTSrecommendations: 'start the recipe or to adjust the portions',123 url: 'https://ik.imagekit.io/CookingAssistant/5_PORTION_SCREEN_wIRz3xylH.png',124 active: false,125 clickableOverlay: {126 overlay: 'clickOverlay3',127 select: {128 actionId: 'CatalanCream_Step_1',129 },130 next: {131 actionId: 'CatalanCream_Step_1',132 },133 prev: {134 actionId: 'SelectRecipe',135 },136 add: {137 actionId: 'RecipeOverview_5P',138 },139 decr: {140 actionId: 'RecipeOverview_4P',141 },142 cancel: {143 actionId: 'ModalCancelRecipe',144 },145 },146 },147 ],148 steps: [149 {150 id: 'CatalanCream_Step_1',151 cp: RecipesSteps,152 startSession: false,153 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_1_BawgCdKiuI.png',154 active: false,155 startTTS: 'Insert the double whisk attachment.',156 clickableOverlay: {157 overlay: 'clickOverlay2',158 next: {159 actionId: 'CatalanCream_Step_2',160 },161 select: {162 actionId: 'CatalanCream_Step_2',163 },164 scale: {165 actionId: '',166 },167 prev: {168 actionId: 'RecipeOverview_2P',169 },170 cancel: {171 actionId: 'ModalCancelRecipe',172 },173 },174 },175 {176 id: 'CatalanCream_Step_2',177 cp: RecipesSteps,178 startSession: false,179 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_2_UCdSbbD1SPJ.png',180 active: false,181 startTTS: 'Measure out 80g of powdered sugar into the bowl.',182 actionDone: false,183 clickableOverlay: {184 overlay: 'clickOverlay2',185 next: {186 actionId: 'ModalAlertSugar',187 },188 select: {189 actionId: 'ModalAlertSugar',190 },191 scale: {192 actionId: 'CatalanCream_Step_2_Green_Signal',193 },194 prev: {195 actionId: 'CatalanCream_Step_1',196 },197 cancel: {198 actionId: 'ModalCancelRecipe',199 },200 },201 },202 {203 id: 'CatalanCream_Step_3',204 cp: RecipesSteps,205 startSession: false,206 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_3_eBKO6neu5.png',207 active: false,208 startTTS: 'Add 4 egg yolks.',209 actionDone: false,210 clickableOverlay: {211 overlay: 'clickOverlay2',212 next: {213 actionId: 'CatalanCream_Step_4',214 },215 select: {216 actionId: 'CatalanCream_Step_4',217 },218 scale: {219 actionId: '',220 },221 prev: {222 actionId: 'CatalanCream_Step_2',223 },224 cancel: {225 actionId: 'ModalCancelRecipe',226 },227 },228 },229 {230 id: 'CatalanCream_Step_4',231 cp: RecipesSteps,232 startSession: false,233 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_4_pBA3js3dRKbU.png',234 active: false,235 startTTS:236 'Shut the lid, insert the measuring cup into the lid, and mix all ingredients together.',237 actionDone: false,238 clickableOverlay: {239 overlay: 'clickOverlay2',240 next: {241 actionId: 'ModalMixing1',242 },243 select: {244 actionId: 'ModalMixing1',245 },246 scale: {247 actionId: '',248 },249 prev: {250 actionId: 'CatalanCream_Step_3',251 },252 cancel: {253 actionId: 'ModalCancelRecipe',254 },255 },256 },257 {258 id: 'CatalanCream_Step_5',259 cp: RecipesSteps,260 startSession: false,261 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_5_ziVjFaGrWi.png',262 active: false,263 startTTS: 'Measure out 20g of cornstarch into the bowl. ',264 actionDone: false,265 clickableOverlay: {266 overlay: 'clickOverlay2',267 next: {268 actionId: 'CatalanCream_Step_6',269 },270 select: {271 actionId: 'CatalanCream_Step_6',272 },273 scale: {274 actionId: '',275 },276 prev: {277 actionId: 'CatalanCream_Step_4',278 },279 cancel: {280 actionId: 'ModalCancelRecipe',281 },282 },283 },284 {285 id: 'CatalanCream_Step_6',286 cp: RecipesSteps,287 startSession: false,288 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_6_aWtna9V_eh.png',289 active: false,290 startTTS: 'Close the lid and mix ingredients again.',291 actionDone: false,292 clickableOverlay: {293 overlay: 'clickOverlay2',294 next: {295 actionId: 'CatalanCream_Step_7',296 },297 select: {298 actionId: 'CatalanCream_Step_7',299 },300 scale: {301 actionId: '',302 },303 prev: {304 actionId: 'CatalanCream_Step_5',305 },306 cancel: {307 actionId: 'ModalCancelRecipe',308 },309 },310 },311 {312 id: 'CatalanCream_Step_7',313 cp: RecipesSteps,314 startSession: false,315 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_7_7FXqV6EKAN9V.png',316 active: false,317 startTTS:318 'Remove the measuring cup from the lid. Make sure the lid is shut and mix the ingredients together again.',319 actionDone: false,320 clickableOverlay: {321 overlay: 'clickOverlay2',322 next: {323 actionId: 'CatalanCream_Step_8',324 },325 select: {326 actionId: 'CatalanCream_Step_8',327 },328 scale: {329 actionId: '',330 },331 prev: {332 actionId: 'CatalanCream_Step_6',333 },334 cancel: {335 actionId: 'ModalCancelRecipe',336 },337 },338 },339 {340 id: 'CatalanCream_Step_8',341 cp: RecipesSteps,342 startSession: false,343 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_8_I2TosV5pHX.png',344 active: false,345 startTTS: 'Cook the Catalan Cream.',346 actionDone: false,347 clickableOverlay: {348 overlay: 'clickOverlay2',349 next: {350 actionId: 'ModalCooking1',351 },352 select: {353 actionId: 'ModalCooking1',354 },355 scale: {356 actionId: '',357 },358 prev: {359 actionId: 'CatalanCream_Step_7',360 },361 cancel: {362 actionId: 'ModalCancelRecipe',363 },364 },365 },366 {367 id: 'CatalanCream_Step_9',368 cp: RecipesSteps,369 startSession: false,370 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_9_7EJNkoHqOKFr.png',371 active: false,372 startTTS: 'Remove the double whisk attachment.',373 actionDone: false,374 clickableOverlay: {375 overlay: 'clickOverlay2',376 next: {377 actionId: 'CatalanCream_Step_10',378 },379 select: {380 actionId: 'CatalanCream_Step_10',381 },382 scale: {383 actionId: '',384 },385 prev: {386 actionId: 'CatalanCream_Step_8',387 },388 cancel: {389 actionId: 'ModalCancelRecipe',390 },391 },392 },393 {394 id: 'CatalanCream_Step_10',395 cp: RecipesSteps,396 startSession: false,397 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_10_6_oGwq1z5O.png',398 active: false,399 startTTS: 'Pour the cream into the ramekins and cool for two hours.',400 actionDone: false,401 clickableOverlay: {402 overlay: 'clickOverlay2',403 next: {404 actionId: 'CatalanCream_Step_12',405 },406 select: {407 actionId: 'CatalanCream_Step_12',408 },409 scale: {410 actionId: '',411 },412 prev: {413 actionId: 'CatalanCream_Step_9',414 },415 cancel: {416 actionId: 'ModalCancelRecipe',417 },418 },419 },420 {421 id: 'CatalanCream_Step_12',422 cp: RecipesSteps,423 startSession: false,424 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_12_lE5WtcNWef-G.png',425 active: false,426 startTTS:427 'Sprinkle around 1 tbsp brown sugar onto the cream. Caramelize the sugar with the culinary torch and enjoy!',428 actionDone: false,429 clickableOverlay: {430 overlay: 'clickOverlay2',431 next: {432 actionId: 'CatalanCream_Step_13',433 },434 select: {435 actionId: 'CatalanCream_Step_13',436 },437 scale: {438 actionId: '',439 },440 prev: {441 actionId: 'CatalanCream_Step_10',442 },443 cancel: {444 actionId: 'ModalCancelRecipe',445 },446 },447 },448 {449 id: 'CatalanCream_Step_13',450 cp: RecipesSteps,451 startSession: false,452 url: 'https://ik.imagekit.io/CookingAssistant/RECIPE_STEP_13_DNrsswzHru.png',453 active: false,454 startTTS: 'Enjoy!',455 actionDone: false,456 clickableOverlay: {457 overlay: 'clickOverlay2',458 next: {459 actionId: '',460 },461 select: {462 actionId: '',463 },464 scale: {465 actionId: '',466 },467 prev: {468 actionId: '',469 },470 cancel: {471 actionId: 'ModalCancelRecipe',472 },473 },474 },475 ],476 },477 ],478 modals: [479 {480 id: 'ModalCancelRecipe',481 cp: ModalRecipes,482 intentFilter: ['CancelRecipe'],483 startSession: false,484 active: false,485 clickableOverlay: {486 overlay: 'modalOverlay1',487 cancel: {488 actionId: 'SelectRecipe',489 },490 },491 url: 'https://ik.imagekit.io/CookingAssistant/CANCEL_RECIPE_SCREEN_naiQaiudlDC.png',492 },493 {494 id: 'ModalAlertSugar',495 cp: ModalRecipes,496 startSession: true,497 intentFilter: ['ReactionToDisplay'],498 startTTS:499 'There is 21g less sugar than the recipe calls for. Would you like to continue with this amount, or add more?',500 active: false,501 clickableOverlay: {502 overlay: 'modalOverlay2',503 add: {504 actionId: 'CatalanCream_Step_2',505 },506 continue: {507 actionId: 'CatalanCream_Step_3',508 },509 },510 url: 'https://ik.imagekit.io/CookingAssistant/ALERT_FOR_LESS_SUGAR_ADDED_2Rg7IeuvJC.png',511 },512 {513 id: 'ModalMixing1',514 cp: ModalRecipes,515 startSession: true,516 intentFilter: ['ReactMixingDisplay'],517 startTTS:518 'Do you want to start the mixing process for 10 seconds on Level 4?',519 active: false,520 clickableOverlay: {521 overlay: 'modalOverlay3',522 cancel: {523 actionId: 'CatalanCream_Step_4',524 },525 continue: {526 actionId: 'ModalMixing2',527 },528 },529 url: 'https://ik.imagekit.io/CookingAssistant/Feedback_Mixing_ADlY380ds.png',530 },531 {532 id: 'ModalMixing2',533 cp: ModalRecipes,534 startSession: true,535 startTTS: 'Ok Im mixing for 10 seconds on level 4 ',536 active: false,537 clickableOverlay: {538 transitionTime: 5,539 overlay: 'modalOverlay4',540 continue: {541 actionId: 'CatalanCream_Step_5',542 },543 },544 url: 'https://ik.imagekit.io/CookingAssistant/Feedback_Mixing_2_JYmMhAJg88E.png',545 },546 {547 id: 'ModalCooking1',548 cp: ModalRecipes,549 startSession: true,550 intentFilter: ['ReactMixingDisplay'],551 startTTS:552 'Do you want to start the cooking process for 10 seconds on Level 4?',553 active: false,554 clickableOverlay: {555 overlay: 'modalOverlay3',556 cancel: {557 actionId: 'CatalanCream_Step_8',558 },559 continue: {560 actionId: 'ModalCooking2',561 },562 },563 url: 'https://ik.imagekit.io/CookingAssistant/Feedback_cooking_-2tDxeZdqr6.png',564 },565 {566 id: 'ModalCooking2',567 cp: ModalRecipes,568 startSession: true,569 startTTS: 'Ok Im cooking for 10 seconds on level 4 ',570 active: false,571 clickableOverlay: {572 transitionTime: 5,573 overlay: 'modalOverlay4',574 continue: {575 actionId: 'CatalanCream_Step_9',576 },577 },578 url: 'https://ik.imagekit.io/CookingAssistant/Feedback_Mixing_2_JYmMhAJg88E.png',579 },580 ],581 extras: [582 {583 id: 'CatalanCream_Step_2_Green_Signal',584 cp: RecipesSteps,585 startSession: false,586 url: 'https://ik.imagekit.io/CookingAssistant/GREEN_SIGNAL_RIGHT_AMOUNT_KFWJt5Rbq.png',587 active: false,588 startTTS: 'Weigh out 80g of powdered sugar into the bowl',589 clickableOverlay: {590 overlay: 'clickOverlay2',591 next: {592 actionId: 'CatalanCream_Step_3',593 },594 select: {595 actionId: 'CatalanCream_Step_3',596 },597 scale: {598 actionId: '',599 },600 prev: {601 actionId: 'CatalanCream_Step_1',602 },603 cancel: {604 actionId: 'ModalCancelRecipe',605 },606 },607 },608 ],609});610function createCount() {611 const { subscribe, set, update } = writable(0);612 return {613 subscribe,614 increment: () => update((n) => n + 1),615 decrement: () => update((n) => n - 1),616 reset: () => set(0),617 };618}619export const currRecipe = writable({});620export const filter = writable('');621export const currRecipeStep = createCount();...

Full Screen

Full Screen

testSuite.js

Source:testSuite.js Github

copy

Full Screen

...34 // describe.skip("next button", function() {35 // it("should select a stimulus when clicked", function(client) {36 // login.loginSuccessfully();37 // conferences.waitForPageDisplayed();38 // conferences.startSession();39 //40 // teacherWorkspace.waitForPageDisplayed();41 // teacherWorkspace.selectReadingStage(2);42 // teacherWorkspace.click("@autoNextButton");43 // browser.pause(100);44 // teacherWorkspace.expect.element("@selectedLetterSoundTile").to.be.present;45 // });46 // });47 // describe("Login", function() {48 //49 // it("should have all of the right elements visible at log in screen @testr", function() {50 // login.expect.element("@error").to.not.be.visible;51 // login.expect.element("@email").to.be.visible;52 // login.expect.element("@password").to.be.visible;53 // login.expect.element("@submit").to.be.visible;54 // });55 //56 // it("fails login", function() {57 // login.loginFailure()58 // }59 // );60 // // it("logs in successfully", function() {61 // // login.loginSuccessfully();62 // // }63 // // );64 // });65 describe("Conferences", function() {66 it("should display settings", function() {67 login.loginSuccessfully();68 conferences.waitForPageDisplayed();69 conferences.settings();70 conferences.waitForSettingsDisplayed();71 }72 );73 //74 // describe.skip("Auto-Refresh", function() {75 // it("should should be present", function (){76 // login.loginSuccessfully();77 // conferences.waitForPageDisplayed();78 // conferences.expect.element("@autoRefresh").to.be.present;79 // });80 it.skip("should default to true", function() {81 login.loginSuccessfully();82 conferences.waitForPageDisplayed();83 conferences.expect.element("@autoRefresh").to.be.selected;84 });85 });86 // it("should switch to student portal settings and show proper content", function () {87 // conferences.settings();88 // conferences.studentPortal();89 // }90 // );91 // });92 //93 // it("should logout when clicked", function () {94 // login.loginSuccessfully();95 // conferences.waitForPageDisplayed();96 // conferences.loginWait();97 // login.expect.element("@error").to.not.be.visible;98 // login.expect.element("@email").to.be.visible;99 // login.expect.element("@password").to.be.visible;100 // login.expect.element("@submit").to.be.visible;101 // }102 // )103 describe("Conferences", function() {104 it("enters teacher workspace", function() {105 login.loginSuccessfully();106 conferences.waitForPageDisplayed();107 conferences.startSession();108 teacherWorkspace.waitForPageDisplayed();109 teacherWorkspace.selectStimulus();110 }111 )112 });113 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX114 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX115 describe("Reinforcements", function() {116 describe("Letters", function() {117 // it.skip("letter appears when you drag it", function() {118 // login.loginSuccessfully();119 // conferences.waitForPageDisplayed();120 // conferences.startSession();121 //122 // teacherWorkspace.waitForPageDisplayed();123 // teacherWorkspace.selectReadingStage(3);124 // teacherWorkspace.selectStimulus();125 //126 // browser.useXpath().click("//*[contains(text(), 'Letters')]");127 // letters.dragTeacher(browser);128 // letters.boardDraggableVisible(browser);129 // }130 // );131 it("letters all the correct elements visible, and student side letter appears when you drag it", function() {132 login.loginSuccessfully();133 conferences.waitForPageDisplayed();134 conferences.startSession();135 teacherWorkspace.waitForPageDisplayed();136 teacherWorkspace.selectReadingStage(3);137 teacherWorkspace.selectStimulus();138 letters.elementsVisible(browser);139 letters.dragStudent(browser);140 }141 )142 });143 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX144 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX145 describe("Tiles", function() {146 // it.skip("Tiles appears when you drag it", function() {147 // login.loginSuccessfully();148 // conferences.waitForPageDisplayed();149 // conferences.startSession();150 //151 // teacherWorkspace.waitForPageDisplayed();152 // teacherWorkspace.selectReadingStage(3);153 // teacherWorkspace.selectStimulus();154 //155 // browser.useXpath().click("//*[contains(text(), 'Tiles')]");156 // tiles.dragTeacherTile();157 // tiles.tileBoardDraggableVisible()158 // }159 // );160 it("Tiles have all the correct elements visible, and student side tiles appears when you drag it", function() {161 login.loginSuccessfully();162 conferences.waitForPageDisplayed();163 conferences.startSession();164 teacherWorkspace.waitForPageDisplayed();165 teacherWorkspace.selectReadingStage(3);166 teacherWorkspace.selectStimulus();167 tiles.tileElementsVisible();168 // tiles.tileDragStudent();169 }170 );171 });172 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX173 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX174 describe("Freehand", function() {175 it("all freehand elements present", function() {176 login.loginSuccessfully();177 conferences.waitForPageDisplayed();178 conferences.startSession();179 teacherWorkspace.waitForPageDisplayed();180 teacherWorkspace.selectReadingStage(3);181 teacherWorkspace.selectStimulus();182 freehand.freehandElements(browser);183 });184 });185 // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX186 // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\187 describe("Silly Sentences", function() {188 it("all silly sentences elements are visible", function() {189 login.loginSuccessfully();190 conferences.waitForPageDisplayed();191 conferences.startSession();192 teacherWorkspace.waitForPageDisplayed();193 teacherWorkspace.selectReadingStage(3);194 teacherWorkspace.selectStimulus();195 silly.sillyElements(browser);196 })197 });198 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX199 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\200 describe("Chant", function() {201 it("all chant elements are visible", function() {202 login.loginSuccessfully();203 conferences.waitForPageDisplayed();204 conferences.startSession();205 teacherWorkspace.waitForPageDisplayed();206 teacherWorkspace.selectReadingStage(3);207 teacherWorkspace.selectStimulus();208 chant.chantElements(browser);209 })210 });211 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX212 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\213 describe("Leveled Text", function() {214 it("Leveled text displays images and content", function() {215 login.loginSuccessfully();216 conferences.waitForPageDisplayed();217 conferences.startSession();218 teacherWorkspace.waitForPageDisplayed();219 teacherWorkspace.selectReadingStage(3);220 teacherWorkspace.selectLeveledText();221 teacherWorkspace.selectStory();222 teacherWorkspace.assertStoryElements();223 })224 });225 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX226 //XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX227 describe("Stage Stories", function() {228 it("Stage Stories displays proper images and content", function() {229 login.loginSuccessfully();230 conferences.waitForPageDisplayed();231 conferences.startSession();232 teacherWorkspace.waitForPageDisplayed();233 teacherWorkspace.selectReadingStage(5);234 teacherWorkspace.selectStageStory();235 teacherWorkspace.selectStageStoryContent();236 teacherWorkspace.assertStageElements();237 });238 });239 // describe.skip("Automate", function() {240 // it("Automate should move on to the next word", function() {241 // login.loginSuccessfully();242 // conferences.waitForPageDisplayed();243 // conferences.startSession();244 //245 // teacherWorkspace.waitForPageDisplayed();246 // teacherWorkspace.selectReadingStage(3);247 // teacherWorkspace.autoMode();248 // })249 // });250 });251 describe("Teacher Workspace", function() {252 it("Sight words Should change when clicked on needs work, learning, and mastered", function() {253 login.loginSuccessfully();254 conferences.waitForPageDisplayed();255 conferences.startSession();256 teacherWorkspace.waitForPageDisplayed();257 teacherWorkspace.selectReadingStage(5);258 teacherWorkspace.mastered();259 })260 it("Onsets Should change when clicked on needs work, learning, and mastered", function() {261 login.loginSuccessfully();262 conferences.waitForPageDisplayed();263 conferences.startSession();264 teacherWorkspace.waitForPageDisplayed();265 teacherWorkspace.selectReadingStage(5);266 teacherWorkspace.onsetMastered();267 })268 it("should have proper content as reading stages change", function() {269 login.loginSuccessfully();270 conferences.waitForPageDisplayed();271 conferences.startSession();272 teacherWorkspace.waitForPageDisplayed();273 teacherWorkspace.selectReadingStage(1);274 teacherWorkspace.readingStageChange();275 })276 })277 describe("newTests", function() {278 it("New features displayed in Teacher Workspace", function() {279 login.loginSuccessfully();280 conferences.waitForPageDisplayed();281 conferences.startSession();282 teacherWorkspace.waitForPageDisplayed();283 teacherWorkspace.selectReadingStage(4);284 teacherWorkspace.waitForFeaturesDisplayed();285 });286 it("starts at reading foundation", function() {287 login.loginSuccessfully();288 conferences.waitForPageDisplayed();289 conferences.startSession();290 teacherWorkspace.waitForPageDisplayed();291 teacherWorkspace.selectReadingStage(4);292 teacherWorkspace.foundationActive();293 });294 it("master list proper elements visible", function() {295 login.loginSuccessfully();296 conferences.waitForPageDisplayed();297 conferences.startSession();298 teacherWorkspace.waitForPageDisplayed();299 teacherWorkspace.selectReadingStage(4);300 //studentWorkspace.masterlistElements();301 });302 it("does not open assessment", function() {303 login.loginSuccessfully();304 conferences.waitForPageDisplayed();305 conferences.startSession();306 teacherWorkspace.waitForPageDisplayed();307 teacherWorkspace.selectReadingStage(4);308 teacherWorkspace.masterlistElements();309 studentWorkspace.doesNotOpen();310 });311 it("advancement has elements", function() {312 login.loginSuccessfully();313 conferences.waitForPageDisplayed();314 conferences.startSession();315 teacherWorkspace.waitForPageDisplayed();316 teacherWorkspace.selectReadingStage(4);317 teacherWorkspace.advancement();318 });319 it("has descriptors", function() {320 login.loginSuccessfully();321 conferences.waitForPageDisplayed();322 conferences.startSession();323 teacherWorkspace.waitForPageDisplayed();324 teacherWorkspace.selectReadingStage(4);325 teacherWorkspace.descriptors();326 });327 it("changes rs", function() {328 login.loginSuccessfully();329 conferences.waitForPageDisplayed();330 conferences.startSession();331 teacherWorkspace.waitForPageDisplayed();332 teacherWorkspace.selectReadingStage(4);333 teacherWorkspace.changesrs();334 });335 it("rla works", function() {336 login.loginSuccessfully();337 conferences.waitForPageDisplayed();338 conferences.startSession();339 teacherWorkspace.waitForPageDisplayed();340 teacherWorkspace.selectReadingStage(4);341 teacherWorkspace.rlafunction();342 });343 it("brings up notes at end session", function() {344 login.loginSuccessfully();345 conferences.waitForPageDisplayed();346 conferences.startSession();347 teacherWorkspace.waitForPageDisplayed();348 teacherWorkspace.selectReadingStage(4);349 teacherWorkspace.endsession();350 });351 it("conference settings exists", function() {352 login.loginSuccessfully();353 conferences.waitForPageDisplayed();354 conferences.settings();355 conferences.assertsetting();356 });357 it("assessment tiles", function() {358 login.loginSuccessfully();359 conferences.waitForPageDisplayed();360 conferences.startSession();361 teacherWorkspace.waitForPageDisplayed();362 teacherWorkspace.selectReadingStage(4);363 teacherWorkspace.assessmenttiles();364 });365 it("reading foundation does not go past 5", function () {366 login.loginSuccessfully();367 conferences.waitForPageDisplayed();368 conferences.startSession();369 teacherWorkspace.waitForPageDisplayed();370 teacherWorkspace.selectReadingStage(4);371 teacherWorkspace.rf6();372 });373 it("simple input box works with correct onset", function(){374 login.loginSuccessfully();375 conferences.waitForPageDisplayed();376 conferences.startSession();377 teacherWorkspace.waitForPageDisplayed();378 teacherWorkspace.selectReadingStage(4);379 teacherWorkspace.sibworks();380 });381 it("simple input box works with incorrect onset", function(){382 login.loginSuccessfully();383 conferences.waitForPageDisplayed();384 conferences.startSession();385 teacherWorkspace.waitForPageDisplayed();386 teacherWorkspace.selectReadingStage(4);387 teacherWorkspace.sibworksincorrect();388 });389});390describe("Newest tests", function() {391 it("search works", function() {392 login.loginSuccessfully();393 conferences.waitForPageDisplayed();394 conferences.startSession();395 teacherWorkspace.waitForPageDisplayed();396 teacherWorkspace.inputSearchParameter();397 });398 it("search in stories works", function() {399 login.loginSuccessfully();400 conferences.waitForPageDisplayed();401 conferences.startSession();402 teacherWorkspace.waitForPageDisplayed();403 teacherWorkspace.selectReadingStage(3);404 teacherWorkspace.selectLeveledText();405 teacherWorkspace.selectStory();406 teacherWorkspace.inputSearchParameterStory();407 teacherWorkspace.inputSearchParameter();408 });409 it("search in master list works", function() {410 login.loginSuccessfully();411 conferences.waitForPageDisplayed();412 conferences.startSession();413 teacherWorkspace.waitForPageDisplayed();414 teacherWorkspace.selectReadingStage(6);415 teacherWorkspace.masterListSearch();416 });417 it("flip function works properly", function(){418 login.loginSuccessfully();419 conferences.waitForPageDisplayed();420 conferences.startSession();421 teacherWorkspace.waitForPageDisplayed();422 teacherWorkspace.selectReadingStage(5);423 teacherWorkspace.flipWorks();424 });425 it("picture switch works", function(){426 login.loginSuccessfully();427 conferences.waitForPageDisplayed();428 conferences.startSession();429 teacherWorkspace.waitForPageDisplayed();430 teacherWorkspace.selectReadingStage(2);431 teacherWorkspace.picSwitchWorks();432 });433 it("notes should open notes", function(){434 login.loginSuccessfully();435 conferences.waitForPageDisplayed();436 conferences.startSession();437 teacherWorkspace.waitForPageDisplayed();438 teacherWorkspace.newNotes();439 });440 it("reading assessment works", function(){441 login.loginSuccessfully();442 conferences.waitForPageDisplayed();443 conferences.startSession();444 teacherWorkspace.waitForPageDisplayed();445 teacherWorkspace.readingAssessment();446 });447});...

Full Screen

Full Screen

server.js

Source:server.js Github

copy

Full Screen

...24app.use(bodyParser.urlencoded({extended: true}));25app.use(express.static(path.join(__dirname, 'static')));2627app.get('/', (req, res) => {28 session.startSession(req, res, function() {29 if (req.session.get('user_name')) {30 res.redirect("/clients");31 } else {32 res.redirect("/login");33 }34 });35});3637app.get('/login', (req, res) => {38 session.startSession(req, res, function() {39 res.sendFile(__dirname + '/views/login.html');40 });41});4243app.post('/login', (req, res) => {44 var username = req.body.username;45 var password = md5(req.body.password);46 session.startSession(req, res, function() {47 connection.query("SELECT * FROM user WHERE username='" + username + "' AND password='" + password + "'",48 function(error, results, fields) {49 if (results.length > 0){50 req.session.put('user_name', results[0].username);51 if (results[0].isAdmin == 1)52 req.session.put('is_admin', true);5354 res.send({succeed: true});55 } 56 else57 res.send({succeed: false});58 });59 });60});6162app.get('/logout', (req, res) => {63 session.startSession(req, res, function() {64 if (req.session.get('user_name')) {65 req.session.pull('user_name');66 req.session.pull('is_admin');67 res.send({succeed: true});68 } else {69 res.send({succeed: false});70 }71 });72});7374app.get('/is-admin', (req, res) => {75 session.startSession(req, res, function() {76 if (req.session.get('user_name')) {77 res.send({succeed: true, is_admin: req.session.get('is_admin')});78 } else {79 res.send({succeed: false});80 }81 });82});8384app.get('/clients', (req, res) => {85 session.startSession(req, res, function() {86 if (req.session.get('user_name')) {87 res.sendFile(__dirname + '/views/clients.html');88 } else {89 res.redirect("/login");90 }91 });92});9394app.post('/add-client', (req, res) => {95 var first_name = req.body.first_name;96 var last_name = req.body.last_name;97 var country = req.body.country;98 var birthday = req.body.birthday;99100 session.startSession(req, res, function() {101 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {102 res.send({succeed: false});103 return;104 }105106 connection.query("INSERT INTO CLIENT (first_name, last_name, country, birthday) VALUES('" + first_name + "', '" + last_name + "', '" + country + "', '" + birthday + "')",107 function(error, results, fields) {108 if(error)109 res.send({succeed: false});110 else111 res.send({succeed: true});112 });113 });114});115116app.get('/get-clients', (req, res) => {117 session.startSession(req, res, function() {118 if (!req.session.get('user_name', false)) {119 res.send({succeed: false});120 return;121 }122123 connection.query("select * from client", function(error, showres, f) {124 if (error)125 res.send({succeed: false});126 else {127 showres.forEach(function(val, id) {128 var arr = val.birthday.toLocaleDateString().split("/");129 var year = arr.pop();130 131 for (i = 0 ; i < arr.length ; i ++) {132 if (arr[i].length == 1)133 arr[i] = "0" + arr[i];134 }135136 arr.unshift(year);137 val.birthday = arr.join("-");138 });139140 res.send({succeed: true, showres: showres});141 }142 });143 });144});145146app.post('/update-client', (req, res) => {147 session.startSession(req, res, function() {148 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {149 res.send({succeed: false});150 return;151 }152153 var query = "UPDATE client SET first_name='" + req.body.first_name + "', last_name='" + req.body.last_name + "', country='" + req.body.country + "', birthday='" + req.body.birthday + "' WHERE id=" + req.body.id;154 connection.query(query, function(error, results, fields) {155 if (error)156 res.send({succeed: false});157 else158 res.send({succeed: true});159 });160 });161});162163app.post('/delete-client', (req, res) => {164 session.startSession(req, res, function() {165 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {166 res.send({succeed: false});167 return;168 }169170 var query = "DELETE FROM client WHERE id=" + req.body.id;171 connection.query(query, function(error, results, fields) {172 if (error)173 res.send({succeed: false});174 else175 res.send({succeed: true});176 });177 });178});179180app.get('/users', (req, res) => {181 session.startSession(req, res, function() {182 if (req.session.get('user_name')) {183 res.sendFile(__dirname + '/views/users.html');184185 } else {186 res.redirect("/login");187 }188 });189});190191app.post('/add-user', (req, res) => {192 var username = req.body.username;193 var password = md5(req.body.password);194 var email = req.body.email;195 var isAdmin = req.body.isAdmin;196197 session.startSession(req, res, function() {198 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {199 res.send({succeed: false});200 return;201 }202203 connection.query("INSERT INTO user (username, password, email, isAdmin) VALUES('" + username + "', '" + password + "', '" + email + "', " + isAdmin + ")", function(error, results, fields) {204 if(error)205 res.send({succeed: false});206 else207 res.send({succeed: true});208 });209 });210});211212app.get('/get-users', (req, res) => {213 session.startSession(req, res, function() {214 if (!req.session.get('user_name', false)) {215 res.send({succeed: false});216 return;217 }218219 connection.query("select * from user", function(error, showres, f) {220 if (error)221 res.send({succeed: false});222 else223 res.send({succeed: true, showres: showres});224 });225 });226});227228app.post('/update-user', (req, res) => {229 session.startSession(req, res, function() {230 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {231 res.send({succeed: false});232 return;233 }234235 var query = "UPDATE user SET username='" + req.body.username + "', password='" + md5(req.body.password) + "', email='" + req.body.email + "', isAdmin=" + req.body.isAdmin + " WHERE id=" + req.body.id;236 connection.query(query, function(error, results, fields) {237 if (error)238 res.send({succeed: false});239 else240 res.send({succeed: true});241 });242 });243});244245app.post('/delete-user', (req, res) => {246 session.startSession(req, res, function() {247 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {248 res.send({succeed: false});249 return;250 }251252 var query = "DELETE FROM user WHERE id=" + req.body.id;253 connection.query(query, function(error, results, fields) {254 if (error)255 res.send({succeed: false});256 else257 res.send({succeed: true});258 });259 });260});261262app.get('/rooms', (req, res) => {263 session.startSession(req, res, function() {264 if (req.session.get('user_name')) {265 res.sendFile(__dirname + '/views/rooms.html');266 } else {267 res.redirect('/login');268 }269 });270});271272app.post('/add-room', (req, res) => {273 session.startSession(req, res, function() {274 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {275 res.send({succeed: false});276 return;277 }278 var desc_str = req.body.description;279 desc_str = desc_str.replace(/'/g, "\\'");280 var query = "INSERT INTO room (room_name, category, num_beds, description, price) VALUES ('" + req.body.room_name + "','" + req.body.category + "'," + req.body.num_beds + ",'" + desc_str + "'," + req.body.price + ")";281 connection.query(query, function(error, results, fields) {282 if (error)283 res.send({succeed: false});284 else285 res.send({succeed: true});286 });287 });288});289290app.get('/get-rooms', (req, res) => {291 session.startSession(req, res, function() {292 if (!req.session.get('user_name', false)) {293 res.send({succeed: false});294 return;295 }296297 var query = "SELECT * FROM room";298 connection.query(query, function(error, results, fields) {299 if (error)300 res.send({succeed: false});301 else302 res.send({succeed: true, content: results});303 });304 });305});306307app.post('/update-room', (req, res) => {308 session.startSession(req, res, function() {309 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {310 res.send({succeed: false});311 return;312 }313 var desc_str = req.body.description;314 desc_str = desc_str.replace(/'/g, "\\'");315 var query = "UPDATE room SET room_name='" + req.body.room_name + "', category='" + req.body.category + "', num_beds=" + req.body.num_beds + ", description='" + desc_str + "', price=" + req.body.price + " WHERE id=" + req.body.id;316 connection.query(query, function(error, results, fields) {317 if (error)318 res.send({succeed: false});319 else320 res.send({succeed: true});321 });322 });323});324325app.post('/delete-room', (req, res) => {326 session.startSession(req, res, function() {327 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {328 res.send({succeed: false});329 return;330 }331332 var query = "DELETE FROM room WHERE id=" + req.body.id;333 connection.query(query, function(error, results, fields) {334 if (error)335 res.send({succeed: false});336 else337 res.send({succeed: true});338 });339 });340});341342app.get('/check-in', (req, res) => {343 session.startSession(req, res, function() {344 if (req.session.get('user_name')) {345 res.sendFile(__dirname + '/views/checkin.html');346 } else {347 res.redirect('/login');348 }349 });350});351352app.post('/add-checkin', (req, res) => {353 session.startSession(req, res, function() {354 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {355 res.send({succeed: false});356 return;357 }358359 var checkin_time = new Date();360 var arr = checkin_time.toLocaleDateString().split("/");361 var year = arr.pop();362 363 for (i = 0 ; i < arr.length ; i ++) {364 if (arr[i].length == 1)365 arr[i] = "0" + arr[i];366 }367368 arr.unshift(year);369 checkin_time = arr.join("-");370371 var query = "INSERT INTO checkin (client_id, room_id, checkin_time, duration) VALUES (" + req.body.client_id + ", " + req.body.room_id + ", '" + checkin_time + "', " + req.body.duration + ")";372 connection.query(query, function(error, results, fields) {373 console.log(error);374 if (error)375 res.send({succeed: false});376 else377 res.send({succeed: true});378 });379 });380});381382app.get('/get-checkins', (req, res) => {383 session.startSession(req, res, function() {384 if (!req.session.get('user_name', false)) {385 res.send({succeed: false});386 return;387 }388389 var query = "SELECT * FROM checkin";390 connection.query(query, function(error, results, fields) {391 if (error)392 res.send({succeed: false});393 else {394 results.forEach(function(val, id) {395 var arr = val.checkin_time.toLocaleDateString().split("/");396 var year = arr.pop();397 398 for (i = 0 ; i < arr.length ; i ++) {399 if (arr[i].length == 1)400 arr[i] = "0" + arr[i];401 }402403 arr.unshift(year);404 val.checkin_time = arr.join("-");405 });406407 res.send({succeed: true, content: results});408 }409 });410 });411});412413app.post('/update-checkin', (req, res) => {414 session.startSession(req, res, function() {415 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {416 res.send({succeed: false});417 return;418 }419420 var query = "UPDATE checkin SET client_id=" + req.body.client_id + ", room_id=" + req.body.room_id + ", checkin_time='" + req.body.checkin_time + "', duration=" + req.body.duration + " WHERE id=" + req.body.id;421 connection.query(query, function(error, results, fields) {422 if (error)423 res.send({succeed: false});424 else425 res.send({succeed: true});426 });427 });428});429430app.post('/delete-checkin', (req, res) => {431 session.startSession(req, res, function() {432 if (!req.session.get('user_name', false) || !req.session.get('is_admin', false)) {433 res.send({succeed: false});434 return;435 }436437 var query = "DELETE FROM checkin WHERE id=" + req.body.id;438 connection.query(query, function(error, results, fields) {439 if (error)440 res.send({succeed: false});441 else442 res.send({succeed: true});443 });444 });445}); ...

Full Screen

Full Screen

landingPage.js

Source:landingPage.js Github

copy

Full Screen

...6 }7 return arg;8}9function Controller() {10 function startSession(e) {11 if ("" != Ti.App.Properties.getString("First Name") && "" != Ti.App.Properties.getString("Last Name") && "" != Ti.App.Properties.getString("Email Address")) {12 var props = Ti.App.Properties.listProperties();13 for (var i = 0, ilen = props.length; ilen > i; i++) {14 var value = Ti.App.Properties.getString(props[i]);15 Ti.API.info(props[i] + " = " + value);16 console.log(props[i] + " = " + value);17 }18 termsController = Alloy.createController("terms").getView();19 termsController.open();20 } else {21 termsController = Alloy.createController("terms").getView();22 termsController.open();23 }24 }...

Full Screen

Full Screen

start_session_command.js

Source:start_session_command.js Github

copy

Full Screen

1(function() {2 'use strict';3 // This test makes assertions about the number of sessions, which are not compatible with4 // implicit sessions.5 TestData.disableImplicitSessions = true;6 var conn;7 var admin;8 var foo;9 var result;10 const request = {startSession: 1};11 conn = MongoRunner.runMongod({setParameter: {maxSessions: 2}});12 admin = conn.getDB("admin");13 // ensure that the cache is empty14 var serverStatus = assert.commandWorked(admin.adminCommand({serverStatus: 1}));15 assert.eq(0, serverStatus.logicalSessionRecordCache.activeSessionsCount);16 // test that we can run startSession unauthenticated when the server is running without --auth17 result = admin.runCommand(request);18 assert.commandWorked(19 result,20 "failed test that we can run startSession unauthenticated when the server is running without --auth");21 assert(result.id, "failed test that our session response has an id");22 assert.eq(23 result.timeoutMinutes, 30, "failed test that our session record has the correct timeout");24 // test that startSession added to the cache25 serverStatus = assert.commandWorked(admin.adminCommand({serverStatus: 1}));26 assert.eq(1, serverStatus.logicalSessionRecordCache.activeSessionsCount);27 // test that we can run startSession authenticated when the server is running without --auth28 admin.createUser({user: 'user0', pwd: 'password', roles: []});29 admin.auth("user0", "password");30 result = admin.runCommand(request);31 assert.commandWorked(32 result,33 "failed test that we can run startSession authenticated when the server is running without --auth");34 assert(result.id, "failed test that our session response has an id");35 assert.eq(36 result.timeoutMinutes, 30, "failed test that our session record has the correct timeout");37 assert.commandFailed(admin.runCommand(request),38 "failed test that we can't run startSession when the cache is full");39 MongoRunner.stopMongod(conn);40 //41 conn = MongoRunner.runMongod({auth: "", nojournal: ""});42 admin = conn.getDB("admin");43 foo = conn.getDB("foo");44 // test that we can't run startSession unauthenticated when the server is running with --auth45 assert.commandFailed(46 admin.runCommand(request),47 "failed test that we can't run startSession unauthenticated when the server is running with --auth");48 //49 admin.createUser({user: 'admin', pwd: 'admin', roles: jsTest.adminUserRoles});50 admin.auth("admin", "admin");51 admin.createUser({user: 'user0', pwd: 'password', roles: jsTest.basicUserRoles});52 foo.createUser({user: 'user1', pwd: 'password', roles: jsTest.basicUserRoles});53 admin.createUser({user: 'user2', pwd: 'password', roles: []});54 admin.logout();55 // test that we can run startSession authenticated as one user with proper permissions56 admin.auth("user0", "password");57 result = admin.runCommand(request);58 assert.commandWorked(59 result,60 "failed test that we can run startSession authenticated as one user with proper permissions");61 assert(result.id, "failed test that our session response has an id");62 assert.eq(63 result.timeoutMinutes, 30, "failed test that our session record has the correct timeout");64 // test that we cant run startSession authenticated as two users with proper permissions65 foo.auth("user1", "password");66 assert.commandFailed(67 admin.runCommand(request),68 "failed test that we cant run startSession authenticated as two users with proper permissions");69 // test that we cant run startSession authenticated as one user without proper permissions70 admin.logout();71 admin.auth("user2", "password");72 assert.commandFailed(73 admin.runCommand(request),74 "failed test that we cant run startSession authenticated as one user without proper permissions");75 //76 MongoRunner.stopMongod(conn);...

Full Screen

Full Screen

session.js

Source:session.js Github

copy

Full Screen

1import { combineReducers } from 'redux'2import { actionTypes } from '../../actions'34const {5 SUCCESS,6 FAILURE,7 REQUEST,8 GET_MASTER_SESSION,9 START_SESSION,10 GET_NEXT_SESSION_TO_BOOK,11 GET_UNRESOLVED_SESSIONS,12 END_SESSION,13 END_SESSION_NO_SHOW_TECH,14 END_SESSION_NO_SHOW15} = actionTypes1617const entity = () => {18 const masterSessions = (state = [], action) => {19 switch (action.type) {20 case GET_MASTER_SESSION[SUCCESS]:21 return action.payload.sessions22 case GET_MASTER_SESSION[REQUEST]:23 case GET_MASTER_SESSION[FAILURE]:24 return []25 default:26 return state27 }28 }29 const startSession = (state = 0, action) => {30 switch (action.type) {31 case START_SESSION[SUCCESS]:32 return action.payload.session33 case START_SESSION[REQUEST]:34 case START_SESSION[FAILURE]:35 return {}36 default:37 return state38 }39 }4041 const nextSession = (state = {}, action) => {42 switch (action.type) {43 case GET_NEXT_SESSION_TO_BOOK[SUCCESS]:44 return action.payload.session45 case GET_NEXT_SESSION_TO_BOOK[REQUEST]:46 case GET_NEXT_SESSION_TO_BOOK[FAILURE]:47 return {}48 default:49 return state50 }51 }5253 const unresolvedSessions = (state = [], action) => {54 switch (action.type) {55 case GET_UNRESOLVED_SESSIONS[SUCCESS]:56 return action.payload.session.bookings57 ? action.payload.session.bookings58 : []59 case GET_UNRESOLVED_SESSIONS[REQUEST]:60 case GET_UNRESOLVED_SESSIONS[FAILURE]:61 return []62 default:63 return state64 }65 }6667 const endSessionStatus = (state = false, action) => {68 switch (action.type) {69 case END_SESSION_NO_SHOW[SUCCESS]:70 case END_SESSION[SUCCESS]:71 case END_SESSION_NO_SHOW_TECH[SUCCESS]:72 return true73 case END_SESSION_NO_SHOW[FAILURE]:74 case END_SESSION[FAILURE]:75 case END_SESSION_NO_SHOW_TECH[FAILURE]:76 case END_SESSION_NO_SHOW[REQUEST]:77 case END_SESSION[REQUEST]:78 case END_SESSION_NO_SHOW_TECH[REQUEST]:79 return false80 default:81 return state82 }83 }8485 return combineReducers({86 masterSessions,87 startSession,88 nextSession,89 unresolvedSessions,90 endSessionStatus91 })92}9394export default entity9596const getSessionState = state =>97 state.startSession.session ? state.startSession.session : {}9899export const getAllMasterSessions = (state, props) => state.masterSessions100export const getSession = (state, props) => state.startSession.session101export const getSessionId = (state, props) =>102 state.startSession.session ? state.startSession.session.id : ''103export const getSlot = (state, props) => state.startSession.slot104export const getTutor = (state, props) => state.startSession.tutor105export const getStudent = (state, props) => state.startSession.student106export const getSessionBookingId = (state, props) => state.startSession.id107export const getSessionDetails = (state, props) =>108 getSessionState(state).session_master109export const getSessionDetailsBookingId = (state, props) =>110 getSessionDetailsBookingId(state).startSession.id111export const getActivities = (state, props) => getSessionState(state).activities112export const getNextSessionMasterId = (state, props) =>113 state.nextSession ? state.nextSession.id : null114export const getUnResolvedSessions = (state, props) => state.unresolvedSessions115 ...

Full Screen

Full Screen

KermadClient.js

Source:KermadClient.js Github

copy

Full Screen

...9// this.server = App.remote.getGlobal('kermad')10// this.client = jayson.Client.tcp({host: this.server.ip, port: this.server.port})11// }12// /** */13// startSession(path, cb) {14// let params = [path]15// console.log(OUT, "StartSession", params)16// this.client.request("StartSession", params, (err, res) => {17// // this.app.Logger.info(IN, res.result);18// cb(err, res.result)19// })20// }21// endSession() {22// }23// }24// const Client = new KermadClient(25class KermaSession {26}27const IN = "<<<"...

Full Screen

Full Screen

Main.js

Source:Main.js Github

copy

Full Screen

...17 const ipData = useSelector((state) => state.startSession.data);18 React.useEffect(() => {19 const startSession = new Date().getTime();20 ipAPI.location((loc) => {21 dispatch(actions.visitorsActions.startSession(loc, startSession));22 });23 }, []);24 React.useEffect(() => {25 if (Object.keys(ipData).length) {26 const socket = io(process.env.REACT_APP_URL_BACKEND);27 socket.on('connect', () => {28 let {startSession} = ipData;29 startSession = moment(startSession).valueOf();30 Object.assign(ipData, {startSession});31 socket.emit('startSession', ipData);32 });33 }34 }, [ipData]);35 return (...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const wdio = require('webdriverio');2const opts = {3 capabilities: {4 }5};6async function main() {7 const client = await wdio.remote(opts);8 await client.startSession();9 await client.deleteSession();10}11main();12const wdio = require('webdriverio');13const opts = {14 capabilities: {15 }16};17async function main() {18 const client = await wdio.remote(opts);19 await client.startSession();20 await client.deleteSession();21}22main();23const wdio = require('webdriverio');24const opts = {25 capabilities: {26 }27};28async function main() {29 const client = await wdio.remote(opts);30 await client.startSession();31 await client.deleteSession();32}33main();34const wdio = require('webdriverio');35const opts = {36 capabilities: {37 }38};39async function main() {40 const client = await wdio.remote(opts);41 await client.startSession();42 await client.deleteSession();43}44main();45const wdio = require('webdriverio');46const opts = {47 capabilities: {48 }49};50async function main() {51 const client = await wdio.remote(opts);52 await client.startSession();53 await client.deleteSession();54}55main();

Full Screen

Using AI Code Generation

copy

Full Screen

1const { BaseDriver } = require('appium-base-driver');2const { startSession } = BaseDriver.prototype;3BaseDriver.prototype.startSession = async function (caps) {4 const sessionId = await startSession.call(this, caps);5 return sessionId;6};7const { BaseDriver } = require('appium-base-driver');8const { createSession } = BaseDriver.prototype;9BaseDriver.prototype.createSession = async function (caps) {10 const sessionId = await createSession.call(this, caps);11 return sessionId;12};13const { BaseDriver } = require('appium-base-driver');14const { deleteSession } = BaseDriver.prototype;15BaseDriver.prototype.deleteSession = async function () {16 const sessionId = await deleteSession.call(this);17 return sessionId;18};19const { BaseDriver } = require('appium-base-driver');20const { executeCommand } = BaseDriver.prototype;21BaseDriver.prototype.executeCommand = async function (command, ...args) {22 const result = await executeCommand.call(this, command, ...args);23 return result;24};25const { BaseDriver } = require('appium-base-driver');26const { executeCommand } = BaseDriver.prototype;27BaseDriver.prototype.executeCommand = async function (command, ...args) {28 const result = await executeCommand.call(this, command, ...args);29 return result;30};31const { BaseDriver } = require('appium-base-driver');32const { executeCommand } = BaseDriver.prototype;33BaseDriver.prototype.executeCommand = async function (command, ...args) {34 const result = await executeCommand.call(this, command, ...args);35 return result;36};37const { BaseDriver } = require('appium-base-driver');38const { executeCommand } = BaseDriver.prototype;39BaseDriver.prototype.executeCommand = async function (command, ...args) {40 const result = await executeCommand.call(this, command, ...args);41 return result;42};43const { BaseDriver } = require('appium-base-driver');44const { executeCommand } = BaseDriver.prototype;

Full Screen

Using AI Code Generation

copy

Full Screen

1const { BaseDriver } = require('appium-base-driver');2const { MJSONWP_ELEMENT_KEY } = require('appium-base-driver').MJSONWP;3const { util } = require('appium-support');4const { errors } = require('appium-base-driver');5const { logger } = require('appium-support');6const { getSimulator } = require('appium-ios-simulator');7const { getDevices } = require('node-simctl');8const { getDeviceString } = require('node-simctl');9const { getDeviceUDID } = require('node-simctl');10const { getDevice } = require('node-simctl');11const { getDeviceByName } = require('node-simctl');12const { getDeviceByIdentifier } = require('node-simctl');13const { createDevice } = require('node-simctl');14const { deleteDevice } = require('node-simctl');15const { eraseDevice } = require('node-simctl');16const { installApp } = require('node-simctl');17const { uninstallApp } = require('node-simctl');18const { launch } = require('node-simctl');19const { shutdown } = require('node-simctl');20const { installSSLCert } = require('node-simctl');21const { removeSSLCert } = require('node-simctl');22const { addMedia } = require('node-simctl');23const { bootDevice } = require('node-simctl');24const { shutdownDevice } = require('node-simctl');25const { setLocale } = require('node-simctl');26const { setLocation } = require('node-simctl');27const { addPhotos } = require('node-simctl');28const { addVideos } = require('node-simctl');29const { addLivePhotos } = require('node-simctl');30const { addContacts } = require('node-simctl');31const { addCalendar } = require('node-simctl');32const { addReminders } = require('node-simctl');33const { addPassbook } = require('node-simctl');34const { setPermissions } = require('node-simctl');35const { getAppContainer } = require('node-simctl');36const { openUrl } = require('node-simctl');37const { spawn

Full Screen

Using AI Code Generation

copy

Full Screen

1await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554'}});2await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', appPackage: 'com.example.android.contactmanager', appActivity: '.ContactManager'}});3await driver.startSession({capabilities: {platformName: 'iOS', deviceName: 'iPhone 6', app: 'path/to/my.app'}});4await driver.startSession({capabilities: {platformName: 'Windows', deviceName: 'WindowsPC', app: 'path/to/my.app'}});5await driver.startSession({capabilities: {platformName: 'Mac', deviceName: 'Mac', app: 'path/to/my.app'}});6await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', app: 'path/to/my.app'}});7await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', app: 'path/to/my.app'}});8await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', app: 'path/to/my.app'}});9await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', app: 'path/to/my.app'}});10await driver.startSession({capabilities: {platformName: 'iOS', deviceName: 'iPhone 6', app: 'path/to/my.app'}});11await driver.startSession({capabilities: {platformName: 'Android', deviceName: 'emulator-5554', browserName: 'Chrome'}});

Full Screen

Using AI Code Generation

copy

Full Screen

1var mySession = driver.startSession();2console.log(mySession);3driver.stopSession(mySession);4var mySession = driver.startSession();5console.log(mySession);6driver.stopSession(mySession);7var mySession = driver.startSession();8console.log(mySession);9driver.stopSession(mySession);10var mySession = driver.startSession();11console.log(mySession);12driver.stopSession(mySession);13var mySession = driver.startSession();14console.log(mySession);15driver.stopSession(mySession);16var mySession = driver.startSession();17console.log(mySession);18driver.stopSession(mySession);19var mySession = driver.startSession();20console.log(mySession);21driver.stopSession(mySession);22var mySession = driver.startSession();23console.log(mySession);24driver.stopSession(mySession);25var mySession = driver.startSession();26console.log(mySession);27driver.stopSession(mySession);28var mySession = driver.startSession();29console.log(mySession);30driver.stopSession(mySession);

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('sample test', function() {2 it('should start session', async function() {3 let caps = {4 };5 await driver.startSession(caps);6 await driver.quit();7 });8});9async startSession (caps) {10 return this.sessionId;11}12async createSession (caps) {13 return this.sessionId;14}15async deleteSession () {16}17async getSession () {18 return this.sessionId;19}20async getStatus () {21 return this.status;22}23driver.on('newSession', (sessionId) => {24});

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 Appium Base Driver 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