コード例 #1
0
            internal override void Execute(CefSharpDriver driver, Dictionary <string, bool> modifyKeys)
            {
                if (!Enum.TryParse <MouseButtonType>(button, out var buttonType))
                {
                    return;
                }
                var mouse = new MouseEmulator(driver.App);

                mouse.Up(buttonType);
            }
コード例 #2
0
 internal override void Execute(CefSharpDriver driver, Dictionary <string, bool> modifyKeys)
 {
     if (KeySpec.IsModifyKey(value))
     {
         modifyKeys.Remove(value);
         KeySpec.SimpleKeyUp(driver.App, value);
     }
     if (KeySpec.IsAzOrNumber(value))
     {
         KeySpec.SimpleKeyUp(driver.App, value);
     }
 }
コード例 #3
0
            internal override void Execute(CefSharpDriver driver, Dictionary <string, bool> modifyKeys)
            {
                var mouse = new MouseEmulator(driver.App);

                if (target == null)
                {
                    var pos = System.Windows.Forms.Cursor.Position;
                    pos.Offset(x, y);
                    mouse.Move(pos);
                }
                else
                {
                    var pos  = driver.PointToScreen(target.Location);
                    var size = target.Size;
                    pos.Offset(size.Width / 2, size.Height / 2);
                    pos.Offset(x, y);
                    mouse.Move(pos);
                }
            }
コード例 #4
0
        public void TestInitialize()
        {
            //start process.
            var process = Process.Start(ProcessPath);

            //attach by friendly.
            _app = new WindowsAppFriend(process);

            //show next dialog.
            var mainWindow = _app.WaitForIdentifyFromTypeFullName("SampleApp.MainWindow");
            var button     = new WPFButtonBase(mainWindow.Dynamic()._buttonNextDialog);

            button.EmulateClick(new Async());

            //get next dialog.
            var nextDialog = _app.WaitForIdentifyFromTypeFullName("SampleApp.NextDialog");

            //create driver.
            _driver = new CefSharpDriver(nextDialog.Dynamic()._browser);
        }
コード例 #5
0
        public void TestInitialize()
        {
            //start process.
            var dir = GetType().Assembly.Location;

            for (int i = 0; i < 4; i++)
            {
                dir = Path.GetDirectoryName(dir);
            }
            var processPath = Path.Combine(dir, @"CefSharpWPFSample\bin\x86\Debug\CefSharpWPFSample.exe");
            var process     = Process.Start(processPath);

            //attach by friendly.
            _app = new WindowsAppFriend(process);
            var main = _app.Type <Application>().Current.MainWindow;

            //create driver.
            _driver     = new CefSharpDriver(main._browser);
            _driver.Url = this.GetHtmlUrl();
        }
コード例 #6
0
 public Navigation(CefSharpDriver driver)
 => _this = driver;
コード例 #7
0
 public void OneTimeSetUp()
 => _driver = AppRunner.RunWpfApp();
コード例 #8
0
 public void OneTimeSetUp()
 => _driver = AppRunner.RunWinFormApp();
コード例 #9
0
 internal virtual void Execute(CefSharpDriver driver, Dictionary <string, bool> modifyKeys)
 {
 }