| ks12 | ||
| echo | --- Sign in | |
| open | /portal/public/intranet/ | |
| windowMaximize | ||
| waitForElementPresent | //div[contains(text(),'Sign in')] | |
| click | //div[contains(text(),'Sign in')] | |
| waitForElementPresent | username | |
| type | username | root |
| type | password | gtn |
| clickAndWait | //div[@id='UIPortalLoginFormAction']//a[text()='Sign in'] | |
| clickAndWait | link=answers | |
| echo | --- Create Data | |
| echo | ----- Create question Q1_SNF_KS_12 which belongs to the top level of categories | |
| waitForElementPresent | link=Submit question | |
| click | link=Submit question | |
| waitForElementPresent | QuestionTitle | |
| type | QuestionTitle | Q1_SNF_KS_12 |
| waitForElementPresent | //iframe[@id='Question___Frame'] | |
| selectFrame | //iframe[@id='Question___Frame'] | |
| waitForElementPresent | //td[@id='xEditingArea']//iframe | |
| selectFrame | //td[@id='xEditingArea']//iframe | |
| typeKeys | //html/body | The detail of Q1_SNF_KS_12 |
| selectFrame | relative=top | |
| type | EmailAddress | root@localhost.vn |
| waitForElementPresent | link=Save | |
| mouseDown | link=Save | |
| waitForElementPresent | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| clickAt | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| waitForElementPresent | link=Q1_SNF_KS_12 | |
| verifyElementPresent | link=Q1_SNF_KS_12 | |
| echo | ----- Create category (Cat_SNF_KS_12) | |
| waitForElementPresent | //a[text()='Category'] | |
| click | //a[text()='Category'] | |
| waitForElementPresent | link=Add category | |
| clickAt | link=Add category | |
| waitForElementPresent | eventCategoryName | |
| type | eventCategoryName | Cat_SNF_KS_12 |
| waitForElementPresent | description | |
| type | description | Cat_SNF_KS_12 des |
| waitForElementPresent | link=Save | |
| click | link=Save | |
| waitForElementPresent | link=Cat_SNF_KS_12 | |
| echo | ----- Create question Q2_SNF_KS_12 in the new category | |
| click | link=Cat_SNF_KS_12 | |
| waitForElementPresent | link=Submit question | |
| click | link=Submit question | |
| waitForElementPresent | QuestionTitle | |
| type | QuestionTitle | Q2_SNF_KS_12 |
| waitForElementPresent | //iframe[@id='Question___Frame'] | |
| selectFrame | //iframe[@id='Question___Frame'] | |
| waitForElementPresent | //td[@id='xEditingArea']//iframe | |
| selectFrame | //td[@id='xEditingArea']//iframe | |
| type | //html/body | The detail of Q2_SNF_KS_12 |
| selectFrame | relative=top | |
| type | EmailAddress | root@localhost.vn |
| waitForElementPresent | link=Save | |
| mouseDown | link=Save | |
| waitForElementPresent | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| clickAt | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| waitForElementPresent | link=Q2_SNF_KS_12 | |
| verifyElementPresent | link=Q2_SNF_KS_12 | |
| echo | ----- Create a multi-language question Q3_SNF_KS_12 in the new category | |
| waitForElementPresent | link=Submit question | |
| click | link=Submit question | |
| waitForElementPresent | QuestionTitle | |
| type | QuestionTitle | Q3_SNF_KS_12_English |
| waitForElementPresent | //iframe[@id='Question___Frame'] | |
| selectFrame | //iframe[@id='Question___Frame'] | |
| waitForElementPresent | //td[@id='xEditingArea']//iframe | |
| selectFrame | //td[@id='xEditingArea']//iframe | |
| type | //html/body | The detail of Q3_SNF_KS_12_English |
| selectFrame | relative=top | |
| type | EmailAddress | root@localhost.vn |
| waitForElementPresent | AllLanguages | |
| select | AllLanguages | label=French |
| waitForElementPresent | //option[@value='French'] | |
| click | //option[@value='French'] | |
| type | QuestionTitle | Q3_SNF_KS_12_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 | The detail of Q3_SNF_KS_12_French |
| selectFrame | relative=top | |
| waitForElementPresent | link=Save | |
| mouseDown | link=Save | |
| waitForElementPresent | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| click | //div[@id='UIAnswersPortlet']//a[text()='OK'] | |
| waitForElementPresent | link=Q3_SNF_KS_12_English | |
| click | link=Q3_SNF_KS_12_English | |
| waitForElementPresent | link=French | |
| click | link=French | |
| waitForTextPresent | Q3_SNF_KS_12_French | |
| verifyTextPresent | Q3_SNF_KS_12_French | |
| waitForTextPresent | The detail of Q3_SNF_KS_12_French | |
| verifyTextPresent | The detail of Q3_SNF_KS_12_French | |
| click | link=English | |
| waitForTextPresent | Q3_SNF_KS_12_English | |
| verifyTextPresent | Q3_SNF_KS_12_English | |
| waitForTextPresent | The detail of Q3_SNF_KS_12_English | |
| verifyTextPresent | The detail of Q3_SNF_KS_12_English | |
| echo | --- Verify tab All Questions with selective Category | |
| waitForElementPresent | link=Manage questions | |
| click | link=Manage questions | |
| echo | ----- Select Category=categories | |
| waitForText | //form[@id='QuestionInfo']/div[2]/div/div[2] | Select category : All categories Cat_SNF_KS_12 |
| waitForElementPresent | ListCategories | |
| select | ListCategories | label=categories |
| waitForElementPresent | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='TrueIcon'] | |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[1] | Q1_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[2] | categories |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyTextNotPresent | categories > Cat_SNF_KS_12 | |
| echo | ----- Select Category=Cat_SNF_KS_12 | |
| select | ListCategories | label=Cat_SNF_KS_12 |
| waitForTextPresent | Q2_SNF_KS_12 | |
| verifyTextPresent | Q2_SNF_KS_12 | |
| verifyTextPresent | Q3_SNF_KS_12_English | |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[2]/td[1] | Q2_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[2]/td[2] | categories > Cat_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[4]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[3]/td[1] | Q3_SNF_KS_12_English |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[3]/td[2] | categories > Cat_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[3]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[3]/td[4]/div[@class='TrueIcon'] | Yes |
| echo | ----- Select Category=All | |
| select | ListCategories | label=All |
| waitForTextPresent | categories > Cat_SNF_KS_12 | |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[2]/td[1] | Q1_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[2]/td[2] | categories |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[4]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[3]/td[1] | Q2_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[3]/td[2] | categories > Cat_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[3]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[3]/td[4]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[4]/td[1] | Q3_SNF_KS_12_English |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[4]/td[2] | categories > Cat_SNF_KS_12 |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[4]/td[3]/div[@class='TrueIcon'] | Yes |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[4]/td[4]/div[@class='TrueIcon'] | Yes |
| echo | --- Test functions: Approve, Activate, Edit on tab All Questions | |
| echo | ----- Disapprove the first row (Q1) | |
| clickAt | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='TrueIcon']/div | |
| waitForElementPresent | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='FalseIcon'] | |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[3]/div[@class='FalseIcon'] | No |
| echo | ----- Inactivate the second row (Q2) | |
| click | //div[@id='UITabContent']//table/tbody/tr[3]/td[4]/div[@class='TrueIcon']/div | |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[3]/td[4]/div[@class='FalseIcon'] | No |
| echo | ----- Edit Q3 | |
| click | //div[@id='UITabContent']//table/tbody/tr[4]/td[5]/div[@title='Edit'] | |
| 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 | Edited: The detail of Q3_SNF_KS_12_English |
| selectFrame | relative=top | |
| type | EmailAddress | root@localhost.vn |
| waitForElementPresent | link=Save | |
| mouseDown | link=Save | |
| echo | ----- Close Manage Questions form and verify Q1 pending | |
| click | //form[@id='UIQuestionManagerForm']/div[2]/table/tbody/tr/td/div/div/div/div/a | |
| waitForElementPresent | //img[@alt='categories'] | |
| clickAt | //img[@alt='categories'] | |
| waitForTextPresent | This question is pending for approval. | |
| verifyElementPresent | link=Q1_SNF_KS_12 | |
| verifyTextPresent | This question is pending for approval. | |
| echo | ----- Open Cat_SNF_KS_12 and verify Q2 invisible | |
| waitForElementPresent | link=Cat_SNF_KS_12 | |
| click | link=Cat_SNF_KS_12 | |
| waitForElementPresent | link=Q3_SNF_KS_12_English | |
| verifyElementPresent | link=Q3_SNF_KS_12_English | |
| verifyElementNotPresent | link=Q2_SNF_KS_12 | |
| echo | ----- Verify that Q3 has been edited and open Manage Questions form again | |
| click | link=Q3_SNF_KS_12_English | |
| waitForTextPresent | exact:Edited: The detail of Q3_SNF_KS_12_English | |
| verifyTextPresent | exact:Edited: The detail of Q3_SNF_KS_12_English | |
| click | link=Manage questions | |
| echo | --- Test function Delete (Q1) on tab All Questions | |
| waitForElementPresent | //div[@id='UITabContent']//table/tbody/tr[2]/td[5]/div[@title='Delete'] | |
| verifyText | //div[@id='UITabContent']/div/div/div/table/tbody/tr[2]/td[1] | Q1_SNF_KS_12 |
| click | //div[@id='UITabContent']//table/tbody/tr[2]/td[5]/div[@title='Delete'] | |
| waitForTextPresent | exact:Do you really want to delete this question and its answers ? Author: root Email: root@localhost.vn Question: Q1_SNF_KS_12 |
|
| verifyTextPresent | exact:Do you really want to delete this question and its answers ? Author: root Email: root@localhost.vn Question: Q1_SNF_KS_12 |
|
| click | //form[@id='Confirm Delete']/div[3]/table/tbody/tr/td/div[1]/div/div/div/a | |
| waitForTextNotPresent | Q1_SNF_KS_12 | |
| verifyTextNotPresent | Q1_SNF_KS_12 | |
| verifyText | //div[@id='UITabContent']//table/tbody/tr[2]/td[1] | Q2_SNF_KS_12 |
| echo | --- Test function Answer on tab Open Questions | |
| echo | ----- Verify Q2, Q3 | |
| click | //form[@id='QuestionInfo']/div[2]//div[2]//div[@class='RightTab']/div | |
| waitForTextPresent | Languages | |
| verifyTextPresent | Languages | |
| select | ListCategories | label=All |
| waitForTextPresent | Q2_SNF_KS_12 | |
| verifyTextPresent | Q2_SNF_KS_12 | |
| verifyTextPresent | Q3_SNF_KS_12_English | |
| verifyText | //div[2]/div/div/div/table/tbody/tr[2]/td[1] | Q2_SNF_KS_12 |
| verifyText | //div[2]/div/div/div/table/tbody/tr[2]/td[2] | categories > Cat_SNF_KS_12 |
| verifyElementPresent | //div[2]/div/div/div/table/tbody/tr[2]/td[3]/div/div[contains(text(),'English')] | |
| verifyText | //div[2]/div/div/div/table/tbody/tr[3]/td[1] | Q3_SNF_KS_12_English |
| verifyText | //div[2]/div/div/div/table/tbody/tr[3]/td[2] | categories > Cat_SNF_KS_12 |
| verifyElementPresent | //div[2]/div/div/div/table/tbody/tr[3]/td[3]/div[1]/div[contains(text(),'English')] | |
| verifyElementPresent | //div[2]/div/div/div/table/tbody/tr[3]/td[3]/div[2]/div[contains(text(),'French')] | - French |
| echo | ----- Answer Q2 (click Answer icon) | |
| click | //div[@id='UITabContent']//table/tbody/tr[2]/td[4]//div[@class='ItemIcon ResponseQuestion'] | |
| 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 | This is the answer to Q2_SNF_KS_12 |
| selectFrame | relative=top | |
| waitForElementPresent | link=Save | |
| click | link=Save | |
| waitForElementNotPresent | //div[2]/div/div/div/table/tbody/tr[3]/td[1] | |
| verifyText | //div[2]/div/div/div/table/tbody/tr[2]/td[1] | Q3_SNF_KS_12_English |
| echo | ----- Answer Q3 in French (click on text area French) | |
| click | //div[2]/div/div/div/table/tbody/tr[2]/td[3]/div[2]/div | - French |
| waitForText | //form[@id='UIResponseForm']/div[2]/div[1]/table/tbody/tr[2]/td[2]/p | The detail of Q3_SNF_KS_12_French |
| verifyText | //form[@id='UIResponseForm']/div[2]/div[1]/table/tbody/tr[2]/td[2]/p | The detail of Q3_SNF_KS_12_French |
| verifyValue | Language | French |
| 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 | This is the French answer to Q2_SNF_KS_12_French |
| selectFrame | relative=top | |
| waitForElementPresent | link=Save | |
| click | link=Save | |
| waitForTextPresent | No Questions | |
| verifyTextPresent | No Questions | |
| click | //form[@id='UIQuestionManagerForm']/div[2]/table/tbody/tr/td/div/div/div/div/a | |
| echo | --- Remove Category Cat_SNF_KS_12 | |
| 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 ? | |
| waitForElementNotPresent | link=Cat_SNF_KS_12 | |
| verifyElementNotPresent | link=Cat_SNF_KS_12 | |
| echo | --- Logout | |
| waitForElementPresent | link=Logout | |
| clickAndWait | link=Logout | |
| echo | --- End of test | |