Example #1
0
        public void User_Edit()
        {
            string login = "******", firstname, lastname, email, city, county, addr, addr2;
            int?   zip = 96701;

            Data.ClientGroupData cg      = Data.ClientGroupData.Admin;
            Data.CompanyData     comp    = Data.CompanyData.DeleteCompany;
            Data.CampaignData    camp    = Data.CampaignData.edit;
            Data.CountryData     country = Data.CountryData.Spain;
            Data.StateData       state   = Data.StateData.HAWAII;
            Data.FilterData      filter  = Data.FilterData.Agent;


            //TODO: add phone field data check
            //TODO: add TimeZone set
            var row = Go.To <UserList>().

                      User.Rows[x => x.Login == login].Edit().
                      //check that "Login" value can't be changed after creating a user
                      Login.Should.BeDisabled().

                      Login.Should.Equal(login).

                      Password.Set("321").
                      PasswordConfirm.Set("321").

                      FirstName.SetRandom(out firstname).

                      LastName.SetRandom(out lastname).

                      Email.SetRandom(out email).

                      ClientGroup.Set(cg).

                      Companies.Set(comp).

                      Campaigns.Set(camp).

                      Countries.Set(country).

                      Zip.Set(zip).

                      Address.SetRandom(out addr).

                      Address2.SetRandom(out addr2).
                      //check that default value for "Filter" is default
                      Filter.Should.Equal(Data.FilterData.Default).

                      Filter.Set(filter).

                      County.SetRandom(out county).

                      City.SetRandom(out city).

                      Save().

                      User.Rows[x => x.Login == login && x.FirstName == firstname && x.LastName == lastname].Edit().

                      FirstName.Should.Equal(firstname).

                      LastName.Should.Equal(lastname).

                      City.Should.Equal(city).

                      Email.Should.Equal(email).

                      ClientGroup.Should.Equal(cg).

                      Companies.Should.Equal(comp).

                      Campaigns.Should.Equal(camp).

                      Countries.Should.Equal(country).

                      Zip.Should.Equal(zip).

                      States.Should.Equal(state).

                      County.Should.Equal(county).

                      City.Should.Equal(city).

                      Address.Should.Equal(addr).

                      Address2.Should.Equal(addr2).

                      Filter.Should.Equal(filter);
        }
Example #2
0
        public void Campaign_Edit()
        {
            Data.CampaignTypeData    camptype2   = Data.CampaignTypeData.Reliant;
            Data.CompanyData         company     = Data.CompanyData.ExistingCompany;
            Data.Five9DomainTypeData domainType  = Data.Five9DomainTypeData.Secondary;
            Data.CampaignData        camp1       = Data.CampaignData.share;
            Data.InfomercialTypeData informType2 = Data.InfomercialTypeData.ShortForm;
            DateTime startDate        = new DateTime(1980, 4, 4);
            DateTime endDate          = new DateTime(1993, 7, 13);
            DateTime projectedEndDate = new DateTime(1995, 12, 14);
            string   name             = "edit";
            string   five9List;
            int?     seats;
            string   addprop = "Additional Properties";

            var row = Go.To <CampaignList>()

                      // finding "edit" campaign and clicking edit
                      .Campaigns.Rows[x => x.Name == name].Edit()

                      // check that "Additional properties" link exists
                      .Content.Should.Contain(addprop)
                      .Name.SetRandom(out name)
                      .SeatsAllocated
                      .SetRandom(out seats)
                      .CampaignToShareWith.Set(camp1)
                      .CampaignType.Set(camptype2)
                      .Client.Set(company)
                      .StartDate.Set(startDate)
                      .EndDate.Set(endDate)
                      .ProjectedEndDate.Set(projectedEndDate)
                      .External.Set(company)
                      .InfomercialType.Set(informType2)
                      .Five9List.SetRandom(out five9List)
                      .Five9DomainType.Set(domainType)

                      // unchecking "Inactive" and "Alternate language" checkboxes
                      .Inactive.Uncheck().AlternateLanguage.Uncheck()

                      // saving the data and going to Campaign List
                      .Save()

                      // finding campaign with ("Name" == name)  and clicking edit
                      .Campaigns.Rows[x => x.Name == name].Edit()

                      // checking that all changes we've made have been saved correctly
                      .Name.Should.Equal(name)
                      .SeatsAllocated.Should.Equal(seats)
                      .ShareWithCampaign.Should.BeChecked()
                      .CampaignToShareWith.Should.Equal(camp1)
                      .CampaignType.Should.Equal(camptype2)
                      .StartDate.Should.Equal(startDate)
                      .EndDate.Should.Equal(endDate)
                      .ProjectedEndDate.Should.Equal(projectedEndDate)
                      .Inactive.Should.BeUnchecked()
                      .AlternateLanguage.Should.BeUnchecked()
                      .Client.Should.Equal(company)
                      .External.Should.Equal(company)
                      .InfomercialType.Should.Equal(informType2)
                      .Five9List.Should.Equal(five9List)
                      .Five9DomainType.Should.Equal(domainType);
        }