public void ValidateContactInfoDetails() { var testData = TestDataFactory.UserContactCreate(); IndexPage indexPage = new IndexPage(driver, url); LoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testData.Email, testData.Password); ContactInfoHomePage contactInfoHomePage = indexPage.Header.ClickOnContactInfo(); Assert.AreEqual(testData.Contact.FirstName, contactInfoHomePage.GetContactFieldText(ContactInfoFields.FirstName)); Assert.AreEqual(testData.Contact.LastName, contactInfoHomePage.GetContactFieldText(ContactInfoFields.LastName)); Assert.AreEqual(testData.Contact.Company, contactInfoHomePage.GetContactFieldText(ContactInfoFields.Company)); Assert.AreEqual(testData.Contact.PhoneNumber, contactInfoHomePage.GetContactFieldText(ContactInfoFields.PhoneNumber)); Assert.AreEqual(testData.Contact.Email, contactInfoHomePage.GetContactFieldText(ContactInfoFields.EmailAddress)); }
public void ValidateContactInfoDetails() { var testUser = DataFactory.Users.CreateTestUser(); APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); indexPage = loginPage.Login(testUser.Username, testUser.Password); ContactInfoHomePage contactInfoHomePage = indexPage.Header.ClickOnContactInfo(); Assert.AreEqual(testUser.ContactInformation.FirstName, contactInfoHomePage.GetContactFieldText(ContactInfoFields.FirstName)); Assert.AreEqual(testUser.ContactInformation.LastName, contactInfoHomePage.GetContactFieldText(ContactInfoFields.LastName)); Assert.AreEqual(testUser.ContactInformation.CompanyName, contactInfoHomePage.GetContactFieldText(ContactInfoFields.Company)); Assert.AreEqual(testUser.ContactInformation.PhoneNumber, contactInfoHomePage.GetContactFieldText(ContactInfoFields.PhoneNumber)); Assert.AreEqual(testUser.ContactInformation.Email, contactInfoHomePage.GetContactFieldText(ContactInfoFields.EmailAddress)); }
public void EditContactInfoPOMElementsValidation() { var testData = TestDataFactory.CreateLoginAccount(); string expectedSectionTitle = "Edit contact information"; string unexpectedText = "new company name"; IndexPage indexPage = new IndexPage(driver, url); LoginPage loginPage = indexPage.Header.ClickOnSignIn(); loginPage.Login(testData.Email, testData.Password); ContactInfoHomePage contactInfoPage = loginPage.Header.ClickOnContactInfo(); ContactInfoEditPage editContactInfoPage = contactInfoPage.ClickOnEditLink(); string actualSectionTitle = editContactInfoPage.GetSectionTitle(); editContactInfoPage.TypeOnCompanyName(unexpectedText); contactInfoPage = editContactInfoPage.ClickOnSubmit(); Assert.IsTrue(expectedSectionTitle == actualSectionTitle, $"{actualSectionTitle} is not different to the expected ({expectedSectionTitle})"); Assert.IsFalse(contactInfoPage.GetContactFieldText(ContactInfoFields.Company) == unexpectedText, "The company name cannot be editable!!"); }
public void EditContactInformation() { var testUser = DataFactory.Users.CreateTestUser(); //expected contact information string expectedFirstName = "john"; string expectedLastName = "doe"; string expectedEmail = "*****@*****.**"; string expectedPhoneNumber = "1231230312"; string expectedCompanyName = string.Empty; string expectedTitle = "Contact information"; APIndexPage indexPage = new APIndexPage(Driver, Url); APLoginPage loginPage = indexPage.Header.ClickOnSignIn(); loginPage.Login(testUser.Username, testUser.Password); ContactInfoHomePage contactInfoPage = loginPage.Header.ClickOnContactInfo(); //store the company name before changes expectedCompanyName = contactInfoPage.GetContactFieldText(ContactInfoFields.Company); ContactInfoEditPage editContactInfoPage = contactInfoPage.ClickOnEditLink(); editContactInfoPage.FillInputText(ContactInfoFields.FirstName, expectedFirstName); editContactInfoPage.FillInputText(ContactInfoFields.LastName, expectedLastName); editContactInfoPage.FillInputText(ContactInfoFields.PhoneNumber, expectedPhoneNumber); editContactInfoPage.FillInputText(ContactInfoFields.EmailAddress, expectedEmail); contactInfoPage = editContactInfoPage.ClickOnSubmit(); string actualContactFirstName = contactInfoPage.GetContactFieldText(ContactInfoFields.FirstName); string actualContactLastName = contactInfoPage.GetContactFieldText(ContactInfoFields.LastName); string actualContactCompanyName = contactInfoPage.GetContactFieldText(ContactInfoFields.Company); string actualContactPhone = contactInfoPage.GetContactFieldText(ContactInfoFields.PhoneNumber); string actualContactEmail = contactInfoPage.GetContactFieldText(ContactInfoFields.EmailAddress); //validate redirection is to contact info page Assert.IsTrue(Driver.Title == expectedTitle, $"The page title is not {expectedTitle}"); Assert.IsTrue(actualContactFirstName == expectedFirstName, $"{actualContactFirstName} is different from {expectedFirstName}"); Assert.IsTrue(actualContactLastName == expectedLastName, $"{actualContactLastName} is different from {expectedLastName}"); Assert.IsTrue(actualContactCompanyName == expectedCompanyName, $"{actualContactCompanyName} is different from {expectedCompanyName}"); Assert.IsTrue(actualContactPhone == expectedPhoneNumber, $"{actualContactPhone} is different from {expectedPhoneNumber}"); Assert.IsTrue(actualContactEmail == expectedEmail, $"{actualContactEmail} is different from {expectedEmail}"); }
public void EditContactInformation() { var testData = TestDataFactory.CreateLoginAccount(); var expectedContactInfo = new ContactInfoModel { FirstName = "john", LastName = "doe", Email = "*****@*****.**", PhoneNumber = "1231230312" }; string expectedTitle = "Contact information"; IndexPage indexPage = new IndexPage(driver, url); LoginPage loginPage = indexPage.Header.ClickOnSignIn(); loginPage.Login(testData.Email, testData.Password); ContactInfoHomePage contactInfoPage = loginPage.Header.ClickOnContactInfo(); //store the company name before changes expectedContactInfo.Company = contactInfoPage.GetContactFieldText(ContactInfoFields.Company); ContactInfoEditPage editContactInfoPage = contactInfoPage.ClickOnEditLink(); editContactInfoPage.FillInputText(ContactInfoFields.FirstName, expectedContactInfo.FirstName); editContactInfoPage.FillInputText(ContactInfoFields.LastName, expectedContactInfo.LastName); editContactInfoPage.FillInputText(ContactInfoFields.PhoneNumber, expectedContactInfo.PhoneNumber); editContactInfoPage.FillInputText(ContactInfoFields.EmailAddress, expectedContactInfo.Email); contactInfoPage = editContactInfoPage.ClickOnSubmit(); string actualContactFirstName = contactInfoPage.GetContactFieldText(ContactInfoFields.FirstName); string actualContactLastName = contactInfoPage.GetContactFieldText(ContactInfoFields.LastName); string actualContactCompanyName = contactInfoPage.GetContactFieldText(ContactInfoFields.Company); string actualContactPhone = contactInfoPage.GetContactFieldText(ContactInfoFields.PhoneNumber); string actualContactEmail = contactInfoPage.GetContactFieldText(ContactInfoFields.EmailAddress); //validate redirection is to contact info page Assert.IsTrue(driver.Title == expectedTitle, $"The page title is not {expectedTitle}"); Assert.IsTrue(actualContactFirstName == expectedContactInfo.FirstName, $"{actualContactFirstName} is different from {expectedContactInfo.FirstName}"); Assert.IsTrue(actualContactLastName == expectedContactInfo.LastName, $"{actualContactLastName} is different from {expectedContactInfo.LastName}"); Assert.IsTrue(actualContactCompanyName == expectedContactInfo.Company, $"{actualContactCompanyName} is different from {expectedContactInfo.Company}"); Assert.IsTrue(actualContactPhone == expectedContactInfo.PhoneNumber, $"{actualContactPhone} is different from {expectedContactInfo.PhoneNumber}"); Assert.IsTrue(actualContactEmail == expectedContactInfo.Email, $"{actualContactEmail} is different from {expectedContactInfo.Email}"); }