public void SetUp()
 {
     selenium = new DefaultSelenium("localhost", 4444, "*iexplore", URL);
     selenium.Start();
     selenium.Open(URL);
     silvernium = new Silvernium(selenium, OBJECTID, SCRIPTKEY);
 }
Exemplo n.º 2
0
 public void ShouldReturnAccessibilityValue()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Some Accessibility Return Value",
                                   "document['Test'].content.accessibility;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("Some Accessibility Return Value", silvernium.Accessibility());
 }
Exemplo n.º 3
0
 public void SetUp()
 {
     selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://localhost");
     selenium.Start();
     selenium.Open("http://localhost");
     silvernium = new Silvernium(selenium, "Test");
 }
Exemplo n.º 4
0
        protected string Call(string functionName, params string[] parameters)
        {
            var parametersWithPath = new List <string>();

            if (GridPath != null)
            {
                parametersWithPath.Add(GridPath);
                parametersWithPath.Add(RowIndex.ToString());
            }
            parametersWithPath.Add(Path);
            parametersWithPath.AddRange(parameters);

            const int maxRetry      = 10;
            const int sleepInterval = 500;

            for (var i = 0; i < maxRetry; i++)
            {
                try
                {
                    return(Silvernium.Call(functionName, parametersWithPath.ToArray()));
                }
                catch (SeleniumException)
                {
                    if (i < maxRetry)
                    {
                        Thread.Sleep(sleepInterval);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(null);
        }
Exemplo n.º 5
0
 protected Condition PathPresentCondition(string gridPath, int rowIndex, string path)
 {
     return(delegate
     {
         var invocationResult = Silvernium.Call("FindControl", gridPath, rowIndex.ToString(), path);
         return invocationResult != "null";
     });
 }
Exemplo n.º 6
0
 protected Condition PathPresentCondition(string path)
 {
     return(delegate
     {
         var invocationResult = Silvernium.Call("FindControl", path);
         return invocationResult != "null";
     });
 }
 public void ShouldReturnJSFunctionForDirectMethodForMSIE()
 {
     mockProcessor.ExpectAndReturn("GetEval", "MSIE", "navigator.userAgent");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("window.document['Test'].Func1();", silvernium.jsForDirectMethod("Func1"));
     Assert.AreEqual("window.document['Test'].Func2('42');", silvernium.jsForDirectMethod("Func2", "42"));
     Assert.AreEqual("window.document['Test'].Func3('42','24');",
                     silvernium.jsForDirectMethod("Func3", new[] { "42", "24" }));
 }
 public void ShouldReturnJSFunctionForContentMethodForFF2()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Firefox/2.0.0.18", "navigator.userAgent");
     silvernium = new Silvernium(selenium, "Test", "Key");
     Assert.AreEqual("document['Test'].content.Func1();", silvernium.jsForContentMethod("Func1"));
     Assert.AreEqual("document['Test'].content.Func2('42');",
                     silvernium.jsForContentMethod("Func2", "42"));
     Assert.AreEqual("document['Test'].content.Func3('42','24');",
                     silvernium.jsForContentMethod("Func3", new[] { "42", "24" }));
 }
Exemplo n.º 9
0
 public void ShouldCallSettingsProperties()
 {
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].settings.enabledFramerateCounter;");
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].settings.enableRedrawRegions;");
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].settings.enableHtmlAccess;");
     mockProcessor.ExpectAndReturn("GetEval", "42", "document['Test'].settings.maxFrameRate;");
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].settings.windowless;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.IsTrue(silvernium.EnabledFrameRateCounter());
     Assert.IsTrue(silvernium.EnableRedrawRegions());
     Assert.IsTrue(silvernium.EnableHtmlAccess());
     Assert.AreEqual(42, silvernium.MaxFrameRate());
     Assert.IsTrue(silvernium.WindowLess());
 }
Exemplo n.º 10
0
 public void ShouldReturnTrueIfVersionIsSupported()
 {
     mockProcessor.ExpectAndReturn("GetEval", "true", "document['Test'].isVersionSupported('10');");
     silvernium = new Silvernium(selenium, "Test");
     Assert.IsTrue(silvernium.IsVersionSupported("10"));
 }
Exemplo n.º 11
0
 public void ShouldReturnFullScreenAttributes()
 {
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].content.fullScreen;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.IsTrue(silvernium.FullScreen());
 }
Exemplo n.º 12
0
 public void ShouldReturnTrueIfLoaded()
 {
     mockProcessor.ExpectAndReturn("GetEval", "True", "document['Test'].isLoaded;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.IsTrue(silvernium.IsLoaded());
 }
Exemplo n.º 13
0
 public void ShouldReturnActualHeightOfMovie()
 {
     mockProcessor.ExpectAndReturn("GetEval", "42", "document['Test'].content.actualHeight;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual(42, silvernium.ActualHeight());
 }
Exemplo n.º 14
0
 public void ShouldReturnActualWidthOfMovie()
 {
     mockProcessor.ExpectAndReturn("GetEval", "24", "document['Test'].content.actualWidth;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual(24, silvernium.ActualWidth());
 }
Exemplo n.º 15
0
 public void ShouldInitParams()
 {
     mockProcessor.ExpectAndReturn("GetEval", "List of init params", "document['Test'].initParams;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("List of init params", silvernium.InitParams());
 }
 public void ShouldReturnDocumentJSPrefixForFF2()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Firefox/2.0.0.18", "navigator.userAgent");
     silvernium = new Silvernium(selenium, "test");
     Assert.AreEqual("document['test'].", silvernium.createJSPrefixDocument("test"));
 }
Exemplo n.º 17
0
 public void ShouldFindName()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Return Name", "document['Test'].content.findName('objectName');");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("Return Name", silvernium.FindName("objectName"));
 }
Exemplo n.º 18
0
 public void ShouldCreateXAMLContent()
 {
     mockProcessor.Expect("GetEval", "document['Test'].content.createFromXaml('xamlContent','namescope');");
     silvernium = new Silvernium(selenium, "Test");
     silvernium.CreateFromXAML("xamlContent", "namescope");
 }
Exemplo n.º 19
0
 public void ShouldReturnSource()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Source Code", "document['Test'].source;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("Source Code", silvernium.Source());
 }
Exemplo n.º 20
0
 public void ShouldReturnRoot()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Root Content", "document['Test'].root;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("Root Content", silvernium.Root());
 }
Exemplo n.º 21
0
 public void ShouldReturnBackgroundInformation()
 {
     mockProcessor.ExpectAndReturn("GetEval", "Bg Info", "document['Test'].settings.background;");
     silvernium = new Silvernium(selenium, "Test");
     Assert.AreEqual("Bg Info", silvernium.Background());
 }