Test_ANS_08_007
open /ksdemo/public/classic/
windowMaximize
echo Step 1: Create category
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
waitForElementPresent //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
clickAndWait //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
waitForElementPresent link=Category
click link=Category
waitForElementPresent link=Add category
mouseDownRight link=Add category
waitForElementPresent eventCategoryName
type eventCategoryName Test_ANS_08_007
type description Add multi-languages question
waitForElementPresent link=Save
click link=Save
echo Step 2: Open Submit question form
waitForElementPresent //div[6]/div/a/span
contextMenu //div[6]/div/a/span
clickAt //div[@id='UIFAQPopupCategories2']/div/div/div/div/div[4]/a
echo Step 3: Submit Question
waitForElementPresent QuestionTitle
type QuestionTitle Question Test_ANS_08_007 English
selectFrame //*[@id="Question___Frame"]
waitForElementPresent //html/body/table/tbody/tr[2]/td/iframe
selectFrame //html/body/table/tbody/tr[2]/td/iframe
waitForElementPresent //html/body
type //html/body Use English
selectFrame relative=top
type EmailAddress root@localhost.com
waitForElementPresent link=Save
clickAt link=Save 1,1
waitForElementPresent //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a
click //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div/a
waitForElementPresent //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div
click //div[3]/div/div[2]/div/div/div/div/div/div[3]/div/table/tbody/tr/td/div/div/div/div
waitForElementPresent //div[6]/div/a/span
click //div[6]/div/a/span
echo Step 3: Show Add language form
waitForElementPresent link=Question Test_ANS_08_007 English
contextMenu link=Question Test_ANS_08_007 English
waitForElementPresent //div[@id='UIPopupQuestion0']/div/div/div/div/div[3]/a
click //div[@id='UIPopupQuestion0']/div/div/div/div/div[3]/a
echo Step 4: Select language
waitForSelectedValue AllLanguages English
select AllLanguages label=Vietnamese
click //option[@value='Vietnamese']
type QuestionTitle Câu hỏi Test_ANS_08_007 Việt Nam
waitForElementPresent QuestionTitle
selectFrame //*[@id="Question___Frame"]
waitForElementPresent //html/body/table/tbody/tr[2]/td/iframe
selectFrame //html/body/table/tbody/tr[2]/td/iframe
waitForElementPresent //html/body
type //html/body Use Tiếng Việt
selectFrame relative=top
type EmailAddress root@localhost.com
waitForElementPresent link=Save
clickAt link=Save 1,1
waitForElementPresent link=Question Test_ANS_08_007 English
click link=Question Test_ANS_08_007 English
waitForText //tr[2]/td/div/div/div[1] Question Test_ANS_08_007 English
verifyText //tr[2]/td/div/div/div[1] Question Test_ANS_08_007 English
click link=Vietnamese
waitForText //tr[2]/td/div/div/div[1] Câu hỏi Test_ANS_08_007 Việt Nam
verifyText //tr[2]/td/div/div/div[1] Câu hỏi Test_ANS_08_007 Việt Nam
echo -- Detele Category --
waitForElementPresent link=Sign out
clickAndWait link=Sign out
waitForElementPresent link=Sign in
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
waitForElementPresent //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
clickAndWait //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
waitForElementPresent //div[6]/div/a/span
mouseOver //div[6]/div/a/span
contextMenu //div[6]/div/a/span
mouseDownRight //div[@id='UIFAQPopupCategories2']/div/div/div/div/div[6]/a
assertConfirmation Are you sure you want to delete this category ?
waitForTextNotPresent Test_ANS_08_007
verifyTextNotPresent Test_ANS_08_007
clickAndWait link=Sign out
waitForElementPresent //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
clickAndWait //div[@id='PortalNavigationTopContainer']/div[4]/div/div/div/div/div/div/a
waitForTextNotPresent Test_ANS_08_007
verifyTextNotPresent Test_ANS_08_007