Test_SNF_KS_54_ksdemo_BrowseCategorySubCategory
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']
echo --Add new Category
open /portal/private/intranet/answers
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 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 //div[@id='UIQuestions']//a[text()='Submit Question']
click //div[@id='UIQuestions']//a[text()='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']//a[text()='Save']
click //form[@id='UIQuestionForm']//a[text()='Save']
mouseDown link=Save
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo --Add new sub-category and Questions inside
waitForElementPresent link=Category
click link=Category
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='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 link=Category
click link=Category
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='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 //div[@id='UIQuestions']//a[text()='Submit Question']
click //div[@id='UIQuestions']//a[text()='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']//a[text()='Save']
clickAt //form[@id='UIQuestionForm']//a[text()='Save']
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
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 //div[@id='UIQuestions']//a[text()='Submit Question']
click //div[@id='UIQuestions']//a[text()='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']//a[text()='Save']
clickAt //form[@id='UIQuestionForm']//a[text()='Save']
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo --Browse added Category/Sub-Category
open /portal/private/intranet/faq
waitForTextNotPresent Parent question
verifyTextNotPresent Parent question
echo - Setting FAQ portlet
waitForElementPresent //ul[@id='PortalNavigationTopContainer']//a[text()='Edit']
mouseOver //ul[@id='PortalNavigationTopContainer']//a[text()='Edit']
waitForElementPresent //ul[@id='PortalNavigationTopContainer']//a[text()='Page']
mouseOver //ul[@id='PortalNavigationTopContainer']//a[text()='Page']
waitForElementPresent //ul[@id='PortalNavigationTopContainer']//a[text()='Layout']
click //ul[@id='PortalNavigationTopContainer']//a[text()='Layout']
echo - Edit Answer portlet
waitForElementPresent //div[@id='UIPage']
mouseOver //div[@id='UIPage']
waitForElementPresent //div[@id='UIPage']//a[@title='Edit Portlet']
click //div[@id='UIPage']//a[@title='Edit Portlet']
echo - Select Parent_SNF_KS_54 checkbox
waitForElementPresent //div[contains(text(),'Parent_SNF_KS_54')]/preceding-sibling::div/input
clickAt //div[contains(text(),'Parent_SNF_KS_54')]/preceding-sibling::div/input 1,1
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=Close
click link=Close
waitForElementPresent //div[@id='UIPageEditor']//a[@title='Finish']
click //div[@id='UIPageEditor']//a[@title='Finish']
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 /portal/public/intranet/answers
waitForElementPresent //div[@id='UIBreadcumbs']//a[contains(text(),'Parent_SNF_KS_54')]
click //div[@id='UIBreadcumbs']//a[contains(text(),'Parent_SNF_KS_54')]
waitForElementPresent link=Category
click link=Category
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Delete']
clickAt //div[@id='FAQCategroManager']//a[text()='Delete'] 1,1
waitForElementNotPresent link=Parent_SNF_KS_54
verifyElementNotPresent link=Parent_SNF_KS_54
verifyConfirmation Are you sure to delete this category?
echo --View FAQ after delete categories
open /portal/public/intranet/faq
verifyTextPresent Category does not exist. Click here to go back to Home.
click //a[contains(text(),'Category does not exist. Click here to go back to Home.')]
waitForTextNotPresent link=Parent_SNF_KS_54
verifyTextNotPresent link=Parent_SNF_KS_54
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForTextPresent Sign in