test :test case for setting opportunity as lost
This commit is contained in:
parent
d9a768a88f
commit
dc218ebeeb
@ -4,7 +4,33 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
import unittest, time
|
||||
from frappe.utils.selenium_testdriver import TestDriver
|
||||
from erpnext.crm.doctype.opportunity.test_opportunity import make_opportunity
|
||||
|
||||
class TestLostReason(unittest.TestCase):
|
||||
pass
|
||||
def setUp(self):
|
||||
self.driver = TestDriver()
|
||||
|
||||
def test_opportunity_lost(self):
|
||||
doc = make_opportunity(with_items=0)
|
||||
doc.save()
|
||||
self.assertEqual(doc.status, "Open")
|
||||
|
||||
self.driver.set_route('Form', 'Opportinuty', doc.name)
|
||||
time.sleep(2)
|
||||
|
||||
lost = self.driver.find('.form-inner-toolbar')[1]
|
||||
lost.click()
|
||||
time.sleep(2)
|
||||
|
||||
self.driver.set_text_editor('order_lost_reason', 'Test reason for detailed reason')
|
||||
|
||||
self.driver.click_primary_action()
|
||||
self.assertEqual(doc.status, "Lost")
|
||||
self.assertEqual(doc.order_lost_reason, "Test reason for detailed reason")
|
||||
|
||||
def tearDown(self):
|
||||
self.driver.close()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user