Test_SNF_KS_12_defaultportal_ManageQuestion
open /portal/public/intranet/
windowMaximize
waitForElementPresent //div[2]/div[2]/div[1]/div/div/div[1]
click //div[2]/div[2]/div[1]/div/div/div[1]
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div[@class='ButtonMiddle']/a
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 SNF_KS_12_Category 1
waitForElementPresent link=Save
click link=Save
waitForTextPresent SNF_KS_12_Category 1
verifyTextPresent SNF_KS_12_Category 1
echo -Add Question-
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle SNF_KS_12_Question 1
pause 1000
selectFrame //iframe[@id='Question___Frame']
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body SNF_KS_12_Question 1 Description
selectFrame relative=top
type EmailAddress root@localhost.vn
waitForElementPresent //div[@id="AddQuestion"]//div[@class="UIAction"]//div[@class="ButtonMiddle"]
clickAt //div[@id="AddQuestion"]//div[@class="UIAction"]//div[@class="ButtonMiddle"]
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
waitForElementPresent link=SNF_KS_12_Category 1
click link=SNF_KS_12_Category 1
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle SNF_KS_12_Question 2
pause 1000
selectFrame //iframe[@id='Question___Frame']
selectFrame //html/body/table/tbody/tr[2]/td/iframe
type //html/body SNF_KS_12_Question 2 Description
selectFrame relative=top
type EmailAddress root@localhost.vn
waitForElementPresent //div[@id="AddQuestion"]//div[@class="UIAction"]//div[@class="ButtonMiddle"]
clickAt //div[@id="AddQuestion"]//div[@class="UIAction"]//div[@class="ButtonMiddle"]
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo -Manage question-
waitForElementPresent link=Manage questions
click link=Manage questions
waitForElementPresent //td[3]/div/div
click //td[3]/div/div
waitForTextPresent No
verifyTextPresent No
waitForElementPresent //td[3]/div/div
click //td[3]/div/div
waitForElementPresent //table[@class='UIGrid']/tbody/tr[2]/td[3]/div[@class='TrueIcon']/div
verifyElementPresent //table[@class='UIGrid']/tbody/tr[2]/td[3]/div[@class='TrueIcon']/div
waitForElementPresent //td[4]/div/div
click //td[4]/div/div
waitForTextPresent No
verifyTextPresent No
waitForElementPresent //td[4]/div/div
click //td[4]/div/div
waitForElementPresent //table[@class='UIGrid']/tbody/tr[2]/td[4]/div[@class='TrueIcon']/div
verifyElementPresent //table[@class='UIGrid']/tbody/tr[2]/td[4]/div[@class='TrueIcon']/div
waitForElementPresent //div[@id='UITabContent']//table/tbody/tr[2]/td[5]/div[1]/div
click //div[@id='UITabContent']//table/tbody/tr[2]/td[5]/div[1]/div
waitForElementPresent QuestionTitle
type QuestionTitle Edit Question
waitForElementPresent //form[@id='UIQuestionForm']//table[@class='ActionContainer']//div
clickAt //form[@id='UIQuestionForm']//table[@class='ActionContainer']//div
waitForTextPresent Edit Question
verifyTextPresent Edit Question
waitForElementPresent ListCategories
select ListCategories label=SNF_KS_12_Category 1
waitForTextPresent SNF_KS_12_Question 2
verifyTextPresent SNF_KS_12_Question 2
select ListCategories label=All
waitForElementPresent //option[@value='All']
click //option[@value='All']
waitForElementPresent //div[@id='UITabContent']//table//tr[2]/td[5]/div[2]/div
click //div[@id='UITabContent']//table//tr[2]/td[5]/div[2]/div
waitForElementPresent //form[@id='Confirm Delete']/div[3]/table/tbody/tr/td//div[@class='ButtonMiddle']
click //form[@id='Confirm Delete']/div[3]/table/tbody/tr/td//div[@class='ButtonMiddle']
waitForTextNotPresent Edit Question
verifyTextNotPresent Edit Question
waitForElementPresent //form[@id='QuestionInfo']/div[2]//div[1]//div[1]//div[2]/div/div/div/div/div
click //form[@id='QuestionInfo']/div[2]//div[1]//div[1]//div[2]/div/div/div/div/div
waitForElementPresent //form[@id='UIQuestionManagerForm']/div[2]//div/div/div/div
click //form[@id='UIQuestionManagerForm']/div[2]//div/div/div/div
echo -Delete Test data-
waitForElementPresent //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
click //div[@onclick="eXo.faq.UIAnswersPortlet.viewTitle('FAQCategroManager');"]
waitForElementPresent link=Delete
clickAt link=Delete
assertConfirmation Are you sure you want to delete this category ?
waitForTextNotPresent SNF_KS_12_Category 1
verifyTextNotPresent SNF_KS_12_Category 1
waitForElementPresent link=Logout
clickAt link=Logout