Test_SNF_KS_20_ksdemo_UserSettingInAnswers
open /ksdemo/public/classic/
windowMaximize
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
echo -Login by Root
clickAndWait //div[@id='UIPortalLoginFormAction']//a[text()="Sign in"]
echo -Go to Answers  and submit question
open /ksdemo/private/classic/answers
waitForElementPresent link=Submit question
click link=Submit question
echo -Add question for user testing test-
waitForElementPresent QuestionTitle
type QuestionTitle Question in English
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 User setting in Answer by English
selectFrame relative=top
type EmailAddress root@localhost.vn
select AllLanguages label=French
click //option[@value='French']
type QuestionTitle Question in French
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 User setting in Answer by French
selectFrame relative=top
echo -Save
waitForElementPresent //div[@id="AddQuestion"]//a[text()="Save"]
mouseDown //div[@id="AddQuestion"]//a[text()="Save"]
waitForTextPresent The question has been posted.
verifyTextPresent The question has been posted.
echo -OK
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo -View the question in multiple languages-
waitForElementPresent link=Question in English
click link=Question in English
waitForTextPresent User setting in Answer by English
verifyTextPresent User setting in Answer by English
echo -Change language into French
waitForElementPresent link=French
click link=French
waitForTextPresent User setting in Answer by French
verifyTextPresent User setting in Answer by French
waitForTextPresent Question in French
verifyTextPresent Question in French
echo -Change language into English
waitForElementPresent link=English
click link=English
waitForTextPresent Question in English
verifyTextPresent Question in English
waitForTextPresent User setting in Answer by English
verifyTextPresent User setting in Answer by English
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_20
waitForElementPresent description
type description SNF_KS_20 des
echo -Save
waitForElementPresent link=Save
click link=Save
waitForElementPresent link=SNF_KS_20
verifyElementPresent link=SNF_KS_20
echo -Watch Category-
waitForElementPresent //a[@title="SNF_KS_20"]
mouseOver //a[@title="SNF_KS_20"]
contextMenu //a[@title="SNF_KS_20"]
mouseDownRight //div[@id='UIFAQPopupCategories2']//a[@class='IconItem Watch']
waitForText //div[2]/div[3]/div/div/div/div/div[2] You are watching this category, you will be notified about all changes.
verifyText //div[2]/div[3]/div/div/div/div/div[2] You are watching this category, you will be notified about all changes.
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
echo -Set User Settings-
waitForElementPresent link=Settings
click link=Settings
echo --  order-by: alphabet/index
waitForElementPresent order-by
select order-by label=alphabet/Index
echo --  order-type: Descending
waitForElementPresent order-type
select order-type label=Descending
echo --  vote
waitForElementPresent vote
check vote
echo --  Sort question by popularity
waitForElementPresent //form[@id='UISettingForm']//div[@title="Watches"]
click //form[@id='UISettingForm']//div[@title="Watches"]
waitForElementPresent UIUserWatchManager
click //form[@id='UIUserWatchManager']/div[2]//div[1]//td[2]/div/div
assertConfirmation Are you sure you want unwatch this category?
echo -Cancel
waitForElementPresent link=Cancel
click link=Cancel
waitForElementPresent link=Save
click link=Save
echo -Chech Sort-
waitForElementPresent link=Submit question
click link=Submit question
waitForElementPresent QuestionTitle
type QuestionTitle XQuestion for sort
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 sort question
selectFrame relative=top
type EmailAddress root@localhost.vn
echo -Save
waitForElementPresent //div[@id="AddQuestion"]//a[text()="Save"]
mouseDown //div[@id="AddQuestion"]//a[text()="Save"]
waitForTextPresent The question has been posted.
verifyTextPresent The question has been posted.
echo -OK
waitForElementPresent //div[@id='UIAnswersPortlet']//a[text()='OK']
click //div[@id='UIAnswersPortlet']//a[text()='OK']
waitForTextPresent XQuestion for sort
verifyTextPresent XQuestion for sort
echo -Delete data-
waitForElementPresent link=XQuestion for sort
click link=XQuestion for sort
echo -Delete question
waitForElementPresent //div[@id='UIQuestions']//a[@title="Delete"]
click //div[@id='UIQuestions']//a[@title="Delete"]
verifyTextPresent Do you really want to delete this question and its answers ?
echo -Ok
waitForElementPresent //form[@id='UIDeleteQuestion']//a[text()="OK"]
click //form[@id='UIDeleteQuestion']//a[text()="OK"]
echo -open Question in English
waitForElementPresent link=Question in English
click link=Question in English
echo -Delete
waitForElementPresent //div[@id='UIQuestions']//a[@title="Delete"]
click //div[@id='UIQuestions']//a[@title="Delete"]
waitForTextPresent Do you really want to delete this question and its answers ?
verifyTextPresent Do you really want to delete this question and its answers ?
echo -OK
waitForElementPresent //form[@id='UIDeleteQuestion']//a[text()="OK"]
click //form[@id='UIDeleteQuestion']//a[text()="OK"]
echo -Delete Category-
waitForElementPresent //a[@title="SNF_KS_20"]
mouseOver //a[@title="SNF_KS_20"]
contextMenu //a[@title="SNF_KS_20"]
mouseDownRight //div[@id='UIFAQPopupCategories2']//a[@class="IconItem DeleteCategory"]
assertConfirmation Are you sure you want to delete this category ?
waitForTextNotPresent SNF_KS_20
verifyTextNotPresent SNF_KS_20
echo -Reset User Settings-
waitForElementPresent link=Settings
click link=Settings
waitForElementPresent order-by
select order-by label=Created date
waitForElementPresent order-type
select order-type label=Ascending
echo -Save
waitForElementPresent link=Save
click link=Save
echo -Sign out
waitForElementPresent link=Sign out
clickAndWait link=Sign out