|
2 | 2 | import string
|
3 | 3 | from selenium.common.exceptions import WebDriverException
|
4 | 4 |
|
5 |
| -from util.api.abstract_clients import RestClient, JSM_EXPERIMENTAL_HEADERS |
| 5 | +from util.api.abstract_clients import RestClient |
| 6 | + |
6 | 7 | from selenium_ui.conftest import retry
|
7 | 8 |
|
8 | 9 | BATCH_SIZE_BOARDS = 1000
|
@@ -201,14 +202,29 @@ def get_nodes(self):
|
201 | 202 | def get_system_info_page(self):
|
202 | 203 | login_url = f'{self.host}/login.jsp'
|
203 | 204 | auth_url = f'{self.host}/secure/admin/WebSudoAuthenticate.jspa'
|
| 205 | + tsv_login_url = f'{self.host}/rest/tsv/1.0/authenticate' |
204 | 206 | auth_body = {
|
205 | 207 | 'webSudoDestination': '/secure/admin/ViewSystemInfo.jspa',
|
206 | 208 | 'webSudoIsPost': False,
|
207 | 209 | 'webSudoPassword': self.password
|
208 | 210 | }
|
209 |
| - self.post(login_url, error_msg='Could not login in') |
| 211 | + tsv_login_body = {"username": self.user, |
| 212 | + "password": self.password, |
| 213 | + "rememberMe": "True", |
| 214 | + "targetUrl": "" |
| 215 | + } |
| 216 | + |
| 217 | + r = self.session.get(login_url) |
| 218 | + if not r.status_code == 200: |
| 219 | + raise Exception(f'ERROR: Could not login to Jira with url {login_url}, status code: {r.status_code}') |
| 220 | + legacy_login = 'login-form-remember-me' in r.text |
| 221 | + if not legacy_login: |
| 222 | + print(f'INFO: 2sv login on Jira detected') |
| 223 | + self.session.post(url=tsv_login_url, json=tsv_login_body) |
| 224 | + else: |
| 225 | + self.post(login_url, error_msg='Could not login in') |
210 | 226 | auth_body['atl_token'] = self.session.cookies.get_dict()['atlassian.xsrf.token']
|
211 |
| - system_info_html = self._session.post(auth_url, data=auth_body, verify=self.verify) |
| 227 | + system_info_html = self.session.post(auth_url, data=auth_body, headers={'X-Atlassian-Token': 'no-check'}, verify=self.verify) |
212 | 228 | return system_info_html.content.decode("utf-8")
|
213 | 229 |
|
214 | 230 | def get_available_processors(self):
|
|
0 commit comments