/* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 2 1 Ġ- Ġpresent ĠIn structure , ĠInc . Ċ Ġ* Ċ Ġ* ĠĠĠĠ ĠThis Ġprogram Ġis Ġfree Ġsoftware : Ġyou Ġcan Ġredistribute Ġit Ġand / or Ġmodify Ċ Ġ* ĠĠĠĠ Ġit Ġunder Ġthe Ġterms Ġof Ġthe ĠGNU ĠGeneral ĠPublic ĠLicense Ġas Ġpublished Ġby Ċ Ġ* ĠĠĠĠ Ġthe ĠFree ĠSoftware ĠFoundation , Ġversion Ġ 3 Ġof Ġthe ĠLicense . Ċ Ġ* Ċ Ġ* ĠĠĠĠ ĠThis Ġprogram Ġis Ġdistributed Ġin Ġthe Ġhope Ġthat Ġit Ġwill Ġbe Ġuseful , Ċ Ġ* ĠĠĠĠ Ġbut ĠWITHOUT ĠANY ĠWARRANTY ; Ġwithout Ġeven Ġthe Ġimplied Ġwarranty Ġof Ċ Ġ* ĠĠĠĠ ĠMERCHANTABILITY Ġor ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE . Ġ ĠSee Ġthe Ċ Ġ* ĠĠĠĠ ĠGNU ĠGeneral ĠPublic ĠLicense Ġfor Ġmore Ġdetails . Ċ Ġ* Ċ Ġ* ĠĠĠĠ ĠYou Ġshould Ġhave Ġreceived Ġa Ġcopy Ġof Ġthe ĠGNU ĠGeneral ĠPublic ĠLicense Ċ Ġ* ĠĠĠĠ Ġalong Ġwith Ġthis Ġprogram . Ġ ĠIf Ġnot , Ġsee Ġ< http :// www . gnu . org / licenses />. Ċ Ġ* Ċ Ġ*/ Ċ package Ġcom . in structure . student . ui . interaction Ċ Ċ import Ġcom . in structure . canvas . espress o . mock Canvas . Mock Canvas Ċ import Ġcom . in structure . canvas . espress o . mock Canvas . add Assignment Ċ import Ġcom . in structure . canvas . espress o . mock Canvas . add Todo Ċ import Ġcom . in structure . canvas . espress o . mock Canvas . init Ċ import Ġcom . in structure . canvas api 2 . models . Assignment Ċ import Ġcom . in structure . canvas api 2 . utils . Remote Config Param Ċ import Ġcom . in structure . canvas api 2 . utils . Remote Config Prefs Ċ import Ġcom . in structure . canvas api 2 . utils . to Api String Ċ import Ġcom . in structure . espress o . page . getString From Resource Ċ import Ġcom . in structure . p anda _ annotations . Feature Category Ċ import Ġcom . in structure . p anda _ annotations . Priority Ċ import Ġcom . in structure . p anda _ annotations . TestCategory Ċ import Ġcom . in structure . p anda _ annotations . Test MetaData Ċ import Ġcom . in structure . p anda utils . utils . date . DateTime Provider Ċ import Ġcom . in structure . student . R Ċ import Ġcom . in structure . student . ui . utils . Fake DateTime Provider Ċ import Ġcom . in structure . student . ui . utils . Student Test Ċ import Ġcom . in structure . student . ui . utils . token Login Element ary Ċ import Ġdagger . h ilt . android . testing . H ilt Android Test Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Test Ċ import Ġjava . util .* Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt Android Test Ċ class ĠSchedule Interaction Test Ġ: ĠStudent Test () Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar ĠdateTime Provider : ĠDateTime Provider ĊĊĠĠĠ Ġoverride Ġfun Ġdisplays Page Objects () Ġ= ĠUnit ĊĊĠĠĠ Ġ@ Before ĊĠĠĠ Ġfun ĠsetUp () Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ(! this :: dateTime Provider . isInitialized ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġh ilt Rule . inject () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 0 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Show Correct Header Items () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Page Objects () ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 8 ", Ġ" S unday ", Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 9 ", Ġ" Monday ", Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 1 0 ", Ġschedule Page . getString From Resource ( R . string . y esterday ), Ġ 4 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 1 1 ", Ġschedule Page . getString From Resource ( R . string . today ), Ġ 6 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 1 2 ", Ġschedule Page . getString From Resource ( R . string . tom orrow ), Ġ 8 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 1 3 ", Ġ" Friday ", Ġ 1 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 1 4 ", Ġ" Saturday ", Ġ 1 2 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 0 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Show Scheduled Assignments () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourses Ġ= Ġdata . courses . values . filter Ġ{ Ġ! it . hom ero om Course Ġ} ĊĠĠĠĠĠĠĠ Ġcourses [ 0 ]. name Ġ= Ġ" Course Ġ 1 " ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Date Ġ= ĠdateTime Provider . get Calendar (). time . to Api String () ĊĠĠĠĠĠĠĠ Ġval Ġassignment 1 Ġ= Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date , Ġname Ġ= Ġ" Assignment Ġ 1 ") ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Course Header Displayed ( courses [ 0 ]. name ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Schedule Item Displayed ( assignment 1 . name !! ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 0 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Show Missing Assignments () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourses Ġ= Ġdata . courses . values . filter Ġ{ Ġ! it . hom ero om Course Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Date Ġ= ĠdateTime Provider . get Calendar (). time . to Api String () ĊĠĠĠĠĠĠĠ Ġval Ġassignment 1 Ġ= Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 1 2 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Missing Item Displayed ( assignment 1 . name !! , Ġcourses [ 0 ]. name , Ġ" 1 0 Ġpts ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 0 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Show ToDo Events () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtodo Ġ= Ġdata . add Todo (" To ĠDo Ġevent ", Ġdata . students [ 0 ]. id , Ġdate Ġ= ĠdateTime Provider . get Calendar (). time ) ĊĠĠĠĠĠĠĠ Ġval Ġtodo 2 Ġ= Ġdata . add Todo (" Calendar Ġevent ", Ġdata . students [ 0 ]. id , Ġdate Ġ= ĠdateTime Provider . get Calendar (). time ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 8 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Course Header Displayed ( schedule Page . getString From Resource ( R . string . schedule _ todo _ title )) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Schedule Item Displayed ( todo . pl ann able . title ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Schedule Item Displayed ( todo 2 . pl ann able . title ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 1 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Refresh () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourses Ġ= Ġdata . courses . values . filter Ġ{ Ġ! it . hom ero om Course Ġ} ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĊĠĠĠĠĠĠĠ Ġ// ĠCheck Ġthat Ġwe Ġdon 't Ġhave Ġany Ġelements Ġinitially ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 8 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert No Schedule Item Displayed () ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Date Ġ= ĠdateTime Provider . get Calendar (). time . to Api String () ĊĠĠĠĠĠĠĠ Ġval Ġassignment 1 Ġ= Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date ) ĊĠĠĠĠĠĠĠ Ġval Ġassignment 2 Ġ= Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . refresh () ĊĊĠĠĠĠĠĠĠ Ġ// ĠCheck Ġthat Ġrefresh Ġwas Ġsuccessful ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 7 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Course Header Displayed ( courses [ 0 ]. name ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Schedule Item Displayed ( assignment 1 . name !! ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Schedule Item Displayed ( assignment 2 . name !! ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 1 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Go Back 2 Week s () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 8 ", Ġ" S unday ", Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 9 ", Ġ" Monday ", Ġ 2 ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . previous Week Button Click () ĊĠĠĠĠĠĠĠ Ġschedule Page . swipe Right () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 2 5 ", Ġ" S unday ", Ġ 0 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 5 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 2 6 ", Ġ" Monday ", Ġ 2 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 5 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 2 7 ", Ġ" Tuesday ", Ġ 4 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 6 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 2 8 ", Ġ" Wednesday ", Ġ 6 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 7 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 2 9 ", Ġ" Thursday ", Ġ 8 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 8 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 3 0 ", Ġ" Friday ", Ġ 1 0 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 2 9 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" July Ġ 3 1 ", Ġ" Saturday ", Ġ 1 2 , Ġre cyclerView Matcher Text Ġ= Ġ" July Ġ 3 0 ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 1 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Go Forward 2 Week s () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 8 ", Ġ" S unday ", Ġ 0 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 0 9 ", Ġ" Monday ", Ġ 2 ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . next Week Button Click () ĊĠĠĠĠĠĠĠ Ġschedule Page . swipe Left () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 2 ", Ġ" S unday ", Ġ 0 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 2 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 3 ", Ġ" Monday ", Ġ 2 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 2 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 4 ", Ġ" Tuesday ", Ġ 4 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 3 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 5 ", Ġ" Wednesday ", Ġ 6 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 4 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 6 ", Ġ" Thursday ", Ġ 8 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 5 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 7 ", Ġ" Friday ", Ġ 1 0 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 6 ") ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Day Header Shown (" Aug ust Ġ 2 8 ", Ġ" Saturday ", Ġ 1 2 , Ġre cyclerView Matcher Text Ġ= Ġ" Aug ust Ġ 2 7 ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 1 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Open Assignment () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourses Ġ= Ġdata . courses . values . filter Ġ{ Ġ! it . hom ero om Course Ġ} ĊĠĠĠĠĠĠĠ Ġcourses [ 0 ]. name Ġ= Ġ" Course Ġ 1 " ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Date Ġ= ĠdateTime Provider . get Calendar (). time . to Api String () ĊĠĠĠĠĠĠĠ Ġval Ġassignment Ġ= Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date , Ġname Ġ= Ġ" Assignment Ġ 1 ") ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 9 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . click Schedule Item ( assignment . name !! ) ĊĊĠĠĠĠĠĠĠ Ġassignment Details Page . assert Page Objects () ĊĠĠĠĠĠĠĠ Ġassignment Details Page . verify Assignment Details ( assignment ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 1 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Open Course () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcourses Ġ= Ġdata . courses . values . filter Ġ{ Ġ! it . hom ero om Course Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġcurrent Date Ġ= ĠdateTime Provider . get Calendar (). time . to Api String () ĊĠĠĠĠĠĠĠ Ġdata . add Assignment ( courses [ 0 ]. id , Ġsubmission Type Ġ= ĠAssignment . Submission Type . ON LINE _ TEXT _ ENTRY , Ġdue At Ġ= Ġcurrent Date ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 8 ) ĊĠĠĠĠĠĠĠ Ġschedule Page . click Course Header ( courses [ 0 ]. name ) ĊĊĠĠĠĠĠĠĠ Ġelement ary Course Page . assert Page Objects () ĊĠĠĠĠĠĠĠ Ġelement ary Course Page . assert Title Correct ( courses [ 0 ]. original Name !! ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġ@ Test MetaData ( Priority . P 2 , ĠFeature Category . K 5 _ DASH BOARD , ĠTest Category . INTER ACTION ) ĊĠĠĠ Ġfun Ġtest Mark As Done () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Date ( 2 0 2 1 , ĠCalendar . AU G UST , Ġ 1 1 ) ĊĠĠĠĠĠĠĠ Ġval Ġdata Ġ= Ġcreate Mock Data ( course Count Ġ= Ġ 1 ) ĊĊĠĠĠĠĠĠĠ Ġdata . add Todo (" To ĠDo Ġevent ", Ġdata . students [ 0 ]. id , Ġdate Ġ= ĠdateTime Provider . get Calendar (). time ) ĊĊĠĠĠĠĠĠĠ Ġgo To Schedule ( data ) ĊĠĠĠĠĠĠĠ Ġschedule Page . scrollTo Position ( 8 ) ĊĊĠĠĠĠĠĠĠ Ġschedule Page . assert Marked As Done Not Shown () ĊĊĠĠĠĠĠĠĠ Ġschedule Page . click Done Checkbox () ĊĠĠĠĠĠĠĠ Ġschedule Page . assert Marked As Done Shown () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġcreate Mock Data ( ĊĠĠĠĠĠĠĠ Ġcourse Count : ĠInt Ġ= Ġ 0 , ĊĠĠĠĠĠĠĠ Ġwith Grad ing Periods : ĠBoolean Ġ= Ġfalse , ĊĠĠĠĠĠĠĠ Ġhom ero om Course Count : ĠInt Ġ= Ġ 0 ): ĠMock Canvas Ġ{ ĊĊĠĠĠĠĠĠĠ Ġ// ĠWe Ġhave Ġto Ġadd Ġthis Ġdelay Ġto Ġbe Ġsure Ġthat Ġthe Ġremote Ġconfig Ġis Ġalready Ġfetched Ġbefore Ġwe Ġwant Ġto Ġoverride Ġremote Ġconfig Ġvalues . ĊĠĠĠĠĠĠĠ ĠThread . sleep ( 3 0 0 0 ) ĊĠĠĠĠĠĠĠ ĠRemote Config Prefs . putString ( Remote Config Param . K 5 _ DE SIGN . rc _ name , Ġ" true ") ĊĊĠĠĠĠĠĠĠ Ġreturn ĠMock Canvas . init ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstudent Count Ġ= Ġ 1 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcourse Count Ġ= Ġcourse Count , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwith Grad ing Periods Ġ= Ġwith Grad ing Periods , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhom ero om Course Count Ġ= Ġhom ero om Course Count ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġgo To Schedule ( data : ĠMock Canvas ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstudent Ġ= Ġdata . students [ 0 ] ĊĠĠĠĠĠĠĠ Ġval Ġtoken Ġ= Ġdata . token For ( student ) !! ĊĠĠĠĠĠĠĠ Ġtoken Login Element ary ( data . domain , Ġtoken , Ġstudent ) ĊĠĠĠĠĠĠĠ Ġelement ary Dashboard Page . waitFor Render () ĊĠĠĠĠĠĠĠ Ġelement ary Dashboard Page . select Schedule Tab () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġset Date ( year : ĠInt , Ġmonth : ĠInt , Ġday OfMonth : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcal Ġ= ĠCalendar . getInstance () ĊĠĠĠĠĠĠĠ Ġcal . set ( Calendar . YEAR , Ġyear ) ĊĠĠĠĠĠĠĠ Ġcal . set ( Calendar . MONTH , Ġmonth ) ĊĠĠĠĠĠĠĠ Ġcal . set ( Calendar . DAY _ OF _ MONTH , Ġday OfMonth ) ĊĠĠĠĠĠĠĠ Ġ( dateTime Provider Ġas ĠFake DateTime Provider ). fake TimeIn Millis Ġ= Ġcal . time In Millis ĊĠĠĠ Ġ} Ċ }