Ejemplo n.º 1
0
        public void ByText()
        {
            // Text
            FlutterDriver.Click(FlutterBy.Text("FUT: FlutterBy.Text (Increment 1)"));

            AssertCounterIs("1", because: "we pressed the Add+1 button");
        }
Ejemplo n.º 2
0
        public void NavigateToTextTestPage()
        {
            FlutterDriver.Click(FlutterBy.Text("Navigate to Taps Test Page"));

            FlutterDriver.WaitFor(FlutterBy.Text("Taps Page"));

            FlutterDriver.GetText(FlutterBy.ValueKey("tapCounter")).Should().Be("0", because: "the counter is initially 0");
        }
Ejemplo n.º 3
0
        public void SetupScreenshotTests()
        {
            // NOTE: If we take the screenshot immediately on app startup, we occasionally get this error:
            // Original error: {"code":-32000,"message":"Could not capture image screenshot."}
            //
            // So its better to wait for some state to converge first
            FlutterDriver.WaitFor(FlutterBy.Text("Navigate to Finders and Position Test Page"));

            OutputPath = System.IO.Path.Combine(TestContext.TestRunResultsDirectory, $"{DateTime.Now.ToString("yyyyMMddHHmmss")}.png");
        }
Ejemplo n.º 4
0
        public void ByText(string inputText, string nodeOutputAsBase64)
        {
            // NodeJs Snippet:
            // console.log(find.byText(null))
            // console.log(find.byText(""))
            // console.log(find.byText(" "))
            // console.log(find.byText("theText"))

            // Output:
            // eyJmaW5kZXJUeXBlIjoiQnlUZXh0IiwidGV4dCI6bnVsbH0
            // eyJmaW5kZXJUeXBlIjoiQnlUZXh0IiwidGV4dCI6IiJ9
            // eyJmaW5kZXJUeXBlIjoiQnlUZXh0IiwidGV4dCI6IiAifQ
            // eyJmaW5kZXJUeXBlIjoiQnlUZXh0IiwidGV4dCI6InRoZVRleHQifQ
            var asPageBackFinder = FlutterBy.Text(inputText);

            var asBase64 = asPageBackFinder.ToBase64();

            asBase64.Should().Be(nodeOutputAsBase64, because: "the Base64 Serialization should match the NodeJs version");
        }
Ejemplo n.º 5
0
 public void NavigateToFindersPage()
 {
     FlutterDriver.Click(FlutterBy.Text("Navigate to Finders and Position Test Page"));
 }
Ejemplo n.º 6
0
        public void NavigateToPageback()
        {
            FlutterDriver.Click(FlutterBy.Text("Navigate to Finders and Position Test Page"));

            FlutterDriver.WaitForAbsent(FlutterBy.Text("Navigate to Finders and Position Test Page"));
        }
Ejemplo n.º 7
0
        public void PageBack()
        {
            FlutterDriver.Click(FlutterBy.PageBack());

            FlutterDriver.WaitFor(FlutterBy.Text("Navigate to Finders and Position Test Page"));
        }
Ejemplo n.º 8
0
        public void NavigateToTextTestPage()
        {
            FlutterDriver.Click(FlutterBy.Text("Navigate to Text Fields Test Page"));

            FlutterDriver.WaitFor(TextFieldControl);
        }