コード例 #1
0
        public async Task NextView()
        {
            app.Tap("ImagePath");
            await Task.Delay(3000);

            app.Screenshot("Próxima View");

            app.Back();
        }
コード例 #2
0
        public void FirstTest()
        {
            #region Web CheatSheet
            //http://www.w3schools.com/cssref/css_selectors.asp
            #endregion

            #region How to Query for ALL elements
            //app.Query(x => x.Css("body"));
            #endregion

            #region How to Query for platform-specifc elements
            //Android: app.Query(x => x.WebView().Invoke("getUrl"))
            //iOS: app.Query(x => x.WebView().Invoke("request").Invoke("URL").Invoke("absoluteString"))
            #endregion

            app.WaitForElement(x => x.Css("#ext-home-create-a-meal-btn-1"), timeout: TimeSpan.FromSeconds(80));
            app.Screenshot("App Launched");

            app.Tap(x => x.Css("#ext-home-create-a-meal-btn-1"));
            app.Screenshot("Tapped on 'Create a Meal' Button");

            app.Tap(x => x.Css(".x-list-item-label"));
            app.Screenshot("Tapped on 'Finest Burger'");

            app.Tap(x => x.Css(".x-list-item-label"));
            Thread.Sleep(2000);
            app.Screenshot("Tapped on 'Southern Charm' Button");

            Thread.Sleep(2000);
            app.Screenshot("Shows 'Sorry, No Photo Available'");

            app.Tap(x => x.Css("#ext-toolbar-allergens-1"));
            app.Screenshot("Tapped on 'Allergen Menu'");
            Thread.Sleep(8000);

            app.Tap(x => x.Css(".top"));
            app.Screenshot("Tapped on 'Red Robin Locations'");

            app.Tap(x => x.Css(".grey-text.loc_search_text"));
            app.Screenshot("Tapped on 'Enter Zip, Or City, State'");
            Thread.Sleep(4000);

            app.EnterText("94111");
            app.Screenshot("Entered in '94111'");

            app.DismissKeyboard();
            app.Screenshot("Dismissed Keyboard");

            app.Tap(x => x.Css(".loc_search_btn"));
            app.Screenshot("Tapped on Search Button");

            app.Back();
            app.Screenshot("Pressed back to get back to Main Menu");

            app.Back();
            app.Screenshot("Pressed back to get back to Main Menu");
        }
コード例 #3
0
        public void ThenIShouldSeeAListOfMatchingMediciationsThatStartsWith(string drugName)
        {
            var drugs = app.Query(x => x.Class("FormsTextView"));

            foreach (Xamarin.UITest.Queries.AppResult drug in drugs)
            {
                drug.Text.ToLower().Contains(drugName);
            }
            app.Back();
        }
コード例 #4
0
ファイル: Tests.cs プロジェクト: jCho23/LasVegas
        public void FirstTest()
        {
            Thread.Sleep(8000);
            app.Tap("skipButton");
            Thread.Sleep(8000);
            app.Screenshot("Lets tap the 'Close' Button");

            Thread.Sleep(8000);
            app.Tap(x => x.Marked("textSection").Index(0));
            Thread.Sleep(8000);
            app.Screenshot("Then, We Tapped on the first news tile");
            Thread.Sleep(8000);
            app.Back();
            Thread.Sleep(8000);
            app.Screenshot("We Tapped on the 'Back' Button");

            app.Tap(x => x.Marked("textSection").Index(1));
            Thread.Sleep(8000);
            app.Screenshot("Next, we Tapped on the second news tile");
            Thread.Sleep(8000);
            app.Back();
            Thread.Sleep(8000);
            app.Screenshot("We Tapped on the 'Back' Button");

            app.Tap("searchButtonBackground");
            Thread.Sleep(8000);
            app.Screenshot("We Tapped on the 'Search' icon");
            app.Query(x => x.Class("android.widget.EditText").Invoke("setText", "microsoft"));
            Thread.Sleep(8000);
            app.Screenshot("We entered in our search, 'Microsoft'");
            Thread.Sleep(8000);
            app.PressEnter();
            app.Screenshot("Then, we Tapped on the enter button");
            Thread.Sleep(8000);

            app.Tap("Business");
            Thread.Sleep(8000);
            app.Screenshot("We Tapped the result that came up");

            app.ScrollDown();
            Thread.Sleep(8000);
            app.Screenshot("Scrolling down for more information");
            Thread.Sleep(8000);

            app.WaitForElement(x => x.Marked("backButton"), timeout: TimeSpan.FromSeconds(30000));
            app.Tap("backButton");
            Thread.Sleep(8000);
            app.Screenshot("We Tapped on the 'Back' Button");

            Thread.Sleep(8000);
            app.Tap("homeButtonBackground");
            Thread.Sleep(8000);
            app.Screenshot("Lastly, we Tapped on the 'Home' icon");
        }
コード例 #5
0
ファイル: Tests.cs プロジェクト: jCho23/BorderStates
        public void FirstTest()
        {
            app.Tap(x => x.Class("android.widget.TextView").Index(3));
            app.Screenshot("We tapped on 'Products'");

            app.Tap(x => x.Marked("tv_category_name").Index(1));
            app.Screenshot("We tapped on 'Boxes and Enclosures'");

            app.Tap(x => x.Marked("tv_category_name").Index(1));
            app.Screenshot("We tapped on 'Boxes'");


            app.Tap(x => x.Marked("tv_category_name").Index(2));
            app.Screenshot("We tapped on our box");

            app.Tap(x => x.Marked("tv_category_name").Index(3));
            app.Screenshot("We tapped on our specific box");

            app.Back();
            app.Screenshot("We tapped the Back Button");

            app.Tap(x => x.Marked("tv_category_name").Index(3));
            app.Screenshot("We tapped on a differnt box");

            app.Back();
            app.Screenshot("We tapped the Back Button");


            app.Tap(x => x.Marked("tv_category_name").Index(3));
            app.Screenshot("We tapped on another box");

            app.Back();
            app.Screenshot("We tapped the Back Button");


            app.Back();
            app.Screenshot("We tapped the Back Button");


            app.Tap(x => x.Marked("tv_category_name").Index(1));

            app.Back();
            app.Screenshot("We tapped the Back Button");


            app.Tap(x => x.Class("android.widget.ImageButton"));
            app.Screenshot("We tapped the Hamburger Icon");

            app.Tap(x => x.Marked("linear_nav_locations"));
            Thread.Sleep(30000);
            app.Screenshot("We tapped on 'Locations'");
        }
コード例 #6
0
        public void FirstTest()
        {
            app.Tap("photo");
            app.Screenshot("Let's start by Tapping on the first item on the page");

            app.Tap("action_observe");
            app.Screenshot("Then we Tapped on the 'Star' Icon");

            app.Back();
            app.Screenshot("We Tapped the 'Back' Button");

            app.Tap("action_search");
            app.Screenshot("Next we Tapped on the 'Search' Icon");

            app.EnterText("microsoft");
            app.Screenshot("We entered our search, 'Microsoft'");

            app.PressEnter();
            app.Screenshot("Then we Tapped on the 'Enter' Button");

            //Thread.Sleep(8000);
            app.Tap("photo");
            app.Screenshot("We Tapped on the first Microsoft item");

            Thread.Sleep(8000);
            app.Tap(x => x.Class("android.widget.ImageView").Index(0));
            app.Screenshot("We Tapped on the main picture");

            app.SwipeRightToLeft();
            app.Screenshot("We Swiped right for more pictures");

            app.SwipeRightToLeft();
            app.Screenshot("We Swiped right for more pictures");

            app.SwipeRightToLeft();
            app.Screenshot("We Swiped right for more pictures");

            Thread.Sleep(8000);
            app.Back();
            app.Screenshot("We Tapped the 'Back' Button");

            Thread.Sleep(8000);
            app.Back();
            app.Screenshot("We Tapped the 'Back' Button again to return to Home Screen");

            //Thread.Sleep(30000);
            //app.Tap(x => x.Class("android.widget.ImageButton").Index(9));
            //app.Screenshot("Then we Tapped on the 'Hamburger' Button");
        }
コード例 #7
0
 public void GivenISelectSortInFavoritesForFoodIndex()
 {
     _FoodIndexPage.WaitForElementPresent(_FoodIndexPage.ListItemName, 3);
     _FoodIndexPage.ListItemName.Click();
     Then("I should be on the food details summary tab");
     app.Back();
 }
コード例 #8
0
        public void TapMenuAndDisplayDetail()
        {
            TapHumburgarMenu(app, "About");
            app.WaitForElement(x => x.Marked("AboutPage.Button"),
                               timeout: TimeSpan.FromSeconds(10));

            app.Screenshot("About Page");

            TapHumburgarMenu(app, "Browse");
            app.WaitForElement(x => x.Marked("ItemsPage.TodoList"),
                               timeout: TimeSpan.FromSeconds(10));

            app.Screenshot("Browse Page").CopyTo("BrowsePage.png");

            app.ScrollDownTo(x => x.Marked("Item.Title").Text("本 📚 を買う"), x => x.Marked("ItemsPage.TodoList"), timeout: TimeSpan.FromSeconds(10), strategy: ScrollStrategy.Auto);
            app.Tap(x => x.Marked("Item.Title").Text("本 📚 を買う"));

            AppResult[] detailResults = app.Query(x => x.Marked("ItemDetailPage.Title").Text("本 📚 を買う"));
            Assert.IsTrue(detailResults.Any());
            app.Screenshot("Detail Page");

            System.Threading.Thread.Sleep(3000); // Wait for a while (demo)

            app.Back();
        }
コード例 #9
0
ファイル: UITests.cs プロジェクト: lj710/proyectoXamarin
        public void TestDetailsFromListView()
        {
            /* ACT */
            // tap the button
            // go to list
            _app.Tap(_queries.NavigationButton);

            // scroll the list
            _app.ScrollUp();

            // tap an item in the list
            _app.Tap(_queries.ListView);

            // make sure we have the deatils page by waiting for the webview
            Assert.IsTrue(_app.Query(_queries.WebView).Any(), "Webview not found in details");

            // go back
            _app.Back();

            _app.WaitForElement(_queries.ListView);
//			_app.Repl ();

            /* ASSERT */
            // make sure we are bank and see a listview
            Assert.IsTrue(_app.Query(_queries.ListView).Any(), "could not find list after going back from details");
        }
コード例 #10
0
ファイル: Tests.cs プロジェクト: jeffBiglebowski/UsingUITest
 public void EntryPopup()
 {
     app.Screenshot("Before Entry");
     app.Tap(Entry);
     app.Screenshot("After Entry");
     app.Back();
     app.Screenshot("After BackPressed");
 }