seitime-frappe/frappe/tests/ui/test_todo.py
Rushabh Mehta f409fd7358 [ui-tests] python is back! (#3565)
* [ui-tests] python is back!

* [minor] remove old test

* [test] dont test test_runner

* [tests] try firefox

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome 1

* [tests] try chrome 2

* [tests] try chrome 3

* [tests] try phantomJS

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] try chrome

* [tests] login click button

* [tests] login click button

* [tests] show log

* [test] test with start_maximized

* [test] test only login

* [travis] test another port for selenium

* [travis] try running ui tests after unittests are done

* [travis] pring body_div if fails

* [tests] complete setup wizard for frappe

* [minor] move ui tests to frappe/ui/tests

* [tests] ui tests in public and codacy fixes

* [fix] tests + eslint

* [minor] move tests to tests/ui folder and print console after print

* [fix] linting

* [tests] added documentation and better integration testing

* [promise] form triggering is now promise based

* [test]

* [test]

* [test]

* [test]

* [test] print output

* [minor] default empty in select and print console

* [cleanup] more minor fixes

* [enhance] first-cut done!

* [minor] frappe.run_serially to pass arguments while chaining
2017-07-03 11:53:00 +05:30

50 lines
1 KiB
Python

from __future__ import print_function
from frappe.utils.selenium_testdriver import TestDriver
import unittest
import time, os
class TestToDo(unittest.TestCase):
def setUp(self):
self.driver = TestDriver()
def test_todo(self):
self.driver.login()
# list view
self.driver.set_route('List', 'ToDo')
time.sleep(2)
# new
self.driver.click_primary_action()
time.sleep(2)
# set input
self.driver.set_text_editor('description', 'hello')
# save
self.driver.click_modal_primary_action()
time.sleep(2)
# refresh
self.driver.click_secondary_action()
time.sleep(2)
result_list = self.driver.get_visible_element('.result-list')
first_element_text = (result_list
.find_element_by_css_selector('.list-item')
.find_element_by_css_selector('.list-id').text)
# if os.environ.get('CI'):
# # we don't run this test in Travis as it always fails
# # reinforcing why we use Unit Testing instead of integration
# # testing
# return
self.assertTrue('hello' in first_element_text)
def tearDown(self):
self.driver.close()