Test_SNF_KS_12_ksdemo_ManageQuestion
open /portal/public/intranet/
windowMaximize
waitForElementPresent //div[contains(text(),'Sign in')]
click //div[contains(text(),'Sign in')]
waitForElementPresent username
type username root
waitForElementPresent password
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
open /portal/private/intranet/answers
echo - Submit question doesn't belong any category
waitForElementPresent link=Submit Question
click link=Submit Question
waitForElementPresent id=QuestionTitle
type id=QuestionTitle Question no category
waitForElementPresent id=EmailAddress
type id=EmailAddress root@localhost.vn
waitForElementPresent link=Save
mouseDown link=Save
waitForElementPresent link=OK
click link=OK
waitForElementPresent link=Question no category
verifyElementPresent link=Question no category
echo - Add category
waitForElementPresent link=Category
click link=Category
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='Add Category']
waitForElementPresent eventCategoryName
type eventCategoryName SNF_KS_12
waitForElementPresent description
type description SNF_KS_12 des
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=SNF_KS_12
verifyElementPresent link=SNF_KS_12
echo - Submit question ofa category
click link=SNF_KS_12
waitForElementPresent link=Submit Question
click link=Submit Question
waitForElementPresent id=QuestionTitle
type id=QuestionTitle Question of a category
waitForElementPresent id=EmailAddress
type id=EmailAddress root@localhost.vn
waitForElementPresent //form[@id='UIQuestionForm']//a[text()='Save']
clickAt //form[@id='UIQuestionForm']//a[text()='Save']
waitForElementPresent link=OK
click link=OK
waitForElementPresent link=Question of a category
verifyElementPresent link=Question of a category
echo -Manage question-
waitForElementPresent //a[contains(text(),'Manage Questions')]
click //a[contains(text(),'Manage Questions')]
echo - Inactive question 1
waitForElementPresent //td[text()='Question no category']/following::td//div[@title='Disapprove']
click //td[text()='Question no category']/following::td//div[@title='Disapprove']
waitForElementPresent //td[text()='Question no category']/following::td//div[@title='Approve']
verifyElementPresent //td[text()='Question no category']/following::td//div[@title='Approve']
echo - Inactive question 2
waitForElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Disapprove']
click //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Disapprove']
waitForElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Approve']
verifyElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Approve']
echo - Edit question
waitForElementPresent //div[@id='UITabContent']//div[@title='Edit']
click //div[@id='UITabContent']//div[@title='Edit']
waitForElementPresent QuestionTitle
type QuestionTitle Question no category Update
waitForElementPresent link=Save
mouseDown link=Save
waitForTextPresent Question no category Update
verifyTextPresent Question no category Update
echo - Select Categories
waitForElementPresent ListCategories
select ListCategories label=SNF_KS_12
waitForTextPresent SNF_KS_12
verifyTextPresent SNF_KS_12
waitForElementPresent ListCategories
select ListCategories label=All
echo - Delete question
waitForElementPresent //div[@id='UITabContent']//div[@title='Delete']
click //div[@id='UITabContent']//div[@title='Delete']
waitForElementPresent //form[@id='Confirm Delete']//a[text()='OK']
click //form[@id='Confirm Delete']//a[text()='OK']
waitForTextNotPresent Question no category Update
verifyTextNotPresent Question no category Update
echo - Active question 2
waitForElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Approve']
click //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Approve']
waitForElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Disapprove']
verifyElementPresent //td[contains(text(),'SNF_KS_12')]/following-sibling::td//div[@title='Disapprove']
waitForElementPresent //form[@id='UIQuestionManagerForm']//a[text()='Close']
click //form[@id='UIQuestionManagerForm']//a[text()='Close']
echo - Answer question
waitForElementPresent link=Question of a category
click link=Question of a category
waitForElementPresent link=Answer
click link=Answer
waitForElementPresent //iframe[@id='QuestionRespone___Frame']
selectFrame //iframe[@id='QuestionRespone___Frame']
waitForElementPresent //html/body/table/tbody/tr[2]/td/iframe
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body Answer 1
waitForElementPresent link=Save
click link=Save
echo - Check Open question
waitForElementPresent //a[contains(text(),'Manage Questions')]
click //a[contains(text(),'Manage Questions')]
waitForElementPresent //form[@id='QuestionInfo']//div[contains(text(),'Open Questions')]
click //form[@id='QuestionInfo']//div[contains(text(),'Open Questions')]
echo - Verify label "No Questions" displayed
waitForTextPresent No Questions
verifyTextPresent No Questions
waitForElementPresent //form[@id='UIQuestionManagerForm']//a[text()='Close']
click //form[@id='UIQuestionManagerForm']//a[text()='Close']
echo - Delete data
waitForElementPresent link=Category
click link=Category
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Delete']
clickAt //div[@id='FAQCategroManager']//a[text()='Delete']
verifyConfirmation Are you sure to delete this category?
waitForElementNotPresent link=SNF_KS_12
verifyElementNotPresent link=SNF_KS_12
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForTextPresent Sign in