Пример #1
0
 public void CLoseChrome(string desktopPath, string chromeClosePath, string leavePath)
 {
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktopPath, chromeClosePath));
     System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(leavePath),
                                         TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait)));
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktopPath, leavePath));
 }
Пример #2
0
 public void FindAndOpenChrome(string desktopPath, string chromePath)
 {
     System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(chromePath),
                                         TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait)));
     subImageCoordinate = ImageWorker.FindSubImageCoordinate(desktopPath, chromePath);
     MouseMethods.LMBClick(subImageCoordinate);
 }
Пример #3
0
 public void FindSearchFieldAndGoToTheTestSite(string desktopPath, string searchPath)
 {
     System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(searchPath),
                                         TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait)));
     subImageCoordinate = ImageWorker.FindSubImageCoordinate(desktopPath, searchPath);
     MouseMethods.LMBClick(subImageCoordinate.X + 100, subImageCoordinate.Y);
     KeyboardMethods.TypeText(SikuliTestData.TestSite);
     KeyboardMethods.PressEnter();
 }
Пример #4
0
 public void MouseMethodsTest()
 {
     Assert.IsTrue(ImageWorker.IsSubImageExist(DesktopPath, ExplorerPath));
     _clickPoint = ImageWorker.FindSubImageCoordinate(DesktopPath, ExplorerPath);
     MouseMethods.MoveToElemment(_clickPoint);
     MouseMethods.RMBClick(_clickPoint);
     MouseMethods.LMBClick(_clickPoint);
     MouseMethods.MoveToElemment(0, 0);
 }
Пример #5
0
 public void SiteTestMethod()
 {
     actions.FindAndOpenChrome(desktop, chrome);
     Logger.Instance.Info($"Open site: {SikuliTestData.TestSite}");
     actions.FindSearchFieldAndGoToTheTestSite(desktop, search);
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(mainPageWithDialog),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that main site form with dialog window is open");
     Logger.Instance.Info("Close dialog window");
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktop, closeButton));
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(mainPage),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that main site form without dialog window is open");
     Logger.Instance.Info("Open 'furnish your room' list");
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktop, furnishYourRoomButton));
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(itemsList),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that 'furnish your room' items list is open");
     Logger.Instance.Info("Select 'dinig room' section");
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktop, diningRoom));
     Logger.Instance.Info("Select bar cheir and move it on workspace");
     actions.MoveCheirOnWorkspace(desktop, cheir);
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(cheirOnWorkspace),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))), "Verify that chair is on the workspace");
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(etalonCheir),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that chair is on the workspace is etalon");
     Logger.Instance.Info("Click on chair to verify it data");
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktop, etalonCheir));
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(cheirName),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that chair has right name");
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(cheirProperties),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that chair has right name");
     Logger.Instance.Info("Remove chair from workspace");
     MouseMethods.LMBClick(ImageWorker.FindSubImageCoordinate(desktop, deleteButton));
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(emptyScene),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))),
                 "Verify that chair was remove");
     Assert.True(System.Threading.SpinWait.SpinUntil(() => ImageWorker.IsSubImageExist(sceneInfo),
                                                     TimeSpan.FromSeconds(int.Parse(SikuliTestData.DefaultWait))), "Verify that scene has default parameters");
     actions.CLoseChrome(desktop, closeChrome, leaveSiteButton);
 }