Example #1
0
        public static void cleanup()
        {
            Browser b = Pegasus.LoginCom("seloffice");
            LocatorReader c = new LocatorReader("Common.xml");
            LocatorReader i = new LocatorReader("iFrame.xml");
            Thread.Sleep(500);

            b.Sequence
                .MoveToElement(b.FindElement((c.Get("name-dropdown"))))
                .Click(b.FindElement(c.Get("admin-link")))
                .Build().Perform();
            Thread.Sleep(2000);

            b.MouseOver(i, "integration-tab")
                .Click(i, "iframe-link")
                .Wait(1)
                .Click(i, "delete")
                .Wait(1)
                .AlertAccept()
                .Wait(1);
            Thread.Sleep(2000);

            b.Click(i, "delete")
                .Wait(1)
                .AlertAccept()
                .Wait(1);
            Thread.Sleep(2000);

            b.Quit();
        }
Example #2
0
        public static void setup(TestContext testContext)
        {
            Browser b = Pegasus.LoginCom("seloffice");
            LocatorReader c = new LocatorReader("Common.xml");
            LocatorReader i = new LocatorReader("iFrame.xml");
            Thread.Sleep(500);

            b.Sequence
                .MoveToElement(b.FindElement((c.Get("name-dropdown"))))
                .Click(b.FindElement(c.Get("admin-link")))
                .Build().Perform();
            Thread.Sleep(2000);

            b.MouseOver(i, "integration-tab")
                .Click(i, "iframe-link")
                .Wait(1)
                .Click(i, "create-button")
                .FillForm(i, "iframe-name", "iFrame 1")
                .FillForm(i, "username", "Email")
                .FillForm(i, "password", "Password")
                .FillForm(i, "login", "https://www.dropbox.com/login")
                .FillForm(i, "forgot", "https://www.dropbox.com/forgot?email_from_login="******"create", "https://www.dropbox.com/")
                .Click(i, "appear")
                .Click(i, "save-button");
            Thread.Sleep(2000);

            b.Click(i, "create-button")
                .FillForm(i, "iframe-name", "iFrame 2")
                .FillForm(i, "username", "Email")
                .FillForm(i, "password", "Password")
                .FillForm(i, "login", "https://www.dropbox.com/login")
                .FillForm(i, "forgot", "https://www.dropbox.com/forgot?email_from_login="******"create", "https://www.dropbox.com/")
                .Click(i, "appear")
                .Click(i, "save-button");
            Thread.Sleep(2000);

            b.Quit();
        }
Example #3
0
 /// <summary>
 ///     Upload a file to the selected element.
 /// </summary>
 /// <param name="r">The LocatorReader instance.</param>
 /// <param name="node">The node to get in the LocatorReader.</param>
 /// <param name="filename">The name of the file in Resources/</param>
 /// <returns>The current Browser instance.</returns>
 public Browser UploadFile(LocatorReader r, string node, string filename)
 {
     return UploadFile(r.Get(node), filename);
 }
Example #4
0
        private void CreateClient()
        {
            var merger = new LocatorReader("Merger.xml");
            var randomName = "Client " + new Random().Next(int.MaxValue);

            Browser.MouseOver(merger.Get("ClientsTab"))
                .Click(merger.Get("CreateClient"))
                .DropdownSelectByText(merger.Get("Status"), "New")
                .DropdownSelectByText(merger.Get("Responsibility"), "Test Test")
                .Click(merger.Get("CompanyDetailsTab"))
                .FillForm(merger.Get("CompanyDBAName"), randomName)
                .Click(merger.Get("Save"));
            Thread.Sleep(2000);
            Assert.AreEqual("Client saved successfully.",
                Browser.FindElement(Common.Get("flash-message")).Text);

            TestContext.Properties["client "] = randomName;
        }
Example #5
0
 public ReadOnlyCollection<IWebElement> FindElements(LocatorReader r, string node)
 {
     return FindElements(r.Get(node));
 }
Example #6
0
 public Browser MouseOver(LocatorReader r, params string[] nodes)
 {
     return MouseOver(nodes.ToList().Select(e => r.Get(e)).ToArray());
 }
Example #7
0
 public Browser FillFormReplace(LocatorReader r, string node, string value)
 {
     return FillFormReplace(r.Get(node), value);
 }
Example #8
0
 public IWebElement FindElement(LocatorReader r, string node)
 {
     return FindElement(r.Get(node));
 }
Example #9
0
 public int ElementCount(LocatorReader r, string node)
 {
     return ElementCount(r.Get(node));
 }
Example #10
0
 public bool ElementsVisible(LocatorReader r, params string[] nodes)
 {
     return ElementsVisible(nodes.ToList().Select(e => r.Get(e)).ToArray());
 }
Example #11
0
 public Browser DropdownSelectByValue(LocatorReader r, string node, string value)
 {
     return DropdownSelectByValue(r.Get(node), value);
 }
Example #12
0
 public Browser DropdownSelectByText(LocatorReader r, string node, string text)
 {
     return DropdownSelectByText(r.Get(node), text);
 }
Example #13
0
 public Browser DropdownSelectByIndex(LocatorReader r, string node, int index)
 {
     return DropdownSelectByIndex(r.Get(node), index);
 }
Example #14
0
 public Browser Click(LocatorReader r, string node)
 {
     return Click(r.Get(node));
 }
Example #15
0
 public Browser ClearForm(LocatorReader r, string node)
 {
     return ClearForm(r.Get(node));
 }