Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone dash renderer (for custom hooks) - March 1 #367

Merged
merged 37 commits into from
Feb 28, 2019
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ef0fbeb
Use DashRenderer as a standalone library
valentijnnieman Sep 4, 2018
938e466
Cleanup code
valentijnnieman Sep 4, 2018
d916765
Update tests with renderer tag
valentijnnieman Sep 5, 2018
456a090
Fix linting error
valentijnnieman Sep 5, 2018
1e957c7
Refactor generate_renderer function
valentijnnieman Sep 5, 2018
e776e8e
Refactor _generate_renderer
valentijnnieman Sep 5, 2018
3edaa12
Fixed pylint line too long error
valentijnnieman Sep 5, 2018
41fdc76
Fixed pylint trailing whitespace error
valentijnnieman Sep 5, 2018
6c3469f
Added test for custom renderer in index string
valentijnnieman Sep 5, 2018
b46f0df
Use updated dash-renderer tarball for now
valentijnnieman Sep 5, 2018
bd8c9fb
Also use dash-renderer tarball in dev-requirements.txt
valentijnnieman Sep 5, 2018
d4b0418
Update dev-requirements-py37
valentijnnieman Sep 5, 2018
d0120db
dash-renderer tarball in dev-requirements-py37
valentijnnieman Sep 5, 2018
421cd2d
Merged with master & resolved merge conflicts
valentijnnieman Sep 7, 2018
0fe6d64
Add renderer to interpolate_index
valentijnnieman Sep 14, 2018
09a0511
application/json -> application/javascript
valentijnnieman Sep 14, 2018
ec95f0b
Add renderer to interpolate_index
valentijnnieman Sep 14, 2018
2a0c922
Add (broken) test for interpolate_index renderer
valentijnnieman Sep 14, 2018
92e6bd8
Fixed typo
valentijnnieman Sep 14, 2018
827e1a3
Add wait_for_text_to_equal and use it in renderer tests
valentijnnieman Sep 14, 2018
2486dcb
Merge branch 'master' of https://github.com/plotly/dash into standalo…
valentijnnieman Feb 15, 2019
01b3216
Try dash-renderer egg instead of tarball :egg:
valentijnnieman Feb 15, 2019
f3a85ca
Add egg to dev-req files too :egg:
valentijnnieman Feb 15, 2019
ea2b623
Use egg of custom_hooks branch of dash-renderer in circleci config to…
valentijnnieman Feb 15, 2019
1358dbe
Use ActionChain instead of .clear() to fix tests
valentijnnieman Feb 21, 2019
f9002e1
Add correct interpolated index test & fix wildcard test
valentijnnieman Feb 21, 2019
0150977
Remove print from test :see_no_evil:
valentijnnieman Feb 21, 2019
bf651ff
Fix formatting
valentijnnieman Feb 21, 2019
ba95dc6
Remove unused code
valentijnnieman Feb 21, 2019
b94ca9a
Remove unused requirements files
valentijnnieman Feb 27, 2019
11d98a1
Changed renderer param example string
valentijnnieman Feb 27, 2019
caf21a2
Add check for new DashRenderer
valentijnnieman Feb 27, 2019
d15f0ba
const -> var
valentijnnieman Feb 27, 2019
4797b2a
Missing > in script tag
valentijnnieman Feb 27, 2019
7fc8a80
Remove unused wait_for methods
valentijnnieman Feb 27, 2019
5fbadf1
Revert renderer scripts check
valentijnnieman Feb 27, 2019
1c59379
Merge branch 'master' of https://github.com/plotly/dash into standalo…
valentijnnieman Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 32 additions & 12 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,32 @@ def wait_for_element_by_id(id):
return self.driver.find_element_by_id(id)
self.wait_for_element_by_id = wait_for_element_by_id


def wait_for_element_by_css_selector(self, selector):
alexcjohnson marked this conversation as resolved.
Show resolved Hide resolved
start_time = time.time()
error = None
while time.time() < start_time + 20:
try:
return self.driver.find_element_by_css_selector(selector)
except Exception as e:
error = e
pass
time.sleep(0.25)
raise error

def wait_for_text_to_equal(self, selector, assertion_text):
start_time = time.time()
error = None
while time.time() < start_time + 20:
el = self.wait_for_element_by_css_selector(selector)
try:
return self.assertEqual(el.text, assertion_text)
except Exception as e:
error = e
pass
time.sleep(0.25)
raise error

def test_simple_callback(self):
app = dash.Dash(__name__)
app.layout = html.Div([
Expand Down Expand Up @@ -602,13 +628,10 @@ def update_output(value):

input1.send_keys('fire request hooks')

output1 = self.wait_for_element_by_id('output-1')
output_pre = self.wait_for_element_by_id('output-pre')
output_post = self.wait_for_element_by_id('output-post')
self.wait_for_text_to_equal('#output-1', 'fire request hooks')
self.wait_for_text_to_equal('#output-pre', 'request_pre changed this text!')
self.wait_for_text_to_equal('#output-post', 'request_post changed this text!')

self.assertEqual('fire request hooks', output1.text)
self.assertEqual('request_pre changed this text!', output_pre.text)
self.assertEqual('request_post changed this text!', output_post.text)
self.percy_snapshot(name='request-hooks')

def test_with_custom_renderer_interpolated(self):
Expand Down Expand Up @@ -677,11 +700,8 @@ def update_output(value):

input1.send_keys('fire request hooks')

output1 = self.wait_for_element_by_id('output-1')
output_pre = self.wait_for_element_by_id('output-pre')
output_post = self.wait_for_element_by_id('output-post')
self.wait_for_text_to_equal('#output-1', 'fire request hooks')
self.wait_for_text_to_equal('#output-pre', 'request_pre changed this text!')
self.wait_for_text_to_equal('#output-post', 'request_post changed this text!')

self.assertEqual('fire request hooks', output1.text)
self.assertEqual('request_pre changed this text!', output_pre.text)
self.assertEqual('request_post changed this text!', output_post.text)
self.percy_snapshot(name='request-hooks interpolated')