FoodMe Cuisine Filtering

The following script illustrates the use of simple, native Toffee commands to perform a sample test on an instance of the "FoodMe" food takeout showcase application.

Foodme is a single-page application originally built by Igor Minar to showcase Google's AngularJS framework (https://github.com/IgorMinar/foodme). We've deployed an instance of that application at http://foodme.toffeetesting.io; feel free to use it and poke around. No login is required, but it does require you to enter your name and delivery address. These can be anything, as you'll see in the script below (kudos to anyone who knows who Arnold Ziffel is), and they are not tracked on the server side. Feel free to enter these commands in your Toffee Composer workspace, or save them in your own scripts.

The following script tests Foodme's ability to filter the choice of restaurants available for takeout by cuisine.  It checks the selections for Thai and African, ensuring that restaurants appear (or not) based on those selections.

This script demonstrates the use and readability of Toffee's "by label" locators, as well as the use of wait commands to add smart pauses in the script to allow the application time to process.


start chrome
wait 5 seconds for pages to load
wait 1 second for commands to execute
load page at http://foodme.toffeetesting.io/#/customer
set textbox "Your Name" to "Arnold Ziffel"
set text "Delivery Address" to "1010 Adams Avenue, Hooterville"
click button "Find Restaurants!"
click checkbox "Thai"
test that link "Satay Village" exists
test that link "Carthage" does not exist
test that link "Burgerama" does not exist
check checkbox "African"
test that link "Satay Village" exists
test that link "Carthage" exists
test that link "Burgerama" does not exist
quit all