Skip to content

QA-7414 added test modules for different file sizes and changes the file sizes #384

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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

This file was deleted.

32 changes: 32 additions & 0 deletions QA_Requests/BHAStressTest/test_cases/test_01_stress_load_1kb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest

from Features.CaseSearch.constants import *
from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows
from QA_Requests.BHAStressTest.test_pages.bha_app_pages import BhaWorkflows
from QA_Requests.BHAStressTest.user_inputs.bha_user_inputs import BhaUserInput
from common_utilities.selenium.webapps import WebApps


def test_case_1_stress_load_files_1kb_1st(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_1kb_1st)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_1kb_1st, BhaUserInput.input_file_1kb
)

def test_case_2_stress_load_files_1kb_2nd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_1kb_2nd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_1kb_2nd, BhaUserInput.input_file_1kb
)

def test_case_2_stress_load_files_1kb_3rd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_1kb_3rd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_1kb_3rd, BhaUserInput.input_file_1kb
)
32 changes: 32 additions & 0 deletions QA_Requests/BHAStressTest/test_cases/test_02_stress_load_2kb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest

from Features.CaseSearch.constants import *
from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows
from QA_Requests.BHAStressTest.test_pages.bha_app_pages import BhaWorkflows
from QA_Requests.BHAStressTest.user_inputs.bha_user_inputs import BhaUserInput
from common_utilities.selenium.webapps import WebApps


def test_case_1_stress_load_files_2kb_1st(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_2kb_1st)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_2kb_1st, BhaUserInput.input_file_2kb
)

def test_case_2_stress_load_files_2kb_2nd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_2kb_2nd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_2kb_2nd, BhaUserInput.input_file_2kb
)

def test_case_2_stress_load_files_2kb_3rd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_2kb_3rd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_2kb_3rd, BhaUserInput.input_file_2kb
)
32 changes: 32 additions & 0 deletions QA_Requests/BHAStressTest/test_cases/test_03_stress_load_3kb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest

from Features.CaseSearch.constants import *
from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows
from QA_Requests.BHAStressTest.test_pages.bha_app_pages import BhaWorkflows
from QA_Requests.BHAStressTest.user_inputs.bha_user_inputs import BhaUserInput
from common_utilities.selenium.webapps import WebApps


def test_case_1_stress_load_files_3kb_1st(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_3kb_1st)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_3kb_1st, BhaUserInput.input_file_3kb
)

def test_case_2_stress_load_files_3kb_2nd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_3kb_2nd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_3kb_2nd, BhaUserInput.input_file_3kb
)

def test_case_2_stress_load_files_3kb_3rd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_3kb_3rd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_3kb_3rd, BhaUserInput.input_file_3kb
)
32 changes: 32 additions & 0 deletions QA_Requests/BHAStressTest/test_cases/test_04_stress_load_4kb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pytest

from Features.CaseSearch.constants import *
from Features.CaseSearch.test_pages.casesearch_page import CaseSearchWorkflows
from QA_Requests.BHAStressTest.test_pages.bha_app_pages import BhaWorkflows
from QA_Requests.BHAStressTest.user_inputs.bha_user_inputs import BhaUserInput
from common_utilities.selenium.webapps import WebApps


def test_case_1_stress_load_files_4kb_1st(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_4kb_1st)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_4kb_1st, BhaUserInput.input_file_4kb
)

def test_case_2_stress_load_files_4kb_2nd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_4kb_2nd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_4kb_2nd, BhaUserInput.input_file_4kb
)

def test_case_2_stress_load_files_4kb_3rd(driver, settings):
"""use case: Admit the client - case doesn't exist"""
app = BhaWorkflows(driver)
app.create_csv_file(BhaUserInput.result_name_4kb_3rd)
app.stress_load_files(BhaUserInput.bha_app_name, BhaUserInput.case_list, BhaUserInput.registration_form,
BhaUserInput.result_name_4kb_3rd, BhaUserInput.input_file_4kb
)
20 changes: 10 additions & 10 deletions QA_Requests/BHAStressTest/test_pages/bha_app_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ def open_form(self, form_name):
time.sleep(5)
self.wait_for_element((By.XPATH, self.current_page.format(form_name)), timeout=50)

def stress_load_files(self, app, menu, form):
for i in range(0, 40):
def stress_load_files(self, app, menu, form, file_name, input_file):
for i in range(0, 20):
print("Running loop for file count: ", str(i + 1))
self.wait_to_click(self.webapps_home)
self.open_app(app)
self.open_menu(menu)
self.open_form(form)
time_value = self.enter_form_value((i + 1))
self.write_to_file(str(i + 1), str(time_value))
time_value = self.enter_form_value((i + 1), input_file)
self.write_to_file(str(i + 1), str(time_value), file_name)

def enter_form_value(self, count):
def enter_form_value(self, count, file_name):
self.wait_for_element((By.XPATH, self.form_textarea.format(BhaUserInput.textarea_label)))
self.send_keys((By.XPATH, self.form_textarea.format(BhaUserInput.textarea_label)), self.textarea_value+" "+str(count))
filename = os.path.abspath(os.path.join(BhaUserInput.USER_INPUT_BASE_DIR,
"test_data/stress_test_file.pdf"
file_name
)
)
for i in range(0, count):
Expand All @@ -123,22 +123,22 @@ def enter_form_value(self, count):
total_time = (end_time - start_time).total_seconds()
return total_time

def write_to_file(self, file_count, time_value):
def write_to_file(self, file_count, time_value, file_name):
text = "Files uploaded " + file_count
data = [text, time_value]
print(data)
filename = os.path.abspath(os.path.join(BhaUserInput.USER_INPUT_BASE_DIR,
"time_records_new.csv"
file_name
)
)
with open(filename, 'a', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(data)
csvfile.close()

def create_csv_file(self):
def create_csv_file(self, file_name):
filename = os.path.abspath(os.path.join(BhaUserInput.USER_INPUT_BASE_DIR,
"time_records_new.csv"
file_name
)
)
with open(filename, 'w', newline='') as csvfile:
Expand Down
23 changes: 22 additions & 1 deletion QA_Requests/BHAStressTest/user_inputs/bha_user_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,25 @@ class BhaUserInput:
registration_form = "Registration Form"

"Labels"
textarea_label = "Enter the stress testing round number"
textarea_label = "Enter the stress testing round number"

result_name_1kb_1st = "time_records_new_1kb_1st.csv"
result_name_1kb_2nd = "time_records_new_1kb_2nd.csv"
result_name_1kb_3rd = "time_records_new_1kb_3rd.csv"

result_name_2kb_1st = "time_records_new_2kb_1st.csv"
result_name_2kb_2nd = "time_records_new_2kb_2nd.csv"
result_name_2kb_3rd = "time_records_new_2kb_3rd.csv"

result_name_3kb_1st = "time_records_new_3kb_1st.csv"
result_name_3kb_2nd = "time_records_new_3kb_2nd.csv"
result_name_3kb_3rd = "time_records_new_3kb_3rd.csv"

result_name_4kb_1st = "time_records_new_4kb_1st.csv"
result_name_4kb_2nd = "time_records_new_4kb_2nd.csv"
result_name_4kb_3rd = "time_records_new_4kb_3rd.csv"

input_file_1kb = "test_data/sample_1kb.pdf"
input_file_2kb = "test_data/sample_2kb.pdf"
input_file_3kb = "test_data/sample_3kb.pdf"
input_file_4kb = "test_data/sample_4kb.pdf"
Binary file not shown.
27 changes: 27 additions & 0 deletions QA_Requests/BHAStressTest/user_inputs/test_data/sample_1kb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Sample Test for Stress Test 1kb
Binary file not shown.
56 changes: 56 additions & 0 deletions QA_Requests/BHAStressTest/user_inputs/test_data/sample_2kb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Sample Test for Stress Test 2kb
Binary file not shown.
Loading
Loading