public void GetSemanticsId_ByScript() { var result = FlutterDriver.ExecuteScript("flutter:getSemanticsId", FlutterBy.Tooltip("FUT: FlutterBy.Tooltip (Increment 3)").ToBase64()); result.Should().BeOfType(typeof(long)); ((long)result).Should().NotBe(0); }
public void GetRenderObjectDiagnostics_Javascript() { var by = FlutterBy.ValueKey("counter"); var response = FlutterDriver.ExecuteScript("flutter:getRenderObjectDiagnostics", by.ToBase64(), new Dictionary <string, object>() { { "includeProperties", true }, { "subtreeDepth", 2 } }); var responseAsDictionary = response as Dictionary <string, object>; AssertGetRenderObjectDiagnosticsResponse(responseAsDictionary); }
public void WaitForAbsent_ExistsForFailQuickly_ByScript() { try { // NOTE: The final parameter is in SECONDS FlutterDriver.ExecuteScript("flutter:waitForAbsent", ControlThatAlwaysExists.ToBase64(), 1); Assert.Fail($"We should never see this statement - the control being searched for ALWAYS EXISTS; so an exception should have been thrown. "); } catch (OpenQA.Selenium.WebDriverException ex) { ex.Message.Should().Contain("Timeout while executing waitForAbsent"); } }
public void WaitFor_NeverExists_ByScript() { // TODO: Better exception try { FlutterDriver.ExecuteScript("flutter:waitFor", ControlThatNeverExists.ToBase64(), 1); Assert.Fail($"We should never see this statement - the control being searched for ALWAYS EXISTS; so an exception should have been thrown. "); } catch (OpenQA.Selenium.WebDriverException ex) { ex.Message.Should().Contain("Timeout while executing waitFor"); } }
public void WaitForAbsent_NeverExists_ByScript() { // HACK: On my own box, there is no issue - but when I run this on the CI/CD I get the following error: /* * Test method GreyhamWooHoo.Flutter.SystemTests.WaitForTests.WaitForAbsent_NeverExists_ByScript threw exception: * OpenQA.Selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Cannot execute command waitForAbsent, server reponse { * "isError": true, * "response": "Timeout while executing waitForAbsent: TimeoutException after 0:00:01.000000: Future not completed\n", * "type": "_extensionType", * "method": "ext.flutter.driver" * } */ // To get around this, I wait for the page to 'converge' first FlutterDriver.WaitFor(ControlThatAlwaysExists); // NOTE: The final parameter is in SECONDS FlutterDriver.ExecuteScript("flutter:waitForAbsent", ControlThatNeverExists.ToBase64(), 1); }
public void GetCenter_ByScript() { var response = FlutterDriver.ExecuteScript("flutter:getCenter", Control.ToBase64()); AssertPositionResultContract(response); }
public void GetTopLeft_ByScript() { var result = FlutterDriver.ExecuteScript("flutter:getTopLeft", Control.ToBase64()); AssertPositionResultContract(result); }
private Position GetPosition_ByScript(string position) { var response = FlutterDriver.ExecuteScript(position, Control.ToBase64()) as Dictionary <string, object>; return(new Position(System.Convert.ToDouble(response["dx"]), System.Convert.ToDouble(response["dy"]))); }
public void WaitFor_ByScript() { // TODO: Better exception FlutterDriver.ExecuteScript("flutter:waitFor", ControlThatAlwaysExists.ToBase64()); }
public void CheckHealth_Javascript() { var result = FlutterDriver.ExecuteScript("flutter:checkHealth"); result.Should().Be("ok"); }
public void GetRenderTree_Javascript() { var result = FlutterDriver.ExecuteScript("flutter:getRenderTree"); result.ToString().StartsWith("RenderView#").Should().BeTrue(because: "the render tree always starts with that text"); }
public void ForceGC_Javascript() { var result = FlutterDriver.ExecuteScript("flutter:forceGC"); result.Should().BeNull(); }
public void ClearTimeline_Javascript() { var result = FlutterDriver.ExecuteScript("flutter:clearTimeline"); result.Should().BeNull(); }