Exemplo n.º 1
0
 public void UserRequestsToBorrowItemAfterViewingLendersProfileThenChangesMindAndDeletesRequestFromNotificationsPage()
 {
     app.Tap(x => x.Text("Sign-in"));
     app.WaitForElement("Tapped on view with class: UIButtonLabel marked: Sign-in");
     app.WaitForElement("Tapped on view with class: UIWebView");
     app.EnterText(x => x.Class("UIWebView").Css("INPUT._56bg._4u9z._5ruq"), "*****@*****.**");
     app.WaitForElement("Tapped on view with class: UIWebView");
     app.EnterText(x => x.Class("UIWebView").Css("INPUT#u_0_2"), "Imperial09!");
     app.WaitForElement("Tapped on view with class: UIWebView");
     app.WaitForElement("Tapped on view with class: UIImageView");
     app.ScrollDownTo("Borrow Item");
     app.WaitForElement("Scrolled to [AppView: Class=[Class: Name=UIButtonLabel], Id=, Text=Borrow Item, Marked=Borrow Item, Css=, XPath=, IndexInTree=-1, Rect=[Rectangle: Left=118.5, Top=527, CenterX=160, CenterY=536, Width=83, Height=18, Bottom=545, Right=201.5]]");
     app.Tap(x => x.Text("Borrow Item"));
     app.WaitForElement("Tapped on view with class: UIButtonLabel marked: Borrow Item");
     app.Tap(x => x.Text("Send borrow request"));
     app.WaitForElement("Tapped on view with class: UIButtonLabel marked: Send borrow request");
     app.Tap(x => x.Marked("Okay"));
     app.WaitForElement("Tapped on view with class: _UIAlertControllerActionView marked: Okay");
     app.ScrollUpTo("Back");
     app.WaitForElement("Scrolled to [AppView: Class=[Class: Name=UIButtonLabel], Id=, Text=Back, Marked=Back, Css=, XPath=, IndexInTree=-1, Rect=[Rectangle: Left=10, Top=23, CenterX=27, CenterY=32, Width=34, Height=18, Bottom=41, Right=44]]");
     app.Tap(x => x.Text("Back"));
     app.WaitForElement("Tapped on view with class: UIButtonLabel marked: Back");
     app.Tap(x => x.Id("*****@*****.**"));
     app.WaitForElement("Tapped on view with class: UITabBarSwappableImageView");
     app.Tap(x => x.Marked("Borrow Request: Finding Nemo"));
     app.WaitForElement("Tapped on view with class: UILabel marked: Borrow Request: Finding Nemo");
     app.Tap(x => x.Marked("Yes"));
     app.WaitForElement("Tapped on view with class: _UIAlertControllerActionView marked: Yes");
 }
Exemplo n.º 2
0
        public void TestTeacherNewAccountFlow()
        {
            createAccount("teacher");

            //verify that we landed on add class screen
            app.WaitForElement("Click here to add a class");
            app.Screenshot("Teacher no class FRE screen");
            app.Tap("Click here to add a class");
            enterText("textInput_addClass", getRandomClassName());
            app.Screenshot("teacher_create_account_flow_welcome");

            app.Tap("Edit class image");

            //select image id: 5
            app.WaitForElement("avatar_grid_item_5");
            app.Screenshot("teacher_create_account_flow_edit_class_image");

            app.Tap("avatar_grid_item_5");

            //ensure that the class avatar image has sifted to imageID: 5
            app.WaitForElement("class_avatar_5");

            app.Tap("Add class");
            app.WaitForElement(x => x.Text("Class Code"));
            app.Screenshot("teacher_create_account_flow_add_class");

            //save class code to be used later by student to join class
            string newClassCode = app.Query(x => x.Marked("classCodeValue")).FirstOrDefault().Text;

            //tap on button to add students manually
            app.Tap("Add students manually");
            app.WaitForElement(x => x.Text("Add Manual Students"));

            string studentName = addManualStudent();

            // test removing the added student by tapping on the remove icon
            app.Tap("student_card_right_comp_" + studentName);
            app.WaitForElement(x => x.Text("Are you sure you want to remove this student?"));
            app.Tap("Remove");
            //verify that the student is removed
            app.WaitForNoElement(x => x.Text(studentName));

            //add a student back again
            studentName = addManualStudent();

            //press done button
            app.Tap("add_student_done_btn");


            app.WaitForElement("Assignments");
            app.Screenshot("teacher_create_account_flow_main");
            app.Tap("Assignments");
            app.WaitForElement("surah_title_touchable");

            //tap on surah ToC to change surah
            app.WaitForElement("surah_title_touchable");
            app.Tap("surah_title_touchable");
            app.Screenshot("teacher_create_account_flow_surah_toc");

            //type to filter surah
            app.WaitForElement("qc_text_input");
            app.EnterText("qc_text_input", "Yus");

            //tap on the fitered surah name
            app.WaitForElement("surahs_toc_item_Yusuf");
            app.Tap("surahs_toc_item_Yusuf");
            app.WaitForElement("surah_header_يوسف");
            app.Screenshot("teacher_create_account_flow_surah");

            //change page
            app.ScrollDownTo("touchable_text_page_number_235_footer");
            app.Tap("touchable_text_page_number_235_footer");
            app.WaitForElement("text_input_mushaf_page_number");
            app.ClearText("text_input_mushaf_page_number");
            app.EnterText("text_input_mushaf_page_number", "111");

            app.Tap("touchable_text_go");
            app.Tap("touchable_text_go");
            app.WaitForNoElement("touchable_text_go");
            //verify that page has been changed
            app.WaitForElement(x => x.Text("المائدة"));
            app.ScrollDownTo("touchable_text_page_number_111_footer");

            //swipe pages left and right

            app.SwipeLeftToRight();
            app.ScrollDownTo("touchable_text_page_number_112_footer");
            //swipe right twice
            app.SwipeRightToLeft();
            app.SwipeRightToLeft();
            app.ScrollDownTo("touchable_text_page_number_110_footer");
            app.ScrollUpTo("surah_title_text");

            //select ayah, verify selection assignment name
            app.Tap("mushaf_word_15504");
            app.WaitForElement(x => x.Marked("mwt_15504_sel"));
            string assignmentName = "Al-Ma'idah (14) p. 110";

            app.Query(x => x.Marked("footer_label_" + assignmentName));

            //select end ayah, verify selection assignment name,
            app.Tap("mushaf_word_15554");
            app.WaitForElement("footer_label_Al-Ma'idah (14 to 15) p. 110");

            //change selection to one ayah again
            app.Tap("mushaf_word_15504");
            app.WaitForElement(x => x.Marked("mwt_15504_sel"));
            app.Query(x => x.Marked("footer_label_" + assignmentName));
            app.Screenshot("teacher_create_account_flow_assignment_mushaf");

            //save assignment, verify assignment name in student card
            app.Tap("Save");

            app.WaitForElement("card_stud_" + studentName + "_assignment_" + assignmentName);
            app.Tap("card_stud_" + studentName + "_assignment_" + assignmentName);
            app.Screenshot("teacher_create_account_flow_main_assigment");

            app.WaitForElement("card_stud_" + studentName + "_assignment_" + assignmentName);
            app.Tap("card_stud_" + studentName + "_assignment_" + assignmentName);

            //edit assignment
            //save

            //grade assignment
            app.Tap("ellipsis");
            app.WaitForElement("btn_evaluate_assignment");
            app.Tap("btn_evaluate_assignment");
            app.WaitForElement("btn_save_eval");

            //-- enter word level evaluation ----
            //tap on a word to enter some evaluation notes for it

            //For some reasons there are two instances of the word item, may be a bug that needs to
            // be investigated later. For now, to get around it, we query how many instances,
            // and tap on the last time since it would be the active one.
            Tap("mwt_15504_sel", 1);

            fillEvalCardNotes("Pay attention to harakat", new string[] { "Muduud" }, true);

            //--- enter ayah level evaluation --
            //tap on end of ayah
            app.Tap("end_of_ayah_14");
            fillEvalCardNotes("ayah needs some more practice", new string[] { "Memorization", "Ekhfae" }, true);


            //tap on rating
            app.Tap("rating_view");
            app.Tap("btn_expand_notes");

            fillEvalCardNotes("overall recitation was fine. Practice some more the ayah.", new string [] { "Memorization", "Ekhfae", "Makharej" }, false);
            app.Screenshot("teacher_create_account_flow_evaluation");

            //save evaluation
            app.Tap("btn_save_eval");
            //verify profile screen: grade, label, history

            app.ScrollTo("past_assignment_Al-Ma'idah (14) p. 110", "student_profile_container");
            app.WaitForElement("past_assignment_" + assignmentName);
            app.Screenshot("teacher_create_account_flow_student_profile");

            app.Tap("past_assignment_" + assignmentName);
            //wait for old evaluation page to load
            app.WaitForElement("TopBannerMiddleTitle");
            app.WaitForElement(x => x.Marked("mwt_15504_sel"));

            //attendance
        }