コード例 #1
0
 protected BrowserTestBase(Constants.BrowserType browser, Constants.OperatingSystem operatingSystem)
 {
     Browser         = browser;
     OperatingSystem = operatingSystem;
     SiteUri         = EnvironmentSettingsRepository.SiteUrl;
     SitecoreUri     = EnvironmentSettingsRepository.SitecoreUrl;
 }
コード例 #2
0
 public ClientInformation()
 {
     _operatingSys = Constants.OperatingSystem.Win;
     _architecture = ProcessorArchitecture.x86;
     Locale        = ClientLocale.English;
     TimeZone      = 600U;
     IPAddress     = new XmlIPAddress(System.Net.IPAddress.Loopback);
 }
コード例 #3
0
        }                                                           //all port is correct?

        public LoginServerConnection(Constants.OperatingSystem opSystem, ushort version, string accountName, string password, bool openTibia, LoginServer[] loginServers, bool debug)
        {
            this.version         = version;
            this.accName         = accountName;
            this.password        = password;
            this.ot              = openTibia;
            this.debug           = debug;
            this.loginServers    = loginServers;
            this.maxLoginServers = loginServers.Length;
            this.os              = (byte)opSystem;
        }
コード例 #4
0
 public GameServerConnection(Constants.OperatingSystem opSystem, ushort version, string accountName,
                             string password, bool openTibia, bool debug, string charName, string serverIp, ushort port)
 {
     this.version  = version;
     this.accName  = accountName;
     this.password = password;
     this.ot       = openTibia;
     this.debug    = debug;
     this.os       = (byte)opSystem;
     this.charName = charName;
     this.serverIp = serverIp;
     this.port     = port;
 }
コード例 #5
0
 public LoginServerConnection(Constants.OperatingSystem opSystem, ushort version, string accountName, string password, bool openTibia, bool debug) :
     this(opSystem, version, accountName, password, openTibia,
          new LoginServer[] {
     new LoginServer("pxg210.loginto.me", 7009),
     new LoginServer("pxg209.loginto.me", 7009),
     new LoginServer("pxg208.loginto.me", 7009),
     new LoginServer("pxg207.loginto.me", 7009),
     new LoginServer("pxg206.loginto.me", 7009),
     new LoginServer("pxg205.loginto.me", 7009),
     new LoginServer("pxg203.loginto.me", 7009),
     new LoginServer("pxg203.loginto.me", 7009),
     new LoginServer("pxg202.loginto.me", 7009),
     new LoginServer("pxg201.loginto.me", 7009)
 }, debug)
 {
 }                                                           //all port is correct?
コード例 #6
0
 public LoginServerConnection(Constants.OperatingSystem opSystem, ushort version, string accountName, string password, bool openTibia, bool debug) :
     this(opSystem, version, accountName, password, openTibia,
          new LoginServer[] {
     new LoginServer("login01.tibia.com", 7171),
     new LoginServer("login02.tibia.com", 7171),
     new LoginServer("login03.tibia.com", 7171),
     new LoginServer("login04.tibia.com", 7171),
     new LoginServer("login05.tibia.com", 7171),
     new LoginServer("tibia01.cipsoft.com", 7171),
     new LoginServer("tibia02.cipsoft.com", 7171),
     new LoginServer("tibia03.cipsoft.com", 7171),
     new LoginServer("tibia04.cipsoft.com", 7171),
     new LoginServer("tibia05.cipsoft.com", 7171)
 }, debug)
 {
 }
コード例 #7
0
 protected BrowserTestBase(Constants.BrowserType browser, Constants.OperatingSystem operatingSystem)
 {
     Browser         = browser;
     OperatingSystem = operatingSystem;
 }
コード例 #8
0
        public WebDriverConfiguration GetBrowser(Constants.BrowserType browser, Constants.OperatingSystem operatingSystem)
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability("browserstack.user", BrowserStackUser());
            capabilities.SetCapability("browserstack.key", BrowserStackKey());
            capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);
            capabilities.SetCapability("browserstack.debug", BrowserstackDebug());
            capabilities.SetCapability("browserstack.local", BrowserstackLocal());
            capabilities.SetCapability("browserstack.video", BrowserstackVideo());

            //Set selenium version to latest (default is 2.53.0) to avoid error in reading cookies in Edge
            capabilities.SetCapability("browserstack.selenium_version", "3.11.0");
            capabilities.SetCapability("project", Assembly.GetCallingAssembly().GetName().Name);

            string name = TestContext.CurrentContext.Test.Name;

            name = NameRegex.Replace(name, string.Empty);

            capabilities.SetCapability("name", name);

            string browserStackIndentifier = BrowserStackIndentifier();

            if (string.IsNullOrEmpty(browserStackIndentifier))
            {
                browserStackIndentifier = Environment.MachineName;
            }

            capabilities.SetCapability("browserstack.localIdentifier", browserStackIndentifier);

            capabilities.SetCapability("resolution", BrowserStackResolution());

            switch (operatingSystem)
            {
            case Constants.OperatingSystem.Windows:
                capabilities.SetCapability("os", "WINDOWS");
                capabilities.SetCapability("os_version", 10);
                break;

            case Constants.OperatingSystem.IPad:
                capabilities.SetCapability("platform", "MAC");
                capabilities.SetCapability("device", "iPad Pro");
                capabilities.SetCapability("deviceOrientation", "landscape");
                capabilities.SetCapability("realMobile",
                                           false); // Currently (2017-08-31) no real devices of this type.
                break;

            case Constants.OperatingSystem.IPhone:
                capabilities.SetCapability("platform", "MAC");
                capabilities.SetCapability("device", "iPhone 7");
                capabilities.SetCapability("realMobile", !BrowserStackUseEmulator());
                break;

            case Constants.OperatingSystem.GalaxyS7:
                capabilities.SetCapability("platform", "ANDROID");
                capabilities.SetCapability("device", "Samsung Galaxy S7");
                capabilities.SetCapability("realMobile", !BrowserStackUseEmulator());
                break;

            case Constants.OperatingSystem.GalaxyTab:
                capabilities.SetCapability("platform", "ANDROID");
                capabilities.SetCapability("device",
                                           BrowserStackUseEmulator()
                            ? "Samsung Galaxy Tab 4 10.1"
                            : "Samsung Galaxy Tab 4");
                capabilities.SetCapability("deviceOrientation", "landscape");
                capabilities.SetCapability("realMobile", !BrowserStackUseEmulator());
                break;
            }

            switch (browser)
            {
            case Constants.BrowserType.Chrome:
                capabilities.SetCapability("browserName", "Chrome");

                // This does not seem to have any effect on BrowserStack but it does locally.
                capabilities.SetCapability("browser.profile.managed_default_content_settings.images", 2);
                capabilities.SetCapability("browser.profile.default_content_settings.state.flash", 0);
                break;

            case Constants.BrowserType.Android:
                capabilities.SetCapability("browserName", "android");
                break;

            case Constants.BrowserType.FireFox:
                capabilities.SetCapability("browserName", "Firefox");
                break;

            case Constants.BrowserType.InternetExplorer:
                capabilities.SetCapability("browserName", "IE");
                capabilities.SetCapability("browser_version", 11);
                capabilities.SetCapability("browserstack.ie.noFlash", true);
                // Use for IE 11 and older.
                capabilities.SetCapability("ie.usePerProcessProxy", true);
                break;

            case Constants.BrowserType.Edge:
                capabilities.SetCapability("browserName", "Edge");
                break;

            case Constants.BrowserType.Safari:
                capabilities.SetCapability("browserName", "Safari");
                capabilities.SetCapability("browser_version", 10);
                break;
            }

            WebDriverConfiguration webDriverConfiguration = new WebDriverConfigurationFactory().Create();

            try
            {
                webDriverConfiguration.WebDriver = new RemoteWebDriver(
                    BrowserStackUrl(),
                    capabilities,
                    TimeSpan.FromSeconds(Constants.Timeouts.BrowserStackCommandTimeout));

                webDriverConfiguration.SessionId = ((RemoteWebDriver)webDriverConfiguration.WebDriver).SessionId;
            }
            catch (Exception ex)
            {
                throw new ServerException(
                          FormattableString.Invariant(
                              $"Failed estabilishing a connection to browserstack, browserstack.localIdentifier: {capabilities.GetCapability("browserstack.localIdentifier").ToString()}"),
                          ex);
            }

            return(webDriverConfiguration);
        }
コード例 #9
0
 protected UserInterfaceBase(Constants.BrowserType browser, Constants.OperatingSystem operatingSystem) : base(browser, operatingSystem)
 {
 }
コード例 #10
0
 public GameServerConnection(Constants.OperatingSystem opSystem, ushort version, string accountName,
                             string password, bool openTibia, bool debug, CharacterLoginInfo charInfo) :
     this(opSystem, version, accountName, password, openTibia, debug, charInfo.CharName, charInfo.WorldIPString, charInfo.WorldPort)
 {
 }