From c468a174a7253950268ebfac985e4f9804578f27 Mon Sep 17 00:00:00 2001 From: Philippe Duval Date: Mon, 29 Oct 2018 13:31:16 -0400 Subject: [PATCH 1/4] Delete requirements.txt --- requirements.txt | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 56b2b5adc3..0000000000 --- a/requirements.txt +++ /dev/null @@ -1,47 +0,0 @@ -appnope==0.1.0 -backports.shutil-get-terminal-size==1.0.0 -click==6.7 -dash-core-components==0.3.3 -dash-html-components==0.12.0 -dash-renderer==0.2.9 -dash.ly==0.14.0 -decorator==4.0.11 -enum34==1.1.6 -Flask==0.12 -Flask-Compress==1.4.0 -Flask-SeaSurf==0.2.2 -funcsigs==1.0.2 -functools32==3.2.3.post2 -ipdb==0.10.2 -ipython==5.3.0 -ipython-genutils==0.2.0 -itsdangerous==0.24 -Jinja2==2.9.5 -jsonschema==2.6.0 -jupyter-core==4.3.0 -MarkupSafe==1.0 -mock==2.0.0 -nbformat==4.3.0 -numpy==1.11.0 -pathlib2==2.2.1 -pbr==2.1.0 -pexpect==4.2.1 -pickleshare==0.7.4 -plotly==2.0.8 -pluggy==0.4.0 -prompt-toolkit==1.0.14 -ptyprocess==0.5.1 -py==1.4.33 -Pygments==2.2.0 -python-dateutil==2.5.3 -pytz==2017.2 -requests==2.13.0 -requests-file==1.4.1 -scandir==1.5 -simplegeneric==0.8.1 -six==1.10.0 -tox==2.7.0 -traitlets==4.3.2 -virtualenv==15.1.0 -wcwidth==0.1.7 -Werkzeug==0.12.1 From 23f7aed24bcea0b504696d79989b2611d802dbe4 Mon Sep 17 00:00:00 2001 From: Philippe Duval Date: Mon, 29 Oct 2018 13:33:28 -0400 Subject: [PATCH 2/4] Move dev-requirements to .circleci/requirements --- .circleci/config.yml | 6 +++--- .../requirements/dev-requirements-py37.txt | 0 .../requirements/dev-requirements.txt | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename dev-requirements-py37.txt => .circleci/requirements/dev-requirements-py37.txt (100%) rename dev-requirements.txt => .circleci/requirements/dev-requirements.txt (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ff25e415d6..b189a4b6b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: docker: - image: circleci/python:2.7-stretch-browsers environment: - REQUIREMENTS_FILE: dev-requirements.txt + REQUIREMENTS_FILE: .circleci/requirements/dev-requirements.txt PYLINTRC: .pylintrc steps: @@ -58,7 +58,7 @@ jobs: docker: - image: circleci/python:3.6-stretch-browsers environment: - REQUIREMENTS_FILE: dev-requirements.txt + REQUIREMENTS_FILE: .circleci/requirements/dev-requirements.txt PYLINTRC: .pylintrc PERCY_ENABLE: 0 @@ -67,7 +67,7 @@ jobs: docker: - image: circleci/python:3.7-stretch-browsers environment: - REQUIREMENTS_FILE: dev-requirements-py37.txt + REQUIREMENTS_FILE: .circleci/requirements/dev-requirements-py37.txt PYLINTRC: .pylintrc37 PERCY_ENABLE: 0 diff --git a/dev-requirements-py37.txt b/.circleci/requirements/dev-requirements-py37.txt similarity index 100% rename from dev-requirements-py37.txt rename to .circleci/requirements/dev-requirements-py37.txt diff --git a/dev-requirements.txt b/.circleci/requirements/dev-requirements.txt similarity index 100% rename from dev-requirements.txt rename to .circleci/requirements/dev-requirements.txt From 9e3ca4d0e05576ba4ed15edbee305f64cc6b22e0 Mon Sep 17 00:00:00 2001 From: Philippe Duval Date: Mon, 29 Oct 2018 13:50:40 -0400 Subject: [PATCH 3/4] Fix tests with WebDriverWait. --- tests/IntegrationTests.py | 17 +++++++++++++++++ tests/test_integration.py | 11 ++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/tests/IntegrationTests.py b/tests/IntegrationTests.py index 73f211624c..09ee32d1b0 100644 --- a/tests/IntegrationTests.py +++ b/tests/IntegrationTests.py @@ -5,6 +5,12 @@ from selenium import webdriver import percy +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC + +TIMEOUT = 20 + class IntegrationTests(unittest.TestCase): @@ -15,6 +21,17 @@ def percy_snapshot(cls, name=''): name=snapshot_name ) + def wait_for_element_by_css_selector(self, selector): + return WebDriverWait(self.driver, TIMEOUT).until( + EC.presence_of_element_located((By.CSS_SELECTOR, selector)) + ) + + def wait_for_text_to_equal(self, selector, assertion_text): + return WebDriverWait(self.driver, TIMEOUT).until( + EC.text_to_be_present_in_element((By.CSS_SELECTOR, selector), + assertion_text) + ) + @classmethod def setUpClass(cls): super(IntegrationTests, cls).setUpClass() diff --git a/tests/test_integration.py b/tests/test_integration.py index 3fcce93c52..c507b80a07 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -11,7 +11,7 @@ import dash import time -from dash.dependencies import Input, Output +from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from .IntegrationTests import IntegrationTests from .utils import assert_clean_console, invincible, wait_for @@ -61,8 +61,7 @@ def update_output(value): input1.send_keys('hello world') - output1 = lambda: self.wait_for_element_by_id('output-1') - wait_for(lambda: output1().text == 'hello world') + output1 = self.wait_for_text_to_equal('#output-1', 'hello world') self.percy_snapshot(name='simple-callback-2') self.assertEqual( @@ -106,8 +105,7 @@ def update_text(data): return data self.startServer(app) - output1 = self.wait_for_element_by_id('output-1') - wait_for(lambda: output1.text == 'initial value') + output1 = self.wait_for_text_to_equal('#output-1', 'initial value') self.percy_snapshot(name='wildcard-callback-1') input1 = self.wait_for_element_by_id('input') @@ -115,8 +113,7 @@ def update_text(data): input1.send_keys('hello world') - output1 = lambda: self.wait_for_element_by_id('output-1') - wait_for(lambda: output1().text == 'hello world') + output1 = self.wait_for_text_to_equal('#output-1', 'hello world') self.percy_snapshot(name='wildcard-callback-2') self.assertEqual( From da9da91f1bc817dc233dd7aab30998092833c720 Mon Sep 17 00:00:00 2001 From: Philippe Duval Date: Mon, 29 Oct 2018 14:07:28 -0400 Subject: [PATCH 4/4] Update dcc requirements. --- .circleci/requirements/dev-requirements-py37.txt | 2 +- .circleci/requirements/dev-requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/requirements/dev-requirements-py37.txt b/.circleci/requirements/dev-requirements-py37.txt index c2138d5415..e35c666ff1 100644 --- a/.circleci/requirements/dev-requirements-py37.txt +++ b/.circleci/requirements/dev-requirements-py37.txt @@ -1,4 +1,4 @@ -dash_core_components>=0.27.2 +dash_core_components>=0.35.1 dash_html_components==0.12.0rc3 dash-flow-example==0.0.3 dash-dangerously-set-inner-html diff --git a/.circleci/requirements/dev-requirements.txt b/.circleci/requirements/dev-requirements.txt index 240c7cdbaa..c80469a4f4 100644 --- a/.circleci/requirements/dev-requirements.txt +++ b/.circleci/requirements/dev-requirements.txt @@ -1,4 +1,4 @@ -dash_core_components>=0.27.2 +dash_core_components>=0.35.1 dash_html_components>=0.12.0rc3 dash_flow_example==0.0.3 dash-dangerously-set-inner-html