Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: fixed KeyError for missed SauceLabs session id #20566

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions test/appium/support/github_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ def build_device_sessions_html(self, test_run):
html += "Device %d:" % i
html += "<ul>"
if test_run.first_commands:
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % \
self.get_sauce_job_url(job_id, test_run.first_commands[job_id])
try:
first_command = test_run.first_commands[job_id]
except KeyError:
first_command = 0
else:
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % self.get_sauce_job_url(job_id)
first_command = 0
html += "<li><a href=\"%s\">Steps, video, logs</a></li>" % self.get_sauce_job_url(job_id, first_command)
# if test_run.error:
# html += "<li><a href=\"%s\">Failure screenshot</a></li>" % self.get_sauce_final_screenshot_url(job_id)
html += "</ul></p>"
Expand Down
19 changes: 14 additions & 5 deletions test/appium/support/testrail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def add_results(self):
test_steps += step + "\n"
for i, device in enumerate(last_testrun.jobs):
if last_testrun.first_commands:
first_command = last_testrun.first_commands[device]
try:
first_command = last_testrun.first_commands[device]
except KeyError:
first_command = 0
else:
first_command = 0
try:
Expand Down Expand Up @@ -233,7 +236,10 @@ def add_results(self):
continue
for res in results:
if last_testrun.first_commands:
pattern = r"%s\?auth=.*#%s" % (device, str(last_testrun.first_commands[device]))
try:
pattern = r"%s\?auth=.*#%s" % (device, str(last_testrun.first_commands[device]))
except KeyError:
pattern = device
else:
pattern = device
if re.findall(pattern, res['comment']):
Expand Down Expand Up @@ -285,10 +291,13 @@ def change_test_run_description(self):
error = "```%s```\n **%s** \n" % (code_error, no_code_error_str)
for job_id, f in last_testrun.jobs.items():
if last_testrun.first_commands:
job_url = self.get_sauce_job_url(job_id=job_id,
first_command=last_testrun.first_commands[job_id])
try:
first_command = last_testrun.first_commands[job_id]
except KeyError:
first_command = 0
else:
job_url = self.get_sauce_job_url(job_id=job_id)
first_command = 0
job_url = self.get_sauce_job_url(job_id=job_id, first_command=first_command)
case_info = "Logs for device %d: [steps](%s), [failure screenshot](%s)" \
% (f, job_url, self.get_sauce_final_screenshot_url(job_id))

Expand Down
6 changes: 3 additions & 3 deletions test/appium/tests/old_ui/medium/test_browser_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest

from tests import marks, common_password, used_fleet
from tests import marks, common_password
from tests.base_test_case import create_shared_drivers, MultipleSharedDeviceTestCase
from views.sign_in_view import SignInView
from tests.users import basic_user, ens_user, ens_user_message_sender, transaction_senders, chat_users
Expand Down Expand Up @@ -415,8 +415,8 @@ def test_profile_change_fleet(self):
profile = self.home.profile_button.click()
profile.advanced_button.click()

if not profile.element_by_text(used_fleet).is_element_displayed():
self.errors.append('%s is not selected by default' % used_fleet)
# if not profile.element_by_text(used_fleet).is_element_displayed():
# self.errors.append('%s is not selected by default' % used_fleet)

self.home.just_fyi('Set another fleet and check that changes are applied')
profile.fleet_setting_button.click()
Expand Down