Skip to content

Commit dbc4378

Browse files
ometelytsiadoit-bi-do
authored andcommitted
DCA-1354 EOL bitbucket 6.10.x and 7.0.x (atlassian#698)
1 parent 28faa10 commit dbc4378

File tree

11 files changed

+55
-103
lines changed

11 files changed

+55
-103
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ This repository contains Taurus scripts for performance testing of Atlassian Dat
1414
* Confluence [Long Term Support release](https://confluence.atlassian.com/enterprise/atlassian-enterprise-releases-948227420.html): `7.13.0`, `7.4.11`
1515

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

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

app/selenium_ui/base_page.py

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,63 +31,46 @@ def go_to_url(self, url):
3131
self.driver.get(url)
3232

3333
def get_element(self, selector):
34-
selector_name = self.get_selector(selector)
35-
by, locator = selector_name[0], selector_name[1]
34+
by, locator = selector[0], selector[1]
3635
return self.driver.find_element(by, locator)
3736

3837
def get_elements(self, selector):
39-
selector_name = self.get_selector(selector)
40-
by, locator = selector_name[0], selector_name[1]
38+
by, locator = selector[0], selector[1]
4139
return self.driver.find_elements(by, locator)
4240

4341
def element_exists(self, selector):
44-
selector_name = self.get_selector(selector)
45-
by, locator = selector_name[0], selector_name[1]
42+
by, locator = selector[0], selector[1]
4643
return True if self.driver.find_elements(by, locator) else False
4744

48-
def wait_until_invisible(self, selector_name, timeout=timeout):
49-
selector = self.get_selector(selector_name)
45+
def wait_until_invisible(self, selector, timeout=timeout):
5046
return self.__wait_until(expected_condition=ec.invisibility_of_element_located(selector), time_out=timeout)
5147

52-
def wait_until_visible(self, selector_name, timeout=timeout):
53-
selector = self.get_selector(selector_name)
48+
def wait_until_visible(self, selector, timeout=timeout):
5449
return self.__wait_until(expected_condition=ec.visibility_of_element_located(selector), time_out=timeout)
5550

56-
def wait_until_available_to_switch(self, selector_name):
57-
selector = self.get_selector(selector_name)
51+
def wait_until_available_to_switch(self, selector):
5852
return self.__wait_until(expected_condition=ec.frame_to_be_available_and_switch_to_it(selector),
5953
time_out=self.timeout)
6054

61-
def wait_until_present(self, selector_name, timeout=timeout):
62-
selector = self.get_selector(selector_name)
55+
def wait_until_present(self, selector, timeout=timeout):
6356
return self.__wait_until(expected_condition=ec.presence_of_element_located(selector), time_out=timeout)
6457

65-
def wait_until_clickable(self, selector_name, timeout=timeout):
66-
selector = self.get_selector(selector_name)
58+
def wait_until_clickable(self, selector, timeout=timeout):
6759
return self.__wait_until(expected_condition=ec.element_to_be_clickable(selector), time_out=timeout)
6860

69-
def wait_until_any_element_visible(self, selector_name, timeout=timeout):
70-
selector = self.get_selector(selector_name)
61+
def wait_until_any_element_visible(self, selector, timeout=timeout):
7162
return self.__wait_until(expected_condition=ec.visibility_of_any_elements_located(selector),
7263
time_out=timeout)
7364

74-
def wait_until_any_ec_presented(self, selector_names, timeout=timeout):
75-
origin_selectors = []
76-
for selector in selector_names:
77-
origin_selectors.append(self.get_selector(selector))
65+
def wait_until_any_ec_presented(self, selectors, timeout=timeout):
7866
any_ec = AnyEc()
79-
any_ec.ecs = tuple(ec.presence_of_element_located(origin_selector) for origin_selector in origin_selectors)
67+
any_ec.ecs = tuple(ec.presence_of_element_located(selector) for selector in selectors)
8068
return self.__wait_until(expected_condition=any_ec, time_out=timeout)
8169

82-
def wait_until_any_ec_text_presented_in_el(self, selector_names, timeout=timeout):
83-
origin_selectors = []
84-
for selector_text in selector_names:
85-
selector = self.get_selector(selector_text[0])
86-
text = selector_text[1]
87-
origin_selectors.append((selector, text))
70+
def wait_until_any_ec_text_presented_in_el(self, selector_text_list, timeout=timeout):
8871
any_ec = AnyEc()
89-
any_ec.ecs = tuple(ec.text_to_be_present_in_element(locator=origin_selector[0], text_=origin_selector[1]) for
90-
origin_selector in origin_selectors)
72+
any_ec.ecs = tuple(ec.text_to_be_present_in_element(locator=selector_text[0], text_=selector_text[1]) for
73+
selector_text in selector_text_list)
9174
return self.__wait_until(expected_condition=any_ec, time_out=timeout)
9275

9376
def __wait_until(self, expected_condition, time_out=timeout):
@@ -124,12 +107,6 @@ def dismiss_popup(self, *args):
124107
def return_to_parent_frame(self):
125108
return self.driver.switch_to.parent_frame()
126109

127-
def get_selector(self, selector_name):
128-
selector = selector_name.get(self.app_version) if type(selector_name) == dict else selector_name
129-
if selector is None:
130-
raise Exception(f'Selector {selector_name} for version {self.app_version} is not found')
131-
return selector
132-
133110
def execute_js(self, js):
134111
return self.driver.execute_script(js)
135112

app/selenium_ui/bitbucket/modules.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def measure():
2727
@print_timing("selenium_login:open_login_page")
2828
def sub_measure():
2929
login_page.go_to()
30-
webdriver.app_version = login_page.get_app_major_version()
3130
if login_page.is_logged_in():
3231
login_page.delete_all_cookies()
3332
login_page.go_to()

app/selenium_ui/bitbucket/pages/pages.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def wait_for_commits_tab(self, ):
202202
self.wait_until_any_element_visible(PullRequestLocator.commit_message_label)
203203

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

214-
def add_code_comment_v6(self):
215-
self.wait_for_comment_text_area()
216-
selector = self.get_selector(PullRequestLocator.comment_text_area)
217-
self.execute_js(f"document.querySelector('{selector[1]}').value = 'Comment from Selenium script';")
218-
self.click_save_comment_button()
219-
220-
def add_code_comment_v7(self):
214+
def add_code_comment(self, ):
221215
self.wait_until_visible(PullRequestLocator.text_area).send_keys('Comment from Selenium script')
222216
self.click_save_comment_button()
223217

224-
def add_code_comment(self, ):
225-
if self.app_version == '6':
226-
self.add_code_comment_v6()
227-
elif self.app_version == '7':
228-
self.add_code_comment_v7()
229-
230218
def click_save_comment_button(self):
231219
return self.wait_until_visible(PullRequestLocator.comment_button).click()
232220

@@ -238,9 +226,6 @@ def wait_merge_button_clickable(self):
238226
self.wait_until_clickable(PullRequestLocator.pull_request_page_merge_button)
239227

240228
def merge_pull_request(self):
241-
if self.driver.app_version == '6':
242-
if self.get_elements(PullRequestLocator.merge_spinner):
243-
self.wait_until_invisible(PullRequestLocator.merge_spinner)
244229
self.wait_until_present(PullRequestLocator.pull_request_page_merge_button).click()
245230
PopupManager(self.driver).dismiss_default_popup()
246231
self.wait_until_visible(PullRequestLocator.diagram_selector)
@@ -275,7 +260,7 @@ def delete_branch(self, branch_name):
275260
self.wait_until_visible(BranchesLocator.branches_name)
276261
self.wait_until_visible(BranchesLocator.search_branch_action).click()
277262
self.execute_js("document.querySelector('li>a.delete-branch').click()")
278-
self.wait_until_clickable(BranchesLocator.delete_branch_diaglog_submit).click()
263+
self.wait_until_clickable(BranchesLocator.delete_branch_dialog_submit).click()
279264

280265

281266
class RepositorySettings(BasePage):

app/selenium_ui/bitbucket/pages/selectors.py

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ class LoginPageLocators:
9191
login_params = UrlManager().login_params
9292
login_url = UrlManager().login_url()
9393

94-
submit_button = {'6': (By.ID, "submit"), '7': (By.ID, "submit")}
95-
username_textfield = {'6': (By.ID, "j_username"), '7': (By.ID, "j_username")}
96-
password_textfield = {'6': (By.ID, "j_password"), '7': (By.ID, "j_password")}
94+
submit_button = (By.ID, "submit")
95+
username_textfield = (By.ID, "j_username")
96+
password_textfield = (By.ID, "j_password")
9797
application_version = (By.ID, 'product-version')
9898
node_id = (By.CLASS_NAME, 'footer-body')
9999

@@ -106,35 +106,33 @@ class LogoutPageLocators:
106106
class GetStartedLocators:
107107
get_started_params = UrlManager().get_started_params
108108
get_started_url = UrlManager().get_started_url()
109-
user_profile_icon = {'6': (By.ID, 'current-user'), '7': (By.ID, 'current-user')}
109+
user_profile_icon = (By.ID, 'current-user')
110110

111111

112112
class DashboardLocators:
113113
dashboard_params = UrlManager().dashboard_params
114114
dashboard_url = UrlManager().dashboard_url()
115115

116-
dashboard_presence = {'6': (By.TAG_NAME, 'h2'), '7': (By.TAG_NAME, 'h2')}
116+
dashboard_presence = (By.TAG_NAME, 'h2')
117117

118118

119119
class ProjectsLocators:
120120
projects_params = UrlManager().projects_params
121121
project_url = UrlManager().projects_url()
122122

123-
projects_list = {'6': (By.ID, "projects-container"), '7': (By.ID, "projects-container")}
123+
projects_list = (By.ID, "projects-container")
124124

125125

126126
class ProjectLocators:
127127

128-
repositories_container = {'6': (By.ID, "repositories-container"), '7': (By.ID, "repositories-container")}
129-
repository_name = {'6': (By.CSS_SELECTOR, "span.repository-name"), '7': (By.CSS_SELECTOR, "span.repository-name")}
128+
repositories_container = (By.ID, "repositories-container")
129+
repository_name = (By.CSS_SELECTOR, "span.repository-name")
130130

131131

132132
class RepoNavigationPanelLocators:
133133

134-
navigation_panel = {'6': (By.CSS_SELECTOR, '.aui-navgroup-vertical>.aui-navgroup-inner'),
135-
'7': (By.CSS_SELECTOR, '.aui-navgroup-vertical>.aui-navgroup-inner')}
136-
clone_repo_button = {'6': (By.CSS_SELECTOR, '.clone-repo>#clone-repo-button'),
137-
'7': (By.CSS_SELECTOR, '.clone-repo>#clone-repo-button')}
134+
navigation_panel = (By.CSS_SELECTOR, '.aui-navgroup-vertical>.aui-navgroup-inner')
135+
clone_repo_button = (By.CSS_SELECTOR, '.clone-repo>#clone-repo-button')
138136

139137
fork_repo_button = (By.CSS_SELECTOR, 'span.icon-fork')
140138

@@ -143,7 +141,7 @@ class RepoNavigationPanelLocators:
143141

144142
class RepoLocators:
145143

146-
pull_requests_list = {'6': (By.ID, 'pull-requests-content'), '7': (By.ID, 'pull-requests-content')}
144+
pull_requests_list = (By.ID, 'pull-requests-content')
147145
repo_fork_sync = (By.ID, "enable-ref-syncing")
148146
fork_name_field = (By.ID, 'name')
149147
fork_repo_submit_button = (By.ID, "fork-repo-submit")
@@ -171,31 +169,24 @@ class RepoLocators:
171169

172170
class PullRequestLocator:
173171

174-
tab_panel = {'6': (By.CSS_SELECTOR, 'ul.tabs-menu'), '7': (By.CSS_SELECTOR, 'ul.tabs-menu')}
172+
tab_panel = (By.CSS_SELECTOR, 'ul.tabs-menu')
175173

176-
commit_files = {'6': (By.CSS_SELECTOR, '.commit-files>.file-tree-container'),
177-
'7': (By.CSS_SELECTOR, '.changes-sidebar>.changes-scope-content')}
178-
diff_code_lines = {'6': (By.CLASS_NAME, 'CodeMirror-code'),
179-
'7': (By.CLASS_NAME, "diff-segment")}
174+
commit_files = (By.CSS_SELECTOR, '.changes-sidebar>.changes-scope-content')
175+
diff_code_lines = (By.CLASS_NAME, "diff-segment")
180176

181177
commit_message_label = (By.CSS_SELECTOR, 'tr>th.message')
182-
inline_comment_button = {'6': (By.CSS_SELECTOR, "button.add-comment-trigger>span.aui-iconfont-add-comment"),
183-
'7': (By.CSS_SELECTOR, ".diff-line-comment-trigger")}
184-
comment_text_area = {'6': (By.CSS_SELECTOR, "textarea.text"), '7': (By.CLASS_NAME, "comment-editor-wrapper")}
185-
text_area = {'6': (By.CSS_SELECTOR, 'textarea.text'), '7': (By.CLASS_NAME, 'CodeMirror-code')}
186-
comment_button = {'6': (By.CSS_SELECTOR, "div.comment-form-footer>div.buttons>button:nth-child(1)"),
187-
'7': (By.CSS_SELECTOR, "div.editor-controls>button:nth-child(1)")}
188-
pull_request_activity_content = {'6': (By.CSS_SELECTOR, ".pull-request-activity-content"),
189-
'7': (By.CSS_SELECTOR, ".pull-request-activities")}
178+
inline_comment_button = (By.CSS_SELECTOR, ".diff-line-comment-trigger")
179+
comment_text_area = (By.CLASS_NAME, "comment-editor-wrapper")
180+
text_area = (By.CLASS_NAME, 'CodeMirror-code')
181+
comment_button = (By.CSS_SELECTOR, "div.editor-controls>button:nth-child(1)")
182+
pull_request_activity_content = (By.CSS_SELECTOR, ".pull-request-activities")
190183

191184
pull_request_page_merge_button = (By.CLASS_NAME, 'merge-button')
192185

193186
merge_spinner = (By.CSS_SELECTOR, "aui-spinner[size='small']")
194-
diagram_selector = {'6': (By.CSS_SELECTOR, 'div.diagram-image'), '7': (By.CLASS_NAME, 'branches-diagram')}
195-
pull_request_modal_merge_button = {'6': (By.CSS_SELECTOR, 'button.confirm-button'),
196-
'7': (By.CSS_SELECTOR, ".merge-dialog button[type='submit']")}
197-
del_branch_checkbox_selector = {'6': (By.CSS_SELECTOR, 'span.pull-request-cleanup-checkbox-wrapper'),
198-
'7': (By.NAME, 'deleteSourceRef')}
187+
diagram_selector = (By.CLASS_NAME, 'branches-diagram')
188+
pull_request_modal_merge_button = (By.CSS_SELECTOR, ".merge-dialog button[type='submit']")
189+
del_branch_checkbox_selector = (By.NAME, 'deleteSourceRef')
199190
delete_branch_per_merge_checkbox = (By.CSS_SELECTOR, "input[type='checkbox']")
200191

201192

@@ -209,7 +200,7 @@ class BranchesLocator:
209200
search_branch_textfield = (By.ID, 'paged-table-input-for-branch-list')
210201
search_branch_action = (By.CSS_SELECTOR, '.branch-actions-column>button')
211202
search_action_delete_branch = (By.CSS_SELECTOR, 'li>a.delete-branch')
212-
delete_branch_diaglog_submit = (By.ID, 'delete-branch-dialog-submit')
203+
delete_branch_dialog_submit = (By.ID, 'delete-branch-dialog-submit')
213204

214205

215206
class RepositorySettingsLocator:

app/selenium_ui/confluence/pages/pages.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,15 @@ def click_submit(self):
125125
self.get_element(EditorLocators.publish_button).click()
126126

127127
def wait_for_editor_open(self):
128-
self.wait_until_any_ec_text_presented_in_el(selector_names=[(EditorLocators.status_indicator, 'Ready to go'),
129-
(EditorLocators.status_indicator, 'Changes saved')])
128+
self.wait_until_any_ec_text_presented_in_el(
129+
selector_text_list=[(EditorLocators.status_indicator, 'Ready to go'),
130+
(EditorLocators.status_indicator, 'Changes saved')])
130131

131132
def save_edited_page(self):
132133
self.get_element(EditorLocators.publish_button).click()
133134
if self.get_elements(EditorLocators.confirm_publishing_button):
134135
if self.get_element(EditorLocators.confirm_publishing_button).is_displayed():
135136
self.get_element(EditorLocators.confirm_publishing_button).click()
136137
self.wait_until_invisible(EditorLocators.save_spinner)
137-
self.wait_until_any_ec_presented(selector_names=[PageLocators.page_title,
138-
EditorLocators.confirm_publishing_button])
138+
self.wait_until_any_ec_presented(selectors=[PageLocators.page_title,
139+
EditorLocators.confirm_publishing_button])

app/selenium_ui/jira/pages/pages.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ def __init__(self, driver, projects_list_pages):
205205

206206
def wait_for_page_loaded(self):
207207
self.wait_until_any_ec_presented(
208-
selector_names=[ProjectLocators.projects_list, ProjectLocators.projects_not_found])
208+
selectors=[ProjectLocators.projects_list, ProjectLocators.projects_not_found])
209209

210210

211211
class BoardsList(BasePage):
@@ -221,9 +221,9 @@ def __init__(self, driver, jql):
221221
self.page_url = url_manager.jql_search_url()
222222

223223
def wait_for_page_loaded(self):
224-
self.wait_until_any_ec_presented(selector_names=[SearchLocators.search_issue_table,
225-
SearchLocators.search_issue_content,
226-
SearchLocators.search_no_issue_found])
224+
self.wait_until_any_ec_presented(selectors=[SearchLocators.search_issue_table,
225+
SearchLocators.search_issue_content,
226+
SearchLocators.search_no_issue_found])
227227

228228

229229
class Board(BasePage):

app/selenium_ui/jsm/pages/agent_pages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def __init__(self, driver, project_key=None, queue_id=None):
178178

179179
def wait_for_page_loaded(self):
180180
self.wait_until_any_ec_presented(
181-
selector_names=[ViewQueueLocators.queues_status, ViewQueueLocators.queue_is_empty], timeout=self.timeout)
181+
selectors=[ViewQueueLocators.queues_status, ViewQueueLocators.queue_is_empty], timeout=self.timeout)
182182

183183
def get_random_queue(self):
184184
if not self.get_elements(ViewQueueLocators.queue_is_empty):

app/util/bitbucket/populate_db.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ BITBUCKET_DB_PASS="Password1!"
3838
BITBUCKET_AUTO_DECLINE_VERSION="7.7.0"
3939

4040
# BITBUCKET version variables
41-
SUPPORTED_BITBUCKET_VERSIONS=(6.10.13 7.0.5 7.6.9)
41+
SUPPORTED_BITBUCKET_VERSIONS=(7.6.9)
4242
BITBUCKET_VERSION=$(sudo su bitbucket -c "cat ${BITBUCKET_VERSION_FILE}")
4343
if [[ -z "$BITBUCKET_VERSION" ]]; then
4444
echo The $BITBUCKET_VERSION_FILE file does not exists or emtpy. Please check if BITBUCKET_VERSION_FILE variable \

app/util/bitbucket/upload_attachments.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ esac; shift; done
2121
################### Variables section ###################
2222
# Bitbucket version variables
2323
BITBUCKET_VERSION_FILE="/media/atl/bitbucket/shared/bitbucket.version"
24-
SUPPORTED_BITBUCKET_VERSIONS=(6.10.13 7.0.5 7.6.9)
24+
SUPPORTED_BITBUCKET_VERSIONS=(7.6.9)
2525
BITBUCKET_VERSION=$(sudo su bitbucket -c "cat ${BITBUCKET_VERSION_FILE}")
2626
if [[ -z "$BITBUCKET_VERSION" ]]; then
2727
echo The $BITBUCKET_VERSION_FILE file does not exists or emtpy. Please check if BITBUCKET_VERSION_FILE variable \

0 commit comments

Comments
 (0)