Create attractive VASL scenarios, with loads of useful information embedded to assist with game play.
https://vasl-templates.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
""" Test response generation. """
|
|
|
|
from vasl_templates.webapp.tests.utils import find_child
|
|
|
|
# ---------------------------------------------------------------------
|
|
|
|
def test_generate( webapp, webdriver ):
|
|
"""Test response generation."""
|
|
|
|
# initialize
|
|
webdriver.get( webapp.url_for( "main" ) )
|
|
|
|
# try saying something
|
|
textbox = find_child( webdriver, "input[type='text']" )
|
|
textbox.clear()
|
|
textbox.send_keys( "Hi, there!" )
|
|
submit = find_child( webdriver, "input[type='submit']" )
|
|
submit.click()
|
|
response = find_child( webdriver, "#response" )
|
|
assert response.text == 'You said: "Hi, there!"'
|
|
|
|
# try saying something else
|
|
textbox = find_child( webdriver, "input[type='text']" )
|
|
textbox.clear()
|
|
textbox.send_keys( "Yo mama so big..." )
|
|
submit = find_child( webdriver, "input[type='submit']" )
|
|
submit.click()
|
|
response = find_child( webdriver, "#response" )
|
|
assert response.text == 'You said: "Yo mama so big..."'
|
|
|
|
# try saying nothing
|
|
textbox = find_child( webdriver, "input[type='text']" )
|
|
textbox.clear()
|
|
submit = find_child( webdriver, "input[type='submit']" )
|
|
submit.click()
|
|
response = find_child( webdriver, "#response" )
|
|
assert response.text == "You said: nothing!"
|
|
|