private void AddUserTable(string bjHtml, string kingHtml, string bigFanHtml) { if (ChatBrowser.InvokeRequired) { var ci = new Control_Invoker_ParamStrs(AddUserTable); this.BeginInvoke(ci, bjHtml, kingHtml, bigFanHtml); } else { if (!string.IsNullOrEmpty(bjHtml)) { UserBrowser.ExecuteScriptAsync("AddUserHtml", new object[] { "sTopFanStarBalloon_BJ", bjHtml }); } if (!string.IsNullOrEmpty(kingHtml)) { UserBrowser.ExecuteScriptAsync("AddUserHtml", new object[] { "sTopFanStarBalloon_King", kingHtml }); } if (!string.IsNullOrEmpty(bigFanHtml)) { UserBrowser.ExecuteScriptAsync("AddUserHtml", new object[] { "sTopFanStarBalloon_BigFan", bigFanHtml }); } } }
public void LogResult(TestContext context, ScenarioContext scenarioContext) { if (_browsers == null) { return; } if (_browsers.Count.Equals(0)) { context.CurrentUser = context.Test.Users.Count.Equals(0) ? new UserDto() { UserType = UserType.Individual, Username = "******" } : Users.GetDefaultParticipantUser(context.Test.Users); var browser = new UserBrowser() .SetBaseUrl(context.VideoWebConfig.VhServices.VideoWebUrl) .SetTargetDevice(context.VideoWebConfig.TestConfig.TargetDevice) .SetTargetBrowser(context.VideoWebConfig.TestConfig.TargetBrowser) .SetDriver(context.Driver); _browsers.Add(context.CurrentUser, browser); } DriverManager.LogTestResult( context.VideoWebConfig.SauceLabsConfiguration.RunningOnSauceLabs(), _browsers[context.CurrentUser].Driver, scenarioContext.TestError == null); }
public AllocateUsersSteps(UserBrowser browser, TestContext testContext, CommonSharedSteps commonSharedSteps, ProgressionSteps progressionSteps) { _browser = browser; _c = testContext; _commonSharedSteps = commonSharedSteps; _progressionSteps = progressionSteps; }
public ProgressionSteps(UserBrowser browser, LoginSteps loginSteps, BrowserSteps browserSteps, CreateHearingsSteps createHearingsSteps) { _browser = browser; _loginSteps = loginSteps; _browserSteps = browserSteps; _createHearingsSteps = createHearingsSteps; }
public static void Delete(UserBrowser browser, By element, int textLength) { textLength.Should().BeGreaterThan(0); for (var i = 0; i < textLength; i++) { browser.Driver.WaitUntilVisible(element).SendKeys(Keys.Backspace); } }
public static UserBrowser GetBrowserInfo() { var browser = new UserBrowser { Name = HttpContext.Current.Request.Browser.Browser, Version = HttpContext.Current.Request.Browser.Version, Platform = HttpContext.Current.Request.Browser.Platform, IsMobileDevice = HttpContext.Current.Request.Browser.IsMobileDevice, }; return(browser); }
public void GivenANewBrowserIsOpenForAUser(string userTypeString) { var userType = GetUserType(userTypeString); AllocateUser(userType); _browser = _browser .SetBaseUrl(_c.Config.Services.TestWebUrl) .SetTargetBrowser(_c.Config.TestSettings.TargetBrowser) .SetTargetDevice(_c.Config.TestSettings.TargetDevice) .SetDriver(_c.Driver); _browser.LaunchBrowser(); _browser.NavigateToPage(); }
private void DellUserTable(string delHtml) { if (UserBrowser.InvokeRequired) { var ci = new Control_Invoker_ParamStr(DellUserTable); this.BeginInvoke(ci, delHtml); } else { if (!string.IsNullOrEmpty(delHtml)) { UserBrowser.ExecuteScriptAsync("DelUserHtml", new object[] { delHtml }); } } }
public void InitUserBrowser() { if (UserBrowser != null) { UserBrowser.LoadHtml(HtmlFormat.UserContainerHtml); return; } UserBrowser = new ChromiumWebBrowser("") { Name = "UserBrowser" }; UserBrowser.LoadHtml(HtmlFormat.UserContainerHtml); splitContainer1.Panel1.Controls.Add(UserBrowser); UserBrowser.Dock = DockStyle.Fill; }
public void Android_Tablet_Simulator() { var driverOptions = new DriverOptions { TargetDevice = TargetDevice.Tablet, TargetOS = TargetOS.Android, TargetBrowser = TargetBrowser.Chrome, TargetDeviceOrientation = TargetDeviceOrientation.LANDSCAPE }; _browser = new UserBrowser() .SetBaseUrl(_config.Url) .SetTargetDevice(TargetDevice.Tablet) .SetTargetBrowser(TargetBrowser.Chrome) .SetDriver(new DriverSetup(GetSauceLabsSettings(), driverOptions, GetSauceLabsOptions())); RunTest(); }
public void IOS_Tablet_Real_Device() { var driverOptions = new DriverOptions { RealDevice = true, TargetDevice = TargetDevice.Tablet, TargetOS = TargetOS.iOS, TargetBrowser = TargetBrowser.Safari, TargetDeviceOrientation = TargetDeviceOrientation.LANDSCAPE }; _browser = new UserBrowser() .SetBaseUrl(_config.Url) .SetTargetDevice(TargetDevice.Tablet) .SetTargetBrowser(TargetBrowser.Safari) .SetDriver(new DriverSetup(new SauceLabsSettingsConfig(), driverOptions, new SauceLabsOptions())); RunTest(); }
public static void VerifyOnce(UserBrowser browser, By element, string expected) { const int RETRIES = 10; const int DELAY = 2; var actual = ""; for (var i = 0; i < RETRIES; i++) { actual = browser.Driver.WaitUntilVisible(element).GetProperty("value"); actual = actual.Replace("\r\n", "."); actual = actual.Replace("\n", "."); if (actual.Contains(expected)) { return; } Thread.Sleep(TimeSpan.FromSeconds(DELAY)); } throw new DataException($"Failed to find the expected text '{expected}' after {RETRIES * DELAY} seconds. Text was '{actual}'"); }
public void LogResult(TestContext context, ScenarioContext scenarioContext) { if (_browsers == null) { return; } if (_browsers.Count.Equals(0)) { context.CurrentUser = context.Users.First(x => x.UserType == UserType.Individual); var browser = new UserBrowser() .SetBaseUrl(context.WebConfig.VhServices.ServiceWebUrl) .SetTargetBrowser(context.WebConfig.TestConfig.TargetBrowser) .SetTargetDevice(context.WebConfig.TestConfig.TargetDevice) .SetDriver(context.Driver); _browsers.Add(context.CurrentUser, browser); } DriverManager.LogTestResult( context.WebConfig.SauceLabsConfiguration.RunningOnSauceLabs(), _browsers[context.CurrentUser].Driver, scenarioContext.TestError == null); }
public static bool IsWebSearch() { string user_agent = HttpContext.Current.Request.UserAgent; if (null == user_agent || string.Empty == user_agent) { return(true); } else { user_agent = user_agent.ToLower(); } for (int i = 0; i < _WebSearchList.Length; i++) { if (-1 != user_agent.IndexOf(_WebSearchList[i])) { return(true); } } return(UserBrowser.Equals("Unknown")); }
public AccessibilitySteps(UserBrowser browser) { _browser = browser; }
public GetChatMessages(UserBrowser browser) { _browser = browser; _chatMessages = new List <ChatMessage>(); }
public EventsSteps(UserBrowser browser, TestContext testContext, CommonSharedSteps commonSharedSteps) { _browser = browser; _c = testContext; _commonSharedSteps = commonSharedSteps; }
public void IOS_Mobile() { _browser = GetBrowser(TargetOS.iOS, TargetBrowser.Safari); RunTest(); }
public void Android_Mobile() { _browser = GetBrowser(TargetOS.Android, TargetBrowser.Chrome); RunTest(); }
public void Latest_Win_Chrome() { _browser = GetBrowser(TargetOS.Windows, TargetBrowser.Chrome); RunTest(); }
public SummarySteps(UserBrowser browser, TestContext testContext, BrowserSteps browserSteps) { _browser = browser; _c = testContext; _browserSteps = browserSteps; }
public void Latest_Win_Firefox() { _browser = GetBrowser(TargetOS.Windows, TargetBrowser.Firefox); RunTest(); }
public void Latest_Win_EdgeChromium() { _browser = GetBrowser(TargetOS.Windows, TargetBrowser.EdgeChromium); RunTest(); }
public DeleteHearingsSteps(UserBrowser browser, TestContext testContext, ScenarioContext scenario) { _browser = browser; _c = testContext; _scenario = scenario; }
public void Latest_Win_IE11() { _browser = GetBrowser(TargetOS.Windows, TargetBrowser.Ie11); RunIETest(); }
public void Latest_MacOS_Chrome() { _browser = GetBrowser(TargetOS.MacOs, TargetBrowser.Chrome); RunTest(); }
public GetHearingRow WithDriver(UserBrowser browser) { _browser = browser; return(this); }
public CreateHearingsSteps(UserBrowser browser, TestContext testContext, CommonSharedSteps commonSharedSteps) { _browser = browser; _c = testContext; _commonSharedSteps = commonSharedSteps; }
public VerifyVideoIsPlayingBuilder(UserBrowser browser) { _browser = browser; }
public LoginSteps(UserBrowser browser, TestContext testContext) { _browser = browser; _c = testContext; }