and not account_synced):
    ui_steps.remove_all_google_accounts(serial=serial)()
    ui_steps.add_google_account_for_L(serial=serial,
                                      account=ACCOUNT,
                                      password=PASSWORD,
                                      prefer_sync=True)()

# remove document if exists
docs_steps.open_docs(serial=serial)()
docs_utils.search_by(serial=serial, name=TITLE)
while ui_utils.view_exists({
        "text": TITLE,
        "resourceIdMatches": ".*title"
},
                           serial=serial):
    print "found one"
    docs_steps.delete_document(serial=serial, title=TITLE, no_check=True)()
    docs_utils.search_by(serial=serial, name=TITLE)
docs_utils.exit_search()

# add new document
docs_steps.add_new_document(serial=serial, title=TITLE, content=CONTENT)()
# rename document
docs_steps.replace_in_document(serial=serial,
                               title=TITLE,
                               to_replace=TO_REPLACE,
                               replaced_by=REPLACED_BY,
                               count=COUNT)()
docs_steps.delete_document(serial=serial, title=TITLE)()
ui_steps.close_all_app_from_recent(serial=serial)()
Exemple #2
0
                                account = ACCOUNT,
                                password = PASSWORD,
                                prefer_sync = True)()

# remove document if exists
docs_steps.open_docs(serial = serial)()
docs_utils.search_by(serial = serial, name = TITLE)
while ui_utils.view_exists({"text":TITLE, "resourceIdMatches":".*title"}, serial = serial):
    print "found one"
    docs_steps.delete_document(serial = serial,
                            title = TITLE,
                            no_check = True)()
    docs_utils.search_by(serial = serial, name = TITLE)
docs_utils.exit_search()

# create new document
docs_steps.add_new_document(title = TITLE,
                            undo = True)()

# set keep to true
docs_steps.keep_document(title = TITLE,
                        keep_on_device = True)()

# set keep to true
docs_steps.keep_document(title = TITLE,
                        keep_on_device = False)()

# delete the document
docs_steps.delete_document(title = TITLE)()
ui_steps.close_all_app_from_recent(serial =  serial)()
if account_exists:
    account_synced = ui_steps.sync_google_account(serial = serial,
                            account = ACCOUNT,
                            password = PASSWORD)()

if (total_account_no >= 2) or (not account_exists) or (account_exists and not account_synced):
    ui_steps.remove_all_google_accounts(serial = serial)()
    ui_steps.add_google_account_for_L(serial = serial,
                                account = ACCOUNT,
                                password = PASSWORD,
                                prefer_sync = True)()

# remove document if exists
docs_steps.open_docs(serial = serial)()
docs_utils.search_by(serial = serial, name = TITLE)
while ui_utils.view_exists({"text":TITLE, "resourceIdMatches":".*title"}):
    docs_steps.delete_document(serial = serial,
                            title = TITLE,
                            no_check = True)()
    docs_utils.search_by(serial = serial, name = TITLE)
docs_utils.exit_search()

# create new document
docs_steps.add_new_document(serial = serial,
                            title = TITLE)()
# delete the document
docs_steps.delete_document(serial = serial,
                            title = TITLE)()
ui_steps.close_all_app_from_recent(serial =  serial)()
Exemple #4
0
account_exists = ui_utils.google_account_exists(serial=serial, where=WHERE)
total_account_no = gms_utils.get_google_account_number(serial=serial)

if account_exists:
    account_synced = ui_steps.sync_google_account(serial=serial,
                                                  account=ACCOUNT,
                                                  password=PASSWORD)()

if (total_account_no >= 2) or (not account_exists) or (account_exists
                                                       and not account_synced):
    ui_steps.remove_all_google_accounts(serial=serial)()
    ui_steps.add_google_account_for_L(serial=serial,
                                      account=ACCOUNT,
                                      password=PASSWORD,
                                      prefer_sync=True)()

# remove document if exists
docs_steps.open_docs(serial=serial)()
docs_utils.search_by(serial=serial, name=TITLE)
while ui_utils.view_exists({"text": TITLE, "resourceIdMatches": ".*title"}):
    print "found one"
    docs_steps.delete_document(serial=serial, title=TITLE, no_check=True)()
    docs_utils.search_by(serial=serial, name=TITLE)
docs_utils.exit_search()

docs_steps.add_new_document(undo=True, title=TITLE)()

# delete the document
docs_steps.delete_document(title=TITLE)()
ui_steps.close_all_app_from_recent(serial=serial)()