public void GetBrowserWindow_WithDynamicWindowTitle_CanInteractWithWindow() { // Arrange string page2GenericWindowTitle = "window title 2"; string page2DynamicGenericWindowTitle = "the window title changed"; string homePageGenericWindowTitle = "Clicking the buttons changes the window title"; DynamicBrowserWindowTitleRepository home = BrowserWindowUnderTest.Launch <DynamicBrowserWindowTitleRepository>(currentDirectory + "/DynamicBrowserWindowTitle.html"); home.btnGoToPage2.Click(); DynamicBrowserWindowTitleRepository page2 = DynamicBrowserWindowUnderTest.GetBrowserWindow <DynamicBrowserWindowTitleRepository>(page2GenericWindowTitle); page2.btnChangeWindowTitle.Click(); // Checkpoint Assert.IsTrue(page2.Title.Contains(page2DynamicGenericWindowTitle), page2.Title); // Act page2 = DynamicBrowserWindowUnderTest.GetBrowserWindow <DynamicBrowserWindowTitleRepository>(page2DynamicGenericWindowTitle); page2.btnGoToHomePage.Click(); page2.SetWindowTitle(homePageGenericWindowTitle); // Assert Assert.IsTrue(page2.Title.Contains(homePageGenericWindowTitle), page2.Title); page2.Close(); }
public void GetBrowserWindow_WithDynamicWindowTitle_CanGetNewWindowTitle() { string page1GenericWindowTitle = "window title 1"; // Arrange DynamicBrowserWindowTitleRepository home = BrowserWindowUnderTest.Launch <DynamicBrowserWindowTitleRepository>(currentDirectory + "/DynamicBrowserWindowTitle.html"); home.btnGoToPage1.Click(); // Act DynamicBrowserWindowTitleRepository page1 = DynamicBrowserWindowUnderTest.GetBrowserWindow <DynamicBrowserWindowTitleRepository>(page1GenericWindowTitle); // Assert Assert.IsTrue(page1.Title.Contains(page1GenericWindowTitle), page1.Title); page1.Close(); }
public void GetBrowserWindow_WithDynamicWindowTitle_CanGetNewWindowTitle() { string page1GenericWindowTitle = "window title 1"; string page1FullWindowTitle = "window title 1 - Windows Internet Explorer"; //Arrange DynamicBrowserWindowTitleRepository home = WebPage.Launch <DynamicBrowserWindowTitleRepository>(CurrentDirectory + "/DynamicBrowserWindowTitle.html"); home.btnGoToPage1.Click(); //Act DynamicBrowserWindowTitleRepository page1 = WebPage.GetPage <DynamicBrowserWindowTitleRepository>(page1GenericWindowTitle); //Assert Assert.AreEqual(page1FullWindowTitle, page1.Title); page1.Close(); }
public void GetBrowserWindow_WithDynamicWindowTitle_CanInteractWithWindow() { //Arrange string page2GenericWindowTitle = "window title 2"; string page2DynamicGenericWindowTitle = "the window title changed"; string page2DynamicFullWindowTitle = "the window title changed - Windows Internet Explorer"; string homePageGenericWindowTitle = "Clicking the buttons changes the window title"; string homePageFullWindowTitle = "Clicking the buttons changes the window title - Windows Internet Explorer"; DynamicBrowserWindowTitleRepository home = WebPage.Launch <DynamicBrowserWindowTitleRepository>(CurrentDirectory + "/DynamicBrowserWindowTitle.html"); home.btnGoToPage2.Click(); DynamicBrowserWindowTitleRepository page2 = WebPage.GetPage <DynamicBrowserWindowTitleRepository>(page2GenericWindowTitle); page2.btnChangeWindowTitle.Click(); //Checkpoint Assert.AreEqual(page2DynamicFullWindowTitle, page2.Title); //Act page2 = WebPage.GetPage <DynamicBrowserWindowTitleRepository>( page2DynamicGenericWindowTitle); page2.btnGoToHomePage.Click(); page2.SetWindowTitle(homePageGenericWindowTitle); //Assert Assert.AreEqual(homePageFullWindowTitle, page2.Title); page2.Close(); }