update to tests
This commit is contained in:
parent
75042fd502
commit
24a3ec57e3
@ -365,7 +365,7 @@ frappe.wiz.Wizard = Class.extend({
|
|||||||
this.parent = $('<div class="setup-wizard-wrapper">').appendTo(this.parent);
|
this.parent = $('<div class="setup-wizard-wrapper">').appendTo(this.parent);
|
||||||
},
|
},
|
||||||
get_message: function(html) {
|
get_message: function(html) {
|
||||||
return $(repl('<div class="panel panel-default">\
|
return $(repl('<div class="panel panel-default" data-state="setup-complete">\
|
||||||
<div class="panel-body" style="padding: 40px;">%(html)s</div>\
|
<div class="panel-body" style="padding: 40px;">%(html)s</div>\
|
||||||
</div>', {html:html}))
|
</div>', {html:html}))
|
||||||
},
|
},
|
||||||
@ -430,7 +430,9 @@ frappe.wiz.Wizard = Class.extend({
|
|||||||
frappe.wiz.WizardSlide = Class.extend({
|
frappe.wiz.WizardSlide = Class.extend({
|
||||||
init: function(opts) {
|
init: function(opts) {
|
||||||
$.extend(this, opts);
|
$.extend(this, opts);
|
||||||
this.$wrapper = $("<div>").appendTo(this.wiz.parent);
|
this.$wrapper = $("<div>")
|
||||||
|
.appendTo(this.wiz.parent)
|
||||||
|
.attr("data-slide-id", this.id);
|
||||||
},
|
},
|
||||||
make: function() {
|
make: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -15,6 +15,7 @@ import install_fixtures
|
|||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def setup_account(args=None):
|
def setup_account(args=None):
|
||||||
|
|
||||||
if frappe.db.sql("select name from tabCompany"):
|
if frappe.db.sql("select name from tabCompany"):
|
||||||
frappe.throw(_("Setup Already Complete!!"))
|
frappe.throw(_("Setup Already Complete!!"))
|
||||||
|
|
||||||
@ -260,16 +261,22 @@ def create_taxes(args):
|
|||||||
# replace % in case someone also enters the % symbol
|
# replace % in case someone also enters the % symbol
|
||||||
tax_rate = (args.get("tax_rate_" + str(i)) or "").replace("%", "")
|
tax_rate = (args.get("tax_rate_" + str(i)) or "").replace("%", "")
|
||||||
|
|
||||||
frappe.get_doc({
|
try:
|
||||||
"doctype":"Account",
|
frappe.get_doc({
|
||||||
"company": args.get("company_name"),
|
"doctype":"Account",
|
||||||
"parent_account": "Duties and Taxes - " + args.get("company_abbr"),
|
"company": args.get("company_name"),
|
||||||
"account_name": args.get("tax_" + str(i)),
|
"parent_account": "Duties and Taxes - " + args.get("company_abbr"),
|
||||||
"group_or_ledger": "Ledger",
|
"account_name": args.get("tax_" + str(i)),
|
||||||
"report_type": "Balance Sheet",
|
"group_or_ledger": "Ledger",
|
||||||
"account_type": "Tax",
|
"report_type": "Balance Sheet",
|
||||||
"tax_rate": flt(tax_rate) if tax_rate else None
|
"account_type": "Tax",
|
||||||
}).insert()
|
"tax_rate": flt(tax_rate) if tax_rate else None
|
||||||
|
}).insert()
|
||||||
|
except frappe.NameError, e:
|
||||||
|
if e.args[2][0]==1062:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
def create_items(args):
|
def create_items(args):
|
||||||
for i in xrange(1,6):
|
for i in xrange(1,6):
|
||||||
|
@ -14,11 +14,89 @@ from __future__ import unicode_literals
|
|||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
from frappe.utils import sel
|
from frappe.utils import sel
|
||||||
|
import time
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
sel.start(verbose=True)
|
try:
|
||||||
|
run()
|
||||||
|
finally:
|
||||||
|
sel.close()
|
||||||
|
|
||||||
|
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")
|
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", "test@erpnext.com")
|
||||||
|
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?")
|
||||||
|
|
||||||
# complete setup
|
# complete setup
|
||||||
# new customer
|
# new customer
|
||||||
|
Loading…
Reference in New Issue
Block a user