#include <../../lib/sda.core.au3>

;Execute Test
SimpleTest()

Func SimpleTest()
	Local $oTest,$oRepo,$Page

	;New Test object
	$oTest = NewTest("Simple Test")

	;Start Test
	$oTest.Setup()

	;Test Report create
	$oTest.Report.Create

	;New Browser
	$oTest.NewBrowser('firefox','http://es.altavista.com/')
	$oTest.Browser.start

	;Get repository
	$oRepo = $oTest.SetRepository("AltaVistaRepo")

	;Search in Altavista
	$Page = $oRepo.WebPage("Page.AltaVista")
	$Page.open("/")
	$Page.windowMaximize
	$Page.input.item("search").type("BlueDuck SDA")
	$Page.button.item("search").click

	;Check and add Steps Results
	If $Page.WaitForText("Try Blueduck SDA") = 1 Then
		$oTest.AddStepResult("Step 1","Search",1)
	Else
		$oTest.AddStepResult("Step 2","Search",0)
	EndIf

	$oTest.Report.Close
	$oTest.Browser.stop
EndFunc