Skip to content
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
963dc1e
added builtinfunctions for performance testing
Sakib75 Jun 12, 2022
8da2349
added perfomance module in sequential action
Sakib75 Jun 12, 2022
f1bdc56
added actions for locust
Sakib75 Jun 12, 2022
82a6053
removed type on builtinfunc
Sakib75 Jun 12, 2022
9e74620
reverted back the unintentional changes
Sakib75 Jun 13, 2022
208e81c
left right
Sakib75 Jun 13, 2022
e1ca9fc
standalone script for converting server json to locust json
Sakib75 Jun 13, 2022
9e90236
logic changed for searching locust config in aciton
Sakib75 Jun 13, 2022
29fc775
updated the filepath of sample json
Sakib75 Jun 13, 2022
90f94f8
formatted output json
Sakib75 Jun 13, 2022
8c6fdcd
read data from testcase json
Sakib75 Jun 13, 2022
e4e8927
function name updated, output path added
Sakib75 Jun 14, 2022
08aba64
changed locust user 'user name' to 'name'
Sakib75 Jun 14, 2022
091e102
Refactor and update assign_locust_user
Oytizzo Jun 14, 2022
cc18ff8
updated dataset reading logic
Sakib75 Jun 14, 2022
fbbc13c
docs updated
Sakib75 Jun 14, 2022
794259e
username/classname to case-sensitive, user type to HttpUser and User
Sakib75 Jun 15, 2022
ae2af1e
Move and update packages for perf
Oytizzo Jun 15, 2022
6898c4a
added optional parameter sequential and weight
Sakib75 Jun 15, 2022
4e54852
Merge branch 'performance_testing' of https://github.com/AutomationSo…
Sakib75 Jun 15, 2022
7579882
username to user name and removed sequential from user
Sakib75 Jun 16, 2022
db62a94
removed sequential from user
Sakib75 Jun 16, 2022
c225d9a
updated user with new format
Sakib75 Jun 16, 2022
6ebfea3
added taskset action
Sakib75 Jun 16, 2022
59a4354
reverted setting.conf
Sakib75 Jun 16, 2022
7291f47
Add dir for storing generated locust files
Oytizzo Jun 16, 2022
1b28482
Add the initial code for run_performance_test action
Oytizzo Jun 16, 2022
fb28408
fixed the mentioned issues
Sakib75 Jun 19, 2022
2ceb940
Add functionality for generating locust python file
Oytizzo Jun 19, 2022
55a55c9
Bugfix
Oytizzo Jun 19, 2022
8ebcaf0
Remove duplicate line
Oytizzo Jun 19, 2022
7872c83
Update generate_performance_testing action
Oytizzo Jun 20, 2022
580b4cd
Add and update run_performance_test
Oytizzo Jun 20, 2022
60bcf7c
Executed the run_performance_test with subprocess
Oytizzo Jun 20, 2022
f391176
Update run, generate locust and add settings for keeping the track of…
Oytizzo Jun 30, 2022
64f54d8
resolved subprocess issue and run_perf update
Oytizzo Jun 30, 2022
9cafa50
Save report to AutomationLog dir
Oytizzo Jun 30, 2022
b9b8398
Update settings.py for report dirs
Oytizzo Jul 1, 2022
667e642
Update path for html report
Oytizzo Jul 1, 2022
28bc15b
update and remove print_exc
Oytizzo Jul 4, 2022
f6b0755
Revert settings.conf
Oytizzo Jul 4, 2022
66e3729
Add csv file generator and update the file name with run_id
Oytizzo Jul 6, 2022
f9ecfde
refactor and remove redundant codes
Oytizzo Jul 6, 2022
33fdca1
Add documentation
Oytizzo Jul 6, 2022
8d3a2a7
Merge branch 'dev' of https://github.com/AutomationSolutionz/Zeuz_Pyt…
Oytizzo Jul 8, 2022
c970cb3
Delete unused code from tests dir in Performance_Testing
Oytizzo Jul 8, 2022
c643b27
Modify CHANGELOG and version, delete generated codes
Oytizzo Jul 13, 2022
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
394 changes: 394 additions & 0 deletions Framework/Built_In_Automation/Performance_Testing/BuiltInFunctions.py

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from locust import HttpUser, task, between, User


class User1(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_homepage(self):
self.client.get(url="/100")

@task
def visit_indexpage(self):
self.client.get(url="/300")


class User2(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_indexpage(self):
self.client.get(url="/400")


class User3(User):
host = "https://http.cat"
wait_time = between(5,10)

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from locust import HttpUser, task, between, User


class User1(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_homepage(self):
self.client.get(url="/100")

@task
def visit_indexpage(self):
self.client.get(url="/300")


class User2(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_indexpage(self):
self.client.get(url="/400")


class User3(User):
host = "https://http.cat"
wait_time = between(5,10)

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from locust import HttpUser, task, between, User


class User1(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_homepage(self):
self.client.get(url="/100")

@task
def visit_indexpage(self):
self.client.get(url="/300")


class User2(HttpUser):
host = "https://http.cat"
wait_time = between(5,10)

@task
def visit_indexpage(self):
self.client.get(url="/400")


class User3(User):
host = "https://http.cat"
wait_time = between(5,10)

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from locust import HttpUser, task, between, User

{% for user in PERF_VARIABLE.users %}
class {{user}}({{PERF_VARIABLE.users[user].type}}):
host = "{{PERF_VARIABLE.users[user].host}}"
wait_time = {{PERF_VARIABLE.users[user].wait_time}}
{% for task in PERF_VARIABLE.users[user].tasks%}
@task
def {{ task.name }}(self):{% if task.action == "post" %}
self.client.post(url="{{ task.url }}", data=None)
{% elif task.action == "get" %}
self.client.get(url="{{ task.url }}")
{% endif %}{% endfor %}
{% endfor %}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
windows,
xml,
database,
performance
)

modules = (
Expand All @@ -20,6 +21,7 @@
windows,
xml,
database,
performance
)

# This will be exported and contains all the actions.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
declarations = (
{ "name": "locust config", "function": "locust_config", "screenshot": "none" },
{ "name": "assign locust user", "function": "assign_locust_user", "screenshot": "none" },
{ "name": "assign locust task", "function": "assign_locust_task", "screenshot": "none" },
{ "name": "assign locust taskset", "function": "assign_locust_taskset", "screenshot": "none" },
{ "name": "run performance test", "function": "run_performance_test", "screenshot": "none" },
{ "name": "generate performance test", "function": "generate_performance_test", "screenshot": "none" },
) # yapf: disable

module_name = "performance"

for dec in declarations:
dec["module"] = module_name
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ def load_sa_modules(
from Framework.Built_In_Automation.Desktop.Windows import (
BuiltInFunctions as windows,
)
elif module == "performance":
global performance
from Framework.Built_In_Automation.Performance_Testing import (
BuiltInFunctions as performance,
)
else:
CommonUtil.ExecLog(
sModuleInfo, "Invalid sequential actions module: %s" % module, 3
Expand Down
44 changes: 22 additions & 22 deletions Framework/settings.conf
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[Authentication]
server_address = https://zeuz.zeuz.ai
username =
password =
api-key =
[Advanced Options]
element_wait = 10
available_to_all_project = False
_file = temp_config.ini
_file_upload_path = TestExecutionLog
[Selenium_driver_paths]
chrome_path =
firefox_path =
edge_path =
opera_path =
ie_path =
[Inspector]
Window =
No_of_level_to_skip = 0
[Authentication]
server_address = https://zeuz.zeuz.ai
username =
password =
api-key =

[Advanced Options]
element_wait = 10
available_to_all_project = False
_file = temp_config.ini
_file_upload_path = TestExecutionLog

[Selenium_driver_paths]
chrome_path =
firefox_path =
edge_path =
opera_path =
ie_path =

[Inspector]
Window =
No_of_level_to_skip = 0
34 changes: 34 additions & 0 deletions settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import os
from pathlib import Path

from Framework.Utilities import ConfigModule


# BASE_DIR or PROJECT_ROOT or Zeuz_Python_Node dir
PROJECT_ROOT = Path(__file__).parent

# AutomationLog dir
AutomationLog_DIR = PROJECT_ROOT / "AutomationLog"

# attachments dir
attachments_DIR = AutomationLog_DIR / "attachments"

# settings.conf file
settings_conf_dir = PROJECT_ROOT / "Framework" / "settings.conf"

# temp_ini_file = os.path.join(
# os.path.join(
# os.path.abspath(__file__).split("Framework")[0],
# os.path.join(
# "AutomationLog",
# ConfigModule.get_config_value("Advanced Options", "_file"),
# ),
# )
# )

# temp_config.ini file
# temp_ini_file = AutomationLog_DIR / "temp_config.ini"
# temp_ini_file = AutomationLog_DIR / ConfigModule.get_config_value("Advanced Options", "_file", settings_conf_dir)
temp_ini_file = AutomationLog_DIR / ConfigModule.get_config_value("Advanced Options", "_file")

performance_report_dir = ConfigModule.get_config_value("sectionOne", "performance_report", temp_ini_file)