public void WhenIEnterTheUsernameAndPasswordAs(Table table)
        {
            FrameworkUtilities.Sleep(1000);
            dynamic data = table.CreateDynamicInstance();

            PageFactory.Instance.CurrentPage.As <LoginPage>().EmailSignInWithExistingAccount((string)data.Username, (string)data.Password);
        }
        public void ClickFirstImage()
        {
            FrameworkUtilities.Sleep(500);
            var firstImage = GetFirstImage();

            firstImage.Click();
        }
        public AppiumWebElement GetFirstImage()
        {
            FrameworkUtilities.Sleep(1000);
            var firstPic = DownloadPictures[1];

            FrameworkUtilities.Sleep(250);
            return(firstPic);
        }
 public void SendMessage()
 {
     ClickSendMessageTextbox();
     GenerateRandomMessage();
     SendMessageTextbox.SendKeys(Message);
     FrameworkUtilities.Sleep(1000);
     SendMessageButton.Click();
 }
Пример #5
0
        public void ThenIGoBackToTheHomePage()
        {
            FrameworkUtilities.Sleep(1500);

            PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <SettingsPage>().GotoHomePage();
            FrameworkUtilities.Sleep(1500);
            Assert.That(PageFactory.Instance.CurrentPage.As <HomePage>().IsHomePage, Is.True, "You are not on the home page");
        }
 public void AddTitle()
 {
     FrameworkUtilities.Sleep(1000);
     ParagraphTitle.Click();
     FrameworkUtilities.Sleep(250);
     GenerateRandomPostTitle();
     ParagraphTitle.SendKeys(PostTitle);
 }
 internal void EmailSignInWithExistingAccount(string email, string password)
 {
     FrameworkUtilities.Sleep(1000);
     FillEmail(email);
     ClickNextButton();
     FrameworkUtilities.Sleep(500);
     FillPassword(password);
 }
        public void WhenIToggleTheNightMode()
        {
            var byteArrayLightMode = PageFactory.Instance.CurrentPage.As <SettingsPage>().TakeScreenshot();

            LightModeBrightness = FrameworkUtilities.ImageBrightness(byteArrayLightMode);
            PageFactory.Instance.CurrentPage.As <SettingsPage>().ToggleNightMode();

            FrameworkUtilities.Sleep(1500);
            var byteArrayNightMode = PageFactory.Instance.CurrentPage.As <SettingsPage>().TakeScreenshot();

            DarkModeBrighness = FrameworkUtilities.ImageBrightness(byteArrayNightMode);
        }
        public void GivenIGoToTheChatsPage()
        {
            PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <HomePage>().GotoChatPage();
            FrameworkUtilities.Sleep(1000);

            PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <ChatPage>().GotoHomePage();
            FrameworkUtilities.Sleep(1000);

            PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <HomePage>().GotoChatPage();
            FrameworkUtilities.Sleep(1000);
            Assert.That(PageFactory.Instance.CurrentPage.As <ChatPage>().IsChatPage, Is.True, "You are not on the settings page");
        }
        public void AddPictureFromGallery()
        {
            FrameworkUtilities.Sleep(1000);
            ClickSelectImage();

            FrameworkUtilities.Sleep(1000);
            GaleryUpload.Click();

            FrameworkUtilities.Sleep(1000);
            AllowGalleryAccess.Click();

            FrameworkUtilities.Sleep(1000);
            CameraDownloadsSection.Click();

            FrameworkUtilities.Sleep(1000);
            ClickFirstImage();
        }
Пример #11
0
        public void WhenIKeepChangingTheTabsManyTimes()
        {
            for (int i = 0; i < 50; i++)
            {
                FrameworkUtilities.Sleep(1000);

                PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <SettingsPage>().GotoHomePage();
                FrameworkUtilities.Sleep(1000);
                PageFactory.Instance.CurrentPage.As <HomePage>().IsHomePage();

                PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <HomePage>().GotoChatPage();
                FrameworkUtilities.Sleep(1000);
                PageFactory.Instance.CurrentPage.As <ChatPage>().IsChatPage();

                PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <ChatPage>().GotoProfilePage();
                FrameworkUtilities.Sleep(1000);
                PageFactory.Instance.CurrentPage.As <ProfilePage>().IsProfilePage();

                PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <ProfilePage>().GotoSettingsPage();
                FrameworkUtilities.Sleep(1000);
                PageFactory.Instance.CurrentPage.As <SettingsPage>().IsSettingsPage();
            }
        }
 internal void FillEmail(string email)
 {
     EmailTextBox.SendKeys(email);
     FrameworkUtilities.Sleep(500);
 }
 public void ThenTheApplicationIsClosedAndTheScreenGoesBackToTheLoginScreen()
 {
     FrameworkUtilities.Sleep(2000);
     PageFactory.Instance.CurrentPage.As <LoginPage>().IsSignInWithEmailExist();
 }
 public void GivenIChooseSignInWithEmail()
 {
     FrameworkUtilities.Sleep(1000);
     Assert.That(PageFactory.Instance.CurrentPage.As <LoginPage>().IsSignInWithEmailExist, Is.True, "Login with email button was not found");
     PageFactory.Instance.CurrentPage.As <LoginPage>().ClickEmailSignIn();
 }
 internal void ClickSignIn()
 {
     SignIn.Click();
     FrameworkUtilities.Sleep(500);
 }
Пример #16
0
 public void ThenIClickTheSettingsTab()
 {
     PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <HomePage>().GotoSettingsPage();
     FrameworkUtilities.Sleep(1000);
     Assert.That(PageFactory.Instance.CurrentPage.As <SettingsPage>().IsSettingsPage, Is.True, "You are not on the settings page");
 }
 internal void FillPassword(string password)
 {
     PasswordTextBox.SendKeys(password);
     FrameworkUtilities.Sleep(500);
 }
 internal void ClickCreateUser()
 {
     CreateUser.Click();
     FrameworkUtilities.Sleep(500);
 }
 internal void FillUsername(string username)
 {
     UsernameTextbox.SendKeys(username);
     FrameworkUtilities.Sleep(500);
 }
 public void WhenIClickTheLoginButton()
 {
     FrameworkUtilities.Sleep(1000);
     PageFactory.Instance.CurrentPage = PageFactory.Instance.CurrentPage.As <LoginPage>().SignInUser();
 }
 public void ThenISeeTheHomepage()
 {
     FrameworkUtilities.Sleep(5000);
     Assert.That(PageFactory.Instance.CurrentPage.As <HomePage>().IsHomePage, Is.True, "Hot Button was not found - you are probably not on the home page");
 }
 internal void ClickCancelPreviousUser()
 {
     CancelPreviousUser.Click();
     FrameworkUtilities.Sleep(500);
 }
 public void ToggleNightMode()
 {
     FrameworkUtilities.Sleep(500);
     ThemeChange.Click();
 }
 internal void ClickNextButton()
 {
     NextButton.Click();
     FrameworkUtilities.Sleep(500);
 }
 public void ClickFirstPersonInChats()
 {
     FirstPersonInChats.Click();
     FrameworkUtilities.Sleep(1000);
 }