Test_SNF_KS_01_ksdemo_ManageCategory
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
waitForElementPresent //a[@id='UIPortalLoginFormAction']
clickAndWait //a[@id='UIPortalLoginFormAction']
open /portal/private/intranet/answers
echo - Add Category 1
waitForElementPresent link=Category
click link=Category
echo -Select Add Category on Menu
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='Add Category'] 1,1
waitForElementPresent eventCategoryName
type eventCategoryName Technical FAQ
waitForElementPresent //img[@title='Select a user ']
click //img[@title='Select a user ']
waitForElementPresent demo
check demo
waitForElementPresent //form[@id='UIUserSelector']//a[text()="Add"]
click //form[@id='UIUserSelector']//a[text()="Add"]
check moderatequestions
check ViewAuthorInfor
check moderateAnswers
type description SNF_KS_01
click link=Save
echo - Add Category 2
waitForElementPresent link=Category
click link=Category
echo -Select Add Category on Menu
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Add Category']
clickAt //div[@id='FAQCategroManager']//a[text()='Add Category'] 1,1
waitForElementPresent eventCategoryName
type eventCategoryName SNF_KS_02
type description SNF_KS_02
click link=Save
echo -Edit Category-
contextMenu //a[@title="SNF_KS_02"]/span[text()='SNF_KS_02'] contextmenu
storeXpathCount //div[contains(@id,'UIFAQPopupCategories')] totals
storeEval ${totals}-1 total1
storeEval ${totals}-1 total2
waitForElementPresent //div[@id='UIFAQPopupCategories${total1}']//a[text()='Edit']
clickAt //div[@id='UIFAQPopupCategories${total1}']//a[text()='Edit'] 1,1
waitForElementPresent eventCategoryName SNF_KS_02
type eventCategoryName SNF_KS_02 Update
type index 2
type description SNF_KS_02 Desc
waitForElementPresent //form[@id='UICategoryForm']//a[text()="Save"]
click //form[@id='UICategoryForm']//a[text()="Save"]
echo -Verify the edit category-
waitForTextPresent SNF_KS_02 Update
verifyTextPresent SNF_KS_02 Update
echo -Move Category-
contextMenu //a[@title="SNF_KS_02 Update"]/span[text()='SNF_KS_02 Update']
waitForElementPresent //div[@id='UIFAQPopupCategories${total2}']//a[text()='Move']
clickAt //div[@id='UIFAQPopupCategories${total2}']//a[text()='Move'] 1,1
waitForElementPresent //a[contains(text(),'Technical FAQ')]
doubleClick //a[contains(text(),'Technical FAQ')]
waitForElementNotPresent link=SNF_KS_02 Update
verifyElementNotPresent link=SNF_KS_02 Update
waitForElementPresent //a[@title="Technical FAQ"]/span
click //a[@title="Technical FAQ"]/span
waitForElementPresent link=SNF_KS_02 Update
verifyElementPresent link=SNF_KS_02 Update
echo -Delete Category 2-
waitForElementPresent //a[@title="SNF_KS_02 Update"]/span[text()='SNF_KS_02 Update']
mouseOver //a[@title="SNF_KS_02 Update"]/span[text()='SNF_KS_02 Update']
contextMenu //a[@title="SNF_KS_02 Update"]/span[text()='SNF_KS_02 Update']
waitForElementPresent //div[@id='UIFAQPopupCategories0']//a[@class="IconItem DeleteCategory"]
mouseDownRight //div[@id='UIFAQPopupCategories0']//a[@class="IconItem DeleteCategory"]
verifyConfirmation Are you sure to delete this category?
waitForTextNotPresent SNF_KS_02 Update
verifyTextNotPresent SNF_KS_02 Update
echo -Delete Category 1-
waitForElementPresent link=Category
click link=Category
echo -Select Add Category on Menu
waitForElementPresent //div[@id='FAQCategroManager']//a[text()='Delete']
clickAt //div[@id='FAQCategroManager']//a[text()='Delete'] 1,1
verifyConfirmation Are you sure to delete this category?
waitForTextNotPresent Technical FAQ
verifyTextNotPresent Technical FAQ
mouseOver //li[@id='UserNavigationTabsContainer']
waitForElementPresent //li[@id='UserNavigationTabsContainer']//a[text()='Logout']
clickAndWait //li[@id='UserNavigationTabsContainer']//a[text()='Logout']
waitForTextPresent Sign in