Exemplo n.º 1
0
def run_tests(app=None, module=None, doctype=None, verbose=False, tests=(), without_serve=False):
	import frappe.test_runner
	from frappe.utils import sel

	frappe.local.localhost = "http://localhost:8888"
	if not without_serve:
		pipe = subprocess.Popen(["frappe", frappe.local.site, "--serve", "--port", "8888"],
			stdout=subprocess.PIPE, stderr=subprocess.PIPE)
		while not pipe.stderr.readline():
			time.sleep(0.5)
		if verbose:
			print "Test server started"

	sel.start(verbose)

	ret = 1
	try:
		ret = frappe.test_runner.main(app and app[0], module and module[0], doctype and doctype[0], verbose,
			tests=tests)
		if len(ret.failures) == 0 and len(ret.errors) == 0:
			ret = 0
	finally:
		if not without_serve:
			pipe.terminate()

		sel.close()

	return ret
Exemplo n.º 2
0
def run_tests(context,
              app=None,
              module=None,
              doctype=None,
              test=(),
              driver=None,
              profile=False):
    "Run tests"
    import frappe.test_runner
    from frappe.utils import sel
    tests = test

    site = get_single_site(context)
    frappe.init(site=site)

    if frappe.conf.run_selenium_tests and False:
        sel.start(context.verbose, driver)

    try:
        ret = frappe.test_runner.main(app,
                                      module,
                                      doctype,
                                      context.verbose,
                                      tests=tests,
                                      force=context.force,
                                      profile=profile)
        if len(ret.failures) == 0 and len(ret.errors) == 0:
            ret = 0
    finally:
        pass
        if frappe.conf.run_selenium_tests:
            sel.close()

    sys.exit(ret)
Exemplo n.º 3
0
def run_tests(context, app=None, module=None, doctype=None, test=(), driver=None, profile=False):
    "Run tests"
    import frappe.test_runner
    from frappe.utils import sel

    tests = test

    site = get_site(context)
    frappe.init(site=site)

    if frappe.conf.run_selenium_tests and False:
        sel.start(context.verbose, driver)

    try:
        ret = frappe.test_runner.main(
            app, module, doctype, context.verbose, tests=tests, force=context.force, profile=profile
        )
        if len(ret.failures) == 0 and len(ret.errors) == 0:
            ret = 0
    finally:
        pass
        if frappe.conf.run_selenium_tests:
            sel.close()

    sys.exit(ret)
Exemplo n.º 4
0
def run_tests(app=None,
              module=None,
              doctype=None,
              verbose=False,
              tests=(),
              driver=None,
              force=False):
    import frappe.test_runner
    from frappe.utils import sel

    sel.start(verbose, driver)

    ret = 1
    try:
        ret = frappe.test_runner.main(app and app[0],
                                      module and module[0],
                                      doctype and doctype[0],
                                      verbose,
                                      tests=tests,
                                      force=force)
        if len(ret.failures) == 0 and len(ret.errors) == 0:
            ret = 0
    finally:
        sel.close()

    return ret
Exemplo n.º 5
0
def run_tests(app=None, module=None, doctype=None, verbose=False, tests=(), driver=None, force=False):
	import frappe.test_runner
	from frappe.utils import sel

	sel.start(verbose, driver)

	ret = 1
	try:
		ret = frappe.test_runner.main(app and app[0], module and module[0], doctype and doctype[0], verbose,
			tests=tests, force=force)
		if len(ret.failures) == 0 and len(ret.errors) == 0:
			ret = 0
	finally:
		sel.close()

	return ret
Exemplo n.º 6
0
def run():
    def next_slide(idx, selector="next-btn"):
        sel.find('[data-slide-id="{0}"] .{1}'.format(idx, selector))[0].click()
        sel.wait_for_ajax()

    sel.start(verbose=True, driver="Firefox")
    sel.input_wait = 0.2
    sel.login("#page-setup-wizard")

    # slide 1
    next_slide("0")

    sel.set_field("first_name", "Test")
    sel.set_field("last_name", "User")
    sel.set_field("email", "*****@*****.**")
    sel.set_field("password", "test")

    next_slide("1")

    sel.set_select("country", "India")

    next_slide("2")

    sel.set_field("company_name", "Wind Power LLC")
    sel.set_field("fy_start_date", "01-04-2014")
    sel.set_field("company_tagline", "Wind Power For Everyone")

    next_slide("3")
    next_slide("4")

    sel.set_field("tax_1", "VAT")
    sel.set_field("tax_rate_1", "12.5")

    sel.set_field("tax_2", "Service Tax")
    sel.set_field("tax_rate_2", "10.36")

    next_slide("5")

    sel.set_field("customer_1", "Asian Junction")
    sel.set_field("customer_contact_1", "January Vaclavik")
    sel.set_field("customer_2", "Life Plan Counselling")
    sel.set_field("customer_contact_2", "Jana Tobeolisa")
    sel.set_field("customer_3", "Two Pesos")
    sel.set_field("customer_contact_3", "Satomi Shigeki")
    sel.set_field("customer_4", "Intelacard")
    sel.set_field("customer_contact_4", "Hans Rasmussen")

    next_slide("6")

    sel.set_field("item_1", "Wind Turbine A")
    sel.set_field("item_2", "Wind Turbine B")
    sel.set_field("item_3", "Wind Turbine C")

    next_slide("7")

    sel.set_field("supplier_1", "Helios Air")
    sel.set_field("supplier_contact_1", "Quimey Osorio")
    sel.set_field("supplier_2", "Ks Merchandise")
    sel.set_field("supplier_contact_2", "Edgarda Salcedo")
    sel.set_field("supplier_3", "Eagle Hardware")
    sel.set_field("supplier_contact_3", "Hafsteinn Bjarnarsonar")

    next_slide("8")

    sel.set_field("item_buy_1", "Bearing Pipe")
    sel.set_field("item_buy_2", "Bearing Assembly")
    sel.set_field("item_buy_3", "Base Plate")
    sel.set_field("item_buy_4", "Coil")

    next_slide("9", "complete-btn")

    sel.wait('[data-state="setup-complete"]')

    w = raw_input("quit?")
def run():
	def next_slide(idx, selector="next-btn"):
		sel.find('[data-slide-id="{0}"] .{1}'.format(idx, selector))[0].click()
		sel.wait_for_ajax()


	sel.start(verbose=True, driver="Firefox")
	sel.input_wait = 0.2
	sel.login("#page-setup-wizard")

	# slide 1
	next_slide("0")

	sel.set_field("first_name", "Test")
	sel.set_field("last_name", "User")
	sel.set_field("email", "*****@*****.**")
	sel.set_field("password", "test")

	next_slide("1")

	sel.set_select("country", "India")

	next_slide("2")

	sel.set_field("company_name", "Wind Power LLC")
	sel.set_field("fy_start_date", "01-04-2014")
	sel.set_field("company_tagline", "Wind Power For Everyone")

	next_slide("3")
	next_slide("4")

	sel.set_field("tax_1", "VAT")
	sel.set_field("tax_rate_1", "12.5")

	sel.set_field("tax_2", "Service Tax")
	sel.set_field("tax_rate_2", "10.36")

	next_slide("5")

	sel.set_field("customer_1", "Asian Junction")
	sel.set_field("customer_contact_1", "January Vaclavik")
	sel.set_field("customer_2", "Life Plan Counselling")
	sel.set_field("customer_contact_2", "Jana Tobeolisa")
	sel.set_field("customer_3", "Two Pesos")
	sel.set_field("customer_contact_3", "Satomi Shigeki")
	sel.set_field("customer_4", "Intelacard")
	sel.set_field("customer_contact_4", "Hans Rasmussen")

	next_slide("6")

	sel.set_field("item_1", "Wind Turbine A")
	sel.set_field("item_2", "Wind Turbine B")
	sel.set_field("item_3", "Wind Turbine C")

	next_slide("7")

	sel.set_field("supplier_1", "Helios Air")
	sel.set_field("supplier_contact_1", "Quimey Osorio")
	sel.set_field("supplier_2", "Ks Merchandise")
	sel.set_field("supplier_contact_2", "Edgarda Salcedo")
	sel.set_field("supplier_3", "Eagle Hardware")
	sel.set_field("supplier_contact_3", "Hafsteinn Bjarnarsonar")

	next_slide("8")

	sel.set_field("item_buy_1", "Bearing Pipe")
	sel.set_field("item_buy_2", "Bearing Assembly")
	sel.set_field("item_buy_3", "Base Plate")
	sel.set_field("item_buy_4", "Coil")

	next_slide("9", "complete-btn")

	sel.wait('[data-state="setup-complete"]')

	w = raw_input("quit?")
Exemplo n.º 8
0
def start():
    sel.start(verbose=True)
    sel.login("#page-setup-wizard")