public void Can_Edit_Organization() { OrganizationCreator.CreateSimpleOrganization(); OrganizationCreator.EditSimpleOrganization(OrganizationCreator.FirstOrganization); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.IsOrganizationSavedAfterEdit, "Organization was not saved successfully after edit"); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.AreOrganizationFieldValuesSavedCorrectly, "Organization field values were not saved correctly after edit"); }
public void Add_Existing_No_Orphan_Contact_To_An_Organization() { ContactCreator.CreateSimpleContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList() .UncheckingOrphanCheckbox() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Add(); AssertThat.IsTrue( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be linked to organization {OrganizationViewPage.OrganizationName} but it is not." ); OrganizationsPage.FindOrganization().WithOrganizationName(ContactCreator.FirstContact.OrganizationName).Open(); AssertThat.IsFalse( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should not belong to organization {OrganizationViewPage.OrganizationName} but it is still linked with it." ); }
public void Add_Contact_To_Organization_Contact_List() { ContactCreator.CreateSimpleOrphanContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Add(); OrganizationsPage.FindOrganization().WithOrganizationName(OrganizationCreator.FirstOrganization.OrganizationName).Open(); AssertThat.IsTrue( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact {ContactCreator.FirstContact.FullName} does not exist within organization {OrganizationCreator.FirstOrganization.OrganizationName} contacts, although it was added previously"); OrganizationViewPage.FindContactFromOrganizationContactList().BySequence(1).Remove(); AssertThat.IsFalse( OrganizationViewPage.FindContactFromOrganizationContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Find(), $"Contact {ContactCreator.FirstContact.FullName} exists within organization {OrganizationCreator.FirstOrganization.OrganizationName} contacts, although it was removed previously"); ContactsPage.FindContact().WithFirstName(ContactCreator.FirstContact.FirstName).AndLastName(ContactCreator.FirstContact.LastName).Open(); AssertThat.AreEqual(ContactViewPage.OrganizationName, "", $"Contact {ContactCreator.FirstContact.FullName} is not orphan though it should because it was removed from organization '{OrganizationCreator.FirstOrganization.OrganizationName}' contacts"); }
public void Edit_Organization_And_Assign_Nonsense_Values() { OrganizationCreator.CreateSimpleOrganization(); OrganizationCreator.EditOrganizationAssigningNonsenseValues(OrganizationCreator.FirstOrganization); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.IsOrganizationSavedAfterEdit, "Organization was not saved successfully after edit though, it should"); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.AreOrganizationFieldValuesSavedCorrectly, "Organization field values were not saved correctly after edit"); }
public void Make_A_Contact_Primary_From_Within_Organization() { OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList().Randomly(2).Add(); AssertThat.AreEqual(OrganizationViewPage.ContactListCount, 2, "Previously added contacts did not show up in organization contact list"); OrganizationViewPage.FindContactFromOrganizationContactList().BySequence(1).MakePrimaryContact(); AssertThat.AreEqual(OrganizationViewPage.PrimaryContact, OrganizationViewPage.GetContactFullNameBySequence(1), $"Contact '{OrganizationViewPage.GetContactFullNameBySequence(1)}' was not made primary though it should"); OrganizationViewPage.FindContactFromOrganizationContactList().BySequence(2).MakePrimaryContact(); AssertThat.AreEqual(OrganizationViewPage.PrimaryContact, OrganizationViewPage.GetContactFullNameBySequence(2), $"Contact '{OrganizationViewPage.GetContactFullNameBySequence(2)}' was not made primary though it should"); }
public void Delete_Organization_Along_With_Its_Linked_Contacts() { ContactCreator.CreateSimpleOrphanContact(); ContactCreator.CreateSimpleOrphanContact(); ContactCreator.CreateSimpleOrphanContact(); OrganizationCreator.CreateSimpleOrganization(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.FirstContact.FirstName) .AndLastName(ContactCreator.FirstContact.LastName) .Add(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.SecondContact.FirstName) .AndLastName(ContactCreator.SecondContact.LastName) .Add(); OrganizationViewPage.AddContactsToContactList() .WithFirstName(ContactCreator.ThirdContact.FirstName) .AndLastName(ContactCreator.ThirdContact.LastName) .Add(); OrganizationViewPage.DeleteOrganization().WithContacts(); VerifyThat.IsFalse( OrganizationsPage.FindOrganization().WithOrganizationName(OrganizationCreator.FirstOrganization.OrganizationName).Find(), $"Organization with name {OrganizationCreator.FirstOrganization.OrganizationName} should be deleted but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.FirstContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.SecondContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); VerifyThat.IsFalse( ContactsPage.FindContact().ContainingKeyword(ContactCreator.ThirdContact.FullName).Find(), $"Contact with name {ContactCreator.FirstContact.FullName} should be deleted along with its organization but, it still exists" ); }
public void Can_Create_A_Simple_Organization() { OrganizationCreator.CreateSimpleOrganization(); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.IsOrganizationCreatedSuccessfully, "Organization was not created successfully but it should"); AssertThat.IsTrue(OrganizationCreator.FirstOrganization.AreOrganizationFieldValuesSavedCorrectly, "Organization field values where not saved correctly"); }
public void Call_An_Organization_Telephone_Number() { OrganizationCreator.CreateSimpleOrganization(); AssertThat.IsTrue(OrganizationViewPage.IsPhoneNumberCallable, "Organization telephone number is not callable"); }
public void Cannot_Save_Organization_After_Assigning_Overflown_Values() { OrganizationCreator.CreateSimpleOrganization(); OrganizationCreator.EditOrganizationAssigningOverflowValues(OrganizationCreator.FirstOrganization); AssertThat.IsFalse(OrganizationCreator.FirstOrganization.IsOrganizationSavedAfterEdit, "Organization was saved successfully after edit though it should not because its field values exceed the character limit"); }
public void Cannot_Save_Organization_After_Leaving_Mandatory_Fields_Empty() { OrganizationCreator.CreateSimpleOrganization(); OrganizationCreator.EditOrganizationRemovingOrganizationName(OrganizationCreator.FirstOrganization); AssertThat.IsFalse(OrganizationCreator.FirstOrganization.IsOrganizationSavedAfterEdit, "Organization was saved successfully after edit though it should not because its name was left empty"); }