Test_SMOKE_KS_03_BasicActionsInFaq
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: Create data from Answer porlet
open /portal/private/intranet/answers
echo -Add category-
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_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 link=Add category
clickAt link=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 link=Submit question
click link=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 /portal/private/intranet/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 /portal/private/intranet/answers
waitForElementPresent //img[@alt='categories']
click //img[@alt='categories']
waitForElementPresent link=Smoke_03_Category
contextMenu link=Smoke_03_Category
clickAt link=Delete
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 /portal/private/intranet/faq
waitForElementNotPresent link=Smoke_03_Category
verifyElementNotPresent link=Smoke_03_Category
echo Step 6: Logout
waitForElementPresent link=Logout
clickAndWait link=Logout
waitForElementPresent //div[contains(text(),'Sign in')]