2017-09-04 11:14:04 +05:30
|
|
|
# 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 09:03:16 +05:30
|
|
|
frappe.db.commit()
|
2017-09-04 11:14:04 +05:30
|
|
|
|
|
|
|
driver.login('#page-setup-wizard')
|
|
|
|
print('Running Setup Wizard Test...')
|
|
|
|
|
|
|
|
# Language slide
|
2017-09-13 11:26:49 +05:30
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(1)
|
|
|
|
|
2017-09-07 09:03:16 +05:30
|
|
|
driver.set_select("language", "English (United States)")
|
2017-09-04 11:14:04 +05:30
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 11:14:04 +05:30
|
|
|
|
|
|
|
# Region slide
|
|
|
|
driver.wait_for_ajax(True)
|
|
|
|
driver.set_select("country", "India")
|
|
|
|
driver.wait_for_ajax(True)
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 11:14:04 +05:30
|
|
|
|
2017-11-17 20:08:45 +05:30
|
|
|
# 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 11:14:04 +05:30
|
|
|
|
2017-10-17 12:30:34 +05:30
|
|
|
# domain slide
|
2017-12-06 13:28:06 +05:30
|
|
|
driver.set_multicheck("domains", ["Manufacturing"])
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(1)
|
|
|
|
driver.click(".next-btn")
|
2017-09-04 11:14:04 +05:30
|
|
|
|
|
|
|
# Org slide
|
2017-09-07 09:03:16 +05:30
|
|
|
driver.set_field("company_name", "For Testing")
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(1)
|
|
|
|
driver.print_console()
|
|
|
|
driver.click(".next-btn")
|
|
|
|
|
2017-09-07 09:03:16 +05:30
|
|
|
driver.set_field("company_tagline", "Just for GST")
|
|
|
|
driver.set_field("bank_account", "HDFC")
|
2017-10-17 12:30:34 +05:30
|
|
|
time.sleep(3)
|
|
|
|
driver.click(".complete-btn")
|
2017-09-04 11:14:04 +05:30
|
|
|
|
2017-09-07 09:03:16 +05:30
|
|
|
# Wait for desktop
|
|
|
|
driver.wait_for('#page-desktop', timeout=600)
|
2017-09-04 11:14:04 +05:30
|
|
|
|
2017-10-17 12:30:34 +05:30
|
|
|
driver.print_console()
|
|
|
|
time.sleep(3)
|
2017-09-04 11:14:04 +05:30
|
|
|
|
|
|
|
frappe.db.set_default('in_selenium', None)
|
2017-09-15 21:22:16 +05:30
|
|
|
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 09:03:16 +05:30
|
|
|
frappe.db.commit()
|
|
|
|
|
2017-09-04 11:14:04 +05:30
|
|
|
driver.close()
|
|
|
|
|
2017-09-13 22:37:14 +05:30
|
|
|
return True
|