Exemple #1
0
class Header(BasePage):
    collapse_button = element(by.id('sidebar-collapse'))

    gear_button = element(by.id('settings-dropdown-toggle'))

    plugins_button = element(by.class_name('plugin-btn'))

    notifications_button = element(by.class_name('announcement-btn'))

    account_button = element(by.class_name('btn-dots'))

    class Settings(BaseEnum):
        EMAIL_SETTINGS = 'Email settings'
        DATABASE_SETTINGS = 'Database settings'
        AUTHENTICATION_SETTINGS = 'Authentication settings'
        USERS_ROLES_AND_REGISTRATION_APPROVAL = 'Users, Roles and Registration Approval'
        CUSTOMIZATION_SETTINGS = 'Customization settings'
        AUDIT = 'Audit'

        @property
        def get_option(self):
            Header.gear_button.click()
            return scroll_into_view(
                element(
                    by.xpath(f'//li/a/span[contains(text(),"{self.value}")]')))

    class Profile(BaseEnum):
        EDIT_PROFILE = 'Edit Profile'
        LOG_OUT = 'Log Out'

        @property
        def get_option(self):
            Header.account_button.click()
            return self._get()
Exemple #2
0
class TimeSelector:
    hours_field = element(by.xpath('//input[@aria-label="Hour"]'))

    minute_field = element(by.xpath('//input[@aria-label="Minute"]'))

    second_field = element(by.xpath('//input[contains(@class,"flatpickr-second")]'))

    part_button = element(by.xpath('//span[@class="flatpickr-am-pm"]'))
class ResetPasswordPage(BasePage):
    password_field = element(by.id('password'))

    confirm_password_field = element(by.id('confirmPassword'))

    reset_password_button = element(
        by.xpath('//button[text()="Reset Password"]'))

    set_password_button = element(by.xpath('//button[text()="Save"]'))
class BasePage:
    url = '/'
    path = ''

    page_title = element(by.class_name('page-title'))

    loader = element(by.class_name('loader active'))

    def navigate(self):
        factory.get_shared_driver().get(f'{self.path}{self.url}')
        return self

    alert = element(by.xpath('//div[@role="alert"]'))
Exemple #5
0
class Navbar(BasePage):
    dashboard_button = element(
        by.xpath('//a[child::span[text()="Dashboard"]]'))

    platform_management_button = element(
        by.xpath('//a[child::span[text()="Platform Management"]]'))

    virtual_workforce_button = element(
        by.xpath('//a[child::span[text()="Virtual Workforce"]]'))

    design_studio_button = element(
        by.xpath('//a[child::span[text()="Design Studio"]]'))

    automation_lifecycle_button = element(
        by.xpath('//a[child::span[text()="Automation Lifecycle"]]'))

    queue_management_button = element(
        by.xpath('//a[child::span[text()="Queue Management"]]'))

    self_serve_button = element(
        by.xpath('//a[child::span[text()="Self-Serve"]]'))

    cognitive_services_button = element(
        by.xpath('//a[child::span[text()="Cognitive Services"]]'))

    platform_builder_button = element(
        by.xpath('//a[child::span[text()="Platform Builder"]]'))

    class PlatformManagement(BaseEnum):
        VIRTUAL_WORKER_SETTINGS = 'Virtual Worker Settings'
        LICENSE_MANAGER = 'License Manager'

        @property
        def get_option(self):
            Navbar.platform_management_button.click()
            return self._get()

    class VirtualWorkforce(BaseEnum):
        UTILIZATION = 'Utilization'
        LIVE_SESSIONS = 'Live Sessions'
        PERFORMANCE = 'Performance'
        LIVE_ACCESS = 'Live Access'

        @property
        def get_option(self):
            Navbar.virtual_workforce_button.click()
            return self._get()

    class DesignStudio(BaseEnum):
        WIREFRAMER = 'Wireframer'
        PROCESS_OBJECT_EXPLORER = 'Process/Object Explorer'
        ENVIRONMENT_DATA_ITEMS = 'Environment Data Items'
        ENVIRONMENT_LOCKS = 'Environment Locks'

        @property
        def get_option(self):
            Navbar.design_studio_button.click()
            return self._get()

    class AutomationLifecycle(BaseEnum):
        BUSINESS_PROCESSES = 'Business Processes'
        APPLICATIONS = 'Applications'
        PROCESS_DEFINITIONS = 'Process Definitions'
        EXCEPTIONS = 'Exceptions'

        @property
        def get_option(self):
            Navbar.automation_lifecycle_button.click()
            return self._get()

    class QueueManagement(BaseEnum):
        QUEUES_OVERVIEW = 'Queues Overview'
        QUEUES_MANAGER = 'Queues Manager'
        QUEUES_ANALYZER = 'Queues Analyzer'

        @property
        def get_option(self):
            Navbar.queue_management_button.click()
            return self._get()

    class SelfServe(BaseEnum):
        FORMS = 'Forms'

        @property
        def get_option(self):
            Navbar.self_serve_button.click()
            return self._get()

    class CognitiveServices(BaseEnum):
        NLU = 'NLU'

        @property
        def get_option(self):
            Navbar.cognitive_services_button.click()
            return self._get()

    class PlatformBuilder(BaseEnum):
        PLATFORM_BUILDER = 'Platform Builder'

        @property
        def get_option(self):
            Navbar.platform_builder_button.click()
            return element(
                by.xpath(
                    f'//li/a[@href]/span[contains(text(), "{self.value}")]'))
Exemple #6
0
 def get_option(self):
     Navbar.platform_builder_button.click()
     return element(
         by.xpath(
             f'//li/a[@href]/span[contains(text(), "{self.value}")]'))
Exemple #7
0
 def get_date(date):
     return element(by.xpath(f'//div[@class="rc-calendar-date" and text()="{date}"]'))
Exemple #8
0
class Calendar:
    @staticmethod
    def get_date(date):
        return element(by.xpath(f'//div[@class="rc-calendar-date" and text()="{date}"]'))

    ok_button = element(by.xpath('//a[contains(@class, "rc-calendar-ok-btn")]'))
class ForgotPasswordPage(BasePage):
    email_address_field = element(by.id('email'))

    send_email_button = element(by.xpath('//button[text()="Send Email"]'))
class SelectAppPage(BasePage, Header, Navbar):
    connect_icon = element(by.xpath('//div[text()="Connect"]'))

    ss_icon = element(by.xpath('//div[text()="Self-Serve"]'))
 def _get(self):
     _element = element(by.xpath(f'//li/a/span[text()="{self.value}"]'))
     return scroll_into_view(_element)
Exemple #12
0
 def get_option(self):
     Header.gear_button.click()
     return scroll_into_view(
         element(
             by.xpath(f'//li/a/span[contains(text(),"{self.value}")]')))