Test_SNF_KS_10_ksdemo_ViewPrintQuestion
open /ksdemo/public/classic
windowMaximize
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
echo --  Login Root
clickAndWait //div[@id='UIPortalLoginFormAction']//a[text()="Sign in"]
echo --  Go to Answers
open /ksdemo/private/classic/answers
echo --  Add Question-
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle Question for Print
pause 1000
waitForElementPresent //iframe[@id='Question___Frame']
selectFrame //iframe[@id='Question___Frame']
waitForElementPresent //html/body/table/tbody/tr[2]/td/iframe
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body English Description.
selectFrame relative=top
type EmailAddress root@localhost.vn
echo --  Save
waitForElementPresent link=Save
mouseDown link=Save
echo --  OK
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo --  Print Question-
waitForElementPresent link=Question for Print
click link=Question for Print
waitForElementPresent //div[@class='DecoratorMC']//a[@title="Print"]
click //div[@class='DecoratorMC']//a[@title="Print"]
pause 3000
echo --  Verify data
waitForTextPresent Question for Print
verifyTextPresent Question for Print
waitForTextPresent English Description.
verifyTextPresent English Description.
echo --  Close
waitForElementPresent //div[@class='UIAction']//a[text()="Close"]
click //div[@class='UIAction']//a[text()="Close"]
echo --  Delete Test Data-
waitForElementPresent //div[@id='AnswersViewContent']//a[@title="Delete"]
click //div[@id='AnswersViewContent']//a[@title="Delete"]
waitForElementPresent //form[@id='UIDeleteQuestion']//a[text()="OK"]
click //form[@id='UIDeleteQuestion']//a[text()="OK"]
waitForTextNotPresent Question for Print
verifyTextNotPresent Question for Print
echo --  Sign out
waitForElementPresent link=Sign out
click link=Sign out