Example #1
0
        public void GateCreatedByAdminIsNotVisibleByUser()
        {
            LoginWidget loginWidget = LoginPage.Navigate(Driver).GetLoginWidget();

            LoginPage.MaximizeWindowSize(Driver);

            loginWidget.EmailInputElement.SendKeys(LoginPage.AdminEmail);
            loginWidget.PasswordInputElement.SendKeys(LoginPage.AdminPassword);
            MainPage mainPage = loginWidget.Login();

            loginWidget.WaitForMainPage();

            NavbarWidget navbarWidget = mainPage.GetNavbarWidget();

            GatesPage gatesPage = navbarWidget.NavigateToGates();

            navbarWidget.WaitForGatePage();

            GateListWidget gateListWidget = gatesPage.GetGateListWidget();

            gateListWidget.CreateGate();
            gateListWidget.WaitCreateGateWidget();

            CreateGateWidget createGateWidget = gatesPage.GetCreateGateWidget();

            createGateWidget.NameInputElement.SendKeys("test");
            createGateWidget.Create();

            TitleWidget titleWidget = mainPage.GetTitleWidget();

            titleWidget.Logout();

            loginWidget.EmailInputElement.SendKeys(LoginPage.UserEmail);
            loginWidget.PasswordInputElement.SendKeys(LoginPage.UserPassword);
            loginWidget.Login();
            loginWidget.WaitForMainPage();

            navbarWidget.NavigateToGates();

            var nameList = gateListWidget.GetAllTableNameData();

            CollectionAssert.DoesNotContain(nameList, "test");
        }
Example #2
0
        public void GetShortTitle_SplitHyphen()
        {
            var s = "workspacer - Visual Studio Code";

            Assert.Equal("Visual Studio Code", TitleWidget.GetShortTitle(s));
        }
Example #3
0
        public void GetShortTitle_EmptyString()
        {
            var s = "";

            Assert.Equal("", TitleWidget.GetShortTitle(s));
        }
Example #4
0
        public void GetShortTitle_NoSeparators()
        {
            var s = "Visual Studio Code";

            Assert.Equal("Visual Studio Code", TitleWidget.GetShortTitle(s));
        }
Example #5
0
    public GladeApp(string[] args)
    {
        program = new Gnome.Program ("mCatalog", "1.0", Gnome.Modules.UI, args);
        Mono.Posix.Catalog.Init ("mcatalog", Defines.GNOME_LOCALE_DIR);

        // Proxy Setup
        bool use_proxy = Conf.Get ("/system/http_proxy/use_http_proxy", false);

        if (use_proxy) {
            string proxy_host = Conf.Get ("/system/http_proxy/host", "");
            int proxy_port = Conf.Get ("/system/http_proxy/port", 8080);
            string proxy = string.Format("http://{0}:{1}/", proxy_host, proxy_port);
            WebProxy proxyObject = new WebProxy(proxy, true);
            System.Net.GlobalProxySelection.Select = proxyObject;
        }

        database = new Database (Conf.HomeDir+"/db.db");
        database.Debug = true;

        Glade.XML gxml = new Glade.XML (null, "mainwindow.glade", "app1", "mcatalog");
        gxml.Autoconnect (this);
        app1.DeleteEvent += OnWindowDeleteEvent;

        presentation = new Presentation ();
        itemShelf = new ItemShelf (presentation);
        swPresentation.AddWithViewport (presentation);
        presentation.Init ();

        searchEntry.Activated += OnSearchEntryActivated;

        itemListPaned.SizeRequested += OnItemListPanedResized;

        // Fill the list hbox
        HBox hBoxList = (HBox)gxml["hBoxList"];
        buttonList = new ToggleButton ();
        buttonList.Clicked += OnButtonListClicked;
        Gtk.Image image1 = new Gtk.Image (new Gdk.Pixbuf (null, "list.png"));
        image1.Visible = true;
        buttonList.Add (image1);
        buttonList.Relief = ReliefStyle.Half;
        hBoxList.PackStart (buttonList, false, true, 0);
        buttonShelf = new ToggleButton ();
        buttonShelf.Clicked += OnButtonShelfClicked;
        Gtk.Image image2 = new Gtk.Image (new Gdk.Pixbuf (null, "shelf.png"));
        image2.Visible = true;
        buttonShelf.Add (image2);
        buttonShelf.Relief = ReliefStyle.Half;
        hBoxList.PackStart (buttonShelf, false, true, 0);
        titleWidget = new TitleWidget ();
        titleWidget.OnOrderChanged += OnOrderChanged;
        hBoxList.PackStart (titleWidget, true, true, 4);
        hBoxList.ShowAll();

        // Get the menu items we need to handle
        menuItemAddItem.Sensitive = false;
        menuItemRemoveItem.Sensitive = false;
        menuItemShelfView.Data["view"] = View.Shelf;
        menuItemListView.Data["view"] = View.List;

        menuItemShelfView.Toggled += OnViewToggled;

        // Buttons
        addItemButton.Sensitive = false;
        removeItemButton.Sensitive = false;
        lendItemButton.Sensitive = false;
        editItemButton.Sensitive = false;

        lendItemButton.Clicked += LendOrReturnItem;
        editItemButton.Clicked += EditItem;

        // Populate the catalog tree
        PopulateCatalogs ();
        PopulateBorrowers ();

        app1.ShowAll();
        RestoreWindowState ();
        program.Run();
    }