예제 #1
0
파일: QC.cs 프로젝트: coastcdl/autotester
        public static void LeftTree()
        {
            TestBrowser browser = new TestBrowser();
            //string url = @"http://cnst50063845:8080/qcbin/start_a.htm";
            //browser.Load(url);
            string title = "Mercury Quality Center 9.0";
            browser.Find(title);
            browser.Wait(10);

            MSAATestObjectPool pool = new MSAATestObjectPool();
            pool.SetTestBrowser(browser);

            MSAATestGUIObject obj = (MSAATestGUIObject)pool.GetObjectByPoint(150, 265); //pool.GetObjectByName("Data_Bank");
            obj.Hover();
        }
예제 #2
0
파일: QC.cs 프로젝트: coastcdl/autotester
        public static void Login()
        {
            TestBrowser browser = new TestBrowser();
            string url = @"http://cnst50063845:8080/qcbin/start_a.htm";
            browser.Load(url);
            string title = "Mercury Quality Center 9.0";
            //browser.Find(title);
            browser.Wait(10);

            MSAATestObjectPool pool = new MSAATestObjectPool();
            pool.SetTestBrowser(browser);

            MSAATestButton btn;
            btn = (MSAATestButton)pool.GetObjectByType("button", "Authenticate", 0);
            btn.Click();

            browser.Wait(1);

            btn = (MSAATestButton)pool.GetObjectByType("button", "Login", 0);
            btn.Click();

            browser.Wait(10);
        }
예제 #3
0
 public InteractionsPage(TestBrowser browser)
 {
     Browser = browser;
 }
예제 #4
0
 public TestBrowserFluent(BrowserHistory history, TestBrowser browser)
 {
     this.history = history;
     this.browser = browser;
 }
예제 #5
0
 public HomePage(TestBrowser browser)
 {
     Browser = browser;
 }
 public AutomationPracticeSwitchWindowsPage(TestBrowser browser)
 {
     Browser = browser;
 }
        private void load(TestBrowser browser)
        {
            this.browser = browser;

            InternalChild = new FillFlowContainer
            {
                RelativeSizeAxes = Axes.Y,
                AutoSizeAxes     = Axes.X,
                Direction        = FillDirection.Horizontal,
                Spacing          = new Vector2(5),
                Children         = new Drawable[]
                {
                    playbackControls = new FillFlowContainer
                    {
                        AutoSizeAxes     = Axes.X,
                        RelativeSizeAxes = Axes.Y,
                        Spacing          = new Vector2(5),
                        Direction        = FillDirection.Horizontal,
                        Children         = new Drawable[]
                        {
                            new SpriteText
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Text   = "Playback:"
                            },
                            new FrameSliderBar
                            {
                                RelativeSizeAxes = Axes.Y,
                                Width            = 250,
                                Current          = browser.CurrentFrame
                            },
                            previousButton = new RepeatButton
                            {
                                Width            = 25,
                                RelativeSizeAxes = Axes.Y,
                                BackgroundColour = Color4.MediumPurple,
                                Text             = "<",
                                Action           = previousFrame
                            },
                            nextButton = new RepeatButton
                            {
                                Width            = 25,
                                RelativeSizeAxes = Axes.Y,
                                BackgroundColour = Color4.MediumPurple,
                                Text             = ">",
                                Action           = nextFrame
                            },
                        }
                    },
                    recordButton = new Button
                    {
                        RelativeSizeAxes = Axes.Y,
                        Width            = 100,
                        Action           = changeState
                    },
                }
            };

            browser.RecordState.BindValueChanged(updateState, true);
        }
예제 #8
0
        private void load(TestBrowser browser)
        {
            this.browser = browser;
            SpriteText maxFrameCount, currentFrame;

            InternalChild = new FillFlowContainer
            {
                RelativeSizeAxes = Axes.Y,
                AutoSizeAxes     = Axes.X,
                Direction        = FillDirection.Horizontal,
                Spacing          = new Vector2(10),
                Children         = new Drawable[]
                {
                    playbackControls = new FillFlowContainer
                    {
                        AutoSizeAxes     = Axes.X,
                        RelativeSizeAxes = Axes.Y,
                        Spacing          = new Vector2(5),
                        Direction        = FillDirection.Horizontal,
                        Children         = new Drawable[]
                        {
                            new SpriteIcon
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Icon   = FontAwesome.Solid.Circle,
                                Colour = Color4.Red,
                                Size   = new Vector2(20),
                            },
                            currentFrame = new SpriteText
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Colour = FrameworkColour.Yellow,
                                Text   = "0",
                                Font   = FrameworkFont.Regular.With(fixedWidth: true)
                            },
                            new BasicSliderBar <int>
                            {
                                Anchor           = Anchor.CentreLeft,
                                Origin           = Anchor.CentreLeft,
                                Height           = 20,
                                Width            = 250,
                                Current          = browser.CurrentFrame,
                                BackgroundColour = FrameworkColour.Blue,
                            },
                            maxFrameCount = new SpriteText
                            {
                                Anchor = Anchor.CentreLeft,
                                Origin = Anchor.CentreLeft,
                                Text   = "0",
                                Font   = FrameworkFont.Regular.With(fixedWidth: true)
                            },
                        }
                    },
                    recordButton = new Button
                    {
                        RelativeSizeAxes = Axes.Y,
                        Width            = 100,
                        Action           = changeState,
                    },
                }
            };

            browser.RecordState.BindValueChanged(updateState, true);
            browser.CurrentFrame.ValueChanged    += frame => currentFrame.Text = frame.NewValue.ToString("00000");
            browser.CurrentFrame.MaxValueChanged += maxVal => maxFrameCount.Text = maxVal.ToString("00000");
        }
예제 #9
0
파일: Program.cs 프로젝트: jerkyboy/msfast
            public int Run()
            {
                if (startInfo.IsValid() == false)
                {
                    return((int)(PageDataCollectorErrors.InvalidOrMissingArguments));
                }

                _processSync = new Mutex(true, Assembly.GetAssembly(typeof(PageDataCollector)).GetName().Name, out _owned);

                if (_owned == false)
                {
                    return((int)(PageDataCollectorErrors.TestAlreadyRunning));
                }

                //Start Proxy
                if (startInfo.IsStartProxy)
                {
                    EngineSuProxyConfiguration spc = EngineSuProxyConfiguration.Default;

                    if (startInfo.ConfigFiles == null)
                    {
                        return((int)PageDataCollectorErrors.InvalidConfiguration);
                    }

                    foreach (String s in startInfo.ConfigFiles)
                    {
                        if (s == null || File.Exists(s) == false)
                        {
                            return((int)PageDataCollectorErrors.InvalidConfiguration);
                        }
                    }

                    spc.ProxyPort    = startInfo.ProxyPort;
                    spc.DumpFolder   = startInfo.DumpFolder;
                    spc.URL          = startInfo.URL;
                    spc.CollectionID = startInfo.CollectionID;

                    spc.ConfigurationFiles = startInfo.ConfigFiles;

                    try
                    {
                        proxy = new SuProxyServer(spc);
                        proxy.Start();
                    }
                    catch
                    {
                        Release();
                        return((int)(PageDataCollectorErrors.CantStartProxy));
                    }

                    startInfo.ProxyAddress = "http://localhost:" + spc.ProxyPort;
                }
                String host = null;

                try
                {
                    Uri i = new Uri(startInfo.URL);
                    host = i.Host;
                }
                catch
                {
                }

                if (String.IsNullOrEmpty(host))
                {
                    host = "msfast.myspace.com";
                }

                //Create "pre collection" test page
                String launchWith = String.Format("http://{0}?PRE_COLLECTION={1}&__r={2}&__c={3}",
                                                  host,
                                                  Convert.ToBase64String(Encoding.UTF8.GetBytes(new Uri(startInfo.URLWithCollectionArgs).AbsoluteUri.ToString())),
                                                  startInfo.CollectionID,
                                                  ((int)startInfo.CollectionType).ToString());

                if (launchWith == null)
                {
                    return((int)PageDataCollectorErrors.CantSaveTempFile);
                }

                startInfo.LaunchWithURL = launchWith;

                TestBrowser bw = null;

#if InternetExplorer
                try
                {
                    bw = new BrowserWrapperIEImpl();
                    return(bw.StartTest(startInfo));
                }
                finally{
                    if (bw != null)
                    {
                        bw.Dispose();
                    }
                }
#else
                return(0);
#endif
            }
예제 #10
0
        /// <summary>
        /// Setup an integration test run for the web project specified by building the target
        /// project using the specified configuration, launching IIS Express and starting the web
        /// driver for the requested browser.
        /// </summary>
        /// <param name="projectName">The test project name</param>
        /// <param name="browser">The browser to use</param>
        /// <param name="configuration">The build configuration to use</param>
        public static void SetupTestRun(string projectName, TestBrowser browser, string configuration = "Test")
        {
            StrixPlatform.Environment = new DefaultEnvironment();
            var projectDirectory = new DirectoryInfo(GetProjectDirectory(projectName));
            _basicHost = new IISRunner();
            _basicHost.ProjectPath = projectDirectory.EnumerateFiles("*.csproj").First().FullName;
            _basicHost.SolutionPath = projectDirectory.Parent.EnumerateFiles("*.sln").First().FullName;
            _basicHost.CleanupPublishedFiles = true;
            _basicHost.Configuration = configuration;

            switch (browser)
            {
                case TestBrowser.Chrome:
                    {
                        _driver = new ChromeDriver();
                    }
                    break;

                case TestBrowser.FireFox:
                    {
                        _driver = new FirefoxDriver();
                    }
                    break;

                case TestBrowser.InternetExplorer:
                    {
                        _driver = new InternetExplorerDriver();
                    }
                    break;
            }

            BaseUrl = _basicHost.Startup();
            _driver.Url = BaseUrl;
        }