Esempio n. 1
0
 public void InitialLaunch()
 {
     app.WaitForElement(q => q.Id("FlashBarText"));
     app.WaitForNoElement(q => q.Id("FlashBarText"),
                          postTimeout: TimeSpan.FromSeconds(1));
     app.Screenshot("Loaded map");
 }
Esempio n. 2
0
        public void ActionBarTabs()
        {
            app.Screenshot("Launch");
            app.Tap(q => q.Text("Action Bar Tabs"));

            app.WaitForElement(q => q.Class("Toolbar"));
            app.Screenshot("Action Bar Tabs");

            // Turn tabs on
            app.Tap(q => q.Id("btn_toggle_tabs"));

            // Add Tabs
            app.Tap(q => q.Id("btn_add_tab"));
            app.WaitForElement(q => q.Text("Tab 0"));
            app.Screenshot("Add Tab 0");
            app.Tap(q => q.Id("btn_add_tab"));
            app.WaitForElement(q => q.Text("Tab 1"));
            app.Screenshot("Add Tab 1");

            app.Tap(q => q.Id("btn_remove_tab"));
            app.WaitForNoElement(q => q.Text("Tab 1"));
            app.Screenshot("Remove Tab 1");

            app.Tap(q => q.Id("btn_remove_all_tabs"));
            app.WaitForNoElement(q => q.Text("Tab 0"));
            app.Screenshot("Remove All Tabs");
        }
        public SalesHomePage(AndroidApp app)
            : base(app, "WEEKLY AVERAGE")
        {
            FirstLead = x => x.Marked("50% - Value Proposition");
            ListView = x => x.Id("content");
            AddLeadButton = x => x.Class("FormsImageView");
            LeadCell = x => x.Class("ViewCellRenderer_ViewCellContainer");
            ChartIdentifier = x => x.Id("stripLinesLayout");
            //Verifying page has loaded
            app.WaitForElement(LeadCell);
            app.WaitForElement(ChartIdentifier);

            app.WaitForNoElement(SalesDataLoading, timeout: TimeSpan.FromSeconds(20));
            app.WaitForNoElement(LeadsLoading, timeout: TimeSpan.FromSeconds(20));
        }
        public SalesHomePage(AndroidApp app)
            : base(app, "WEEKLY AVERAGE")
        {
            FirstLead       = x => x.Marked("50% - Value Proposition");
            ListView        = x => x.Id("content");
            AddLeadButton   = x => x.Class("FormsImageView");
            LeadCell        = x => x.Class("ViewCellRenderer_ViewCellContainer");
            ChartIdentifier = x => x.Id("stripLinesLayout");
            //Verifying page has loaded
            app.WaitForElement(LeadCell);
            app.WaitForElement(ChartIdentifier);

            app.WaitForNoElement(SalesDataLoading, timeout: TimeSpan.FromSeconds(20));
            app.WaitForNoElement(LeadsLoading, timeout: TimeSpan.FromSeconds(20));
        }
Esempio n. 5
0
        public void RunBenchmarkHelper(string benchmark)
        {
            var assembly = Assembly.GetExecutingAssembly();

            using (Stream stream = assembly.GetManifestResourceStream("AndroidAgent.UITests.params.json")) {
                using (StreamReader reader = new StreamReader(stream)) {
                    dynamic json          = JsonConvert.DeserializeObject(reader.ReadToEnd());
                    string  githubAPIKey  = json.githubAPIKey;
                    string  httpAPITokens = json.httpAPITokens;
                    string  machineName   = json.machineName;
                    string  runSetId      = json.runSetId;
                    string  configName    = json.configName;

                    app.Screenshot("init");

                    clearAndSetTextField("benchmark", benchmark);
                    clearAndSetTextField("githubAPIKey", githubAPIKey);
                    clearAndSetTextField("httpAPITokens", httpAPITokens);
                    clearAndSetTextField("machineName", machineName);
                    clearAndSetTextField("runSetId", runSetId);
                    clearAndSetTextField("configName", configName);

                    app.Tap(c => c.Marked("myButton"));
                    app.Screenshot("after tap");
                    app.WaitForNoElement(c => c.Marked("myButton").Text("running"), "Benchmark is taking too long", TimeSpan.FromMinutes(179));
                    Assert.AreEqual(app.Query(c => c.Marked("myButton")).First().Text, "start");
                    app.Screenshot("after benchmark");
                }
            }
        }
        public void IndoorDemo()
        {
            app.Screenshot("Launch");
            app.ScrollDownAndTap(q => q.Text("Indoor"));
            app.WaitForElement(q => q.Id("map"));
            app.Screenshot("Map");

            app.Tap(q => q.Id("focused_bulding_info_button"));
            app.WaitForElement(q => q.Text("3 2 1 "));
            app.Screenshot("Focused Building");

            app.Tap(q => q.Id("focused_level_info_button"));
            app.WaitForElement(q => q.Text("2"));
            app.Screenshot("Focused Level");

            // Tap level 1
            app.Tap(q => q.Text("1"));
            app.Tap(q => q.Id("focused_level_info_button"));
            app.WaitForElement(q => q.Text("1"));
            app.Screenshot("Level 1");

            app.Tap(q => q.Id("toggle_level_picker_button"));
            app.WaitForNoElement(q => q.Text("3"));
            app.Screenshot("Toggle Level Picker");
            app.Tap(q => q.Id("toggle_level_picker_button"));
            app.WaitForElement(q => q.Text("3"));
            app.Screenshot("Toggle Level Picker");

            app.Tap(q => q.Id("higher_level_button"));
            app.WaitForElement(q => q.Text("Activating level 2"));
            app.Screenshot("Activate Higher Level");
        }
Esempio n. 7
0
        public async Task Login_Error2()
        {
            app.EnterText(c => c.TextField().Index(1), "DummyID");
            app.EnterText(c => c.TextField().Index(2), "DummyPassword");
            app.Tap(c => c.Button().Index(0));
            await Task.Delay(1000);

            app.WaitForNoElement(c => c.Class("FormsTextView"));
        }
        public void AnonymousAuth()
        {
            app.WaitForElement(q => q.Text("AnonymousAuthActivity"));

            app.Screenshot("Launch");

            app.Tap(q => q.Text("AnonymousAuthActivity"));

            app.WaitForElement(q => q.Text("Anonymous Sign In"));

            app.Tap(q => q.Id("button_anonymous_sign_in"));

            System.Threading.Thread.Sleep(500);

            app.WaitForNoElement(q => q.Id("progress"));

            app.Screenshot("Signed In");
        }
        public void Video()
        {
            app.Screenshot("Launch");
            app.Tap(q => q.Text("Dark Theme"));
            app.Screenshot("Dark Theme");
            app.Tap(q => q.Text("Cats with hats"));
            app.Screenshot("Cats with hats");

            if (app.Query(q => q.Class("MediaRouteButton")).Any())
            {
                app.WaitForElement(q => q.Class("MediaRouteButton"));
                app.Tap(q => q.Class("MediaRouteButton"));
                app.WaitForElement(q => q.Id("media_route_list"));
                app.Screenshot("Connect to device");
                app.Back();
                app.WaitForNoElement(q => q.Id("media_route_list"));
            }
        }
Esempio n. 10
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
        }