Skip to content

Commit 7d8a6ae

Browse files
committed
set chrome options for webdriver
1 parent 6dc1db7 commit 7d8a6ae

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/test_callbacks.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
from selenium.webdriver.common.by import By
66

77

8-
9-
108
def test_callback(sample_app, start_app):
11-
129
# Start the app in another thread
1310
start_app(sample_app)
1411

15-
driver = webdriver.Chrome()
12+
options = webdriver.ChromeOptions()
13+
options.add_argument("--headless")
14+
driver = webdriver.Chrome(options=options)
1615
driver.get("http://127.0.0.1:5000")
1716

1817
# Set text in the input with id "input_sample"
@@ -21,8 +20,10 @@ def test_callback(sample_app, start_app):
2120
time.sleep(2)
2221

2322
# Check that it is showing up as the graph title
24-
graph = driver.find_element(By.ID, "graph-component-sample").find_element(By.CLASS_NAME, "g-gtitle")
23+
graph = driver.find_element(By.ID, "graph-component-sample").find_element(
24+
By.CLASS_NAME, "g-gtitle"
25+
)
2526
assert graph.text == "Hello, world!!"
2627

2728
# Close the driver
28-
driver.quit()
29+
driver.quit()

0 commit comments

Comments
 (0)