Test_SNF_KS_54_ksdemo_BrowseCategorySubCategory
echo --View default category/sub-category/Question
windowMaximize
open /ksdemo/public/classic/
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div[@class='ButtonMiddle']/a
open /ksdemo/private/classic/faq
waitForElementPresent link=What does eXo Knowledge Suite contain ?
click link=What does eXo Knowledge Suite contain ?
waitForElementPresent link=Forum Troubleshooting
click link=Forum Troubleshooting
waitForElementPresent //div[@id='UIViewer']/div/span[2]/a[@class='ActionLink']
click //div[@id='UIViewer']/div/span[2]/a[@class='ActionLink']
waitForElementPresent //img[@alt='categories']
clickAndWait //img[@alt='categories']
echo --Add new Category
open /ksdemo/private/classic/answers
waitForElementPresent link=Category
click link=Category
waitForElementPresent link=Add category
clickAt link=Add category
waitForElementPresent eventCategoryName
type eventCategoryName Parent_SNF_KS_54
waitForElementPresent link=Save
click link=Save
echo --Add new question
waitForElementPresent link=Parent_SNF_KS_54
click link=Parent_SNF_KS_54
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle Parent question
waitForElementPresent //iframe[@id='Question___Frame']
selectFrame //iframe[@id='Question___Frame']
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body What is open question
selectFrame relative=top
type EmailAddress root@localhost.com
waitForElementPresent //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
clickAt //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
waitForElementPresent //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
click //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
echo --Add new sub-category and Questions inside
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent link=Add category
clickAt link=Add category
type eventCategoryName Sub1_SNF_KS_54
waitForElementPresent link=Save
click link=Save
waitForTextPresent Sub1_SNF_KS_54
verifyTextPresent Sub1_SNF_KS_54
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent link=Add category
clickAt link=Add category
type eventCategoryName Sub2_SNF_KS_54
waitForElementPresent link=Save
click link=Save
waitForTextPresent Sub2_SNF_KS_54
verifyTextPresent Sub2_SNF_KS_54
echo --Add question for sub-category 1
waitForElementPresent link=Sub1_SNF_KS_54
click link=Sub1_SNF_KS_54
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle Sub-question 1
waitForElementPresent //iframe[@id='Question___Frame']
selectFrame //iframe[@id='Question___Frame']
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body what is pending question
selectFrame relative=top
type EmailAddress root@localhost.com
waitForElementPresent //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
clickAt //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
waitForElementPresent //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
click //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
echo --Add question for subcategory 2
waitForElementPresent link=Parent_SNF_KS_54
click link=Parent_SNF_KS_54
waitForElementPresent link=Sub2_SNF_KS_54
click link=Sub2_SNF_KS_54
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle Sub-question 2
waitForElementPresent //iframe[@id='Question___Frame']
selectFrame //iframe[@id='Question___Frame']
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body what is answer
selectFrame relative=top
type EmailAddress root@localhost.com
waitForElementPresent //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
clickAt //form[@id='UIQuestionForm']/div[3]/table[@class='ActionContainer']/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
waitForElementPresent //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
click //div[@id='UIAnswersPortlet']//div[@class='ExoMessageDecorator']/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div[@class='ActionButton LightBlueStyle']/div/div/div
echo --Browse added Category/Sub-Category
open /ksdemo/private/classic/faq
waitForTextPresent Parent question
verifyTextPresent Parent question
waitForElementPresent link=Sub1_SNF_KS_54
click link=Sub1_SNF_KS_54
waitForTextPresent Sub-question 1
verifyTextPresent Sub-question 1
waitForElementPresent //img[@alt='categories']
click //img[@alt='categories']
waitForElementPresent link=Sub2_SNF_KS_54
click link=Sub2_SNF_KS_54
waitForTextPresent Sub-question 2
verifyTextPresent Sub-question 2
echo --Delete add categories
open /ksdemo/private/classic/answers
waitForElementPresent //div[@id='UIBreadcumbs']/div/table/tbody/tr/td/div//div[2]
click //div[@id='UIBreadcumbs']/div/table/tbody/tr/td/div//a[2]
waitForElementPresent xpath=//div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click xpath=//div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent //div[@id='FAQCategroManager']/div/div/div/div/div[3]
clickAt //div[@id='FAQCategroManager']/div/div/div/div/div[3]
assertConfirmation Are you sure you want to delete this category ?
waitForElementNotPresent link=Parent_SNF_KS_54
verifyElementNotPresent link=Parent_SNF_KS_54
echo --View FAQ after delete categories
open /ksdemo/private/classic/faq
waitForTextPresent Category does not exist.Click here to back home
verifyTextPresent Category does not exist.Click here to back home
waitForElementPresent //div[@id='UIViewer']/a
click //div[@id='UIViewer']/a
waitForTextNotPresent link=Parent_SNF_KS_54
verifyTextNotPresent link=Parent_SNF_KS_54
clickAndWait link=Sign out