Skip to content

Commit

Permalink
Fix the test on CircleCI by using keystrokes
Browse files Browse the repository at this point in the history
For whatever reason, input1.clear() didn't clear the input field
on CircleCI although it was fine when running tests locally.
  • Loading branch information
jkseppan committed Nov 10, 2018
1 parent 379d75c commit 67f3611
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import dash_core_components as dcc
import dash_flow_example

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import dash

from dash.dependencies import Input, Output, State
Expand Down Expand Up @@ -576,15 +578,20 @@ def update_output(value):

self.startServer(app)
output1 = self.wait_for_text_to_equal('#output', 'initial value')

input1 = self.wait_for_element_by_id('input')
input1.clear()

chain = (ActionChains(self.driver)
.click(input1)
.send_keys(Keys.HOME)
.key_down(Keys.SHIFT)
.send_keys(Keys.END)
.key_up(Keys.SHIFT)
.send_keys(Keys.DELETE))
chain.perform()
input1.send_keys('Hello World')

output1 = self.wait_for_text_to_equal('#output', 'Hello World')

cookie = [cookie for cookie in self.driver.get_cookies()
if cookie['name'] == 'dash cookie'][0]
cookie = self.driver.get_cookie('dash cookie')
self.assertEqual(cookie['value'], '"Hello World"') # gets json encoded

assert_clean_console(self)

0 comments on commit 67f3611

Please sign in to comment.