Skip to content

Commit

Permalink
QA-7229 updated the time display and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbo001 committed Dec 20, 2024
1 parent a9adc8f commit c4a8efa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions LocustScripts/update-scripts/commcarehq-badge-test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

import time
from datetime import datetime

from locust import SequentialTaskSet, between, task, tag, events
from locust.exception import InterruptTaskSet
Expand Down Expand Up @@ -112,16 +113,16 @@ def submit_clinic_count_form(self):
@tag('count_menu_again')
@task
def count_menu_again(self):
start_time = time.time()
start_time = datetime.now()
self.user.hq_user.navigate(
"Open 'Counts' Menu After Form Submission",
data={"selections": [self.FUNC_COUNT['selections']]},
expected_title=self.FUNC_COUNT['title'],
commands_list=self.FUNC_COUNT['commands']
)
end_time = time.time()
total_time = end_time - start_time
if total_time <= 0.3:
end_time = datetime.now()
total_time = (end_time - start_time).total_seconds()
if total_time <= 3:
logger.debug("Open 'Counts' Menu load time for mobile worker " + self.user.user_detail.username +
" is : " + str(total_time) + " seconds"
)
Expand Down
4 changes: 2 additions & 2 deletions LocustScripts/update-scripts/user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def submit_all(self, name, data, expected_response_message=None, status=None):
)

def post_formplayer(self, command, extra_json=None, name=None, validation=None):
logger.info("User: %s; Request: %s; Name: %s", self.user_details, command, name)
logger.info("User: %s; Request: %s; Name: %s", self.user_details.username, command, name)
try:
return formplayer.post(
command, self.client, self.app_details, self.user_details, extra_json, name, validation
)
except Exception as e:
logger.error(f"user: {self.user_details}; request: {command}; name:{name}; exception: {str(e)}")
logger.error(f"user: {self.user_details.username}; request: {command}; name:{name}; exception: {str(e)}")


class BaseLoginCommCareUser(HttpUser):
Expand Down

0 comments on commit c4a8efa

Please sign in to comment.