2017-09-04 05:44:04 +00:00
|
|
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
import frappe, time
|
|
|
|
from frappe.utils.selenium_testdriver import TestDriver
|
|
|
|
|
|
|
|
def run_setup_wizard_test():
|
|
|
|
driver = TestDriver()
|
|
|
|
frappe.db.set_default('in_selenium', '1')
|
2017-09-07 03:33:16 +00:00
|
|
|
frappe.db.commit()
|
2017-09-04 05:44:04 +00:00
|
|
|
|
|
|
|
driver.login('#page-setup-wizard')
|
|
|
|
print('Running Setup Wizard Test...')
|
|
|
|
|
|
|
|
# Language slide
|
2017-09-13 05:56:49 +00:00
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(1)
|
|
|
|
|
2017-09-07 03:33:16 +00:00
|
|
|
driver.set_select("language", "English (United States)")
|
2017-09-04 05:44:04 +00:00
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 05:44:04 +00:00
|
|
|
|
|
|
|
# Region slide
|
|
|
|
driver.wait_for_ajax(True)
|
|
|
|
driver.set_select("country", "India")
|
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 05:44:04 +00:00
|
|
|
|
2017-11-17 14:38:45 +00:00
|
|
|
# Profile slide
|
|
|
|
driver.set_field("full_name", "Great Tester")
|
|
|
|
driver.set_field("email", "great@example.com")
|
|
|
|
driver.set_field("password", "test")
|
|
|
|
driver.wait_for_ajax(True)
|
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
|
|
|
time.sleep(1)
|
2017-09-04 05:44:04 +00:00
|
|
|
|
2017-10-17 07:00:34 +00:00
|
|
|
# domain slide
|
2017-12-06 07:58:06 +00:00
|
|
|
driver.set_multicheck("domains", ["Manufacturing"])
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 05:44:04 +00:00
|
|
|
|
|
|
|
# Org slide
|
2017-09-07 03:33:16 +00:00
|
|
|
driver.set_field("company_name", "For Testing")
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(1)
|
|
|
|
driver.print_console()
|
|
|
|
driver.click(".next-btn")
|
|
|
|
|
2017-09-07 03:33:16 +00:00
|
|
|
driver.set_field("company_tagline", "Just for GST")
|
|
|
|
driver.set_field("bank_account", "HDFC")
|
2017-10-17 07:00:34 +00:00
|
|
|
time.sleep(3)
|
|
|
|
driver.click(".complete-btn")
|
2017-09-04 05:44:04 +00:00
|
|
|
|
2017-09-07 03:33:16 +00:00
|
|
|
# Wait for desktop
|
|
|
|
driver.wait_for('#page-desktop', timeout=600)
|
2017-09-04 05:44:04 +00:00
|
|
|
|
2017-10-17 07:00:34 +00:00
|
|
|
driver.print_console()
|
|
|
|
time.sleep(3)
|
2017-09-04 05:44:04 +00:00
|
|
|
|
|
|
|
frappe.db.set_default('in_selenium', None)
|
2017-09-15 15:52:16 +00:00
|
|
|
frappe.db.set_value("Company", "For Testing", "write_off_account", "Write Off - FT")
|
|
|
|
frappe.db.set_value("Company", "For Testing", "exchange_gain_loss_account", "Exchange Gain/Loss - FT")
|
2017-09-07 03:33:16 +00:00
|
|
|
frappe.db.commit()
|
|
|
|
|
2017-09-04 05:44:04 +00:00
|
|
|
driver.close()
|
|
|
|
|
2017-09-13 17:07:14 +00:00
|
|
|
return True
|