How to use isDisplayed method in Webdriverio

Best JavaScript code snippet using webdriverio-monorepo

inclass_pi.spec.js

Source:inclass_pi.spec.js Github

copy

Full Screen

...55 })56 })57 it("should check correct inclass review content", function() {58 expect(inclass_page.title).toEqual("In-class Review: PI module 1")59 expect(inclass_page.display_button.isDisplayed()).toEqual(true);60 expect(inclass_page.display_button.isEnabled()).toEqual(true);61 var module = inclass_page.module_item(1)62 expect(module.title).toEqual("PI lecture1 video quizzes")63 expect(module.inclass_quizzes.count()).toEqual(1)64 var inclass_quiz = module.inclass_quiz(1)65 expect(inclass_quiz.title).toEqual("Quiz: PI MCQ QUIZ")66 expect(inclass_quiz.visibility_box.isSelected()).toEqual(true)67 })68 it("should check correct inclass time estimate", function() {69 expect(inclass_page.total_inclass_time).toEqual("8");70 expect(inclass_page.total_pi_time).toEqual("8")71 expect(inclass_page.total_pi_quizzes).toEqual("1")72 expect(inclass_page.total_review_time).toEqual("0")73 expect(inclass_page.total_review_quizzes).toEqual("0")74 expect(inclass_page.total_review_discussions).toEqual("0")75 expect(inclass_page.total_review_surveys).toEqual("0")76 })77 })78 describe('Student 1 go inClass', function(){79 it("should go to student mode",function(){80 utils.switch_browser(student_browser)81 login_page.sign_in(params.student1.email, params.password)82 course_list.open()83 course_list.open_student_course(1)84 })85 it("should open student inclass",function(){86 var module = navigator.module(module_count)87 // var module = navigator.module(1)88 module.open()89 module.open_student_inclass()90 sleep(6000)91 })92 it("should have correct student inclass content",function(){93 expect(student_inclass_page.title).toEqual("PI module 1")94 expect(student_inclass_page.get_block_text(1)).toEqual("Intro")95 expect(student_inclass_page.get_block_text(2)).toEqual("Self")96 expect(student_inclass_page.get_block_text(3)).toEqual("Group")97 expect(student_inclass_page.get_block_text(4)).toEqual("Discussion")98 })99 it("should show no class running",function(){100 expect(student_inclass_page.noclass.isDisplayed()).toEqual(true)101 expect(student_inclass_page.noclass.getText()).toContain("The in-class session has not started")102 expect(student_inclass_page.noclass.getText()).toContain("Please try again later or click on the 'Refresh' button below")103 expect(student_inclass_page.refresh_button.isDisplayed()).toEqual(true)104 })105 it("should try to go to next stage student inclass",function(){106 student_inclass_page.refresh()107 expect(student_inclass_page.title).toEqual("PI module 1")108 expect(student_inclass_page.noclass.isDisplayed()).toEqual(true)109 expect(student_inclass_page.noclass.getText()).toContain("The in-class session has not started")110 expect(student_inclass_page.noclass.getText()).toContain("Please try again later or click on the 'Refresh' button below")111 expect(student_inclass_page.refresh_button.isDisplayed()).toEqual(true)112 })113 })114 describe('Student 2 go inClass', function(){115 it("should go to student mode",function(){116 utils.switch_browser(student2_browser)117 login_page.sign_in(params.student2.email, params.password)118 course_list.open()119 course_list.open_student_course(1)120 })121 it("should open student inclass",function(){122 var module = navigator.module(module_count)123 // var module = navigator.module(1)124 module.open()125 module.open_student_inclass()126 sleep(6000)127 })128 it("should have correct student inclass content",function(){129 expect(student_inclass_page.title).toEqual("PI module 1")130 expect(student_inclass_page.get_block_text(1)).toEqual("Intro")131 expect(student_inclass_page.get_block_text(2)).toEqual("Self")132 expect(student_inclass_page.get_block_text(3)).toEqual("Group")133 expect(student_inclass_page.get_block_text(4)).toEqual("Discussion")134 })135 it("should show no class running",function(){136 expect(student_inclass_page.noclass.isDisplayed()).toEqual(true)137 expect(student_inclass_page.noclass.getText()).toContain("The in-class session has not started")138 expect(student_inclass_page.noclass.getText()).toContain("Please try again later or click on the 'Refresh' button below")139 expect(student_inclass_page.refresh_button.isDisplayed()).toEqual(true)140 })141 it("should try to go to next stage student inclass",function(){142 student_inclass_page.refresh()143 expect(student_inclass_page.title).toEqual("PI module 1")144 expect(student_inclass_page.noclass.isDisplayed()).toEqual(true)145 expect(student_inclass_page.noclass.getText()).toContain("The in-class session has not started")146 expect(student_inclass_page.noclass.getText()).toContain("Please try again later or click on the 'Refresh' button below")147 expect(student_inclass_page.refresh_button.isDisplayed()).toEqual(true)148 })149 })150 describe('Teacher start inClass', function(){151 it('Should start in class review First Stage', function(){152 utils.switch_browser(teacher_browser)153 inclass_page.start_inclass_review();154 expect(review_model.review_model.isDisplayed()).toEqual(true)155 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")156 expect(review_model.question_block.isDisplayed()).toEqual(true)157 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")158 expect(review_model.get_block(1).getAttribute('class')).toContain("active")159 expect(review_model.get_block_text(1)).toEqual("Intro")160 expect(review_model.get_block_text(2)).toEqual("Self")161 expect(review_model.get_block_text(3)).toEqual("Group")162 expect(review_model.get_block_text(4)).toEqual("Discussion")163 expect(review_model.get_block_text(5)).toEqual("")164 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")165 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 166 expect(review_model.chart.isDisplayed()).toEqual(false)167 expect(review_model.next_button.isDisplayed()).toEqual(true)168 expect(review_model.prev_button.isDisplayed()).toEqual(true)169 expect(review_model.exit_button.isDisplayed()).toEqual(true)170 // expect(review_model.review_model.isDisplayed()).toEqual(true)171 })172 })173 describe('Student 1 go to intro', function(){174 it("should go to next stage",function(){175 utils.switch_browser(student_browser)176 student_inclass_page.refresh()177 })178 it("should show student inclass intro",function(){179 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)180 expect(student_inclass_page.intro.isDisplayed()).toEqual(true)181 expect(student_inclass_page.get_block(1).getAttribute('class')).toContain("active")182 expect(student_inclass_page.intro.getText()).toContain("The in-class question has not started")183 expect(student_inclass_page.intro.getText()).toContain("Click on 'Next' when the question shows up")184 expect(student_inclass_page.intro_next_button.isDisplayed()).toEqual(true)185 })186 it("should try to go to next stage student inclass",function(){187 student_inclass_page.intro_next()188 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)189 expect(student_inclass_page.intro.isDisplayed()).toEqual(true)190 expect(student_inclass_page.get_block(1).getAttribute('class')).toContain("active")191 expect(student_inclass_page.intro.getText()).toContain("The in-class question has not started")192 expect(student_inclass_page.intro.getText()).toContain("Click on 'Next' when the question shows up")193 expect(student_inclass_page.intro_next_button.isDisplayed()).toEqual(true)194 })195 })196 describe('Student 2 go to intro', function(){197 it("should go to next stage",function(){198 utils.switch_browser(student2_browser)199 student_inclass_page.refresh()200 })201 it("should show student inclass intro",function(){202 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)203 expect(student_inclass_page.intro.isDisplayed()).toEqual(true)204 expect(student_inclass_page.get_block(1).getAttribute('class')).toContain("active")205 expect(student_inclass_page.intro.getText()).toContain("The in-class question has not started")206 expect(student_inclass_page.intro.getText()).toContain("Click on 'Next' when the question shows up")207 expect(student_inclass_page.intro_next_button.isDisplayed()).toEqual(true)208 })209 it("should try to go to next stage student inclass",function(){210 student_inclass_page.intro_next()211 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)212 expect(student_inclass_page.intro.isDisplayed()).toEqual(true)213 expect(student_inclass_page.get_block(1).getAttribute('class')).toContain("active")214 expect(student_inclass_page.intro.getText()).toContain("The in-class question has not started")215 expect(student_inclass_page.intro.getText()).toContain("Click on 'Next' when the question shows up")216 expect(student_inclass_page.intro_next_button.isDisplayed()).toEqual(true)217 })218 })219 describe('Teacher start Self stage', function(){220 it('Should go to the Self Stage', function(){221 utils.switch_browser(teacher_browser)222 review_model.next()223 expect(review_model.review_model.isDisplayed()).toEqual(true)224 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")225 expect(review_model.question_block.isDisplayed()).toEqual(true)226 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")227 expect(review_model.get_block(2).getAttribute('class')).toContain("active")228 // expect(element(by.className('active')).getText()).toContain('Self')229 expect(review_model.get_block_text(1)).toEqual("Intro")230 expect(review_model.get_block_text(2)).toEqual("Self")231 expect(review_model.get_block_text(3)).toEqual("Group")232 expect(review_model.get_block_text(4)).toEqual("Discussion")233 expect(review_model.get_block_text(5)).toEqual("")234 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")235 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 236 expect(review_model.chart.isDisplayed()).toEqual(false)237 expect(review_model.next_button.isDisplayed()).toEqual(true)238 expect(review_model.prev_button.isDisplayed()).toEqual(true)239 expect(review_model.exit_button.isDisplayed()).toEqual(true)240 })241 })242 describe('Student 1 solve Self Qs', function(){243 it("should go to next stage",function(){244 utils.switch_browser(student_browser)245 student_inclass_page.intro_next()246 })247 it("should show the self question choices", function(){248 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)249 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)250 expect(student_inclass_page.self.isDisplayed()).toEqual(true)251 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)252 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")253 expect(student_inclass_page.self_choices.count()).toEqual(3)254 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")255 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")256 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")257 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)258 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)259 })260 it("should vote without selecting any choice",function(){261 student_inclass_page.self_vote()262 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)263 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)264 expect(student_inclass_page.self.isDisplayed()).toEqual(true)265 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)266 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")267 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(true)268 expect(student_inclass_page.alert_box.getText()).toContain("Please choose your answer")269 expect(student_inclass_page.self_choices.count()).toEqual(3)270 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")271 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")272 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")273 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)274 // expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)275 // expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)276 // student_inclass_page.self_next()277 // expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)278 // expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")279 // student_inclass_page.self_retry()280 })281 it("should select first and third choice",function(){282 expect(student_inclass_page.self_choice(1).getAttribute('class')).not.toContain("selected")283 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")284 expect(student_inclass_page.self_choice(3).getAttribute('class')).not.toContain("selected")285 student_inclass_page.self_choice(1).click()286 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")287 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")288 student_inclass_page.self_choice(3).click()289 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")290 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")291 })292 it("should check that selected answers remain after browser refresh",function(){293 browser.refresh()294 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)295 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)296 expect(student_inclass_page.self.isDisplayed()).toEqual(true)297 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)298 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")299 expect(student_inclass_page.self_choices.count()).toEqual(3)300 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")301 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")302 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")303 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)304 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")305 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")306 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")307 })308 it("should vote for selected answer and check selected answers",function(){309 student_inclass_page.self_vote()310 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)311 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)312 expect(student_inclass_page.self.isDisplayed()).toEqual(false)313 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(true)314 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")315 expect(student_inclass_page.self_selected_choices.count()).toEqual(3)316 expect(student_inclass_page.self_selected_choice(1).getText()).toContain("Answer 1")317 expect(student_inclass_page.self_selected_choice(2).isDisplayed()).toEqual(false)318 expect(student_inclass_page.self_selected_choice(3).getText()).toContain("Answer 3")319 expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)320 expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)321 })322 it("should try to go to next stage in student inclass",function(){323 student_inclass_page.self_next()324 expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)325 expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")326 })327 it("should retry quiz student inclass",function(){328 student_inclass_page.self_retry()329 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)330 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)331 expect(student_inclass_page.self.isDisplayed()).toEqual(true)332 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)333 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")334 expect(student_inclass_page.self_choices.count()).toEqual(3)335 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")336 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")337 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")338 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)339 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)340 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")341 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")342 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")343 })344 it("should change selected answer",function(){345 student_inclass_page.self_choice(1).click()346 student_inclass_page.self_choice(2).click()347 sleep(2000)348 expect(student_inclass_page.self_choice(1).getAttribute('class')).not.toContain("selected")349 expect(student_inclass_page.self_choice(2).getAttribute('class')).toContain("selected")350 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")351 })352 it("should vote with new selected answer and check selected answers",function(){353 student_inclass_page.self_vote()354 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)355 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)356 expect(student_inclass_page.self.isDisplayed()).toEqual(false)357 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(true)358 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")359 expect(student_inclass_page.self_selected_choices.count()).toEqual(3)360 expect(student_inclass_page.self_selected_choice(1).isDisplayed()).toEqual(false)361 expect(student_inclass_page.self_selected_choice(2).getText()).toContain("Answer 2")362 expect(student_inclass_page.self_selected_choice(3).getText()).toContain("Answer 3")363 expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)364 expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)365 })366 it("should try to go to next stage in student inclass",function(){367 student_inclass_page.self_next()368 expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)369 expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")370 })371 })372 describe('Student 2 solve Self Qs', function(){373 it("should go to next stage",function(){374 utils.switch_browser(student2_browser)375 student_inclass_page.intro_next()376 })377 it("should show the self question choices", function(){378 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)379 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)380 expect(student_inclass_page.self.isDisplayed()).toEqual(true)381 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)382 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")383 expect(student_inclass_page.self_choices.count()).toEqual(3)384 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")385 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")386 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")387 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)388 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)389 })390 it("should vote without selecting any choice",function(){391 student_inclass_page.self_vote()392 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)393 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)394 expect(student_inclass_page.self.isDisplayed()).toEqual(true)395 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)396 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")397 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(true)398 expect(student_inclass_page.alert_box.getText()).toContain("Please choose your answer")399 expect(student_inclass_page.self_choices.count()).toEqual(3)400 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")401 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")402 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")403 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)404 // expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)405 // expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)406 // student_inclass_page.self_next()407 // expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)408 // expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")409 // student_inclass_page.self_retry()410 })411 it("should select first and third choice",function(){412 expect(student_inclass_page.self_choice(1).getAttribute('class')).not.toContain("selected")413 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")414 expect(student_inclass_page.self_choice(3).getAttribute('class')).not.toContain("selected")415 student_inclass_page.self_choice(1).click()416 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")417 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")418 student_inclass_page.self_choice(3).click()419 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")420 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")421 })422 it("should check that selected answers remain after browser refresh",function(){423 browser.refresh()424 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)425 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)426 expect(student_inclass_page.self.isDisplayed()).toEqual(true)427 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)428 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")429 expect(student_inclass_page.self_choices.count()).toEqual(3)430 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")431 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")432 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")433 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)434 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")435 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")436 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")437 })438 it("should vote for selected answer and check selected answers",function(){439 student_inclass_page.self_vote()440 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)441 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)442 expect(student_inclass_page.self.isDisplayed()).toEqual(false)443 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(true)444 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")445 expect(student_inclass_page.self_selected_choices.count()).toEqual(3)446 expect(student_inclass_page.self_selected_choice(1).getText()).toContain("Answer 1")447 expect(student_inclass_page.self_selected_choice(2).isDisplayed()).toEqual(false)448 expect(student_inclass_page.self_selected_choice(3).getText()).toContain("Answer 3")449 expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)450 expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)451 })452 it("should try to go to next stage in student inclass",function(){453 student_inclass_page.self_next()454 expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)455 expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")456 })457 it("should retry quiz student inclass",function(){458 student_inclass_page.self_retry()459 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)460 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)461 expect(student_inclass_page.self.isDisplayed()).toEqual(true)462 expect(student_inclass_page.self_note.isDisplayed()).toEqual(true)463 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")464 expect(student_inclass_page.self_choices.count()).toEqual(3)465 expect(student_inclass_page.self_choice(1).getText()).toContain("Answer 1")466 expect(student_inclass_page.self_choice(2).getText()).toContain("Answer 2")467 expect(student_inclass_page.self_choice(3).getText()).toContain("Answer 3")468 expect(student_inclass_page.self_vote_button.isDisplayed()).toEqual(true)469 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)470 expect(student_inclass_page.self_choice(1).getAttribute('class')).toContain("selected")471 expect(student_inclass_page.self_choice(2).getAttribute('class')).not.toContain("selected")472 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")473 })474 it("should change selected answer",function(){475 student_inclass_page.self_choice(1).click()476 student_inclass_page.self_choice(2).click()477 sleep(2000)478 expect(student_inclass_page.self_choice(1).getAttribute('class')).not.toContain("selected")479 expect(student_inclass_page.self_choice(2).getAttribute('class')).toContain("selected")480 expect(student_inclass_page.self_choice(3).getAttribute('class')).toContain("selected")481 })482 it("should vote with new selected answer and check selected answers",function(){483 student_inclass_page.self_vote()484 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)485 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)486 expect(student_inclass_page.self.isDisplayed()).toEqual(false)487 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(true)488 expect(student_inclass_page.get_block(2).getAttribute('class')).toContain("active")489 expect(student_inclass_page.self_selected_choices.count()).toEqual(3)490 expect(student_inclass_page.self_selected_choice(1).isDisplayed()).toEqual(false)491 expect(student_inclass_page.self_selected_choice(2).getText()).toContain("Answer 2")492 expect(student_inclass_page.self_selected_choice(3).getText()).toContain("Answer 3")493 expect(student_inclass_page.self_retry_btn.isDisplayed()).toEqual(true)494 expect(student_inclass_page.self_next_btn.isDisplayed()).toEqual(true)495 })496 it("should try to go to next stage in student inclass",function(){497 student_inclass_page.self_next()498 expect(student_inclass_page.self_wait_alert.isDisplayed()).toEqual(true)499 expect(student_inclass_page.self_wait_alert.getText()).toContain("Please wait for the teacher to continue")500 })501 })502 describe('Teacher start Group stage', function(){503 // it('Should check for solvers count', function(){504 // expect(element(by.binding('session_votes')).getText()).toBe('(1/1)')505 // })506 it('Should go to the Group Stage', function(){507 utils.switch_browser(teacher_browser)508 review_model.next()509 expect(review_model.review_model.isDisplayed()).toEqual(true)510 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")511 expect(review_model.question_block.isDisplayed()).toEqual(true)512 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")513 expect(review_model.get_block(3).getAttribute('class')).toContain("active")514 // expect(element(by.className('active')).getText()).toContain('Group')515 expect(review_model.get_block_text(1)).toEqual("Intro")516 expect(review_model.get_block_text(2)).toEqual("Self")517 expect(review_model.get_block_text(3)).toEqual("Group")518 expect(review_model.get_block_text(4)).toEqual("Discussion")519 expect(review_model.get_block_text(5)).toEqual("")520 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")521 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 522 expect(review_model.chart.isDisplayed()).toEqual(false)523 expect(review_model.next_button.isDisplayed()).toEqual(true)524 expect(review_model.prev_button.isDisplayed()).toEqual(true)525 expect(review_model.exit_button.isDisplayed()).toEqual(true)526 })527 })528 describe('Student 1 solve group Qs', function(){529 it("should go to next stage",function(){530 utils.switch_browser(student_browser)531 student_inclass_page.self_next()532 })533 it("should show the group question choices",function(){534 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)535 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)536 expect(student_inclass_page.self.isDisplayed()).toEqual(false)537 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)538 expect(student_inclass_page.group.isDisplayed()).toEqual(true)539 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")540 expect(student_inclass_page.group_choices.count()).toEqual(3)541 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")542 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")543 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")544 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)545 expect(student_inclass_page.group_note.isDisplayed()).toEqual(true)546 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)547 })548 it("should vote without selecting any choice",function(){549 student_inclass_page.group_vote()550 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)551 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)552 expect(student_inclass_page.self.isDisplayed()).toEqual(false)553 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)554 expect(student_inclass_page.group.isDisplayed()).toEqual(true)555 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")556 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(true)557 expect(student_inclass_page.alert_box.getText()).toContain("Please choose your answer")558 expect(student_inclass_page.group_choices.count()).toEqual(3)559 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")560 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")561 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")562 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)563 expect(student_inclass_page.group_note.isDisplayed()).toEqual(true)564 })565 it("should select first and third choice",function(){566 expect(student_inclass_page.group_choice(1).getAttribute('class')).not.toContain("selected")567 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")568 expect(student_inclass_page.group_choice(3).getAttribute('class')).not.toContain("selected")569 student_inclass_page.group_choice(1).click()570 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")571 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")572 student_inclass_page.group_choice(3).click()573 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")574 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")575 })576 it("should check that selected answers remain after browser refresh",function(){577 browser.refresh()578 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)579 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)580 expect(student_inclass_page.self.isDisplayed()).toEqual(false)581 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)582 expect(student_inclass_page.group.isDisplayed()).toEqual(true)583 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")584 expect(student_inclass_page.group_choices.count()).toEqual(3)585 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")586 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")587 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")588 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)589 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")590 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")591 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")592 })593 it("should vote for selected answer and check selected answers",function(){594 student_inclass_page.group_vote()595 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)596 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)597 expect(student_inclass_page.self.isDisplayed()).toEqual(false)598 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)599 expect(student_inclass_page.group.isDisplayed()).toEqual(false)600 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)601 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")602 sleep(2000)603 expect(student_inclass_page.group_self_selected_choices.count()).toEqual(3)604 expect(student_inclass_page.group_self_selected_choice(1).isDisplayed()).toEqual(false)605 expect(student_inclass_page.group_self_selected_choice(2).getText()).toContain("Answer 2")606 expect(student_inclass_page.group_self_selected_choice(3).getText()).toContain("Answer 3")607 expect(student_inclass_page.group_selected_choices.count()).toEqual(3)608 expect(student_inclass_page.group_selected_choice(1).getText()).toContain("Answer 1")609 expect(student_inclass_page.group_selected_choice(2).isDisplayed()).toEqual(false)610 expect(student_inclass_page.group_selected_choice(3).getText()).toContain("Answer 3")611 expect(student_inclass_page.group_retry_btn.isDisplayed()).toEqual(true)612 expect(student_inclass_page.group_next_btn.isDisplayed()).toEqual(true)613 })614 it("should try to go to next stage in student inclass",function(){615 student_inclass_page.group_next()616 expect(student_inclass_page.group_wait_alert.isDisplayed()).toEqual(true)617 expect(student_inclass_page.group_wait_alert.getText()).toContain("Please wait for the teacher to continue")618 })619 it("should retry quiz student inclass",function(){620 student_inclass_page.group_retry()621 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)622 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)623 expect(student_inclass_page.self.isDisplayed()).toEqual(false)624 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)625 expect(student_inclass_page.group.isDisplayed()).toEqual(true)626 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)627 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")628 expect(student_inclass_page.group_choices.count()).toEqual(3)629 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")630 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")631 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")632 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)633 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)634 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")635 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")636 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")637 })638 it("should change selected answer",function(){639 student_inclass_page.group_choice(1).click()640 student_inclass_page.group_choice(2).click()641 expect(student_inclass_page.group_choice(1).getAttribute('class')).not.toContain("selected")642 expect(student_inclass_page.group_choice(2).getAttribute('class')).toContain("selected")643 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")644 })645 it("should vote with new selected answer and check selected answers",function(){646 student_inclass_page.group_vote()647 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)648 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)649 expect(student_inclass_page.self.isDisplayed()).toEqual(false)650 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)651 expect(student_inclass_page.group.isDisplayed()).toEqual(false)652 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)653 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")654 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)655 expect(student_inclass_page.group_self_selected_choices.count()).toEqual(3)656 expect(student_inclass_page.group_self_selected_choice(1).isDisplayed()).toEqual(false)657 expect(student_inclass_page.group_self_selected_choice(2).getText()).toContain("Answer 2")658 expect(student_inclass_page.group_self_selected_choice(3).getText()).toContain("Answer 3")659 expect(student_inclass_page.group_selected_choices.count()).toEqual(3)660 expect(student_inclass_page.group_selected_choice(1).isDisplayed()).toEqual(false)661 expect(student_inclass_page.group_selected_choice(2).getText()).toContain("Answer 2")662 expect(student_inclass_page.group_selected_choice(3).getText()).toContain("Answer 3")663 expect(student_inclass_page.group_retry_btn.isDisplayed()).toEqual(true)664 expect(student_inclass_page.group_next_btn.isDisplayed()).toEqual(true)665 })666 it("should try to go to next stage in student inclass",function(){667 student_inclass_page.group_next()668 expect(student_inclass_page.group_wait_alert.isDisplayed()).toEqual(true)669 expect(student_inclass_page.group_wait_alert.getText()).toContain("Please wait for the teacher to continue")670 })671 })672 describe('Student 2 solve group Qs', function(){673 it("should go to next stage",function(){674 utils.switch_browser(student2_browser)675 student_inclass_page.self_next()676 })677 it("should show the group question choices",function(){678 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)679 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)680 expect(student_inclass_page.self.isDisplayed()).toEqual(false)681 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)682 expect(student_inclass_page.group.isDisplayed()).toEqual(true)683 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")684 expect(student_inclass_page.group_choices.count()).toEqual(3)685 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")686 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")687 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")688 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)689 expect(student_inclass_page.group_note.isDisplayed()).toEqual(true)690 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)691 })692 it("should vote without selecting any choice",function(){693 student_inclass_page.group_vote()694 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)695 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)696 expect(student_inclass_page.self.isDisplayed()).toEqual(false)697 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)698 expect(student_inclass_page.group.isDisplayed()).toEqual(true)699 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")700 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(true)701 expect(student_inclass_page.alert_box.getText()).toContain("Please choose your answer")702 expect(student_inclass_page.group_choices.count()).toEqual(3)703 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")704 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")705 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")706 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)707 expect(student_inclass_page.group_note.isDisplayed()).toEqual(true)708 709 })710 it("should select first and third choice",function(){711 expect(student_inclass_page.group_choice(1).getAttribute('class')).not.toContain("selected")712 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")713 expect(student_inclass_page.group_choice(3).getAttribute('class')).not.toContain("selected")714 student_inclass_page.group_choice(1).click()715 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")716 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")717 student_inclass_page.group_choice(3).click()718 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")719 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")720 })721 it("should check that selected answers remain after browser refresh",function(){722 browser.refresh()723 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)724 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)725 expect(student_inclass_page.self.isDisplayed()).toEqual(false)726 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)727 expect(student_inclass_page.group.isDisplayed()).toEqual(true)728 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")729 expect(student_inclass_page.group_choices.count()).toEqual(3)730 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")731 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")732 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")733 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)734 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")735 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")736 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")737 })738 it("should vote for selected answer and check selected answers",function(){739 student_inclass_page.group_vote()740 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)741 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)742 expect(student_inclass_page.self.isDisplayed()).toEqual(false)743 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)744 expect(student_inclass_page.group.isDisplayed()).toEqual(false)745 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)746 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")747 sleep(2000)748 expect(student_inclass_page.group_self_selected_choices.count()).toEqual(3)749 expect(student_inclass_page.group_self_selected_choice(1).isDisplayed()).toEqual(false)750 expect(student_inclass_page.group_self_selected_choice(2).getText()).toContain("Answer 2")751 expect(student_inclass_page.group_self_selected_choice(3).getText()).toContain("Answer 3")752 expect(student_inclass_page.group_selected_choices.count()).toEqual(3)753 expect(student_inclass_page.group_selected_choice(1).getText()).toContain("Answer 1")754 expect(student_inclass_page.group_selected_choice(2).isDisplayed()).toEqual(false)755 expect(student_inclass_page.group_selected_choice(3).getText()).toContain("Answer 3")756 expect(student_inclass_page.group_retry_btn.isDisplayed()).toEqual(true)757 expect(student_inclass_page.group_next_btn.isDisplayed()).toEqual(true)758 })759 it("should try to go to next stage in student inclass",function(){760 student_inclass_page.group_next()761 expect(student_inclass_page.group_wait_alert.isDisplayed()).toEqual(true)762 expect(student_inclass_page.group_wait_alert.getText()).toContain("Please wait for the teacher to continue")763 })764 it("should retry quiz student inclass",function(){765 student_inclass_page.group_retry()766 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)767 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)768 expect(student_inclass_page.self.isDisplayed()).toEqual(false)769 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)770 expect(student_inclass_page.group.isDisplayed()).toEqual(true)771 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)772 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")773 expect(student_inclass_page.group_choices.count()).toEqual(3)774 expect(student_inclass_page.group_choice(1).getText()).toContain("Answer 1")775 expect(student_inclass_page.group_choice(2).getText()).toContain("Answer 2")776 expect(student_inclass_page.group_choice(3).getText()).toContain("Answer 3")777 expect(student_inclass_page.group_vote_button.isDisplayed()).toEqual(true)778 expect(student_inclass_page.alert_box.isDisplayed()).toEqual(false)779 expect(student_inclass_page.group_choice(1).getAttribute('class')).toContain("selected")780 expect(student_inclass_page.group_choice(2).getAttribute('class')).not.toContain("selected")781 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")782 })783 it("should change selected answer",function(){784 student_inclass_page.group_choice(1).click()785 student_inclass_page.group_choice(2).click()786 expect(student_inclass_page.group_choice(1).getAttribute('class')).not.toContain("selected")787 expect(student_inclass_page.group_choice(2).getAttribute('class')).toContain("selected")788 expect(student_inclass_page.group_choice(3).getAttribute('class')).toContain("selected")789 })790 it("should vote with new selected answer and check selected answers",function(){791 student_inclass_page.group_vote()792 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)793 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)794 expect(student_inclass_page.self.isDisplayed()).toEqual(false)795 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)796 expect(student_inclass_page.group.isDisplayed()).toEqual(false)797 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)798 expect(student_inclass_page.get_block(3).getAttribute('class')).toContain("active")799 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(true)800 expect(student_inclass_page.group_self_selected_choices.count()).toEqual(3)801 expect(student_inclass_page.group_self_selected_choice(1).isDisplayed()).toEqual(false)802 expect(student_inclass_page.group_self_selected_choice(2).getText()).toContain("Answer 2")803 expect(student_inclass_page.group_self_selected_choice(3).getText()).toContain("Answer 3")804 expect(student_inclass_page.group_selected_choices.count()).toEqual(3)805 expect(student_inclass_page.group_selected_choice(1).isDisplayed()).toEqual(false)806 expect(student_inclass_page.group_selected_choice(2).getText()).toContain("Answer 2")807 expect(student_inclass_page.group_selected_choice(3).getText()).toContain("Answer 3")808 expect(student_inclass_page.group_retry_btn.isDisplayed()).toEqual(true)809 expect(student_inclass_page.group_next_btn.isDisplayed()).toEqual(true)810 })811 it("should try to go to next stage in student inclass",function(){812 student_inclass_page.group_next()813 expect(student_inclass_page.group_wait_alert.isDisplayed()).toEqual(true)814 expect(student_inclass_page.group_wait_alert.getText()).toContain("Please wait for the teacher to continue")815 })816 })817 describe('Teacher start Discussion stage', function(){818 it('Should go to the Discussion Stage', function(){819 utils.switch_browser(teacher_browser)820 review_model.next()821 expect(review_model.review_model.isDisplayed()).toEqual(true)822 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")823 expect(review_model.question_block.isDisplayed()).toEqual(true)824 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")825 expect(review_model.get_block(4).getAttribute('class')).toContain("active")826 expect(review_model.get_block_text(1)).toEqual("Intro")827 expect(review_model.get_block_text(2)).toEqual("Self")828 expect(review_model.get_block_text(3)).toEqual("Group")829 expect(review_model.get_block_text(4)).toEqual("Discussion")830 expect(review_model.get_block_text(5)).toEqual("")831 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")832 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 833 expect(review_model.next_button.isDisplayed()).toEqual(true)834 expect(review_model.prev_button.isDisplayed()).toEqual(true)835 expect(review_model.exit_button.isDisplayed()).toEqual(true)836 review_model.next()837 expect(review_model.chart.isDisplayed()).toEqual(true)838 })839 // it('Should check the chart info', function(){840 //841 // })842 })843 describe('Student 1 go to Discussion', function(){844 it("should go to next stage",function(){845 utils.switch_browser(student_browser)846 student_inclass_page.group_next()847 })848 it("should show the discussion stage",function(){849 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)850 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)851 expect(student_inclass_page.self.isDisplayed()).toEqual(false)852 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)853 expect(student_inclass_page.group.isDisplayed()).toEqual(false)854 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)855 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)856 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")857 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)858 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)859 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")860 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")861 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)862 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)863 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")864 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")865 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)866 })867 it("should try to go to next stage",function(){868 student_inclass_page.discussion_continue()869 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)870 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)871 expect(student_inclass_page.self.isDisplayed()).toEqual(false)872 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)873 expect(student_inclass_page.group.isDisplayed()).toEqual(false)874 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)875 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)876 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")877 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)878 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)879 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")880 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")881 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)882 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)883 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")884 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")885 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)886 })887 })888 describe('Student 2 go to Discussion', function(){889 it("should go to next stage",function(){890 utils.switch_browser(student2_browser)891 student_inclass_page.group_next()892 })893 it("should show the discussion stage",function(){894 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)895 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)896 expect(student_inclass_page.self.isDisplayed()).toEqual(false)897 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)898 expect(student_inclass_page.group.isDisplayed()).toEqual(false)899 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)900 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)901 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")902 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)903 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)904 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")905 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")906 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)907 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)908 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")909 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")910 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)911 })912 it("should try to go to next stage",function(){913 student_inclass_page.discussion_continue()914 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)915 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)916 expect(student_inclass_page.self.isDisplayed()).toEqual(false)917 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)918 expect(student_inclass_page.group.isDisplayed()).toEqual(false)919 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)920 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)921 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")922 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)923 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)924 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")925 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")926 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)927 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)928 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")929 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")930 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)931 })932 })933 describe('Teacher Start last Stage', function(){934 it('Should go to the Last Stage', function(){935 utils.switch_browser(teacher_browser)936 expect(review_model.get_block(5).getAttribute('class')).toContain("active")937 review_model.next()938 expect(review_model.review_model.isDisplayed()).toEqual(true)939 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")940 expect(review_model.question_block.isDisplayed()).toEqual(true)941 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")942 expect(review_model.get_block(6).getAttribute('class')).toContain("active")943 944 expect(review_model.get_block_text(1)).toEqual("Intro")945 expect(review_model.get_block_text(2)).toEqual("Self")946 expect(review_model.get_block_text(3)).toEqual("Group")947 expect(review_model.get_block_text(4)).toEqual("Discussion")948 expect(review_model.get_block_text(5)).toEqual("")949 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")950 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 951 expect(review_model.next_button.isDisplayed()).toEqual(true)952 expect(review_model.prev_button.isDisplayed()).toEqual(true)953 expect(review_model.exit_button.isDisplayed()).toEqual(true)954 expect(review_model.chart.isDisplayed()).toEqual(true)955 })956 })957 describe('Student 1 should try to continue', function(){958 it("should try to go to next stage",function(){959 utils.switch_browser(student_browser)960 student_inclass_page.discussion_continue()961 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)962 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)963 expect(student_inclass_page.self.isDisplayed()).toEqual(false)964 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)965 expect(student_inclass_page.group.isDisplayed()).toEqual(false)966 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)967 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)968 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")969 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)970 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)971 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")972 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")973 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)974 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)975 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")976 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")977 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)978 })979 })980 describe('Student 2 should try to continue', function(){981 it("should try to go to next stage",function(){982 utils.switch_browser(student2_browser)983 student_inclass_page.discussion_continue()984 expect(student_inclass_page.noclass.isDisplayed()).toEqual(false)985 expect(student_inclass_page.intro.isDisplayed()).toEqual(false)986 expect(student_inclass_page.self.isDisplayed()).toEqual(false)987 expect(student_inclass_page.self_answered.isDisplayed()).toEqual(false)988 expect(student_inclass_page.group.isDisplayed()).toEqual(false)989 expect(student_inclass_page.group_answered.isDisplayed()).toEqual(false)990 expect(student_inclass_page.discussion.isDisplayed()).toEqual(true)991 expect(student_inclass_page.get_block(4).getAttribute('class')).toContain("active")992 expect(student_inclass_page.discussion_self_selected_choices.count()).toEqual(3)993 expect(student_inclass_page.discussion_self_selected_choice(1).isDisplayed()).toEqual(false)994 expect(student_inclass_page.discussion_self_selected_choice(2).getText()).toContain("Answer 2")995 expect(student_inclass_page.discussion_self_selected_choice(3).getText()).toContain("Answer 3")996 expect(student_inclass_page.discussion_group_selected_choices.count()).toEqual(3)997 expect(student_inclass_page.discussion_group_selected_choice(1).isDisplayed()).toEqual(false)998 expect(student_inclass_page.discussion_group_selected_choice(2).getText()).toContain("Answer 2")999 expect(student_inclass_page.discussion_group_selected_choice(3).getText()).toContain("Answer 3")1000 expect(student_inclass_page.discussion_continue_button.isDisplayed()).toEqual(true)1001 })1002 })1003 describe('Teacher should go back', function(){1004 it('Should be back to discussions', function(){1005 utils.switch_browser(teacher_browser)1006 review_model.previous()1007 expect(review_model.chart.isDisplayed()).toEqual(true)1008 review_model.previous()1009 expect(review_model.review_model.isDisplayed()).toEqual(true)1010 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")1011 expect(review_model.question_block.isDisplayed()).toEqual(true)1012 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")1013 expect(review_model.get_block(4).getAttribute('class')).toContain("active")1014 expect(review_model.get_block_text(1)).toEqual("Intro")1015 expect(review_model.get_block_text(2)).toEqual("Self")1016 expect(review_model.get_block_text(3)).toEqual("Group")1017 expect(review_model.get_block_text(4)).toEqual("Discussion")1018 expect(review_model.get_block_text(5)).toEqual("")1019 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")1020 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 1021 expect(review_model.next_button.isDisplayed()).toEqual(true)1022 expect(review_model.prev_button.isDisplayed()).toEqual(true)1023 expect(review_model.exit_button.isDisplayed()).toEqual(true)1024 expect(review_model.chart.isDisplayed()).toEqual(false)1025 })1026 it('Should be back to Group', function(){1027 review_model.previous()1028 expect(review_model.review_model.isDisplayed()).toEqual(true)1029 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")1030 expect(review_model.question_block.isDisplayed()).toEqual(true)1031 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")1032 expect(review_model.get_block(3).getAttribute('class')).toContain("active")1033 // expect(element(by.className('active')).getText()).toContain('Group')1034 expect(review_model.get_block_text(1)).toEqual("Intro")1035 expect(review_model.get_block_text(2)).toEqual("Self")1036 expect(review_model.get_block_text(3)).toEqual("Group")1037 expect(review_model.get_block_text(4)).toEqual("Discussion")1038 expect(review_model.get_block_text(5)).toEqual("")1039 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")1040 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 1041 expect(review_model.chart.isDisplayed()).toEqual(false)1042 expect(review_model.next_button.isDisplayed()).toEqual(true)1043 expect(review_model.prev_button.isDisplayed()).toEqual(true)1044 expect(review_model.exit_button.isDisplayed()).toEqual(true)1045 })1046 it('Should be back to Self', function(){1047 review_model.previous()1048 expect(review_model.review_model.isDisplayed()).toEqual(true)1049 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")1050 expect(review_model.question_block.isDisplayed()).toEqual(true)1051 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")1052 expect(review_model.get_block(2).getAttribute('class')).toContain("active")1053 // expect(element(by.className('active')).getText()).toContain('Self')1054 expect(review_model.get_block_text(1)).toEqual("Intro")1055 expect(review_model.get_block_text(2)).toEqual("Self")1056 expect(review_model.get_block_text(3)).toEqual("Group")1057 expect(review_model.get_block_text(4)).toEqual("Discussion")1058 expect(review_model.get_block_text(5)).toEqual("")1059 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")1060 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 1061 expect(review_model.chart.isDisplayed()).toEqual(false)1062 expect(review_model.next_button.isDisplayed()).toEqual(true)1063 expect(review_model.prev_button.isDisplayed()).toEqual(true)1064 expect(review_model.exit_button.isDisplayed()).toEqual(true)1065 })1066 it('Should be back to Intro', function(){1067 review_model.previous()1068 expect(review_model.review_model.isDisplayed()).toEqual(true)1069 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")1070 expect(review_model.question_block.isDisplayed()).toEqual(true)1071 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")1072 expect(review_model.get_block(1).getAttribute('class')).toContain("active")1073 expect(review_model.get_block_text(1)).toEqual("Intro")1074 expect(review_model.get_block_text(2)).toEqual("Self")1075 expect(review_model.get_block_text(3)).toEqual("Group")1076 expect(review_model.get_block_text(4)).toEqual("Discussion")1077 expect(review_model.get_block_text(5)).toEqual("")1078 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")1079 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 1080 expect(review_model.chart.isDisplayed()).toEqual(false)1081 expect(review_model.next_button.isDisplayed()).toEqual(true)1082 expect(review_model.prev_button.isDisplayed()).toEqual(true)1083 expect(review_model.exit_button.isDisplayed()).toEqual(true)1084 })1085 it('Should try to get before Intro', function(){1086 review_model.previous()1087 expect(review_model.review_model.isDisplayed()).toEqual(true)1088 expect(review_model.lecture_title.getText()).toEqual("PI lecture1 video quizzes")1089 expect(review_model.question_block.isDisplayed()).toEqual(true)1090 expect(review_model.quiz_title.getText()).toBe("PI MCQ QUIZ ( multiple choice )")1091 expect(review_model.get_block(1).getAttribute('class')).toContain("active")1092 expect(review_model.get_block_text(1)).toEqual("Intro")1093 expect(review_model.get_block_text(2)).toEqual("Self")1094 expect(review_model.get_block_text(3)).toEqual("Group")1095 expect(review_model.get_block_text(4)).toEqual("Discussion")1096 expect(review_model.get_block_text(5)).toEqual("")1097 expect(review_model.get_block(5).getAttribute('class')).toContain("small_circles")1098 expect(review_model.connected_blocks.count()).toEqual(6) // it was 5 and we added 1 block for showing the result 1099 expect(review_model.chart.isDisplayed()).toEqual(false)1100 expect(review_model.next_button.isDisplayed()).toEqual(true)1101 expect(review_model.prev_button.isDisplayed()).toEqual(true)1102 expect(review_model.exit_button.isDisplayed()).toEqual(true)1103 })1104 })1105 describe('Teacher end it', function(){1106 it('Should go to the blackscreen', function(){1107 utils.switch_browser(teacher_browser)1108 review_model.next()1109 review_model.next()1110 review_model.next()1111 review_model.next()1112 review_model.next()1113 review_model.next() 1114 expect(element(by.className('blackscreen')).getText()).toEqual('Review finished. Press ESC to end')1115 })1116 it('Should be back to inClass Review', function(){1117 browser.actions().sendKeys(protractor.Key.ESCAPE).perform();1118 expect(inclass_page.title).toEqual("In-class Review: PI module 1")1119 expect(inclass_page.display_button.isDisplayed()).toEqual(true);1120 expect(inclass_page.display_button.isEnabled()).toEqual(true);1121 var module = inclass_page.module_item(1)1122 expect(module.title).toEqual("PI lecture1 video quizzes")1123 expect(module.inclass_quizzes.count()).toEqual(1)1124 var inclass_quiz = module.inclass_quiz(1)1125 expect(inclass_quiz.title).toEqual("Quiz: PI MCQ QUIZ")1126 expect(inclass_quiz.visibility_box.isSelected()).toEqual(true)1127 expect(inclass_page.total_inclass_time).toEqual("8");1128 expect(inclass_page.total_pi_time).toEqual("8")1129 expect(inclass_page.total_pi_quizzes).toEqual("1")1130 expect(inclass_page.total_review_time).toEqual("0")1131 expect(inclass_page.total_review_quizzes).toEqual("0")1132 expect(inclass_page.total_review_discussions).toEqual("0")1133 expect(inclass_page.total_review_surveys).toEqual("0")...

Full Screen

Full Screen

header-spec-definition.js

Source:header-spec-definition.js Github

copy

Full Screen

...18 expect(frontPage.accountDropdown().isPresent()).to.eventually.eql(false);19 expect(frontPage.accountDropdownButton().isPresent()).to.eventually.eql(false);20 });21 it('shows the engine selection', function () {22 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(true);23 expect(frontPage.engineSelectDropdownButton().isDisplayed()).to.eventually.eql(true);24 });25 it('shows the app switch', function () {26 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(true);27 expect(frontPage.appSwitchDropdownButton().isDisplayed()).to.eventually.eql(true);28 });29 it('does not show a hamburger button', function () {30 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(false);31 });32 });33 describe('for authenticated user', function () {34 before(function () {35 frontPage.authentication.userLogin('admin', 'admin');36 });37 after(function () {38 frontPage.logout();39 });40 it('shows the account', function () {41 expect(frontPage.accountDropdown().isDisplayed()).to.eventually.eql(true);42 expect(frontPage.accountDropdownButton().isDisplayed()).to.eventually.eql(true);43 });44 it('shows the full name of the logged in user', function () {45 expect(frontPage.accountDropdownButton().getText()).to.eventually.eql('Steve Hentschi');46 });47 it('shows the engine selection', function () {48 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(true);49 expect(frontPage.engineSelectDropdownButton().isDisplayed()).to.eventually.eql(true);50 });51 it('shows the app switch', function () {52 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(true);53 expect(frontPage.appSwitchDropdownButton().isDisplayed()).to.eventually.eql(true);54 });55 it('does not show a hamburger button', function () {56 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(false);57 });58 });59 });60 describe('on small screens', function () {61 var originalSize;62 before(function () {63 browser.manage().window().getSize().then(function (size) {64 originalSize = size;65 browser.manage().window().setSize(760, 560);66 browser.sleep(500);67 });68 });69 after(function () {70 browser.manage().window().setSize(originalSize.width, originalSize.height);71 });72 describe('for anonymous user', function () {73 it('does not show the account', function () {74 expect(frontPage.accountDropdown().isPresent()).to.eventually.eql(false);75 });76 it('does not show the engine selection', function () {77 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(false);78 });79 it('does not show the app switch', function () {80 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(false);81 });82 it('shows a hamburger button', function () {83 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);84 });85 describe('after beeing expanded', function () {86 before(function () {87 frontPage.hamburgerButton().click();88 });89 it('shows the engine selection', function () {90 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(true);91 expect(frontPage.engineSelectDropdownButton().isDisplayed()).to.eventually.eql(true);92 });93 it('shows the app switch', function () {94 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(true);95 expect(frontPage.appSwitchDropdownButton().isDisplayed()).to.eventually.eql(true);96 });97 it('shows a hamburger button', function () {98 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);99 });100 describe('after beeing collapsed again', function () {101 before(function () {102 frontPage.hamburgerButton().click();103 });104 it('does not show the engine selection', function () {105 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(false);106 });107 it('does not show the app switch', function () {108 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(false);109 });110 it('shows a hamburger button', function () {111 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);112 });113 });114 });115 });116 describe('for authenticated user', function () {117 before(function () {118 frontPage.authentication.userLogin('admin', 'admin');119 });120 after(function () {121 frontPage.accountDropdown().isDisplayed().then(function (displayed) {122 if (!displayed) {123 return frontPage.hamburgerButton().click().then(function () {124 frontPage.logout();125 });126 }127 frontPage.logout();128 });129 });130 it('does not show the engine selection', function () {131 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(false);132 });133 it('does not show the app switch', function () {134 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(false);135 });136 it('shows a hamburger button', function () {137 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);138 });139 describe('after beeing expanded', function () {140 before(function () {141 frontPage.hamburgerButton().click();142 });143 it('shows the account', function () {144 expect(frontPage.accountDropdown().isDisplayed()).to.eventually.eql(true);145 expect(frontPage.accountDropdownButton().isDisplayed()).to.eventually.eql(true);146 });147 it('shows the engine selection', function () {148 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(true);149 expect(frontPage.engineSelectDropdownButton().isDisplayed()).to.eventually.eql(true);150 });151 it('shows the app switch', function () {152 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(true);153 expect(frontPage.appSwitchDropdownButton().isDisplayed()).to.eventually.eql(true);154 });155 it('shows a hamburger button', function () {156 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);157 });158 describe('after beeing collapsed again', function () {159 before(function () {160 frontPage.hamburgerButton().click();161 });162 it('does not show the engine selection', function () {163 expect(frontPage.engineSelectDropdown().isDisplayed()).to.eventually.eql(false);164 });165 it('does not show the app switch', function () {166 expect(frontPage.appSwitchDropdown().isDisplayed()).to.eventually.eql(false);167 });168 it('shows a hamburger button', function () {169 expect(frontPage.hamburgerButton().isDisplayed()).to.eventually.eql(true);170 });171 });172 });173 });174 });175 };...

Full Screen

Full Screen

sidebar.page.js

Source:sidebar.page.js Github

copy

Full Screen

...27 it('should contain the correct number of links', function () {28 expect(self.links.count()).toBe(13);29 });30 it('should contain the expected links', function () {31 expect(self.latestPostsLink.isDisplayed()).toBe(true);32 expect(self.subscriptionsLink.isDisplayed()).toBe(true);33 expect(self.newPostLink.isDisplayed()).toBe(true);34 expect(self.livePostsLink.isDisplayed()).toBe(true);35 expect(self.scheduledPostsLink.isDisplayed()).toBe(true);36 expect(self.viewProfileLink.isDisplayed()).toBe(true);37 expect(self.editProfileLink.isDisplayed()).toBe(true);38 expect(self.subscribersLink.isDisplayed()).toBe(true);39 expect(self.guestListLink.isDisplayed()).toBe(true);40 expect(self.accountLink.isDisplayed()).toBe(true);41 expect(self.signOutLink.isDisplayed()).toBe(true);42 expect(self.sendFeedbackLink.isDisplayed()).toBe(true);43 expect(self.helpLink.isDisplayed()).toBe(true);44 });45 if(highlightedLink){46 it('should highlight the current area', function () {47 expect(highlightedLink.getAttribute('class')).toContain('active');48 });49 }50 });51 }},52 includeNewCreatorTests: { value: function(highlightedLink) {53 var self = this;54 describe('new creator sidebar', function() {55 it('should contain the correct number of links', function () {56 expect(self.links.count()).toBe(7);57 });58 it('should contain the expected links', function () {59 expect(self.latestPostsLink.isDisplayed()).toBe(true);60 expect(self.subscriptionsLink.isDisplayed()).toBe(true);61 expect(self.createChannelLink.isDisplayed()).toBe(true);62 expect(self.accountLink.isDisplayed()).toBe(true);63 expect(self.signOutLink.isDisplayed()).toBe(true);64 expect(self.sendFeedbackLink.isDisplayed()).toBe(true);65 expect(self.helpLink.isDisplayed()).toBe(true);66 });67 if(highlightedLink){68 it('should highlight the current area', function () {69 expect(highlightedLink.getAttribute('class')).toContain('active');70 });71 }72 });73 }},74 includeConsumerTests: { value: function(highlightedLink) {75 var self = this;76 describe('consumer sidebar', function() {77 it('should contain the correct number of links', function () {78 expect(self.links.count()).toBe(7);79 });80 it('should contain the expected links', function () {81 expect(self.latestPostsLink.isDisplayed()).toBe(true);82 expect(self.subscriptionsLink.isDisplayed()).toBe(true);83 expect(self.publishLink.isDisplayed()).toBe(true);84 expect(self.accountLink.isDisplayed()).toBe(true);85 expect(self.signOutLink.isDisplayed()).toBe(true);86 expect(self.sendFeedbackLink.isDisplayed()).toBe(true);87 expect(self.helpLink.isDisplayed()).toBe(true);88 });89 if(highlightedLink){90 it('should highlight the current area', function () {91 expect(highlightedLink.getAttribute('class')).toContain('active');92 });93 }94 });95 }},96 includeSignedOutTests: { value: function(highlightedLink) {97 var self = this;98 describe('consumer sidebar', function() {99 it('should contain the correct number of links', function () {100 expect(self.links.count()).toBe(3);101 });102 it('should contain the expected links', function () {103 expect(self.signInLink.isDisplayed()).toBe(true);104 expect(self.registerLink.isDisplayed()).toBe(true);105 expect(self.helpLink.isDisplayed()).toBe(true);106 });107 if(highlightedLink){108 it('should highlight the current area', function () {109 expect(highlightedLink.getAttribute('class')).toContain('active');110 });111 }112 });113 }}114});...

Full Screen

Full Screen

Main.js

Source:Main.js Github

copy

Full Screen

1import React, { useState } from "react";2import PersonalBlock from "./PersonalBlock";3import EducationBlock from "./EducationBlock";4import WorkBlock from "./WorkBlock";5import DisplayPersonal from "./DisplayPersonal";6import DisplayEducation from "./DisplayEducation";7import DisplayWork from "./DisplayWork";8import uniqid from "uniqid";9import styles from "../styles/StyleMain.module.css"10function Main() {11 const [personalData, setPersonalData] = useState({12 name: "",13 email: "",14 phone: "",15 city: ""16 })17 const [educationData, setEducationData] = useState({18 schoolName: "",19 degreeName: "",20 startYear: "",21 endYear: ""22 })23 const initWorkState = {24 companyName: "",25 position: "",26 jobDuties: "",27 employStart: "",28 employEnd: "",29 id: uniqid()30 }31 const [jobs, setJobs] = useState([])32 const [workData, setWorkData] = useState(initWorkState)33 const [isDisplayed, setIsDisplayed] = useState({34 personal: false,35 educational: false,36 educationalBtn: true,37 showEduFields: false,38 work: false,39 workBtn: true,40 showWorkFields: false41 })42 const showBtnEdu = (btnState) => {43 if (btnState) {44 return (45 <button className={styles.addSection}46 onClick={() => {47 setIsDisplayed({...isDisplayed,48 educationalBtn: false,49 showEduFields: true50 })51 }}52 > Add Education Information </button>53 )54 }55 }56 const showBtnWork = (btnState) => {57 if (btnState) {58 return (59 <button className={styles.addSection}60 onClick={() => {61 setIsDisplayed({...isDisplayed,62 workBtn: false,63 showWorkFields: true64 })65 }}66 > Add Work Experience </button>67 )68 }69 }70 const togglePersonal = () => {71 setIsDisplayed({ ...isDisplayed, personal: !isDisplayed.personal})72 }73 const toggleEducational = () => {74 setIsDisplayed({ ...isDisplayed,75 educational: !isDisplayed.educational,76 showEduFields: !isDisplayed.showEduFields77 })78 }79 const toggleWork = () => {80 setIsDisplayed({ ...isDisplayed,81 work: !isDisplayed.work,82 showWorkFields: !isDisplayed.showWorkFields,83 workBtn: !isDisplayed.workBtn84 })85 }86 const handleSubmitPersonal = (e, obj) => {87 e.preventDefault()88 togglePersonal()89 setPersonalData({...obj})90 }91 const handleSubmitEducation = (e, obj) => {92 e.preventDefault()93 toggleEducational()94 setEducationData({...obj})95 }96 const handleSubmitWork = (e, obj) => {97 e.preventDefault()98 setJobs([...jobs, obj])99 setWorkData(initWorkState)100 setIsDisplayed({ ...isDisplayed,101 work: true,102 showWorkFields: !isDisplayed.showWorkFields,103 workBtn: !isDisplayed.workBtn104 })105 }106 const editWork = (id) => {107 let target = jobs.find(o => o.id === id)108 let curr = jobs109 let index = curr.indexOf(target)110 let [edit] = curr.splice(index, 1)111 setWorkData(edit)112 toggleWork()113 }114 return (115 <div className={styles.resumeMain}>116 <div className={styles.addDataHalf}>117 {/* Personal Info */}118 { !isDisplayed.personal &&119 <PersonalBlock data={personalData}120 updateParent={handleSubmitPersonal}121 /> }122 {/* Educational Info */}123 { showBtnEdu(isDisplayed.educationalBtn) }124 { isDisplayed.showEduFields && <EducationBlock data={educationData}125 updateParent={handleSubmitEducation}126 />}127 {/* Practical Info */}128 { showBtnWork(isDisplayed.workBtn) }129 { isDisplayed.showWorkFields && <WorkBlock data={workData}130 updateParent={handleSubmitWork}131 />}132 </div>133 {/* Render Data onto 'CV' */}134 <div className={styles.resumeHalf}>135 { isDisplayed.personal && <DisplayPersonal dataObj={personalData}136 btnRef={togglePersonal}137 />}138 { isDisplayed.educational && <DisplayEducation dataObj={educationData}139 btnRef={toggleEducational}140 /> }141 { isDisplayed.work && <DisplayWork dataArray={jobs}142 btnRef={editWork}143 />}144 </div>145 </div>146 )147}...

Full Screen

Full Screen

findFirstAllowedEndpoint.test.js

Source:findFirstAllowedEndpoint.test.js Github

copy

Full Screen

1import findFirstAllowedEndpoint, { generateArrayOfLinks } from '../findFirstAllowedEndpoint';2describe('ADMIN | SettingsPage | utils', () => {3 describe('findFirstAllowedEndpoint', () => {4 it('should return null if there is no sections', () => {5 expect(findFirstAllowedEndpoint([])).toBeNull();6 });7 it('should return null if all links are hidden', () => {8 const data = [9 {10 id: 'global',11 links: [12 {13 to: 'global.test',14 isDisplayed: false,15 },16 {17 to: 'global.test2',18 isDisplayed: false,19 },20 ],21 },22 {23 id: 'test',24 links: [25 {26 to: 'test.test',27 isDisplayed: false,28 },29 {30 to: 'test.test2',31 isDisplayed: false,32 },33 ],34 },35 ];36 expect(findFirstAllowedEndpoint(data)).toBeNull();37 });38 it('should return the destination of the first displayed link', () => {39 const data = [40 {41 id: 'global',42 links: [43 {44 to: 'global.test',45 isDisplayed: false,46 },47 {48 to: 'global.test2',49 isDisplayed: false,50 },51 ],52 },53 {54 id: 'test',55 links: [56 {57 to: 'test.test',58 isDisplayed: false,59 },60 {61 to: 'test.test2',62 isDisplayed: true,63 },64 {65 to: 'test.test3',66 isDisplayed: true,67 },68 ],69 },70 {71 id: 'test1',72 links: [73 {74 to: 'test1.test',75 isDisplayed: true,76 },77 {78 to: 'test1.test2',79 isDisplayed: true,80 },81 {82 to: 'test1.test3',83 isDisplayed: true,84 },85 ],86 },87 ];88 expect(findFirstAllowedEndpoint(data)).toEqual('test.test2');89 });90 });91 describe('generateArrayOfLinks', () => {92 it('should return an empty array', () => {93 expect(generateArrayOfLinks([])).toEqual([]);94 });95 it('should return an array containing all the links', () => {96 const data = [97 {98 id: 'global',99 links: [100 {101 to: 'global.test',102 isDisplayed: false,103 },104 {105 to: 'global.test2',106 isDisplayed: false,107 },108 ],109 },110 {111 id: 'test',112 links: [113 {114 to: 'test.test',115 isDisplayed: false,116 },117 {118 to: 'test.test2',119 isDisplayed: true,120 },121 {122 to: 'test.test3',123 isDisplayed: true,124 },125 ],126 },127 {128 id: 'test1',129 links: [130 {131 to: 'test1.test',132 isDisplayed: true,133 },134 {135 to: 'test1.test2',136 isDisplayed: true,137 },138 {139 to: 'test1.test3',140 isDisplayed: true,141 },142 ],143 },144 ];145 const expected = [146 {147 to: 'global.test',148 isDisplayed: false,149 },150 {151 to: 'global.test2',152 isDisplayed: false,153 },154 {155 to: 'test.test',156 isDisplayed: false,157 },158 {159 to: 'test.test2',160 isDisplayed: true,161 },162 {163 to: 'test.test3',164 isDisplayed: true,165 },166 {167 to: 'test1.test',168 isDisplayed: true,169 },170 {171 to: 'test1.test2',172 isDisplayed: true,173 },174 {175 to: 'test1.test3',176 isDisplayed: true,177 },178 ];179 expect(generateArrayOfLinks(data)).toEqual(expected);180 });181 });...

Full Screen

Full Screen

elementsExist.js

Source:elementsExist.js Github

copy

Full Screen

...12 });13 });14 describe('Elements exist', function () {15 it('TC-002 Header is present ', function () {16 let header = $(sel.header).isDisplayed();17 expect(header).toEqual(true);18 });19 it('TC-003 Instruction is present ', function () {20 let instruction = $(sel.instruction).isDisplayed();21 expect(instruction).toEqual(true);22 });23 it('TC-004 Name field label is present ', function () {24 let label = $$(sel.requiredLabel)[0].isDisplayed();25 expect(label).toEqual(true);26 });27 it('TC-005 Name field is present', function () {28 let name = $(sel.name).isDisplayed();29 expect(name).toEqual(true);30 });31 it('TC-006 Gender radio buttons label is present', function () {32 let label = $$(sel.requiredLabel)[1].isDisplayed();33 expect(label).toEqual(true);34 });35 it('TC-007.a Gender radio buttons is present', function () {36 let button = $$(sel.radioButtons)[0].isDisplayed();37 expect(button).toEqual(true);38 });39 it('TC-007.b Gender radio buttons is present', function () {40 let button = $$(sel.radioButtons)[1].isDisplayed();41 expect(button).toEqual(true);42 });43 it('TC-007.c Gender radio buttons is present', function () {44 let button = $$(sel.radioButtons)[2].isDisplayed();45 expect(button).toEqual(true);46 });47 it('TC-008 Age field label is present', function () {48 let label = $$(sel.requiredLabel)[2].isDisplayed();49 expect(label).toEqual(true);50 });51 it('TC-009 Age field is present', function () {52 let age = $(sel.age).isDisplayed();53 expect(age).toEqual(true);54 });55 it('TC-010 Story Type dropdown label is present', function () {56 let label = $$(sel.requiredLabel)[3].isDisplayed();57 expect(label).toEqual(true);58 });59 it('TC-011 Story Type dropdown is present', function () {60 let dropdown = $(sel.storyType).isDisplayed();61 expect(dropdown).toEqual(true);62 });63 it('TC-012 Image field label is present', function () {64 let label = $$(sel.imageLabel)[4].isDisplayed();65 expect(label).toEqual(true);66 });67 it('TC-013 Image field is present', function () {68 let image = $(sel.image).isDisplayed();69 expect(image).toEqual(true);70 });71 it('TC-014 Submit button is present', function () {72 let button = $(sel.submit).isDisplayed();73 expect(button).toEqual(true);74 });75 });...

Full Screen

Full Screen

todo_page.js

Source:todo_page.js Github

copy

Full Screen

...45 this.save = function() {46 this.saveButton.click();47 };48 this.isInDisplayMode = function() {49 expect(this.title.isDisplayed()).toEqual(true);50 expect(this.titleInput.isDisplayed()).toEqual(false);51 expect(this.text.isDisplayed()).toEqual(true);52 expect(this.textInput.isDisplayed()).toEqual(false);53 expect(this.editButton.isDisplayed()).toEqual(true);54 expect(this.newButton.isDisplayed()).toEqual(true);55 expect(this.deleteButton.isDisplayed()).toEqual(true);56 expect(this.cancelButton.isDisplayed()).toEqual(false);57 expect(this.saveButton.isDisplayed()).toEqual(false);58 };59 this.isInEditMode = function() {60 expect(this.title.isDisplayed()).toEqual(false);61 expect(this.titleInput.isDisplayed()).toEqual(true);62 expect(this.text.isDisplayed()).toEqual(false);63 expect(this.textInput.isDisplayed()).toEqual(true);64 expect(this.editButton.isDisplayed()).toEqual(false);65 expect(this.newButton.isDisplayed()).toEqual(false);66 expect(this.deleteButton.isDisplayed()).toEqual(false);67 expect(this.cancelButton.isDisplayed()).toEqual(true);68 expect(this.saveButton.isDisplayed()).toEqual(true);69 };70 this.containsText = function(text) {71 checkText(text, function(result) {72 expect(result).toBe(true);73 });74 };75 this.doesNotContainText = function(text) {76 checkText(text, function(result) {77 expect(result).toBe(false);78 });79 };80 function checkText(text, fn) {81 driver82 .isElementPresent({...

Full Screen

Full Screen

browser_markup_node_not_displayed_01.js

Source:browser_markup_node_not_displayed_01.js Github

copy

Full Screen

1/* Any copyright is dedicated to the Public Domain.2 http://creativecommons.org/publicdomain/zero/1.0/ */3"use strict";4// Tests that nodes that are not displayed appear differently in the markup-view5// when these nodes are imported in the view.6// Note that nodes inside a display:none parent are obviously not displayed too7// but the markup-view uses css inheritance to mark those as hidden instead of8// having to visit each and every child of a hidden node. So there's no sense9// testing children nodes.10const TEST_URL = URL_ROOT + "doc_markup_not_displayed.html";11const TEST_DATA = [12 { selector: "#normal-div", isDisplayed: true },13 { selector: "head", isDisplayed: false },14 { selector: "#display-none", isDisplayed: false },15 { selector: "#hidden-true", isDisplayed: false },16 { selector: "#visibility-hidden", isDisplayed: true },17 { selector: "#hidden-via-hide-shortcut", isDisplayed: false },18];19add_task(async function() {20 const { inspector } = await openInspectorForURL(TEST_URL);21 for (const { selector, isDisplayed } of TEST_DATA) {22 info("Getting node " + selector);23 const nodeFront = await getNodeFront(selector, inspector);24 const container = getContainerForNodeFront(nodeFront, inspector);25 is(26 !container.elt.classList.contains("not-displayed"),27 isDisplayed,28 `The container for ${selector} is marked as displayed ${isDisplayed}`29 );30 }...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')5 console.log('Title is: ' + title)6 })7 it('should have the right title', () => {8 const title = browser.getTitle()9 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')10 console.log('Title is: ' + title)11 })12 it('should have the right title', () => {13 const title = browser.getTitle()14 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')15 console.log('Title is: ' + title)16 })17 it('should have the right title', () => {18 const title = browser.getTitle()19 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')20 console.log('Title is: ' + title)21 })22 it('should have the right title', () => {23 const title = browser.getTitle()24 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')25 console.log('Title is: ' + title)26 })27})28describe('webdriver.io page', () => {29 it('should have the right title', () => {30 const title = browser.getTitle()31 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')32 console.log('Title is: ' + title)33 })34 it('should have the right title', () => {35 const title = browser.getTitle()36 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')37 console.log('Title is: ' + title)38 })39 it('should have the right title', () => {

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle();4 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');5 console.log(browser.getTitle());6 console.log(browser.getUrl());7 console.log(browser.isDisplayed('css selector','a[href="/docs/gettingstarted.html"]'));8 });9});10public void test() {11 System.out.println(driver.getTitle());12 System.out.println(driver.getCurrentUrl());13 System.out.println(driver.findElement(By.cssSelector("a[href=\"/docs/gettingstarted.html\"]")).isDisplayed());14}155. isEnabled() – To check whether the element is enabled or not16describe('webdriver.io page', () => {17 it('should have the right title', () => {18 const title = browser.getTitle();19 expect(title).toEqual('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');20 console.log(browser.getTitle());21 console.log(browser.getUrl());22 console.log(browser.isEnabled('css selector','a[href="/docs/gettingstarted.html"]'));23 });24});25public void test() {26 System.out.println(driver.getTitle());27 System.out.println(driver.getCurrentUrl());28 System.out.println(driver.findElement(By.cssSelector("a[href=\"/docs/gettingstarted.html\"]")).isEnabled());29}306. isSelected() – To check whether the element is selected or not31describe('webdriver.io page', () => {32 it('should have the right

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')5 })6})7describe('webdriver.io page', () => {8 it('should have the right title', () => {9 const title = browser.getTitle()10 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')11 })12})13describe('webdriver.io page', () => {14 it('should have the right title', () => {15 const title = browser.getTitle()16 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')17 })18})19describe('webdriver.io page', () => {20 it('should have the right title', () => {21 const title = browser.getTitle()22 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')23 })24})25describe('webdriver.io page', () => {26 it('should have the right title', () => {27 const title = browser.getTitle()28 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')29 })30})31describe('webdriver.io page', () => {32 it('should have the right title', () => {33 const title = browser.getTitle()34 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')35 })36})37describe('webdriver.io page', () => {38 it('should have the right title', () => {39 const title = browser.getTitle()40 expect(title).to.equal('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')

Full Screen

Using AI Code Generation

copy

Full Screen

1var webdriverio = require('webdriverio');2var options = { desiredCapabilities: { browserName: 'chrome' } };3var client = webdriverio.remote(options);4 .init()5 .isVisible('#lst-ib').then(function(isVisible) {6 })7 .end();

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', function() {2 it('should have the right title - the fancy generator way', function () {3 var title = browser.getTitle();4 expect(title).to.be.equal('WebdriverIO - Selenium 2.0 javascript bindings for nodejs');5 var isDisplayed = browser.isVisible('.header-logo');6 });7});8describe('webdriver.io page', function() {9 it('should have the right title - the fancy generator way', function () {10 browser.waitForVisible('.header-logo', 5000);11 var isDisplayed = browser.isVisible('.header-logo');12 });13});14describe('webdriver.io page', function() {15 it('should have the right title - the fancy generator way', function () {16 browser.waitForExist('.header-logo', 5000);17 var isDisplayed = browser.isVisible('.header-logo');18 });19});20describe('webdriver.io page', function() {21 it('should have the right title - the fancy generator way', function () {22 browser.waitForText('.header-logo',

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')5 })6 it('should have the right title', () => {7 const title = browser.getTitle()8 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')9 })10 it('should have the right title', () => {11 const title = browser.getTitle()12 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')13 })14 it('should have the right title', () => {15 const title = browser.getTitle()16 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')17 })18 it('should have the right title', () => {19 const title = browser.getTitle()20 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')21 })22 it('should have the right title', () => {23 const title = browser.getTitle()24 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')25 })26 it('should have the right title', () => {27 const title = browser.getTitle()28 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')29 })30 it('should have the right title', () => {31 const title = browser.getTitle()32 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')33 })34 it('should have the right title', () => {35 const title = browser.getTitle()36 expect(title).to.equal('WebdriverIO - WebDriver bindings for Node.js')37 })38})

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('My Login application', () => {2 it('should login with valid credentials', () => {3 const username = $('#username')4 const password = $('#password')5 const loginButton = $('button[type="submit"]')6 username.setValue('tomsmith')7 password.setValue('SuperSecretPassword!')8 loginButton.click()9 browser.pause(3000)10 const flash = $('#flash')11 console.log(flash.isDisplayed())12 browser.pause(3000)13 })14})

Full Screen

Using AI Code Generation

copy

Full Screen

1describe('webdriver.io page', () => {2 it('should have the right title', () => {3 const title = browser.getTitle()4 console.log("Title is: "+title)5 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')6 })7 it('should have the right title', () => {8 const title = browser.getTitle()9 console.log("Title is: "+title)10 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')11 })12 it('should have the right title', () => {13 const title = browser.getTitle()14 console.log("Title is: "+title)15 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')16 })17 it('should have the right title', () => {18 const title = browser.getTitle()19 console.log("Title is: "+title)20 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')21 })22 it('should have the right title', () => {23 const title = browser.getTitle()24 console.log("Title is: "+title)25 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')26 })27 it('should have the right title', () => {28 const title = browser.getTitle()29 console.log("Title is: "+title)30 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')31 })32 it('should have the right title', () => {33 const title = browser.getTitle()34 console.log("Title is: "+title)35 expect(title).toBe('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js')36 })37 it('should have the right title', () => {38 const title = browser.getTitle()39 console.log("Title is: "+title)40 expect(title).toBe

Full Screen

Using AI Code Generation

copy

Full Screen

1const assert = require('assert');2const webdriverio = require('webdriverio');3describe('webdriver.io page', () => {4 it('should have the right title', () => {5 const title = browser.getTitle();6 assert.strictEqual(title, 'WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');7 browser.pause(3000);8 });9 it('should display the search bar', () => {10 const searchBar = browser.$('#search_input_react');11 const isDisplayed = searchBar.isDisplayed();12 assert.strictEqual(isDisplayed, true);13 browser.pause(3000);14 });15 it('should display the search bar after waiting for it to be displayed', () => {16 const searchBar = browser.$('#search_input_react');17 const isDisplayed = searchBar.waitForDisplayed({ timeout: 5000 });18 assert.strictEqual(isDisplayed, true);19 browser.pause(3000);20 });21});

Full Screen

WebdriverIO Tutorial

Wondering what could be a next-gen browser and mobile test automation framework that is also simple and concise? Yes, that’s right, it's WebdriverIO. Since the setup is very easy to follow compared to Selenium testing configuration, you can configure the features manually thereby being the center of attraction for automation testing. Therefore the testers adopt WedriverIO to fulfill their needs of browser testing.

Learn to run automation testing with WebdriverIO tutorial. Go from a beginner to a professional automation test expert with LambdaTest WebdriverIO tutorial.

Chapters

  1. Running Your First Automation Script - Learn the steps involved to execute your first Test Automation Script using WebdriverIO since the setup is very easy to follow and the features can be configured manually.

  2. Selenium Automation With WebdriverIO - Read more about automation testing with WebdriverIO and how it supports both browsers and mobile devices.

  3. Browser Commands For Selenium Testing - Understand more about the barriers faced while working on your Selenium Automation Scripts in WebdriverIO, the ‘browser’ object and how to use them?

  4. Handling Alerts & Overlay In Selenium - Learn different types of alerts faced during automation, how to handle these alerts and pops and also overlay modal in WebdriverIO.

  5. How To Use Selenium Locators? - Understand how Webdriver uses selenium locators in a most unique way since having to choose web elements very carefully for script execution is very important to get stable test results.

  6. Deep Selectors In Selenium WebdriverIO - The most popular automation testing framework that is extensively adopted by all the testers at a global level is WebdriverIO. Learn how you can use Deep Selectors in Selenium WebdriverIO.

  7. Handling Dropdown In Selenium - Learn more about handling dropdowns and how it's important while performing automated browser testing.

  8. Automated Monkey Testing with Selenium & WebdriverIO - Understand how you can leverage the amazing quality of WebdriverIO along with selenium framework to automate monkey testing of your website or web applications.

  9. JavaScript Testing with Selenium and WebdriverIO - Speed up your Javascript testing with Selenium and WebdriverIO.

  10. Cross Browser Testing With WebdriverIO - Learn more with this step-by-step tutorial about WebdriverIO framework and how cross-browser testing is done with WebdriverIO.

Run Webdriverio 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