Test_SMOKE_KS_02_BasicActionsInAnswers
echo Step 1: Login
open /portal/public/intranet/
windowMaximize
waitForElementPresent //div[contains(text(),'Sign in')]
click //div[contains(text(),'Sign in')]
waitForElementPresent username root
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
echo Step 2: Add category
open /portal/private/intranet/answers
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent link=Add category
clickAt link=Add category
waitForElementPresent eventCategoryName
type eventCategoryName Smoke_02_Category
waitForElementPresent //img[@title='Select a user ']
click //img[@title='Select a user ']
waitForElementPresent demo
click demo
waitForElementPresent //form[@id='UIUserSelector']/div[2]/div[2]/table/tbody/tr/td/a[1]/div/div/div
click //form[@id='UIUserSelector']/div[2]/div[2]/table/tbody/tr/td/a[1]/div/div/div
click ViewAuthorInfor
click moderateAnswers
type description SNF_KS_01
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=Smoke_02_Category
verifyElementPresent link=Smoke_02_Category
echo Step 3: Ask Question
waitForElementPresent link=Smoke_02_Category
click link=Smoke_02_Category
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle Smoke_02_Question
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 The detail of Smoke_02_Question
selectFrame relative=top
type EmailAddress root@localhost.vn
waitForElementPresent link=Save
mouseDown link=Save
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
waitForElementPresent link=Smoke_02_Question
verifyElementPresent link=Smoke_02_Question
echo step 4: Add answers
click link=Smoke_02_Question
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 for Smoke_02
selectFrame relative=top
waitForElementPresent link=Save
click link=Save
waitForTextPresent Answer for Smoke_02
verifyTextPresent Answer for Smoke_02
verifyElementPresent //div[@id='SetWidthContent']/div/div/table/tbody/tr/td[3]/a/div[@class='UnApprovedQuestion']
echo -Check unapprove answer by normal user
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForElementPresent //div[contains(text(),'Sign in')]
click //div[contains(text(),'Sign in')]
waitForElementPresent username
type username demo
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
open /portal/private/intranet/answers
waitForElementPresent link=Smoke_02_Category
click link=Smoke_02_Category
waitForElementPresent link=Smoke_02_Question
click link=Smoke_02_Question
waitForTextNotPresent Answer for Smoke_02
verifyTextNotPresent Answer for Smoke_02
echo Step 5: Approve answer
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForElementPresent //div[contains(text(),'Sign in')]
click //div[contains(text(),'Sign in')]
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
open /portal/private/intranet/answers
waitForElementPresent link=Smoke_02_Category
click link=Smoke_02_Category
waitForElementPresent link=Smoke_02_Question
click link=Smoke_02_Question
waitForElementPresent //div[@id='SetWidthContent']/div/div/table/tbody/tr/td[3]/a/div
click //div[@id='SetWidthContent']/div/div/table/tbody/tr/td[3]/a/div
waitForElementPresent //div[@id='SetWidthContent']/div/div/table/tbody/tr/td[3]/a/div[@class='ApprovedQuestion']
verifyElementPresent //div[@id='SetWidthContent']/div/div/table/tbody/tr/td[3]/a/div[@class='ApprovedQuestion']
echo Step 6: Comment for Question
waitForElementPresent //div[@id='AnswersViewContent']//div[@class='Comment']/a
click //div[@id='AnswersViewContent']//div[@class='Comment']/a
waitForElementPresent //iframe[@id='CommentContent___Frame']
selectFrame //iframe[@id='CommentContent___Frame']
waitForElementPresent //html/body/table/tbody/tr[2]/td/iframe
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body Comment Smoke_02
selectFrame relative=top
waitForElementPresent link=Save
click link=Save
waitForTextPresent Comment Smoke_02
verifyTextPresent Comment Smoke_02
echo -Delete Test data-
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent link=Delete
clickAt link=Delete
assertConfirmation Are you sure you want to delete this category ?
waitForElementNotPresent link=Smoke_02_Category
verifyElementNotPresent link=Smoke_02_Category
echo Step 7: Logout
waitForElementPresent link=Logout
clickAndWait link=Logout