Beispiel #1
0
        public void AppLaunches()
        {
            //Carousel Swipe
            app.SwipeRightToLeft();
            app.WaitForElement(x => x.Id("NoResourceEntry-1"));
            app.SwipeRightToLeft();
            app.WaitForElement(x => x.Id("NoResourceEntry-2"));
            app.SwipeRightToLeft();
            app.WaitForElement(x => x.Id("NoResourceEntry-3"));
            app.SwipeRightToLeft();
            app.Screenshot("LoginPage");

            //Login Credentials
            app.WaitForElement(x => x.Marked("Email address"));
            app.Tap(x => x.Index(48));
            app.EnterText("*****@*****.**");
            app.DismissKeyboard();
            app.Tap(x => x.Button("btnContinue"));
            app.WaitForElement(x => x.Marked("PIN"));
            app.EnterText("6804");
            app.DismissKeyboard();
            app.Tap(x => x.Button("btnContinue"));
            app.Screenshot("Logging in with my credentials");

            //End of Introduction
            app.WaitForElement(x => x.Marked("NEXT"));
            app.Flash(x => x.Marked("NEXT"));
            app.Tap(x => x.Marked("NEXT"));
            app.Tap(x => x.Marked("NEXT"));
            app.Tap(x => x.Marked("NEXT"));
            app.Tap(x => x.Marked("OK, GOT IT"));
            app.Screenshot("End of Introduction");
            app.Back();

            //Hollenbeck Home
            app.Flash(x => x.Marked("Hollenbeck Home"));
            app.Tap(x => x.Marked("Hollenbeck Home"));
            app.WaitForElement(x => x.Marked("SCHEDULE A TOUR"));
            app.ScrollDownTo(x => x.Marked("MORE"));
            app.Tap(x => x.Marked("Prices (starting at)"));
            Thread.Sleep(TimeSpan.FromSeconds(3));
            app.Screenshot("Hollenbeck Home Info");
            app.Back();

            app.Repl();
        }
        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"));
            }
        }
        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");
        }
Beispiel #4
0
        // [TestCase]
        public void NewTest()
        {
            app.Tap(x => x.Class("EntryEditText"));
            app.Screenshot("Tapped on view with class: EntryEditText");
            // step 2
            app.EnterText(x => x.Class("EntryEditText"), "sandy");
            app.PressEnter();
            app.Tap(x => x.Class("EntryEditText").Index(1));
            app.EnterText(x => x.Class("EntryEditText").Index(1), "engg");
            app.PressEnter();
            app.Tap(x => x.Class("EntryEditText").Index(2));
            app.EnterText(x => x.Class("EntryEditText").Index(2), "public");
            app.Tap(x => x.Class("EntryEditText").Index(3));
            app.EnterText(x => x.Class("EntryEditText").Index(3), "*****@*****.**");
            app.Tap(x => x.Class("EntryEditText").Index(4));
            app.EnterText(x => x.Class("EntryEditText").Index(4), "1234567890");
            app.PressEnter();
            app.Screenshot("Pressed enter key");
            // step 3
            app.Tap(x => x.Text("GET STARTED"));
            app.Screenshot("Tapped on view with class: Button with text: GET STARTED");
            // step 4
            app.Tap(x => x.Text("NEW PROJECT"));
            app.WaitForElement(x => x.Marked("SiteName"));
            app.Screenshot("Tapped on view with class: FormsTextView with text: Copy project settings from\nanother project");
            // step 5
            app.Tap(x => x.Marked("siteName"));
            app.EnterText(x => x.Marked("siteName"), "first");
            app.PressEnter();
            app.Tap(x => x.Marked("EntrySiteLoc"));
            app.EnterText(x => x.Marked("EntrySiteLoc"), "germany");
            app.PressEnter();
            app.Tap(x => x.Text("Project Type").Index(1));
            app.TouchAndHold(x => x.Text("Commercial"));
            app.Screenshot("Long press on view with class: Platform_DefaultRenderer");
            // step 6
            app.TouchAndHold(x => x.Text("Advanced Settings"));
            app.Screenshot("Entered text: D");
            // step 7
            app.Tap(x => x.Text("02"));
            app.Screenshot("Entered text: 02");

            // step 8
            for (int i = 0; i < 2; i++)
            {
                app.ScrollDown();
                if ((app.Query(x => x.Marked("Panel Languages"))).Length > 0)
                {
                    break;
                }
            }
            app.Screenshot("Scrolled for the Panel Language");
            // step 9
            app.Tap(x => x.Class("EditText").Index(2));
            app.Screenshot("Tapped on view with class: EditText");
            // step 10
            app.Tap(x => x.Id("button1"));
            app.Screenshot("Tapped on OK");
            // step 11
            for (int i = 0; i < 2; i++)
            {
                app.ScrollDown();
                if ((app.Query(x => x.Marked("No of repeaters"))).Length > 0)
                {
                    break;
                }
            }
            // step 12
            app.Tap(x => x.Text("+").Index(1));
            app.Tap(x => x.Text("+").Index(1));
            app.Tap(x => x.Text("+").Index(1));
            app.Tap(x => x.Text("+").Index(1));
            app.Tap(x => x.Text("+").Index(1));
            //app.Tap(x => x.Text("+").Index(2));
            //app.Tap(x => x.Text("+").Index(2));
            //app.Tap(x => x.Text("+").Index(2));
            //app.Tap(x => x.Text("+").Index(2));
            //app.Tap(x => x.Text("+").Index(2));
            app.Screenshot("Tapped on view with class: Button with text: +");
            // step
            app.Back();
            app.Tap(x => x.Text("CREATE"));
            app.Screenshot("Tapped on view with class: Button with text: CREATE");



            //for (int i = 0; i < 6; i++)
            //{
            //    app.Back();
            //    if ((app.Query(x => x.Marked("Do you really want to exit?"))).Length > 0)
            //    {
            //        break;
            //    }
            //    for (i = 0; i < 2000; i++)
            //    {
            //        ;
            //    }

            //}
            //app.Screenshot("about to exit");

            //app.Tap(x => x.Id("button1"));
            //app.Screenshot("app closed");

            //BeforeEachTest();
            //app.Screenshot("reopen");



            // step
            app.TouchAndHold(x => x.Text("first"));
            app.Screenshot("Long press on view with class: Platform_DefaultRenderer");
            // step
            app.Tap(x => x.Text("NEW PANEL"));
            app.Screenshot("Tapped on view with class: Button with text: NEW PANEL");
            // step
            app.Tap(x => x.Class("EntryEditText"));
            app.EnterText(x => x.Class("EntryEditText"), "dxc");
            app.PressEnter();
            app.Screenshot("dxc");
            // step
            app.Tap(x => x.Class("EntryEditText").Index(1));
            app.EnterText(x => x.Class("EntryEditText").Index(1), "first floor");
            app.PressEnter();
            app.Screenshot("Pressed enter key");
            // step
            app.Tap(x => x.Text("CREATE"));
            app.Screenshot("Tapped on view with class: Button with text: CREATE");
            // step
            app.TouchAndHold(x => x.Text("dxc"));
            app.Screenshot("pressed DXC");
            // step
            app.TouchAndHold(x => x.Text("Devices"));
            app.Screenshot("Long press on view with class: FormsImageView");
            // step
            app.TouchAndHold(x => x.Text("Zones"));
            app.Screenshot("Long press on view with class: FormsTextView with text: Zones");
            // step
            app.TouchAndHold(x => x.Text("Logics"));
            app.Screenshot("Long press on view with class: LOGICS");
            // step
            app.TouchAndHold(x => x.Text("Events"));
            app.Screenshot("Long press on view with class: FormsTextView with text: Events");
            // step
            app.Tap(x => x.Text("All"));
            app.Screenshot("press All");
            // step
            app.ScrollDown();
            app.Screenshot("press Fault");
            // step
            app.Tap(x => x.Id("button1"));
            app.Screenshot("Long press on view with class: FormsImageView");
            // step
            app.Back();
            app.Screenshot("goto prev screen");
            // step
            app.Tap(x => x.Text("QUICK CONFIGURE"));
            app.Screenshot("Tapped on view with class: Button with text: QUICK CONFIGURE");
            // step
            app.Tap(x => x.Text("CONTINUE"));
            app.Screenshot("Tapped on view with class: Button with text: CONTINUE");
            // step
            app.Tap(x => x.Class("EntryEditText"));
            app.EnterText(x => x.Class("EntryEditText"), "two");
            app.PressEnter();
            app.Tap(x => x.Class("EntryEditText").Index(1));
            app.EnterText(x => x.Class("EntryEditText").Index(1), "second floor");
            app.PressEnter();
            app.Tap(x => x.Text("04"));
            app.Screenshot("filled the page and tap on CONTINUE");
            // step
            app.Tap(x => x.Text("CONTINUE"));
            app.Screenshot("Tapped on view with class: Button with text: CONTINUE");
            // step
            app.Tap(x => x.Text("Loop 1"));
            app.Screenshot("Long press on view with class: LOOP 1");
            // step
            app.Tap(x => x.Class("EntryEditText"));
            app.EnterText(x => x.Class("EntryEditText"), "20");
            app.PressEnter();
            app.Tap(x => x.Class("EntryEditText").Index(1));
            app.EnterText(x => x.Class("EntryEditText").Index(1), "0");
            app.PressEnter();
            app.Screenshot("added sensor and modules");
            // step
            app.Tap(x => x.Text("DONE"));
            app.Screenshot("Tapped on view with class: Button with text: DONE");
            // step
            app.Tap(x => x.Text("CONTINUE"));
            app.Screenshot("Tapped on view with class: Button with text: CONTINUE");
            // step


            app.Tap(x => x.Text("SKIP"));
            app.Screenshot("Tapped on view with class: Button with text: SKIP");
            // step
            app.Tap(x => x.Class("RadioButton"));
            app.Tap(x => x.Class("RadioButton").Index(2));
            app.Tap(x => x.Class("RadioButton").Index(1));
            app.Screenshot("Tapped on view with class: RadioButton");
            // step
            app.Tap(x => x.Text("ASSIGN"));
            app.Screenshot("Tapped on view with class: Button with text: ASSIGN");
            // step
            app.Tap(x => x.Class("RadioButton"));
            app.Tap(x => x.Class("RadioButton").Index(1));
            app.Screenshot("Long press on view with class: RadioButton");
            // step
            app.Tap(x => x.Text("DONE"));
            app.Screenshot("Long press on view with class: Button with text: DONE");
            // step
            app.Tap(x => x.Text("DONE"));
            app.Screenshot("Tapped on view with class: Button with text: DONE");

            app.Back();
            app.Screenshot("panels list");

            for (int i = 0; i < 6; i++)
            {
                app.Back();
                if ((app.Query(x => x.Marked("Do you really want to exit?"))).Length > 0)
                {
                    break;
                }
                else
                {
                    continue;
                }
            }
            app.Screenshot("about to exit");

            app.Tap(x => x.Id("button1"));
            app.Screenshot("app closed");

            BeforeEachTest();
            app.Screenshot("reopen");

            app.Flash("first");
            app.Screenshot("first flash");

            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(1))[0].Text, "first");
            app.Screenshot("assertion 1");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(2))[0].Text, "germany");
            app.Screenshot("assertion 2");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(6))[0].Text, "Commercial");
            app.Screenshot("assertion 3");

            app.TouchAndHold(x => x.Text("first"));
            app.Screenshot("Long press on view with class: Platform_DefaultRenderer");
            for (int i = 0; i < 20000; i++)
            {
                ;
            }

            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(2))[0].Text, "two");
            app.Screenshot("assertion 4");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(3))[0].Text, "second floor");
            app.Screenshot("assertion 5");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(5))[0].Text, "4");
            app.Screenshot("assertion 6");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(7))[0].Text, "20");
            app.Screenshot("assertion 7");

            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(12))[0].Text, "dxc");
            app.Screenshot("assertion 8");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(13))[0].Text, "first floor");
            app.Screenshot("assertion 9");
            Assert.AreEqual(app.Query(e => e.Class("FormsTextView").Index(15))[0].Text, "2");
            app.Screenshot("assertion 10");
        }