public void Init()
        {
            var separateRegOfTestUserDriver = new ChromeDriver();
            var random   = new System.Random(100);
            var testUser = new User
            {
                FullName        = "For deletition",
                Email           = string.Format("{0}@test.bg", System.Guid.NewGuid().ToString().Substring(0, 5)),
                Password        = "******",
                ConfirmPassword = "******",
                IsAdmin         = false,
                IsUser          = true
            };
            var registerPage = new RegistrationPage(separateRegOfTestUserDriver);

            registerPage.NavigateTo();
            registerPage.FillRegistrationForm(testUser);
            separateRegOfTestUserDriver.Close();


            this.driver = new ChromeDriver();
            var logPage = new LoginPage(this.driver);

            User user = AccessExcelData.GetUserTestData("LoginAsAdmin");

            logPage.NavigateTo();
            logPage.FillLoginForm(user);

            var userList = new UserListPage(this.driver);

            userList.NavigateTo();
            _userGuid = userList.GetUserGuid();
        }
        public MainLayout()
        {
            InitializeComponent();

            // apply employeeListPage
            employeeListPage = new UserListPage(Role.Employee);
            contentPanel.Controls.Add(employeeListPage);
            employeeListPage.Dock     = DockStyle.Fill;
            employeeListPage.Location = new Point(0, 0);
            employeeListPage.Name     = "employeeListPage";
            employeeListPage.Size     = new Size(799, 441);
            employeeListPage.TabIndex = 4;

            makeOrderButton.BackColor = LayoutUnits.primaryColor;
            makeOrderButton.ForeColor = Color.White;

            this.CenterToScreen();

            // init first page to show
            HandleChangePage(Pages.catalogListPage);

            userEmailLabel.Text = Store.user.Email;
            roleName.Text       = Store.user.RoleName;

            if (Store.user.RoleName.Equals(Role.Employee))
            {
                employeeButton.Visible = false;
            }
        }
        public UserListPageViewModel(UserListPage view, UserRepository repository)
        {
            this.view       = view;
            this.repository = repository;

            RetrieveData();
        }
        public void UserListPageLoaded()
        {
            var userListPage = new UserListPage(this.driver);

            userListPage.NavigateTo();

            userListPage.AssertUserListPageIsLoaded("Users");
        }
        public void DeleteUsers()
        {
            var userListPage = new UserListPage(driver);

            userListPage.LogIn();
            userListPage.NavigateTo();
            userListPage.Delete();
        }
Ejemplo n.º 6
0
        public void WDeleteTestUser()
        {
            var userListPage = new UserListPage(driver);

            userListPage.LogIn();
            userListPage.NavigateTo();
            userListPage.DeleteTestUser();
        }
Ejemplo n.º 7
0
        public GenHomeTabPage()
        {
            navigationListView = new ListView
            {
                ItemTemplate = new DataTemplate(typeof(NavigationCell)),
                ItemsSource  = GlobalVars.NavigationChoices
            };

            this.Title = GlobalVars.appTitle;

            Command <Type> navigateCommand =
                new Command <Type>(async(Type pageType) =>
            {
                Page page = (Page)Activator.CreateInstance(pageType);
                await this.Navigation.PushAsync(page);
            });

            var MapPage = new ContentPage
            {
                Title   = GlobalVars.navigationTitle,
                Content = new StackLayout
                {
                    // Edit children here to add additional navigation options besides just maps.
                    Children =
                    {
                        //headerLayout,
                        navigationListView
                    }
                }
            };

            searchPage = new GenSearchPage();

            userListPage = new UserListPage();

            Children.Add(MapPage);
            Children.Add(searchPage);
            Children.Add(userListPage);

            Xamarin.Forms.PlatformConfiguration.AndroidSpecific.TabbedPage.SetIsSwipePagingEnabled(this, true);

            // Define a selected handler for the ListView.
            navigationListView.ItemSelected += (async(sender, args) => {
                if (args.SelectedItem != null)
                {
                    DetailChoice selectedDetailChoice = (DetailChoice)args.SelectedItem;

                    if (selectedDetailChoice.data.ToLower().StartsWith("http:") || selectedDetailChoice.data.ToLower().StartsWith("https:"))
                    {
                        await CrossShare.Current.OpenBrowser(selectedDetailChoice.data, null);
                    }
                    else
                    {
                        Page page = (Page)Activator.CreateInstance(selectedDetailChoice.pageType);
                        page.BindingContext = selectedDetailChoice;
                        //this.IsPresented = false;
                        await this.Navigation.PushAsync(page);
                    }
                }
            });
        }