Test_POR_09_022_CheckAddNewPortalWhenUserDoesNotHaveRigtToCreateNewPortal
open /portal/public/classic/
echo -- Check add new portal when user does not have the right to create a new portal --
windowMaximize
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
clickAndWait link=New Staff
waitForElementPresent username
type username TEST_POR_09_022
type password TEST_POR_09_022
type Confirmpassword TEST_POR_09_022
type firstName TEST_POR_09_022
type lastName TEST_POR_09_022
type email TEST_POR_09_022@gmail.com
echo -- Choose User Profile tab --
waitForElementPresent //div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div
click //div[@id='UIAccountPortlet']/div[1]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div
waitForElementPresent user.language
select user.language label=English
waitForElementPresent link=Save
click link=Save
waitForTextPresent You have registered a new account.
verifyTextPresent You have registered a new account.
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 link=Sign out
clickAndWait link=Sign out
echo -- Login by new user --
open /portal/public/classic/
click link=Sign in
waitForElementPresent username
type username TEST_POR_09_022
type password TEST_POR_09_022
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
clickAndWait link=Site
waitForTextPresent Portal Navigation
verifyTextPresent Portal Navigation
waitForTextNotPresent Add New Portal
verifyTextNotPresent Add New Portal
clickAndWait link=Sign out
open /portal/public/classic/
click link=Sign in
waitForElementPresent username
type username root
type password gtn
clickAndWait //div[@id='UIPortalLoginFormAction']/div/div/div/a
clickAndWait link=Users and groups management
waitForElementPresent searchTerm
type searchTerm TEST_POR_09_022
waitForElementPresent //form[@id='UISearchForm']/div[2]/a
click //form[@id='UISearchForm']/div[2]/a
waitForElementPresent //img[@alt='DeleteUser']
click //img[@alt='DeleteUser']
waitForConfirmationPresent
assertConfirmation Are you sure you want to delete TEST_POR_09_022 user?
waitForTextPresent Empty data
verifyTextPresent Empty data
waitForElementPresent link=Sign out
clickAndWait link=Sign out