private void enterUrl(string url) { StartSeChromeCommand cmdlet0 = //new StartSeChromeCommandTestFixture(); WebDriverFactory.Container.Resolve<StartSeChromeCommand>(); SeStartChromeCommand command0 = new SeStartChromeCommand(cmdlet0); command0.Execute(); EnterSeUrlCommand cmdlet1 = //new EnterSeURLCommandTestFixture(); WebDriverFactory.Container.Resolve<EnterSeUrlCommand>(); cmdlet1.InputObject = //new FakeWebDriver[]{ (CommonCmdletBase.UnitTestOutput[0] as FakeWebDriver) }; new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput) }; cmdlet1.Url = url; SeEnterUrlCommand command1 = new SeEnterUrlCommand(cmdlet1); command1.Execute(); ReadSeWebDriverUrlCommand cmdlet2 = //new ReadSeWebDriverUrlCommandTestFixture(); WebDriverFactory.Container.Resolve<ReadSeWebDriverUrlCommand>(); cmdlet2.InputObject = //new FakeWebDriver[]{ (CommonCmdletBase.UnitTestOutput[1] as FakeWebDriver) }; new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput) }; SeReadWebDriverUrlCommand command2 = new SeReadWebDriverUrlCommand(cmdlet2); command2.Execute(); }
//private IWebDriver startChrome(string directoryPath, bool useOptions, bool useService, int milliSeconds) private IWebDriver startChrome(string directoryPath, bool useOptions, int milliSeconds) { StartSeChromeCommand cmdlet = //new StartSeChromeCommandTestFixture(); WebDriverFactory.Container.Resolve<StartSeChromeCommand>(); if (string.Empty != directoryPath) { cmdlet.DriverDirectoryPath = directoryPath; } if (true == useOptions) { //cmdlet.Options = new FakeOptions(); //cmdlet.Options = new ChromeOptions(); //cmdlet.ChromeOptions = WebDriverFactory.GetChromeOptions(); cmdlet.ChromeOptions = // resolve ChromeOptions WebDriverFactory.Container.Resolve<OpenQA.Selenium.Chrome.ChromeOptions>(); } if (0 != milliSeconds) { cmdlet.Timeout = milliSeconds; } SeStartChromeCommand command = new SeStartChromeCommand(cmdlet); command.Execute(); return ((IWebDriver)PSTestLib.UnitTestOutput.LastOutput[0]); }
private void enterUrl(string firstUrl, string secondUrl) { StartSeChromeCommand cmdlet0 = WebDriverFactory.Container.Resolve<StartSeChromeCommand>(); SeStartChromeCommand command0 = new SeStartChromeCommand(cmdlet0); command0.Execute(); EnterSeURLCommand cmdlet1 = WebDriverFactory.Container.Resolve<EnterSeURLCommand>(); cmdlet1.InputObject = new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput[0]) }; cmdlet1.URL = firstUrl; SeEnterURLCommand command1 = new SeEnterURLCommand(cmdlet1); command1.Execute(); EnterSeURLCommand cmdlet2 = WebDriverFactory.Container.Resolve<EnterSeURLCommand>(); cmdlet2.InputObject = new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput[0]) }; cmdlet2.URL = secondUrl; SeEnterURLCommand command2 = new SeEnterURLCommand(cmdlet2); command2.Execute(); InvokeSeNavigateBackCommand cmdlet3 = WebDriverFactory.Container.Resolve<InvokeSeNavigateBackCommand>(); cmdlet3.InputObject = new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput[0]) }; SeInvokeNavigateBackCommand command3 = new SeInvokeNavigateBackCommand(cmdlet3); command3.Execute(); InvokeSeNavigateForwardCommand cmdlet4 = WebDriverFactory.Container.Resolve<InvokeSeNavigateForwardCommand>(); cmdlet4.InputObject = new FakeWebDriver[]{ ((FakeWebDriver)(object)PSTestLib.UnitTestOutput.LastOutput[0]) }; SeInvokeNavigateForwardCommand command4 = new SeInvokeNavigateForwardCommand(cmdlet4); command4.Execute(); }