Skip to content

Commit

Permalink
Merge pull request #729 from atlassian/release/5.2.0
Browse files Browse the repository at this point in the history
Release 5.2.0
  • Loading branch information
ometelytsia committed Nov 17, 2021
2 parents f05089b + 9f8f7f9 commit c972679
Show file tree
Hide file tree
Showing 35 changed files with 192 additions and 182 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ This repository contains Taurus scripts for performance testing of Atlassian Dat

## Supported versions
* Supported Jira versions:
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.10`, `8.5.18`
* Jira [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `8.13.13`, `8.20.1`

* Supported Jira Service Management versions:
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.10`, `4.5.18`
* Jira Service Management [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `4.13.13`, `4.20.1`

* Supported Confluence versions:
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.0`, `7.4.11`
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.2`, `7.4.13`

* Supported Bitbucket Server versions:
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.9`, `6.10.13`
* Bitbucket Server Platform release: `7.0.5`
* Bitbucket Server [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.6.10`, `7.17.1`

* Supported Crowd versions:
* Crowd [Long Term Support release](https://confluence.atlassian.com/crowd/crowd-release-notes-199094.html): `4.3.5`
* Crowd [Long Term Support release](https://confluence.atlassian.com/crowd/crowd-release-notes-199094.html): `4.4.0`

## Support
In case of technical questions, issues or problems with DC Apps Performance Toolkit, contact us for support in the [community Slack](http://bit.ly/dcapt_slack) **#data-center-app-performance-toolkit** channel.
Expand Down
2 changes: 1 addition & 1 deletion app/bitbucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
version: "95.0.4638.69" # Supports Chrome version 95. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/confluence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
version: "95.0.4638.69" # Supports Chrome version 95. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
2 changes: 1 addition & 1 deletion app/jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "93.0.4577.63" # Supports Chrome version 93. You can refer to http://chromedriver.chromium.org/downloads
version: "95.0.4638.69" # Supports Chrome version 95. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
7 changes: 4 additions & 3 deletions app/jsm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ settings:
application_postfix: # e.g. /jira in case of url like http://localhost:2990/jira
admin_login: admin
admin_password: admin
load_executor: jmeter
load_executor: jmeter # jmeter and locust are supported. jmeter by default.
concurrency_agents: 50 # number of concurrent virtual agent users for jmeter or locust scenario
concurrency_customers: 150 # number of concurrent virtual customer users for jmeter or locust scenario
test_duration: 45m
Expand All @@ -21,7 +21,7 @@ settings:
WEBDRIVER_VISIBLE: False
JMETER_VERSION: 5.2.1
LANGUAGE: en_US.utf8
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
allow_analytics: Yes # Allow sending basic run analytics to Atlassian. These analytics help us to understand how the tool is being used and help us to continue to invest in this tooling. For more details please see our README.
# Action percentage for Jmeter and Locust load executors
agent_browse_projects: 10
agent_view_request: 24
Expand Down Expand Up @@ -49,6 +49,7 @@ services:
- module: shellexec
prepare:
- python util/pre_run/environment_checker.py
- python util/pre_run/check_for_updates.py
- python util/data_preparation/jsm_prepare_data.py
shutdown:
- python util/post_run/jmeter_post_check.py
Expand Down Expand Up @@ -150,7 +151,7 @@ modules:
httpsampler.ignore_failed_embedded_resources: "true"
selenium:
chromedriver:
version: "91.0.4472.101" # Supports Chrome version 91. You can refer to http://chromedriver.chromium.org/downloads
version: "95.0.4638.69" # Supports Chrome version 95. You can refer to http://chromedriver.chromium.org/downloads
reporting:
- data-source: sample-labels
module: junit-xml
18 changes: 9 additions & 9 deletions app/locustio/common_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,18 @@ def global_measure(func, start_time, interaction, *args, **kwargs):
except Exception as e:
total = int((time.time() - start_time) * 1000)
print(e)
events.request_failure.fire(request_type="Action",
name=interaction,
response_time=total,
response_length=0,
exception=e)
events.request.fire(request_type="Action",
name=interaction,
response_time=total,
response_length=0,
exception=e)
logger.error(f'{interaction} action failed. Reason: {e}')
else:
total = int((time.time() - start_time) * 1000)
events.request_success.fire(request_type="Action",
name=interaction,
response_time=total,
response_length=0)
events.request.fire(request_type="Action",
name=interaction,
response_time=total,
response_length=0)
logger.info(f'{interaction} is finished successfully')
return result

Expand Down
75 changes: 33 additions & 42 deletions app/selenium_ui/base_page.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.action_chains import ActionChains
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.support.ui import Select
import random
import string
from collections import OrderedDict

from packaging import version
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.support.ui import Select
from selenium.webdriver.support.wait import WebDriverWait

TIMEOUT = 20

Expand All @@ -30,64 +33,58 @@ def wait_for_page_loaded(self):
def go_to_url(self, url):
self.driver.get(url)

def get_selector(self, selector):
if type(selector) is OrderedDict:
result = next(iter(selector.items()))[1]
for sel_version, sel in selector.items():
selector_version = version.parse(sel_version)
if self.app_version >= selector_version:
result = sel
return result
else:
return selector

def get_element(self, selector):
selector_name = self.get_selector(selector)
by, locator = selector_name[0], selector_name[1]
by, locator = selector[0], selector[1]
return self.driver.find_element(by, locator)

def get_elements(self, selector):
selector_name = self.get_selector(selector)
by, locator = selector_name[0], selector_name[1]
by, locator = selector[0], selector[1]
return self.driver.find_elements(by, locator)

def element_exists(self, selector):
selector_name = self.get_selector(selector)
by, locator = selector_name[0], selector_name[1]
by, locator = selector[0], selector[1]
return True if self.driver.find_elements(by, locator) else False

def wait_until_invisible(self, selector_name, timeout=timeout):
selector = self.get_selector(selector_name)
def wait_until_invisible(self, selector, timeout=timeout):
return self.__wait_until(expected_condition=ec.invisibility_of_element_located(selector), time_out=timeout)

def wait_until_visible(self, selector_name, timeout=timeout):
selector = self.get_selector(selector_name)
def wait_until_visible(self, selector, timeout=timeout):
return self.__wait_until(expected_condition=ec.visibility_of_element_located(selector), time_out=timeout)

def wait_until_available_to_switch(self, selector_name):
selector = self.get_selector(selector_name)
def wait_until_available_to_switch(self, selector):
return self.__wait_until(expected_condition=ec.frame_to_be_available_and_switch_to_it(selector),
time_out=self.timeout)

def wait_until_present(self, selector_name, timeout=timeout):
selector = self.get_selector(selector_name)
def wait_until_present(self, selector, timeout=timeout):
return self.__wait_until(expected_condition=ec.presence_of_element_located(selector), time_out=timeout)

def wait_until_clickable(self, selector_name, timeout=timeout):
selector = self.get_selector(selector_name)
def wait_until_clickable(self, selector, timeout=timeout):
return self.__wait_until(expected_condition=ec.element_to_be_clickable(selector), time_out=timeout)

def wait_until_any_element_visible(self, selector_name, timeout=timeout):
selector = self.get_selector(selector_name)
def wait_until_any_element_visible(self, selector, timeout=timeout):
return self.__wait_until(expected_condition=ec.visibility_of_any_elements_located(selector),
time_out=timeout)

def wait_until_any_ec_presented(self, selector_names, timeout=timeout):
origin_selectors = []
for selector in selector_names:
origin_selectors.append(self.get_selector(selector))
def wait_until_any_ec_presented(self, selectors, timeout=timeout):
any_ec = AnyEc()
any_ec.ecs = tuple(ec.presence_of_element_located(origin_selector) for origin_selector in origin_selectors)
any_ec.ecs = tuple(ec.presence_of_element_located(selector) for selector in selectors)
return self.__wait_until(expected_condition=any_ec, time_out=timeout)

def wait_until_any_ec_text_presented_in_el(self, selector_names, timeout=timeout):
origin_selectors = []
for selector_text in selector_names:
selector = self.get_selector(selector_text[0])
text = selector_text[1]
origin_selectors.append((selector, text))
def wait_until_any_ec_text_presented_in_el(self, selector_text_list, timeout=timeout):
any_ec = AnyEc()
any_ec.ecs = tuple(ec.text_to_be_present_in_element(locator=origin_selector[0], text_=origin_selector[1]) for
origin_selector in origin_selectors)
any_ec.ecs = tuple(ec.text_to_be_present_in_element(locator=selector_text[0], text_=selector_text[1]) for
selector_text in selector_text_list)
return self.__wait_until(expected_condition=any_ec, time_out=timeout)

def __wait_until(self, expected_condition, time_out=timeout):
Expand Down Expand Up @@ -124,12 +121,6 @@ def dismiss_popup(self, *args):
def return_to_parent_frame(self):
return self.driver.switch_to.parent_frame()

def get_selector(self, selector_name):
selector = selector_name.get(self.app_version) if type(selector_name) == dict else selector_name
if selector is None:
raise Exception(f'Selector {selector_name} for version {self.app_version} is not found')
return selector

def execute_js(self, js):
return self.driver.execute_script(js)

Expand Down
1 change: 0 additions & 1 deletion app/selenium_ui/bitbucket/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def measure():
@print_timing("selenium_login:open_login_page")
def sub_measure():
login_page.go_to()
webdriver.app_version = login_page.get_app_major_version()
if login_page.is_logged_in():
login_page.delete_all_cookies()
login_page.go_to()
Expand Down
29 changes: 9 additions & 20 deletions app/selenium_ui/bitbucket/pages/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class PopupManager(BasePage):

def dismiss_default_popup(self):
return self.dismiss_popup(PopupLocators.default_popup, PopupLocators.popup_1, PopupLocators.popup_2,
PopupLocators.popup_3)
PopupLocators.popup_3, PopupLocators.popup_4)


class Repository(BasePage):
Expand Down Expand Up @@ -202,7 +202,7 @@ def wait_for_commits_tab(self, ):
self.wait_until_any_element_visible(PullRequestLocator.commit_message_label)

def click_inline_comment_button_js(self):
selector = self.get_selector(PullRequestLocator.inline_comment_button)
selector = PullRequestLocator.inline_comment_button
self.execute_js(f"elems=document.querySelectorAll('{selector[1]}'); "
"item=elems[Math.floor(Math.random() * elems.length)];"
"item.scrollIntoView();"
Expand All @@ -211,22 +211,10 @@ def click_inline_comment_button_js(self):
def wait_for_comment_text_area(self):
return self.wait_until_visible(PullRequestLocator.comment_text_area)

def add_code_comment_v6(self):
self.wait_for_comment_text_area()
selector = self.get_selector(PullRequestLocator.comment_text_area)
self.execute_js(f"document.querySelector('{selector[1]}').value = 'Comment from Selenium script';")
self.click_save_comment_button()

def add_code_comment_v7(self):
def add_code_comment(self, ):
self.wait_until_visible(PullRequestLocator.text_area).send_keys('Comment from Selenium script')
self.click_save_comment_button()

def add_code_comment(self, ):
if self.app_version == '6':
self.add_code_comment_v6()
elif self.app_version == '7':
self.add_code_comment_v7()

def click_save_comment_button(self):
return self.wait_until_visible(PullRequestLocator.comment_button).click()

Expand All @@ -238,13 +226,14 @@ def wait_merge_button_clickable(self):
self.wait_until_clickable(PullRequestLocator.pull_request_page_merge_button)

def merge_pull_request(self):
if self.driver.app_version == '6':
if self.get_elements(PullRequestLocator.merge_spinner):
self.wait_until_invisible(PullRequestLocator.merge_spinner)
self.wait_until_present(PullRequestLocator.pull_request_page_merge_button).click()
PopupManager(self.driver).dismiss_default_popup()
self.wait_until_visible(PullRequestLocator.diagram_selector)
self.execute_js(f'document.querySelector("{PullRequestLocator.delete_branch_per_merge_checkbox[1]}").click()')
self.wait_until_visible(PullRequestLocator.merge_diagram_selector)
self.wait_until_present(PullRequestLocator.delete_branch_per_merge_checkbox)
if self.get_element(PullRequestLocator.delete_branch_per_merge_checkbox).is_selected():
self.execute_js(f'document.querySelector('
f'"{PullRequestLocator.delete_branch_per_merge_checkbox[1]}").click()')
self.wait_until_clickable(PullRequestLocator.pull_request_modal_merge_button).click()
self.wait_until_invisible(PullRequestLocator.del_branch_checkbox_selector)

Expand Down Expand Up @@ -275,7 +264,7 @@ def delete_branch(self, branch_name):
self.wait_until_visible(BranchesLocator.branches_name)
self.wait_until_visible(BranchesLocator.search_branch_action).click()
self.execute_js("document.querySelector('li>a.delete-branch').click()")
self.wait_until_clickable(BranchesLocator.delete_branch_diaglog_submit).click()
self.wait_until_clickable(BranchesLocator.delete_branch_dialog_submit).click()


class RepositorySettings(BasePage):
Expand Down
Loading

0 comments on commit c972679

Please sign in to comment.