Example #1
0
def main():
    startApplication("fatcrm")
    # load methods
    import campaignsHandling
    import mainWindowHandling
    # data to be registered
    name = "TestCampaign"
    status = "In Queue"
    detailsList = [
        name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000",
        "200000"
    ]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # check data values
    campaignsHandling.checkDetailsValues(detailsList)
    campaignsHandling.checkOtherDetailsValues(otherDetailsList)
    campaignsHandling.checkDescriptionValue(description)
    # remove
    campaignsHandling.removeCampaign(name)
    # quit
    mainWindowHandling.justQuit()
Example #2
0
def main():
    startApplication("sugarclient")
    # load methods 
    import campaignsHandling
    import mainWindowHandling
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # check data values 
    campaignsHandling.checkDetailsValues(detailsList)
    campaignsHandling.checkOtherDetailsValues(otherDetailsList)       
    campaignsHandling.checkDescriptionValue(description)
    # remove 
    campaignsHandling.removeCampaign(name)
    # quit
    mainWindowHandling.justQuit()
Example #3
0
def main():
    startApplication("fatcrm")
    # load methods 
    import campaignsHandling   
    import mainWindowHandling
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()    
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")    
    # new data
    mDetailsList = [name, status, "2/2", "3/3", "Radio", "US Dollars : $", "500000", "6600000"]
    mOtherDetailsList = ["max", "60000", "9000000", "300000", "mradio marketting"]      
    mDescription = "a modified campaign"
    #modify 
    campaignsHandling.registerDetails(mDetailsList)
    campaignsHandling.registerOtherDetails(mOtherDetailsList)       
    campaignsHandling.registerDescription(mDescription)
    # save remotely
    campaignsHandling.saveCampaign()    
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")    
    #verify
    campaignsHandling.checkDetailsValues(mDetailsList)
    campaignsHandling.checkOtherDetailsValues(mOtherDetailsList)
    campaignsHandling.checkDescriptionValue(mDescription)
    #remove
    campaignsHandling.removeCampaign(name)
    #quit
    mainWindowHandling.justQuit()
    
    
Example #4
0
def main():
    startApplication("sugarclient")
    # load methods 
    import accountsHandling
    import campaignsHandling
    import contactsHandling
    import mainWindowHandling
    
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")    
    # select account tab
    # mainWindowHandling.selectTab("Account")
    # create an account 
    # data to be registered
    accountName = "test account"
    detailsList = [accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel", "Analyst", "", "max"]
    otherDetailsList = ["12345", "67890", "09876", "100", "90", "3333", "1000000000", "*****@*****.**"]
    billingList = ["billing","Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")  
    # data to be registered
    firstName = "TestContact" 
    detailsList = ["Mr.", firstName, "Bob", "Director Sales", "Admin", "", "Campaign", "", "max", "", "*****@*****.**"]
    otherDetailsList = ["123456", "789012", "345678", "901234", "567890", "3/3", "Mrs Assist", "567890", "true"]
    addressesList = ["jonas väg", "Hagfors", " a state","32456", "Sweden", "jonsons", "väg", "Örebro", "45678", "USA"]   
    description = "a contact created via my refactored functions"
    # launch the details widget
    contactsHandling.createContact()
    # write the data
    contactsHandling.registerDetails(detailsList)
    contactsHandling.registerOtherDetails(otherDetailsList)
    contactsHandling.registerAddresses(addressesList)    
    contactsHandling.registerDescription(description)
    # save remotely
    contactsHandling.saveContact()
    # make sure it is saved before proceeding 
    label = findObject(':Contact Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''") 
    text = label.text  
    # modified values
    mdetailsList = ["Ms.", firstName, "mBob", "mDirector Sales", "mAdmin", "test account", "Employee", "TestCampaign", "max", firstName, "*****@*****.**"]
    motherDetailsList = ["m123456", "m789012", "m345678", "m901234", "m567890", "3/3", "mMrs Assist", "m567890", "false"]
    maddressesList = ["mjonas väg", "mHagfors", " ma state","m32456", "mSweden", "mjonsons", "mväg", "mÖrebro", "m45678", "mUSA"]   
    mdescription = "a contact created via my refactored functions and modified blah blah"
    # write the data
    contactsHandling.registerDetails(mdetailsList)
    contactsHandling.registerOtherDetails(motherDetailsList)
    contactsHandling.registerAddresses(maddressesList)    
    contactsHandling.registerDescription(mdescription)
    # save remotely
    contactsHandling.saveContact()
    # make sure it is saved before proceeding 
    label = findObject(':Contact Information.modifiedDate_QLineEdit')
    waitFor("label.text != text")   
    
    # check data values 
    contactsHandling.checkDetailsValues(mdetailsList)
    contactsHandling.checkOtherDetailsValues(motherDetailsList)
    contactsHandling.checkAddressesValues(maddressesList)   
    contactsHandling.checkDescriptionValue(mdescription)
    # test done cleanup
    contactsHandling.removeContact(firstName)
    accountsHandling.removeAccount(accountName) 
    campaignsHandling.removeCampaign(name)  
    #quit
    mainWindowHandling.justQuit()
Example #5
0
def main():
    startApplication("fatcrm")
    # load methods
    import campaignsHandling
    import accountsHandling
    import opportunitiesHandling
    import mainWindowHandling
    # create a campaign
    # data to be registered
    name = "TestCampaign"
    status = "In Queue"
    detailsList = [
        name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000",
        "200000"
    ]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # create an account
    # data to be registered
    accountName = "test account"
    detailsList = [
        accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel",
        "Analyst", "", "max"
    ]
    otherDetailsList = [
        "12345", "67890", "09876", "100", "90", "3333", "1000000000",
        "*****@*****.**"
    ]
    billingList = ["billing", "Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    #create an opportunity
    # data to be registered
    opportunityName = "test opportunity"
    detailsList = [
        opportunityName, "", "Existing Business", "Employee", "",
        "Prospecting", "max"
    ]
    otherDetailsList = ["US Dollars : $", "10000", "1/2", "another step", "90"]
    description = "an opportunity created via my refactored functions"
    # launch the details widget
    opportunitiesHandling.createOpportunity()
    # write the data
    opportunitiesHandling.registerDetails(detailsList)
    opportunitiesHandling.registerOtherDetails(otherDetailsList)
    opportunitiesHandling.registerDescription(description)
    # save remotely
    opportunitiesHandling.saveOpportunity()
    modifyList = [
        opportunityName, accountName, "Existing Business", "Employee", name,
        "Prospecting", "max"
    ]
    #modify data
    opportunitiesHandling.registerDetails(modifyList)
    #save
    opportunitiesHandling.saveOpportunity()
    #check
    opportunitiesHandling.checkDetailsValues(modifyList)
    #test done - cleanup and quit
    accountsHandling.removeAccount(accountName)
    campaignsHandling.removeCampaign(name)
    opportunitiesHandling.removeOpportunity(opportunityName)
    #quit
    mainWindowHandling.justQuit()
Example #6
0
def main():
    startApplication("fatcrm")
    # load methods 
    import campaignsHandling
    import accountsHandling
    import mainWindowHandling
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")    
    # select account tab
    # mainWindowHandling.selectTab("Account")
    # create an account 
    # data to be registered
    accountName = "test account"
    detailsList = [accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel", "Analyst", "", "max"]
    otherDetailsList = ["12345", "67890", "09876", "100", "90", "3333", "1000000000", "*****@*****.**"]
    billingList = ["billing","Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")  
    modifyDetailsList = ["test account", "mwww.kdab.net", "ma ticker", "test account" , "mAB", "Apparel", "Analyst", "TestCampaign", "max"]
    modifyOtherList = ["m12345", "m67890", "m09876", "m100", "m90", "m3333", "m1000000000", "*****@*****.**"]
    modifyBillingList = ["mbilling","mHagfors", "mVärmland", "m34567", "mSweden"]
    modifyShippingList = ["mshipping", "mHagfors", "mVärmland", "m34567", "mSweden"]
    modifyDescription = "a modified account description" 
    #modify data
    accountsHandling.registerDetails(modifyDetailsList)
    accountsHandling.registerOtherDetails(modifyOtherList)
    accountsHandling.registerAddresses(modifyBillingList, modifyShippingList)
    accountsHandling.registerDescription(modifyDescription)
    #save
    accountsHandling.saveAccount()
    # make sure it is saved before proceeding
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")  
    #check
    accountsHandling.checkDetailsValues(modifyDetailsList)
    accountsHandling.checkOtherDetailsValues(modifyOtherList)
    accountsHandling.checkAddressesValues(modifyBillingList, modifyShippingList)
    accountsHandling.checkDescriptionValue(modifyDescription)
    #test done - cleanup and quit
    accountsHandling.removeAccount(accountName) 
    campaignsHandling.removeCampaign(name)  
    # quit
    mainWindowHandling.justQuit()
Example #7
0
def main():
    startApplication("fatcrm")
    # load methods 
    import campaignsHandling
    import accountsHandling
    import opportunitiesHandling
    import mainWindowHandling
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()    
    # create an account 
    # data to be registered
    accountName = "test account"
    detailsList = [accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel", "Analyst", "", "max"]
    otherDetailsList = ["12345", "67890", "09876", "100", "90", "3333", "1000000000", "*****@*****.**"]
    billingList = ["billing","Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    #create an opportunity
    # data to be registered
    opportunityName = "test opportunity"
    detailsList = [opportunityName, "", "Existing Business", "Employee", "", "Prospecting", "max"]
    otherDetailsList = ["US Dollars : $", "10000", "1/2", "another step", "90"]   
    description = "an opportunity created via my refactored functions"
    # launch the details widget
    opportunitiesHandling.createOpportunity()
    # write the data
    opportunitiesHandling.registerDetails(detailsList)
    opportunitiesHandling.registerOtherDetails(otherDetailsList)    
    opportunitiesHandling.registerDescription(description)
    # save remotely
    opportunitiesHandling.saveOpportunity()
    modifyList = [opportunityName, accountName, "Existing Business", "Employee", name, "Prospecting", "max"]
    #modify data
    opportunitiesHandling.registerDetails(modifyList)
    #save
    opportunitiesHandling.saveOpportunity()
    #check
    opportunitiesHandling.checkDetailsValues(modifyList)
    #test done - cleanup and quit
    accountsHandling.removeAccount(accountName) 
    campaignsHandling.removeCampaign(name)
    opportunitiesHandling.removeOpportunity(opportunityName)  
    #quit
    mainWindowHandling.justQuit()
Example #8
0
def main():
    startApplication("fatcrm")
    # load methods
    import campaignsHandling
    import accountsHandling
    import mainWindowHandling
    # create a campaign
    # data to be registered
    name = "TestCampaign"
    status = "In Queue"
    detailsList = [
        name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000",
        "200000"
    ]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # select account tab
    # mainWindowHandling.selectTab("Account")
    # create an account
    # data to be registered
    accountName = "test account"
    detailsList = [
        accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel",
        "Analyst", "", "max"
    ]
    otherDetailsList = [
        "12345", "67890", "09876", "100", "90", "3333", "1000000000",
        "*****@*****.**"
    ]
    billingList = ["billing", "Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    modifyDetailsList = [
        "test account", "mwww.kdab.net", "ma ticker", "test account", "mAB",
        "Apparel", "Analyst", "TestCampaign", "max"
    ]
    modifyOtherList = [
        "m12345", "m67890", "m09876", "m100", "m90", "m3333", "m1000000000",
        "*****@*****.**"
    ]
    modifyBillingList = [
        "mbilling", "mHagfors", "mVärmland", "m34567", "mSweden"
    ]
    modifyShippingList = [
        "mshipping", "mHagfors", "mVärmland", "m34567", "mSweden"
    ]
    modifyDescription = "a modified account description"
    #modify data
    accountsHandling.registerDetails(modifyDetailsList)
    accountsHandling.registerOtherDetails(modifyOtherList)
    accountsHandling.registerAddresses(modifyBillingList, modifyShippingList)
    accountsHandling.registerDescription(modifyDescription)
    #save
    accountsHandling.saveAccount()
    # make sure it is saved before proceeding
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    #check
    accountsHandling.checkDetailsValues(modifyDetailsList)
    accountsHandling.checkOtherDetailsValues(modifyOtherList)
    accountsHandling.checkAddressesValues(modifyBillingList,
                                          modifyShippingList)
    accountsHandling.checkDescriptionValue(modifyDescription)
    #test done - cleanup and quit
    accountsHandling.removeAccount(accountName)
    campaignsHandling.removeCampaign(name)
    # quit
    mainWindowHandling.justQuit()
Example #9
0
def main():
    startApplication("fatcrm")
    # load methods
    import campaignsHandling
    import leadsHandling
    import mainWindowHandling

    # create a campaign
    # data to be registered
    name = "TestCampaign"
    status = "In Queue"
    detailsList = [
        name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000",
        "200000"
    ]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # data to be registered
    firstName = "Lead"
    detailsList = [
        "Self Generated", "This is a self generated lead", "", "Michel", "Mr.",
        firstName, "Bob", "2/2", "an account", "VD", "Sales", "max"
    ]
    otherDetailsList = [
        "New", "this is a new lead", "150000", "123456", "789012", "345678",
        "901234", "567890", "true", "*****@*****.**", "*****@*****.**"
    ]
    addressesList = [
        "jonas väg", "Hagfors", " a state", "32456", "Sweden", "jonsons",
        "väg", "Örebro", "45678", "USA", "false"
    ]
    description = "a lead created via my refactored functions"
    # launch the details widget
    leadsHandling.createLead()
    # write the data
    leadsHandling.registerDetails(detailsList)
    leadsHandling.registerOtherDetails(otherDetailsList)
    leadsHandling.registerAddresses(addressesList)
    leadsHandling.registerDescription(description)
    # save remotely
    leadsHandling.saveLead()
    # make sure it is saved before proceeding
    label = findObject(':Lead Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # modified data
    mdetailsList = [
        "Cold Call", "mThis is a self generated lead", "TestCampaign",
        "mMichel", "Mrs.", "mLead", "mBob", "3/3", "mMMMMan account", "mVD",
        "mSales", "max"
    ]
    motherDetailsList = [
        "Assigned", "mmmmMthis is a new lead", "190000", "m123456", "m789012",
        "m345678", "m901234", "m567890", "false", "*****@*****.**",
        "*****@*****.**"
    ]
    maddressesList = [
        "mmjonas väg", "mHagfors", " ma state", "m32456", "mSweden",
        "mjonsons", "mväg", "mÖrebro", "m45678", "mUSA", "false"
    ]
    mdescription = "mmmmmMa lead created via my refactored functions"
    # write the data
    leadsHandling.registerDetails(mdetailsList)
    leadsHandling.registerOtherDetails(motherDetailsList)
    leadsHandling.registerAddresses(maddressesList)
    leadsHandling.registerDescription(mdescription)
    # save remotely
    leadsHandling.saveLead()
    # make sure it is saved before proceeding
    label = findObject(':Lead Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # check data values
    leadsHandling.checkDetailsValues(mdetailsList)
    leadsHandling.checkOtherDetailsValues(motherDetailsList)
    leadsHandling.checkAddressesValues(maddressesList)
    leadsHandling.checkDescriptionValue(mdescription)
    # remove
    campaignsHandling.removeCampaign(name)
    leadsHandling.removeLead(firstName)
    # quit
    mainWindowHandling.justQuit()
Example #10
0
def main():
    startApplication("fatcrm")
    # load methods 
    import accountsHandling
    import campaignsHandling
    import contactsHandling
    import mainWindowHandling
    
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")    
    # select account tab
    # mainWindowHandling.selectTab("Account")
    # create an account 
    # data to be registered
    accountName = "test account"
    detailsList = [accountName, "www.kdab.com", "a ticker", "", "SARL", "Apparel", "Analyst", "", "max"]
    otherDetailsList = ["12345", "67890", "09876", "100", "90", "3333", "1000000000", "*****@*****.**"]
    billingList = ["billing","Hagfors", "Värmland", "34567", "Sweden"]
    shippingList = ["shipping", "Hagfors", "Värmland", "34567", "Sweden"]
    description = "an account created via my refactored functions"
    # launch the details widget
    accountsHandling.createAccount()
    # write the data
    accountsHandling.registerDetails(detailsList)
    accountsHandling.registerOtherDetails(otherDetailsList)
    accountsHandling.registerAddresses(billingList, shippingList)
    accountsHandling.registerDescription(description)
    # save remotely
    accountsHandling.saveAccount()
    label = findObject(':Account Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")  
    # data to be registered
    firstName = "TestContact" 
    detailsList = ["Mr.", firstName, "Bob", "Director Sales", "Admin", "", "Campaign", "", "max", "", "*****@*****.**"]
    otherDetailsList = ["123456", "789012", "345678", "901234", "567890", "3/3", "Mrs Assist", "567890", "true"]
    addressesList = ["jonas väg", "Hagfors", " a state","32456", "Sweden", "jonsons", "väg", "Örebro", "45678", "USA"]   
    description = "a contact created via my refactored functions"
    # launch the details widget
    contactsHandling.createContact()
    # write the data
    contactsHandling.registerDetails(detailsList)
    contactsHandling.registerOtherDetails(otherDetailsList)
    contactsHandling.registerAddresses(addressesList)    
    contactsHandling.registerDescription(description)
    # save remotely
    contactsHandling.saveContact()
    # make sure it is saved before proceeding 
    label = findObject(':Contact Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''") 
    text = label.text  
    # modified values
    mdetailsList = ["Ms.", firstName, "mBob", "mDirector Sales", "mAdmin", "test account", "Employee", "TestCampaign", "max", firstName, "*****@*****.**"]
    motherDetailsList = ["m123456", "m789012", "m345678", "m901234", "m567890", "3/3", "mMrs Assist", "m567890", "false"]
    maddressesList = ["mjonas väg", "mHagfors", " ma state","m32456", "mSweden", "mjonsons", "mväg", "mÖrebro", "m45678", "mUSA"]   
    mdescription = "a contact created via my refactored functions and modified blah blah"
    # write the data
    contactsHandling.registerDetails(mdetailsList)
    contactsHandling.registerOtherDetails(motherDetailsList)
    contactsHandling.registerAddresses(maddressesList)    
    contactsHandling.registerDescription(mdescription)
    # save remotely
    contactsHandling.saveContact()
    # make sure it is saved before proceeding 
    label = findObject(':Contact Information.modifiedDate_QLineEdit')
    waitFor("label.text != text")   
    
    # check data values 
    contactsHandling.checkDetailsValues(mdetailsList)
    contactsHandling.checkOtherDetailsValues(motherDetailsList)
    contactsHandling.checkAddressesValues(maddressesList)   
    contactsHandling.checkDescriptionValue(mdescription)
    # test done cleanup
    contactsHandling.removeContact(firstName)
    accountsHandling.removeAccount(accountName) 
    campaignsHandling.removeCampaign(name)  
    #quit
    mainWindowHandling.justQuit()
Example #11
0
def main():
    startApplication("sugarclient")
    # load methods     
    import campaignsHandling
    import leadsHandling
    import mainWindowHandling
    
    # create a campaign
    # data to be registered
    name = "TestCampaign" 
    status = "In Queue"
    detailsList = [name, status, "1/1", "2/2", "Radio", "US Dollars : $", "100000", "200000"]
    otherDetailsList = ["max", "20000", "85000", "100000", "radio marketting"]      
    description = "a campaign created via my refactored functions"
    # launch the details widget
    campaignsHandling.createCampaign()
    # write the data
    campaignsHandling.registerDetails(detailsList)
    campaignsHandling.registerOtherDetails(otherDetailsList)       
    campaignsHandling.registerDescription(description)
    # save remotely
    campaignsHandling.saveCampaign()
    # make sure it is saved before proceeding 
    label = findObject(':Campaign Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # data to be registered
    firstName = "Lead" 
    detailsList = ["Self Generated", "This is a self generated lead", "", "Michel", "Mr.", firstName, "Bob", "2/2", "an account", "VD", "Sales", "max"]
    otherDetailsList = ["New", "this is a new lead", "150000", "123456", "789012", "345678", "901234", "567890", "true", "*****@*****.**", "*****@*****.**"]
    addressesList = ["jonas väg", "Hagfors", " a state","32456", "Sweden", "jonsons", "väg", "Örebro", "45678", "USA", "false"]   
    description = "a lead created via my refactored functions"
    # launch the details widget
    leadsHandling.createLead()
    # write the data
    leadsHandling.registerDetails(detailsList)
    leadsHandling.registerOtherDetails(otherDetailsList)
    leadsHandling.registerAddresses(addressesList)    
    leadsHandling.registerDescription(description)
    # save remotely
    leadsHandling.saveLead()
    # make sure it is saved before proceeding
    label = findObject(':Lead Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # modified data     
    mdetailsList = ["Cold Call", "mThis is a self generated lead", "TestCampaign", "mMichel", "Mrs.", "mLead", "mBob", "3/3", "mMMMMan account", "mVD", "mSales", "max"]
    motherDetailsList = ["Assigned", "mmmmMthis is a new lead", "190000", "m123456", "m789012", "m345678", "m901234", "m567890", "false", "*****@*****.**", "*****@*****.**"]
    maddressesList = ["mmjonas väg", "mHagfors", " ma state","m32456", "mSweden", "mjonsons", "mväg", "mÖrebro", "m45678", "mUSA", "false"]   
    mdescription = "mmmmmMa lead created via my refactored functions"
    # write the data
    leadsHandling.registerDetails(mdetailsList)
    leadsHandling.registerOtherDetails(motherDetailsList)
    leadsHandling.registerAddresses(maddressesList)    
    leadsHandling.registerDescription(mdescription)
    # save remotely
    leadsHandling.saveLead()
    # make sure it is saved before proceeding
    label = findObject(':Lead Information.modifiedDate_QLineEdit')
    waitFor("label.text !=''")
    # check data values 
    leadsHandling.checkDetailsValues(mdetailsList)
    leadsHandling.checkOtherDetailsValues(motherDetailsList)
    leadsHandling.checkAddressesValues(maddressesList)   
    leadsHandling.checkDescriptionValue(mdescription)
    # remove 
    campaignsHandling.removeCampaign(name)  
    leadsHandling.removeLead(firstName)
    # quit
    mainWindowHandling.justQuit()