public void StartingPoint()
        {
            var navigateTo = new NavigateTo();

            // 1. Navigate to NavigateTo.Destination by Ctrl+Click or Go To Definition
            navigateTo.Destination();
        }
        public void LessThan5Chars()
        {
            NavigateTo.LoginFormScenarioThroughMenu(Driver);
            Actions.FillLoginForm(Config.Credentials.Invalid.Username.FourCharactors, Config.Credentials.Valid.Password, Config.Credentials.Valid.Password, Driver);

            alert = Driver.SwitchTo().Alert();

            Assert.AreEqual(Config.AlertMessages.UsernameLengthOutOfRange, alert.Text);
            alert.Accept();
        }
Esempio n. 3
0
        public static void AddUserToFriends(User user)
        {
            NavigateTo.Url(user.ProfileUrl);
            UserProfilePage.AddAsFriendButton.Click();

            Manager.Current.ActiveBrowser.WaitUntilReady();
            Manager.Current.ActiveBrowser.Refresh();

            UserProfilePage.UnfriendButton.Wait.ForExists(10000);
        }
Esempio n. 4
0
        public void Send_Message_Button_On_A_Friends_Tile_Navigates_To_The_Correct_Place()
        {
            LoginSteps.LoginTestUser1();
            NavigateTo.Page(this.FriendsPage);

            this.FriendsPage.Elements.SendMessageButton.Click();
            Manager.Current.ActiveBrowser.WaitUntilReady();

            this.MessagesPage.Elements.Messages.AssertTextIsContained("13:32, 1.10Test22:49, 8.10Test22:52, 8.10Test22:54, 8.10This is a text message");
        }
Esempio n. 5
0
        public static void SendMessageTo(User user, string messageContent)
        {
            NavigateTo.Url(user.ProfileUrl);
            UserProfilePage.SendMessageButton.Click();

            Manager.Current.ActiveBrowser.WaitUntilReady();

            MessagesPage.Elements.MessageToSendTextArea.Text = messageContent;
            MessagesPage.Elements.SendMessageButton.Click();
        }
Esempio n. 6
0
        public void EnterUserCredentials(string username, string password, string firstNameBg, string lastNameBg, string email)
        {
            NavigateTo.Page(this);

            this.Elements.UsernameField.Text             = username;
            this.Elements.PasswordField.Text             = password;
            this.Elements.PasswordAgainField.Text        = password;
            this.Elements.FirstNameInBulgarianField.Text = firstNameBg;
            this.Elements.LastNameInBulgarianField.Text  = lastNameBg;
            this.Elements.EmailField.Text = email;
        }
Esempio n. 7
0
 private async void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Name == "loaded")
     {
         Type view = (Type)obj.View;
         if (view == (typeof(MijnRitten)))
         {
             Loaded();
         }
     }
 }
Esempio n. 8
0
 private void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Reload == true)
     {
         Type view = (Type)obj.View;
         if (view == (typeof(VindRitFilter)))
         {
             Loaded();
         }
     }
 }
Esempio n. 9
0
 private void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Name == "loaded")
     {
         Type view = (Type)obj.View;
         if (view == (typeof(FeestjesOverzicht)))
         {
             Loaded();
         }
     }
 }
Esempio n. 10
0
        public static async Task OnNavigateTo(NavigateTo action, IEffectContext context)
        {
            var navigationManager = context.Services.GetRequiredService <NavigationManager>();

            if (navigationManager == null)
            {
                throw new NullReferenceException("Unable to resolved service 'NavigationManager'.");
            }
            navigationManager.NavigateTo(action.Uri, action.ForceLoad, action.Replace);
            await Task.CompletedTask;
        }
Esempio n. 11
0
 private void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Name == "loaded")
     {
         Type view = (Type)obj.View;
         if (view == (typeof(VeranderWachtwoord)))
         {
             Loaded();
         }
     }
 }
Esempio n. 12
0
 private void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Name == "loaded")
     {
         Type view = (Type)obj.View;
         if (view == typeof(Punten))
         {
             Loaded();
         }
     }
 }
Esempio n. 13
0
 private void ExecuteNavigatedTo(NavigateTo obj)
 {
     if (obj.Name == "loaded")
     {
         Type view = (Type)obj.View;
         if (view == (typeof(Views.Register)))
         {
             Loaded();
         }
     }
 }
Esempio n. 14
0
        public void TestAddToWishListWhileLogin()
        {
            TestLoginForm testSignUpForm = new TestLoginForm();

            testSignUpForm.PartialInitializer(Driver);
            testSignUpForm.PartialLoginFunction(Driver);

            Thread.Sleep(1000);

            NavigateTo.NavigateToItemOnHotelSearch(Driver);
            hotelInfo = new HotelDetailsPage(Driver);
            Thread.Sleep(1000);

            //get the name of the current hotel detail item
            HotelName = hotelInfo.HotelNameTitle.Text;
            Console.WriteLine(HotelName);

            //click on the add to wishlist
            hotelInfo.AddToWishListButton.Click();
            Thread.Sleep(3000);

            try
            {
                // Check the presence of alert
                alertHandler = Driver.SwitchTo().Alert();
                //print to console the alert message
                Console.WriteLine(alertHandler.Text);
                // if present consume the alert
                alertHandler.Accept();
            }
            catch (NoAlertPresentException ex)
            {
                Console.Write(ex.Message);
            }


            //navigate back to account
            NavigateTo.NavigateBackToProfileWhenLogin(Driver);
            Thread.Sleep(3000);

            //load the wishlist
            profile.WishList.Click();
            Thread.Sleep(3000);

            //get the name of the current hotel profile
            //change the name to uppercase
            HotelNameOnWishList = profile.ItemFromWishList.Text.ToUpper();


            //Assert that both are the same names
            Assert.AreEqual(HotelName, HotelNameOnWishList);
            Thread.Sleep(2000);
        }
        public void ValidLogin()
        {
            Driver.Navigate().GoToUrl("http://testing.todorvachev.com");

            NavigateTo.LoginFormThroughMenu(Driver);
            Actions.FillLoginForm(Config.Credentials.Valid.Username, Config.Credentials.Valid.Password, Config.Credentials.Valid.RepeatPassword, Driver);

            alert = Driver.SwitchTo().Alert();

            Assert.AreEqual(Config.AlertMessages.SuccessfulLogin, alert.Text);

            alert.Accept();
        }
Esempio n. 16
0
        public void Removing_A_Friend_Removes_Him_From_Your_Friends_List()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);

            NavigateTo.Page(this.FriendsPage);
            Manager.Current.ActiveBrowser.RefreshDomTree();
            this.FriendsPage.Elements.NoFriendsMessage.Wait.ForExists(5000);

            // Reverse to initial state (the two test users ARE friends)
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);
            LoginSteps.LoginTestUser2();
            FriendsSteps.AcceptUserInvitation();
        }
Esempio n. 17
0
        public void AddRoleWithValidData()
        {
            LoginSteps.LoginAdmin();
            NavigateTo.Url(this.rolesPage.Url);
            this.rolesPage.Elements.AnchorAddNewRole.Click();
            this.rolesPage.Elements.Name.Text = VadlidName;
            this.rolesPage.Elements.UpdateButton.Click();

            var text = this.Browser.ViewSourceString;

            bool result = text.Contains(VadlidName);

            Assert.IsTrue(result);
        }
Esempio n. 18
0
        public HomePage()
        {
            InitializeComponent();
            var version = Assembly.GetAssembly(typeof(ExtendedButton)).GetName().Version;

            VersionElement.Text = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
            foreach (var button in ControlsPanel.Children.OfType <HyperlinkButton>())
            {
                button.Click += (s, e) =>
                {
                    NavigateTo?.Invoke(this, button.Tag as Type);
                };
            }
        }
Esempio n. 19
0
        public void Requesting_A_Friendship_Does_Not_Add_User_To_Your_Friends_Without_Approval()
        {
            LoginSteps.LoginTestUser1();
            FriendsSteps.RemoveUserFromFriends(TestUsers.TestUser2);
            FriendsSteps.AddUserToFriends(TestUsers.TestUser2);

            NavigateTo.Page(this.FriendsPage);

            this.FriendsPage.Elements.SentInvitationsList.Wait.ForExists(5000);

            // Reverse to initial state (the two test users ARE friends)
            LoginSteps.LoginTestUser2();
            FriendsSteps.AcceptUserInvitation();
        }
        public static void CreateADataSourceMapping_VarYr()

        {
            HomePage homepage = new HomePage();
            SelectedSpecificationDataSourcePage selectedspecificationdatasourcepage = new SelectedSpecificationDataSourcePage();
            SelectSourceDatasetsPage            selectsourcedatasetspage            = new SelectSourceDatasetsPage();
            MapDataSourcesToDatasetsPage        mapdatasourcestodatasetpage         = new MapDataSourcesToDatasetsPage();

            homepage.Header.Click();
            Thread.Sleep(2000);

            NavigateTo.MapDataSourcesToDatasetsPage();
            Thread.Sleep(2000);

            var    specName      = ScenarioContext.Current["SpecificationName"];
            string specCreated   = specName.ToString();
            string specCreatedID = specName.ToString().Replace("Test Spec Name ", "");

            var    specYear   = ScenarioContext.Current["SpecificationYear"];
            string specAcYear = specYear.ToString();

            var selectYear    = mapdatasourcestodatasetpage.mapDataSourcesSpecficationYearDropDown;
            var selectElement = new SelectElement(selectYear);

            selectElement.SelectByValue(specAcYear);
            Thread.Sleep(2000);

            mapdatasourcestodatasetpage.mapDataSourcesSearchTermField.SendKeys(specCreatedID);
            mapdatasourcestodatasetpage.mapDataSourcesSearchTermButton.Click();
            Thread.Sleep(4000);

            Actions.MapDataSourcesToDatasetsForSpecification();
            Thread.Sleep(2000);
            selectedspecificationdatasourcepage.specificationDataSourceCount.Should().NotBeNull();

            selectedspecificationdatasourcepage.specificationDataSourceMissing.Click();
            Thread.Sleep(2000);
            selectsourcedatasetspage.selectSourceDatasetSaveButton.Should().NotBeNull();

            Actions.SelectSourceDatasetsRadioOption();
            Thread.Sleep(2000);
            Actions.SelectSourceDatasetVersionRadioOption();
            Thread.Sleep(2000);
            selectsourcedatasetspage.selectSourceDatasetSaveButton.Click();
            Thread.Sleep(2000);

            selectedspecificationdatasourcepage.specificationDataSourceMissing.Should().NotBeNull();
            selectedspecificationdatasourcepage.specificationDataSourceAddedAlert.Displayed.Should().BeTrue();
            Thread.Sleep(5000);
        }
 public LoginViewModel(INavigation navigate) : base(navigate)
 {
     LogInCommand = new Command(async() =>
     {
         bool loginStatus = await LoginAsync();
         if (!loginStatus)
         {
             await NavigateTo.PushAsync(new ErrorView("Access danied"));
         }
         else
         {
             await NavigateTo.PopAsync();
         }
     });
 }
        public void ThenADmiUserIsCreated()
        {
            james.IsAbleTo(Print.ToTheScreen("it works!"));
            james.IsAbleTo(Browse.TheWeb(driver));
            james.IsAbleTo(NavigateTo.Google());

            Console.WriteLine(user.firstname);
            Console.WriteLine(user.lastname);
            Console.WriteLine(user.username);
            Console.WriteLine(user.email);

            user.CanViewOrders();
            user.CanViewSettlements();
            user.DeleteUser();
        }
Esempio n. 23
0
        public void New_Messages_Notification_Is_Removed_After_The_Message_Is_Read()
        {
            LoginSteps.LoginTestUser1();

            string messageContent = RandomDataGenerator.GenerateRandomString(5, 15);

            MessagesSteps.SendMessageTo(TestUsers.TestUser2, messageContent);

            LoginSteps.LoginTestUser2();

            this.StartPageElements.NewMessagesLink.AssertIsPresent();
            MessagesSteps.ReadNewMessages();

            NavigateTo.Url("http://test.telerikacademy.com/");
            this.StartPageElements.NewMessagesLink.AssertIsNotPresent();
        }
        public void NavigationBar()
        {
            Driver.driver.Navigate().GoToUrl("http://testing.todorvachev.com");

            NavigateTo.LoginFormThroughMenu();

            Thread.Sleep(500);

            Driver.driver.Navigate().GoToUrl("http://testing.todorvachev.com");

            NavigateTo.LoginFormThroughThePost();

            Thread.Sleep(5000);

            Driver.driver.Quit();
        }
Esempio n. 25
0
        public void StartingPoint()
        {
            var navigateTo = new NavigateTo();

            // 1. "Destination" に対して、宣言への移動操作を行います。
            //      移動した先で戻る操作をしてみてください。
            //
            // 宣言への移動操作は憶えていますか?忘れた人は以下です。
            // <shortcut id="Go to Declaration or Usages">F12    or CTRL + Click (ReSharper VisualStudio Keymap)</shortcut>
            // <shortcut id="Go to Declaration or Usages">Ctrl+B or CTRL + Click (Rider Default IntelliJ Keymap)</shortcut>
            //
            // 2. この場所に戻ってきたら、今度は進む操作をしてみましょう。
            //    先ほど参照した "Destination" の宣言をもう一度確認することが出来るはずです。
            //
            navigateTo.Destination();
        }
        public static void CreateANewSpecification_VarYr()

        {
            ManageSpecificationPage managespecficationpage  = new ManageSpecificationPage();
            CreateSpecificationPage createspecificationpage = new CreateSpecificationPage();
            CreateCalculationPage   createcalculationpage   = new CreateCalculationPage();
            HomePage homepage = new HomePage();

            string newname         = "Test Spec Name ";
            string descriptiontext = "This is a Description for: ";
            string fundingStreams  = "all";

            NavigateTo.CreatetheSpecfication();
            Assert.IsNotNull(createcalculationpage.CalculationName);
            Thread.Sleep(2000);
            var randomSpecName = newname + TestDataUtils.RandomString(6);

            ScenarioContext.Current["SpecificationName"] = randomSpecName;

            createspecificationpage.SpecName.SendKeys(randomSpecName);
            createspecificationpage.SpecDescription.SendKeys(descriptiontext + randomSpecName);
            var selectYear = createspecificationpage.SpecFundingPeriod;

            var    specYear      = ScenarioContext.Current["SpecificationYear"];
            string specAcYear    = specYear.ToString();
            var    selectElement = new SelectElement(selectYear);

            selectElement.SelectByValue(specAcYear);
            //createspecificationpage.FundingStream.Click();
            //createspecificationpage.FundingStream.SendKeys(OpenQA.Selenium.Keys.Enter);
            Actions.CreateSpecificationChooseAllFundingStreams(fundingStreams);
            Thread.Sleep(2000);
            createspecificationpage.SaveSpecification.Click();
            Thread.Sleep(2000);

            homepage.Header.Click();
            Thread.Sleep(2000);
            homepage.ManagetheSpecification.Click();
            Thread.Sleep(2000);

            var    specName    = ScenarioContext.Current["SpecificationName"];
            string specCreated = specName.ToString();

            Console.WriteLine(specCreated + " has been created successfully");
            Driver._driver.FindElement(By.LinkText(specCreated)).Click();
            Thread.Sleep(1000);
        }
Esempio n. 27
0
        public static void EditANewCalculaton()

        {
            ManageCalculationPage managecalculationpage = new ManageCalculationPage();
            EditCalculationsPage  editcalculationspage  = new EditCalculationsPage();
            HomePage homepage = new HomePage();

            homepage.Header.Click();
            Thread.Sleep(2000);

            NavigateTo.ManagetheCalculation();
            Assert.IsNotNull(managecalculationpage.CalculationSearchField);
            Thread.Sleep(3000);

            var    specCalcName    = ScenarioContext.Current["SpecCalcName"];
            string specCalcCreated = specCalcName.ToString();

            Driver._driver.FindElement(By.LinkText(specCalcCreated)).Click();
            Thread.Sleep(2000);
            editcalculationspage.SaveCalculationButton.Should().NotBeNull();

            Thread.Sleep(2000);
            var datasetName = ScenarioContext.Current["DatasetSchemaName"];

            editcalculationspage.CalculationVBEditor.Should().NotBeNull();
            editcalculationspage.CalculationVBTextEditor.SendKeys(Keys.Delete);
            editcalculationspage.CalculationVBTextEditor.SendKeys(Keys.Shift + Keys.End);
            Thread.Sleep(2000);
            editcalculationspage.CalculationVBTextEditor.SendKeys("Return Datasets." + datasetName + ".FullSubtractTimeNumberOfPupilsInYearGroup1SubtractDualRegistrations + 10");
            Thread.Sleep(2000);
            editcalculationspage.BuildCalculationButton.Click();
            Thread.Sleep(10000);

            IWebElement EditCalculationCompiled = Driver._driver.FindElement(By.Id("compiler-response"));
            string      CalculationCompiled     = EditCalculationCompiled.Text;

            CalculationCompiled.Should().Be("Code compiled successfully: true");
            Console.WriteLine(CalculationCompiled);

            editcalculationspage.SaveCalculationButton.Click();
            Thread.Sleep(2000);

            Assert.IsNotNull(managecalculationpage.CalculationSearchField);
            Thread.Sleep(3000);
            Console.WriteLine(specCalcCreated + " has been edited successfully");
            Thread.Sleep(1000);
        }
Esempio n. 28
0
        public void OnlySpaceCharactersInLastName()
        {
            NavigateTo.NavigateToContactUsPage();

            Actions.ClearContactUsForm();

            Actions.FillContactUsForm(Config.FormEntries.ValidEntries.FirstName, Config.FormEntries.InvalidEntries.LastName.OnlySpaceCharacters,
                                      Config.FormEntries.ValidEntries.CompanyName, Config.FormEntries.ValidEntries.EmailAddress,
                                      Config.FormEntries.ValidEntries.PhoneNumber, Config.FormEntries.ValidEntries.Subject1,
                                      Config.FormEntries.ValidEntries.Message);

            Actions.SubmitContactUsForm();

            FantooContactUsPage cuEmptyLastName = new FantooContactUsPage();

            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoLastName, cuEmptyLastName.WarningNoLastName.Text);
        }
Esempio n. 29
0
        public void InvalidEmailAddressMissingAtSymbol()
        {
            NavigateTo.NavigateToContactUsPage();

            Actions.ClearContactUsForm();

            Actions.FillContactUsForm(Config.FormEntries.ValidEntries.FirstName, Config.FormEntries.ValidEntries.LastName,
                                      Config.FormEntries.ValidEntries.CompanyName, Config.FormEntries.InvalidEntries.EmailAddress.MissingAtSymbol,
                                      Config.FormEntries.ValidEntries.PhoneNumber, Config.FormEntries.ValidEntries.Subject1,
                                      Config.FormEntries.ValidEntries.Message);

            Actions.SubmitContactUsForm();

            FantooContactUsPage cuInvalidEmailMessage = new FantooContactUsPage();

            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.InvalidEmailWarningMessage, cuInvalidEmailMessage.WarningInvalidOrBlankEmail.Text);
        }
Esempio n. 30
0
        public void AttemptToSubmitEmptyContactUsForm()
        {
            NavigateTo.NavigateToContactUsPage();

            Actions.ClearContactUsForm();

            Actions.SubmitContactUsForm();

            FantooContactUsPage cuEmptySubmitWarnings = new FantooContactUsPage();

            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoFirstName, cuEmptySubmitWarnings.WarningNoFirstName.Text);
            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoLastName, cuEmptySubmitWarnings.WarningNoLastName.Text);
            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoCompanyName, cuEmptySubmitWarnings.WarningNoCompanyName.Text);
            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoEmailAddress, cuEmptySubmitWarnings.WarningInvalidOrBlankEmail.Text);
            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoSubject, cuEmptySubmitWarnings.WarningNoSubject.Text);
            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoMessage, cuEmptySubmitWarnings.WarningNoMessage.Text);
        }
Esempio n. 31
0
        public void NoSubject()
        {
            NavigateTo.NavigateToContactUsPage();

            Actions.ClearContactUsForm();

            Actions.FillContactUsForm(Config.FormEntries.ValidEntries.FirstName, Config.FormEntries.ValidEntries.LastName,
                                      Config.FormEntries.ValidEntries.CompanyName, Config.FormEntries.ValidEntries.EmailAddress,
                                      Config.FormEntries.ValidEntries.PhoneNumber, Config.FormEntries.InvalidEntries.Subject.NoSelection,
                                      Config.FormEntries.ValidEntries.Message);

            Actions.SubmitContactUsForm();

            FantooContactUsPage cuNoSubject = new FantooContactUsPage();

            Assert.AreEqual(Config.FormEntries.WarningMessagesEmptyContactUsForm.NoCompanyName, cuNoSubject.WarningNoSubject.Text);
        }