Test_SMOKE_KS_03_BasicActionsInFaq
echo Step 1: Login
open /ksdemo/public/classic/
windowMaximize
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username root
type username root
type password gtn
clickAndWait //a[@id='UIPortalLoginFormAction']
echo Step 2: Create data from Answer porlet
open /ksdemo/private/classic/answers
echo -Add category-
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='Add Category']
waitForElementPresent eventCategoryName
type eventCategoryName Smoke_03_Category
type description Description for Smoke_03
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=Smoke_03_Category
verifyElementPresent link=Smoke_03_Category
echo -Add sub-category
click link=Smoke_03_Category
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='Add Category']
waitForElementPresent eventCategoryName
type eventCategoryName Sub-Category
type description Description for Sub-Category
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=Sub-Category
verifyElementPresent link=Sub-Category
echo -Add Question-
waitForElementPresent //div[@id='UIQuestions']//a[text()='Submit Question']
click //div[@id='UIQuestions']//a[text()='Submit Question']
waitForElementPresent QuestionTitle
type QuestionTitle Smoke_03_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_03_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_03_Question
verifyElementPresent link=Smoke_03_Question
echo -Add answer-
click link=Smoke_03_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_03
selectFrame relative=top
waitForElementPresent link=Save
click link=Save
waitForTextPresent Answer for Smoke_03
verifyTextPresent Answer for Smoke_03
echo Step 3: Browse Category
open /ksdemo/private/classic/faq
waitForElementPresent link=Smoke_03_Category
clickAndWait link=Smoke_03_Category
waitForElementPresent link=Sub-Category
verifyElementPresent link=Sub-Category
echo Step 4: Browse Sub-Category
waitForElementPresent //img[@alt='categories']
clickAndWait //img[@alt='categories']
waitForElementPresent link=Sub-Category
clickAndWait link=Sub-Category
echo Step 5: Browse Question
waitForElementPresent //img[@alt='categories']
clickAndWait //img[@alt='categories']
waitForElementPresent link=Smoke_03_Question
click link=Smoke_03_Question
waitForTextPresent Answer for Smoke_03
verifyTextPresent Answer for Smoke_03
echo -Delete Test data-
open /ksdemo/private/classic/answers
waitForElementPresent //img[@alt='categories']
click //img[@alt='categories']
waitForElementPresent //div[6]/div/a/span
mouseOver //div[6]/div/a/span
contextMenu //div[6]/div/a/span
mouseDownRight //div[@id='UIFAQPopupCategories2']/div/div/div/div/div[6]/a
assertConfirmation Are you sure you want to delete this category ?
waitForElementNotPresent link=Smoke_03_Category
verifyElementNotPresent link=Smoke_03_Category
echo -Verify present of category after delete
open /ksdemo/private/classic/faq
waitForElementNotPresent link=Smoke_03_Category
verifyElementNotPresent link=Smoke_03_Category
echo Step 6: Logout
waitForElementPresent link=Sign out
clickAndWait link=Sign out
waitForElementPresent link=Sign in