def __create_data_set(jira_api):
    dataset = dict()
    dataset[USERS] = __get_users(jira_api)
    perf_user = random.choice(dataset[USERS])
    perf_user_api = JiraRestClient(JIRA_SETTINGS.server_url, perf_user['name'],
                                   DEFAULT_USER_PASSWORD)
    software_projects = __get_software_projects(perf_user_api)
    dataset[PROJECTS] = software_projects
    dataset[ISSUES] = __get_issues(perf_user_api, software_projects)
    dataset[CUSTOM_ISSUES] = __get_custom_issues(
        perf_user_api, JIRA_SETTINGS.custom_dataset_query)
    dataset[SCRUM_BOARDS] = __get_boards(perf_user_api, 'scrum')
    dataset[KANBAN_BOARDS] = __get_boards(perf_user_api, 'kanban')
    dataset[JQLS] = __generate_jqls(count=150)
    dataset[VERSIONS] = __get_project_versions(perf_user_api)
    print(f'Users count: {len(dataset[USERS])}')
    print(f'Projects: {len(dataset[PROJECTS])}')
    print(f'Issues count: {len(dataset[ISSUES])}')
    print(f'Scrum boards count: {len(dataset[SCRUM_BOARDS])}')
    print(f'Kanban boards count: {len(dataset[KANBAN_BOARDS])}')
    print(f'Jqls count: {len(dataset[JQLS])}')
    print('------------------------')
    print(f'Custom dataset issues: {len(dataset[CUSTOM_ISSUES])}')
    print(f'Versions count: {len(dataset[VERSIONS])}')

    return dataset
def main():
    print("Started preparing data")
    url = JSM_SETTINGS.server_url
    print("Server url: ", url)
    jsm_client = JsmRestClient(url, JSM_SETTINGS.admin_login, JSM_SETTINGS.admin_password, verify=JSM_SETTINGS.secure,
                               headers=JSM_EXPERIMENTAL_HEADERS)
    jira_client = JiraRestClient(url, JSM_SETTINGS.admin_login, JSM_SETTINGS.admin_password, JSM_SETTINGS.secure)
    dataset = __create_data_set(jira_client=jira_client, jsm_client=jsm_client)
    __write_test_data_to_files(dataset)
def main():
    print("Started preparing data")

    url = JIRA_SETTINGS.server_url
    print("Server url: ", url)

    client = JiraRestClient(url, JIRA_SETTINGS.admin_login, JIRA_SETTINGS.admin_password, verify=JIRA_SETTINGS.secure)

    __check_for_admin_permissions(client)
    __check_current_language(client)
    dataset = __create_data_set(client)
    write_test_data_to_files(dataset)

    print("Finished preparing data")
Exemplo n.º 4
0
import random
import urllib.parse

from selenium_ui.conftest import print_timing
from selenium_ui.jira.pages.pages import Login, PopupManager, Issue, Project, Search, ProjectsList, \
    BoardsList, Board, Dashboard, Logout

from util.api.jira_clients import JiraRestClient
from util.conf import JIRA_SETTINGS

client = JiraRestClient(JIRA_SETTINGS.server_url, JIRA_SETTINGS.admin_login,
                        JIRA_SETTINGS.admin_password)
rte_status = client.check_rte_status()

KANBAN_BOARDS = "kanban_boards"
SCRUM_BOARDS = "scrum_boards"
USERS = "users"
ISSUES = "issues"
CUSTOM_ISSUES = "custom_issues"
JQLS = "jqls"
PROJECTS = "projects"


def setup_run_data(datasets):
    page_size = 25
    projects_count = len(datasets[PROJECTS])
    user = random.choice(datasets[USERS])
    issue = random.choice(datasets[ISSUES])
    if CUSTOM_ISSUES in datasets:
        if len(datasets[CUSTOM_ISSUES]) > 0:
            custom_issue = random.choice(datasets[CUSTOM_ISSUES])
Exemplo n.º 5
0
    def create_ops_item(self, project: str, summary: str,
                        description: str) -> None:
        client = JiraRestClient(JIRA_SETTINGS.server_url,
                                JIRA_SETTINGS.admin_login,
                                JIRA_SETTINGS.admin_password)
        rte_status = client.check_rte_status()

        @print_timing("load_aws_project")
        def load_aws_project():
            project_page = ProjectPage(self.driver, project_key=project)
            project_page.go_to()
            project_page.wait_for_page_loaded()

        load_aws_project()

        @print_timing("load_aws_create_issue_modal")
        def load_aws_create_issue_modal():
            issue_modal = Issue(self.driver)
            issue_modal.open_create_issue_modal()

            @print_timing("select_aws_opsitem_issue_type")
            def select_aws_opsitem_issue_type():
                issue_modal.get_element(IssueLocators.issue_type_field).click()
                issue_dropdown_elements: List[
                    WebElement] = issue_modal.get_elements(
                        IssueLocators.issue_type_dropdown_elements)
                if issue_dropdown_elements:
                    for element in issue_dropdown_elements:
                        cls = element.get_attribute('class')
                        if 'aui-list-item-li-aws-opsitem' in cls:
                            issue_modal.action_chains().move_to_element(
                                element).click(element).perform()
                issue_modal.wait_until_invisible(
                    IssueLocators.issue_ready_to_save_spinner)

            select_aws_opsitem_issue_type()

            @print_timing("set_aws_opsitem_summary")
            def set_aws_opsitem_summary():
                issue_modal.wait_until_clickable(
                    IssueLocators.issue_summary_field).send_keys(summary)

            set_aws_opsitem_summary()

            @print_timing("set_aws_opsitem_description")
            def set_aws_opsitem_description():
                if rte_status:
                    issue_modal.wait_until_available_to_switch(
                        IssueLocators.issue_description_field_RTE)
                    issue_modal.get_element(
                        IssueLocators.tinymce_description_field).send_keys(
                            description)
                    issue_modal.return_to_parent_frame()
                else:
                    issue_modal.get_element(
                        IssueLocators.issue_description_field).send_keys(
                            description)

            set_aws_opsitem_description()

            @print_timing("submit_aws_opsitem")
            def submit_aws_opsitem():
                issue_modal.submit_issue()

            submit_aws_opsitem()

        load_aws_create_issue_modal()