Ejemplo n.º 1
0
        public void successfulRegisterAndDeleteTest()
        {
            page.register("*****@*****.**", "Test1!", "Test1!");
            page.logout();

            driver.FindElement(By.LinkText("Login")).Click();
            loginPage = new LoginPage(driver);
            wait      = new WebDriverWait(driver, new TimeSpan(0, 0, 5));
            //Navigate to the Login page and login as admin
            loginPage.login("*****@*****.**", "Admin1*");
            wait.Until(wt => wt.FindElement(By.LinkText("*****@*****.**")));

            driver.FindElement(By.LinkText("CLIENTS")).Click();
            ClientsPage clientsPage = new ClientsPage(driver);

            wait = new WebDriverWait(driver, new TimeSpan(0, 0, 5));
            wait.Until(wt => wt.FindElement(By.Id("clientsTable")));

            int numberRows = clientsPage.countRows();

            clientsPage.deleteUserWithEmail("*****@*****.**");
            IAlert alert = driver.SwitchTo().Alert();

            alert.Accept();
            Thread.Sleep(1000);
            int newNumberRows = clientsPage.countRows();

            Assert.AreEqual(numberRows - 1, newNumberRows);
        }
Ejemplo n.º 2
0
        public MainPage()
        {
            Page bicyclesPage, clientsPage, reservationsPage, aboutPage = null;

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                aboutPage = new NavigationPage(new AboutPage())
                {
                    Title = "Aplikacja"
                };
                bicyclesPage = new NavigationPage(new BicyclesPage())
                {
                    Title = "Rowery"
                };
                clientsPage = new NavigationPage(new ClientsPage())
                {
                    Title = "Klienci"
                };
                reservationsPage = new NavigationPage(new ReservationsPage())
                {
                    Title = "Rezerwacje"
                };
                bicyclesPage.Icon     = "tab_feed.png";
                clientsPage.Icon      = "tab_feed.png";
                reservationsPage.Icon = "tab_feed.png";
                aboutPage.Icon        = "tab_about.png";
                break;

            default:
                aboutPage = new AboutPage()
                {
                    Title = "Aplikacja"
                };
                bicyclesPage = new BicyclesPage()
                {
                    Title = "Rowery"
                };
                clientsPage = new ClientsPage()
                {
                    Title = "Klienci"
                };
                reservationsPage = new ReservationsPage()
                {
                    Title = "Rezerwacje"
                };
                break;
            }
            Children.Add(aboutPage);
            Children.Add(bicyclesPage);
            Children.Add(clientsPage);
            Children.Add(reservationsPage);

            Title = Children[0].Title;
        }
Ejemplo n.º 3
0
        public async Task GoToClientsPageAsync()
        {
            using (UserDialogs.Instance.Loading("Loading"))
            {
                ClientsPage ClientsPage = new ClientsPage();
                App.instance.ClientsViewModel = App.instance.ClientsViewModel == null ? new ClientsViewModel() : App.instance.ClientsViewModel;
                ClientsPage.BindingContext    = App.instance.ClientsViewModel;
                Clients = Clients.Any() ? Clients : await App.instance.ClientsViewModel.LoadClientsFromRent(App.instance.DashboardViewModel.CurrentRent);

                (App.instance.MainPage as MainPage).IsPresented = false;
                await App.instance.PushAsyncNewPage(ClientsPage);
            }
        }
Ejemplo n.º 4
0
        public void newClientRatesAFilm()
        {
            //create new user that will rate a film
            driver.Navigate().GoToUrl("http://*****:*****@test.com", "Test1!", "Test1!");
            wait = new WebDriverWait(driver, new TimeSpan(0, 0, 5));
            wait.Until(wt => wt.FindElement(By.LinkText("*****@*****.**")));

            driver.FindElement(By.LinkText("MOVIES")).Click();
            filmsPage = new FilmsPage(driver);
            filmsPage.clickOnMovieToAccessDetailsFromPosition(1);
            detailsPage = new DetailsPage(driver);
            float oldRating = detailsPage.getRating();

            detailsPage.rateFilm(10);
            Thread.Sleep(2000);
            Assert.AreEqual(detailsPage.getDoneMessage(), "Thank you for rating this movie!");
            detailsPage.rateFilm(6);
            Thread.Sleep(2000);
            Assert.AreEqual(detailsPage.getDoneMessage(), "You have already rated this movie!");
            float newRating = detailsPage.getRating();

            Assert.AreNotEqual(oldRating, newRating);
            detailsPage.clickLogOut();

            //admin deletes the new user
            string loginURL = "http://*****:*****@yahoo.com", "Admin2*");
            wait.Until(wt => wt.FindElement(By.LinkText("*****@*****.**")));
            driver.FindElement(By.LinkText("CLIENTS")).Click();
            clientsPage = new ClientsPage(driver);
            wait.Until(wt => wt.FindElement(By.Id("clientsTable")));
            int numberRows = clientsPage.countRows();

            clientsPage.deleteUserWithEmail("*****@*****.**");
            Thread.Sleep(1500);
            IAlert alert = driver.SwitchTo().Alert();

            alert.Accept();
            Thread.Sleep(1500);
            int newNumberRows = clientsPage.countRows();

            Assert.AreEqual(numberRows - 1, newNumberRows);
        }
Ejemplo n.º 5
0
        private void Save()
        {
            NetworkPage.Save();
            GeneralPage.Save();
            SnapshottingPage.Save();
            ReplicationPage.Save();
            ClientsPage.Save();
            MemoryManagementPage.Save();
            LazyFreeingPage.Save();
            AppendOnlyModePage.Save();
            LuaScriptingPage.Save();
            RedisClusterPage.Save();
            ClusterNatSupportPage.Save();
            SlowLogPage.Save();
            LatencyMonitorPage.Save();
            EventNotificationPage.Save();
            AdvancedConfigPage.Save();
            ActiveDefragmentationPage.Save();

            // always last to save password and don't lose connection
            SecurityPage.Save();
        }
Ejemplo n.º 6
0
        public void init()
        {
            //Initialize driver and page
            driver = DriverFactory.createDriver();
            //======================HARDKODIRAN WINDOW SIZE ZA DA RABOTI SEGDE=========================
            //======================TRGNI PRED PREZENTACIJA============================================
            //driver.Manage().Window.Size = new System.Drawing.Size(1024, 768);
            //=========================================================================================
            page = new ClientsPage(driver);

            string pageURL  = "http://*****:*****@yahoo.com", "Admin2*");
            wait.Until(wt => wt.FindElement(By.LinkText("*****@*****.**")));

            //Navigate to the Clients page once logged in
            driver.Navigate().GoToUrl(pageURL); // Go to /Clients/Index
        }
Ejemplo n.º 7
0
        private void PageChanged(int pageIndex)
        {
            this.pageIndex = pageIndex;
            switch (pageIndex)
            {
            case 0:
                newClientPage     = new NewClientPage(CloseFrame);
                MainFrame.Content = newClientPage;
                break;

            case 1:
                newOrderPage      = new NewOrderPage(CloseFrame);
                MainFrame.Content = newOrderPage;
                break;

            case 2:
                newProjectPage    = new NewProjectPage(CloseFrame);
                MainFrame.Content = newProjectPage;
                break;

            case 3:
                newEmployeePage   = new NewEmployeePage(CloseFrame);
                MainFrame.Content = newEmployeePage;
                break;

            case 4:
                clientsPage       = new ClientsPage(CloseFrame);
                MainFrame.Content = clientsPage;
                break;

            case 5:
                ordersPage        = new OrdersPage(CloseFrame);
                MainFrame.Content = ordersPage;
                break;

            case 6:
                employeesPage     = new EmployeesPage(CloseFrame);
                MainFrame.Content = employeesPage;
                break;

            case 7:
                allprojectsPage   = new AllProjectsPage(CloseFrame);
                MainFrame.Content = allprojectsPage;
                break;

            case 8:
                lifeprojectsPage  = new ProjectLifePage(CloseFrame);
                MainFrame.Content = lifeprojectsPage;
                break;

            case 9:
                notopened         = new NotOpenedProjectsPage(CloseFrame);
                MainFrame.Content = notopened;
                break;

            case 10:
                alltasksPage      = new TasksPage(CloseFrame);
                MainFrame.Content = alltasksPage;
                break;

            case 11:
                newTaskPage       = new NewTaskPage(CloseFrame);
                MainFrame.Content = newTaskPage;
                break;

            case 12:
                newItemPage       = new NewItemPage(CloseFrame);
                MainFrame.Content = newItemPage;
                break;

            case 13:
                itemsPage         = new ItemsPage(CloseFrame);
                MainFrame.Content = itemsPage;
                break;
            }
        }
Ejemplo n.º 8
0
        public App()
        {
            InitializeComponent();

            MainPage = new ClientsPage();
        }