Skip to content

Commit 9c45725

Browse files
committed
Removed 2 UI methods from batch processing because now we are checking assertions via DB
1 parent b703c70 commit 9c45725

File tree

1 file changed

+0
-90
lines changed

1 file changed

+0
-90
lines changed

utils/batch_processing.py

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -208,93 +208,3 @@ def check_batch_in_archived_batch_list(page: Page, link_text) -> None:
208208
logging.error(
209209
f"[UI ASSERTIONS] Batch {link_text} not visible in archived batch list: {str(e)}"
210210
)
211-
212-
213-
def assert_batch_present_in_active_list(
214-
page: Page, batch_type: str, batch_description: str
215-
) -> None:
216-
"""
217-
Asserts that a batch is present in the active batch list.
218-
Raises AssertionError if not found.
219-
220-
Args:
221-
page (Page): The playwright page object
222-
batch_type (str): The batch type (e.g., "A348")
223-
batch_description (str): The batch description
224-
225-
Raises:
226-
AssertionError: If batch is not found in active batch list
227-
"""
228-
try:
229-
BasePage(page).click_main_menu_link()
230-
BasePage(page).go_to_communications_production_page()
231-
CommunicationsProductionPage(page).go_to_active_batch_list_page()
232-
233-
# Filter by batch type
234-
ActiveBatchListPage(page).enter_event_code_filter(batch_type)
235-
236-
# Check if batch with description exists
237-
batch_description_cells = page.locator(f"//td[text()='{batch_description}']")
238-
239-
if batch_description_cells.count() == 0:
240-
raise AssertionError(
241-
f"Batch {batch_type} - '{batch_description}' not found in active batch list"
242-
)
243-
244-
logging.info(
245-
f"[BATCH ASSERTION] Batch {batch_type} - '{batch_description}' verified in active batch list"
246-
)
247-
248-
except Exception as e:
249-
error_msg = (
250-
f"[BATCH ASSERTION FAILED] Batch {batch_type} - '{batch_description}' "
251-
f"not found in active batch list: {str(e)}"
252-
)
253-
logging.error(error_msg)
254-
raise AssertionError(error_msg) from e
255-
256-
257-
def assert_batch_not_present_in_active_list(
258-
page: Page, batch_type: str, batch_description: str
259-
) -> None:
260-
"""
261-
Asserts that a batch is NOT present in the active batch list.
262-
Raises AssertionError if batch is found.
263-
264-
Args:
265-
page (Page): The playwright page object
266-
batch_type (str): The batch type (e.g., "A374")
267-
batch_description (str): The batch description
268-
269-
Raises:
270-
AssertionError: If batch is found in active batch list
271-
"""
272-
try:
273-
BasePage(page).click_main_menu_link()
274-
BasePage(page).go_to_communications_production_page()
275-
CommunicationsProductionPage(page).go_to_active_batch_list_page()
276-
277-
# Filter by batch type
278-
ActiveBatchListPage(page).enter_event_code_filter(batch_type)
279-
280-
# Check if batch with description exists
281-
batch_description_cells = page.locator(f"//td[text()='{batch_description}']")
282-
283-
if batch_description_cells.count() > 0:
284-
raise AssertionError(
285-
f"Batch {batch_type} - '{batch_description}' should NOT be present in active batch list, but it was found"
286-
)
287-
288-
logging.info(
289-
f"[BATCH ASSERTION] Batch {batch_type} - '{batch_description}' correctly NOT present in active batch list"
290-
)
291-
292-
except AssertionError:
293-
raise
294-
except Exception as e:
295-
error_msg = (
296-
f"[BATCH ASSERTION FAILED] Error while checking batch {batch_type} - '{batch_description}' "
297-
f"in active batch list: {str(e)}"
298-
)
299-
logging.error(error_msg)
300-
raise AssertionError(error_msg) from e

0 commit comments

Comments
 (0)