public void LoginAddNewFriend() { LoginPageObject page = new LoginPageObject(); LobbyPageObject lobby = new LobbyPageObject(); ProfilePageObject profile = new ProfilePageObject(); System.Threading.Thread.Sleep(2000); page.Username.SendKeys("*****@*****.**"); page.Password.SendKeys("[email protected]"); WebDriverWait wait = new WebDriverWait(PropertiesCollection.driver, TimeSpan.FromSeconds(10)); wait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("button.mt-sm-1"))); if (page.ButtonLogin.Enabled) { page.ButtonLogin.Click(); System.Threading.Thread.Sleep(5000); Assert.AreEqual(@"http://172.16.45.50:9001/#/lobby", PropertiesCollection.driver.Url); } else { throw new ArgumentException("Button is unavaliable"); } System.Threading.Thread.Sleep(2000); lobby.MyProfile.Click(); Thread.Sleep(2000); wait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("div:nth-child(2)>div>div.glass-button.text-uppercase.d-flex.flex-column>span:nth-child(2)"))); profile.AddFriend.Click(); Thread.Sleep(2000); profile.SearchFriends.SendKeys("Guest"); var element = PropertiesCollection.driver.FindElements(By.CssSelector("div.friends-list-container>perfect-scrollbar")).FirstOrDefault(); element.Click(); Thread.Sleep(2000); profile.AddSelectedFriend.Click(); profile.FriendsRequest.Click(); Thread.Sleep(2000); profile.DeclineFriendRequest.Click(); Thread.Sleep(2000); profile.AreYouSureCancelFriendRequestYes.Click(); Thread.Sleep(4000); }
public void LoginAsGuestAndRegister() { LoginPageObject LoginPage = new LoginPageObject(); LobbyPageObject LobbyPage = new LobbyPageObject(); ProfilePageObject ProfilePage = new ProfilePageObject(); WebDriverWait wait = new WebDriverWait(PropertiesCollection.driver, TimeSpan.FromSeconds(10)); wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector("button.guest"))); LoginPage.ButtonGuest.Click(); Thread.Sleep(4000); Assert.AreEqual(@"http://172.16.45.50:9001/#/lobby", PropertiesCollection.driver.Url); Thread.Sleep(4000); PropertiesCollection.driver.SwitchTo().ActiveElement(); LobbyPage.ButtonCollect.Click(); Thread.Sleep(2000); LobbyPage.MyProfile.Click(); Thread.Sleep(2000); ProfilePage.Register.Click(); Thread.Sleep(2000); PropertiesCollection.driver.SwitchTo().ActiveElement(); ProfilePage.Username.SendKeys("*****@*****.**"); Thread.Sleep(2000); ProfilePage.Password.SendKeys("[email protected]"); Thread.Sleep(2000); WaitClass.WaitForElementMethod(ProfilePage.RegisterButton); ProfilePage.RegisterButton.Click(); Thread.Sleep(3000); WaitClass.WaitForElementMethod(LobbyPage.ButtonCollect); Thread.Sleep(3000); LobbyPage.ButtonCollect.Click(); Thread.Sleep(3000); WaitClass.WaitForElementMethod(ProfilePage.ResendEmailButton); ProfilePage.ResendEmailButton.Click(); Thread.Sleep(3000); PropertiesCollection.driver.SwitchTo().ActiveElement(); string expectedMessage = "THANKS!"; string message = PropertiesCollection.driver.FindElement(By.CssSelector("div>mat-card-title")).Text; Assert.AreEqual(expectedMessage, message); ProfilePage.ButtonOKResendEmail.Click(); }
public void LoginEditProfile() { LoginPageObject page = new LoginPageObject(); ProfilePageObject profile = new ProfilePageObject(); LobbyPageObject lobby = new LobbyPageObject(); System.Threading.Thread.Sleep(2000); page.Username.SendKeys("*****@*****.**"); page.Password.SendKeys("[email protected]"); WebDriverWait wait = new WebDriverWait(PropertiesCollection.driver, TimeSpan.FromSeconds(10)); wait.Until(ExpectedConditions.ElementToBeClickable(By.CssSelector("button.mt-sm-1"))); if (page.ButtonLogin.Enabled) { page.ButtonLogin.Click(); System.Threading.Thread.Sleep(5000); Assert.AreEqual(@"http://172.16.45.50:9001/#/lobby", PropertiesCollection.driver.Url); } else { throw new ArgumentException("Button is unavaliable"); } System.Threading.Thread.Sleep(4000); lobby.MyProfile.Click(); Thread.Sleep(2000); profile.ButtonEditProfile.Click(); Thread.Sleep(2000); profile.NickNameField.Clear(); profile.NickNameField.SendKeys("SomeNewNick"); PropertiesCollection.driver.FindElement(By.CssSelector("#item-select>div>div.wrap.text-left.item-selected>div>i")).Click(); Thread.Sleep(2000); PropertiesCollection.driver.FindElement(By.CssSelector("#item-select>div>div:nth-child(4)>span")).Click(); Thread.Sleep(2000); WaitClass.WaitForElementMethod(profile.EditProfileSaveBtn); profile.EditProfileSaveBtn.Click(); Thread.Sleep(4000); }
public ProfilePageSteps(DataContext dataContext) { _dataContext = dataContext; _profilePageObject = new ProfilePageObject(); }
public void ThenUserCanSeeLogoutButton() { ProfilePageObject PpO = new ProfilePageObject(_driver); PpO.IsLogOutDisplayed(); }