Exemple #1
0
 private void clearAndSetTextField(string id, string value)
 {
     app.ClearText(c => c.Marked(id));
     app.ClearText(c => c.Marked(id));
     app.EnterText(c => c.Marked(id), value);
     app.Screenshot("enter " + id);
 }
Exemple #2
0
 public void UpdateFirstName()
 {
     app.WaitForElement(x => x.Marked("Armstead, Evan"), "timed out waiting for list to load", new TimeSpan(0, 0, 10));                // wait for the list to appear
     app.Screenshot("App start, display list");
     app.ScrollDownTo("Green, Monica");
     app.Screenshot("Scrolled to Monica Green");
     app.Tap(x => x.Text("Green, Monica"));
     app.WaitForElement(x => x.Marked("Zoom out")); // wait for the map to appear
     Thread.Sleep(2000);                            // wait 2 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Marked("Edit"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Text("Monica"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Erica");
     app.DismissKeyboard();
     app.Screenshot("Altered value of company name field");
     app.Tap(x => x.Marked("Save"));
     app.WaitForElement(x => x.Marked("Zoom out")); // wait for the map to appear
     Thread.Sleep(2000);                            // wait 2 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Class("ImageButton"));
     app.ScrollDownTo("Green, Erica");
     app.Screenshot("First name updated on list screen, first name updated");
 }
Exemple #3
0
 public void UpdateFirstName()
 {
     app.Screenshot("App Started");
     app.EnterText(x => x.Class("EntryEditText"), "UseLocalDataSource");
     app.Screenshot("Entered data parition phrase");
     app.Tap(x => x.Text("Continue"));
     Thread.Sleep(10000);             // wait 10 seconds to let list and all images load
     app.Screenshot("Display list");
     app.ScrollDownTo("Green, Monica", swipePercentage: 0.5, swipeSpeed: 200);
     app.Screenshot("Scrolled to Monica Green");
     app.Tap(x => x.Text("Green, Monica"));
     Thread.Sleep(3000);             // wait 3 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Marked("Edit"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Text("Monica"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Erica");
     app.DismissKeyboard();
     app.Screenshot("Altered value of company name field");
     app.Tap(x => x.Marked("Save"));
     Thread.Sleep(3000);             // wait 3 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Class("ImageButton"));
     app.ScrollDownTo("Green, Erica");
     app.Screenshot("First name updated on list screen, first name updated");
 }
Exemple #4
0
 public void UpdateFirstName()
 {
     app.Screenshot("App Started");
     app.Tap(x => x.Id("setupDataPartitionPhraseField"));
     app.EnterText("UseLocalDataSource");
     app.Screenshot("Entered data parition phrase");
     app.Tap(x => x.Id("setupContinueButton"));
     app.WaitForElement(x => x.Marked("Armstead, Evan"));
     Thread.Sleep(3000);             // wait a few seconds for list images to fully load
     app.Screenshot("Display list");
     app.Tap(x => x.Marked("Armstead, Evan"));
     Thread.Sleep(3000);             // wait 3 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Id("acquaintanceEditButton"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Id("firstNameField"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Jonathan");
     app.DismissKeyboard();
     app.Screenshot("Altered value of first name field");
     app.Tap(x => x.Id("acquaintanceSaveButton"));
     Thread.Sleep(3000);             // wait 3 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Marked("Navigate up"));
     app.Screenshot("First name updated on list screen");
 }
Exemple #5
0
 public void UpdateFirstName()
 {
     app.WaitForElement(x => x.Id("nameTextView"));             // wait for the list to appear
     app.Screenshot("App start, display list");
     app.ScrollDownTo("Green, Monica", withinMarked: "acquaintanceRecyclerView");
     app.Screenshot("Scrolled to Monica Green");
     app.Tap(x => x.Marked("Green, Monica"));
     Thread.Sleep(2000);             // wait 2 seconds to give map time to fully render
     app.Screenshot("Detail screen");
     app.Tap(x => x.Id("acquaintanceEditButton"));
     app.Screenshot("Edit screen");
     app.ScrollDownTo("First");
     app.Tap(x => x.Id("firstNameField"));
     app.ClearText();
     app.Screenshot("Cleared first name field");
     app.EnterText("Erica");
     app.DismissKeyboard();
     app.Screenshot("Altered value of company name field");
     app.Tap(x => x.Id("acquaintanceSaveButton"));
     Thread.Sleep(2000);              // wait 2 seconds to give map time to fully render
     app.Screenshot("Saved changes, navigated to detail screen, first name updated");
     app.Tap(x => x.Marked("Navigate up"));
     app.ScrollDownTo("Green, Erica");
     app.Screenshot("First name updated on list screen, first name updated");
 }
Exemple #6
0
        public void EspressoTest()
        {
            app.Screenshot("When I run the app");

            app.ClearText("SubTotal");
            app.Screenshot("When I clear text");

            app.EnterText("SubTotal", "4.00");
            app.Screenshot("And Enter $4.00");

            var total = app.Query("Total").First();
            var tip   = app.Query("TipAmount").First();

            Assert.AreEqual(total.Text, "Total: $4.50");
            Assert.AreEqual(tip.Text, "Tip: $0.50");


            app.Screenshot("Total is $4.50 with $0.50 tip");
        }
Exemple #7
0
        public void ChangePhoneNum()
        {
            app.Tap("PhoneNumberText");
            app.ClearText();
            app.EnterText("PhoneNumberText", "ABCDEF");
            app.Tap("CallButton");
            string labelStr = app.Query("CallButton")[0].Text;

            Assert.AreEqual("Call 222333", labelStr);
        }
Exemple #8
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
        }
        public void A_SigningUp()
        {
            app.Screenshot("The app started");

            app.Tap(x => x.Id("pink"));
            app.Screenshot("Select pink");

            app.Tap(x => x.Id("signup"));
            app.WaitForElement(x => x.Marked("Get Started"));
            app.Screenshot("Start the sign up process");

            app.ClearText(x => x.Id("identifier"));
            app.EnterText(x => x.Id("identifier"), "xamarin@testcloud");

            if (!(app.Query(x => x.Id("nickname")).Any()))
            {
                app.Back();
            }
            app.EnterText(x => x.Id("nickname"), "Test");

            if (!((app.Query(x => x.Id("continue_button")).Any())))
            {
                app.Back();
            }
            app.WaitForElement(x => x.Id("continue_button"));
            if (app.Query(x => x.Id("continue_button")).First().Enabled == true)
            {
                Assert.Fail();
            }
            app.Screenshot("Continue button should be disabled");

            app.ClearText(x => x.Id("identifier"));
            app.EnterText(x => x.Id("identifier"), "*****@*****.**");
            if (!((app.Query(x => x.Id("continue_button")).Any())))
            {
                app.Back();
            }
            app.Screenshot("Continue button is enabled now");

            app.Tap(x => x.Id("continue_button"));
            if (!((app.Query(x => x.Id("ping")).Any())))
            {
                app.Back();
            }
            app.WaitForElement(x => x.Id("pin"));
            if (!((app.Query(x => x.Id("continue_button")).Any())))
            {
                app.Back();
            }
            app.Screenshot("On the pin page");

            app.EnterText(x => x.Id("pin"), "000000");
            if (!((app.Query(x => x.Id("continue_button")).Any())))
            {
                app.Back();
            }
            app.Screenshot("Pin is entered");

            app.Tap(x => x.Id("continue_button"));
            app.WaitForElement(x => x.Id("message"));
            app.Screenshot("Logged into the app");

            app.Tap(x => x.Marked("OK"));
            app.WaitForElement(x => x.Id("avatar"));

            app.Screenshot("Home page is open");
        }