Add new directory structure for page objects
Creates new directory structure for page objects that reflects horizon main menu. Pageobjects should be located in the directories according to their location in the main menu. Partially implements blueprint: selenium-integration-testing Closes-Bug: #1348232 Change-Id: Ibed2581721be114d696673038d1381a6002aef58
This commit is contained in:
parent
4089c70b54
commit
b4b0e9c677
@ -13,7 +13,7 @@
|
||||
from openstack_dashboard.test.integration_tests.pages import basepage
|
||||
|
||||
|
||||
class AdminPage(basepage.BasePage):
|
||||
class OverviewPage(basepage.BasePage):
|
||||
def __init__(self, driver, conf):
|
||||
super(AdminPage, self).__init__(driver, conf)
|
||||
super(OverviewPage, self).__init__(driver, conf)
|
||||
self._page_title = "Usage Overview"
|
@ -13,9 +13,11 @@
|
||||
from selenium.webdriver.common import by
|
||||
from selenium.webdriver.common import keys
|
||||
|
||||
from openstack_dashboard.test.integration_tests.pages import adminpage
|
||||
from openstack_dashboard.test.integration_tests.pages.admin.system import \
|
||||
overviewpage as system_overviewpage
|
||||
from openstack_dashboard.test.integration_tests.pages import pageobject
|
||||
from openstack_dashboard.test.integration_tests.pages import projectpage
|
||||
from openstack_dashboard.test.integration_tests.pages.project.compute import \
|
||||
overviewpage as compute_overviewpage
|
||||
|
||||
|
||||
class LoginPage(pageobject.PageObject):
|
||||
@ -77,10 +79,10 @@ class LoginPage(pageobject.PageObject):
|
||||
self.username.send_keys(self.conf.identity.admin_username)
|
||||
self.password.send_keys(password)
|
||||
login_method()
|
||||
return adminpage.AdminPage(self.driver, self.conf)
|
||||
return system_overviewpage.OverviewPage(self.driver, self.conf)
|
||||
|
||||
def login_as_user(self, user, password, login_method):
|
||||
self.username.send_keys(user)
|
||||
self.password.send_keys(password)
|
||||
login_method()
|
||||
return projectpage.ProjectPage(self.driver, self.conf)
|
||||
return compute_overviewpage.OverviewPage(self.driver, self.conf)
|
||||
|
@ -16,7 +16,8 @@
|
||||
from selenium.webdriver.common import by
|
||||
|
||||
from openstack_dashboard.test.integration_tests.pages import basepage
|
||||
from openstack_dashboard.test.integration_tests.pages import keypairpage
|
||||
from openstack_dashboard.test.integration_tests.pages.project.compute.\
|
||||
access_and_security import keypairpage
|
||||
|
||||
|
||||
class AccessSecurityPage(basepage.BasePage):
|
@ -11,22 +11,23 @@
|
||||
# under the License.
|
||||
from selenium.webdriver.common import by
|
||||
|
||||
from openstack_dashboard.test.integration_tests.pages import accesssecuritypage
|
||||
from openstack_dashboard.test.integration_tests.pages import basepage
|
||||
from openstack_dashboard.test.integration_tests.pages import settingspage
|
||||
from openstack_dashboard.test.integration_tests.pages.project.compute.\
|
||||
access_and_security import accesssecuritypage
|
||||
from openstack_dashboard.test.integration_tests.pages.settings import \
|
||||
settingspage
|
||||
from openstack_dashboard.test.integration_tests.regions import forms
|
||||
from openstack_dashboard.test.integration_tests.regions import tables
|
||||
|
||||
|
||||
class ProjectPage(basepage.BasePage):
|
||||
|
||||
class OverviewPage(basepage.BasePage):
|
||||
_usage_table_locator = (by.By.CSS_SELECTOR, 'table#project_usage')
|
||||
_date_form_locator = (by.By.CSS_SELECTOR, 'form#date_form')
|
||||
|
||||
USAGE_TABLE_ACTIONS = ("download_csv",)
|
||||
|
||||
def __init__(self, driver, conf):
|
||||
super(ProjectPage, self).__init__(driver, conf)
|
||||
super(OverviewPage, self).__init__(driver, conf)
|
||||
self._page_title = 'Instance Overview'
|
||||
|
||||
def go_to_settings_page(self):
|
@ -13,8 +13,9 @@
|
||||
from selenium.webdriver.common import by
|
||||
|
||||
from openstack_dashboard.test.integration_tests.pages import basepage
|
||||
from openstack_dashboard.test.integration_tests.pages import changepasswordpage
|
||||
from openstack_dashboard.test.integration_tests.pages import pageobject
|
||||
from openstack_dashboard.test.integration_tests.pages.settings import \
|
||||
changepasswordpage
|
||||
|
||||
|
||||
class SettingsPage(basepage.BasePage):
|
Loading…
Reference in New Issue
Block a user