File tree Expand file tree Collapse file tree 6 files changed +22
-20
lines changed
Expand file tree Collapse file tree 6 files changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def login_as_user_bcss401(self):
3232 user_details = UserTools .retrieve_user ("BCSS401" )
3333 self .username .fill (user_details ["username" ])
3434 # Retrieve and enter password from .env file
35- password = os .getenv ("BCSS401_PASS " )
35+ password = os .getenv ("BCSS_PASS " )
3636 self .password .fill (password )
3737 # Click submit button
3838 self .submit_button .click ()
@@ -45,7 +45,7 @@ def login_as_user_bcss118(self):
4545 user_details = UserTools .retrieve_user ("BCSS118" )
4646 self .username .fill (user_details ["username" ])
4747 # Retrieve and enter password from .env file
48- password = os .getenv ("BCSS118_PASS " )
48+ password = os .getenv ("BCSS_PASS " )
4949 self .password .fill (password )
5050 # Click submit button
5151 self .submit_button .click ()
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ def __init__(self, page: Page):
1010 self .help_link = self .page .get_by_role ("link" , name = "Help" )
1111 self .log_out_link = self .page .get_by_role ("link" , name = "Log-out" )
1212
13- def click_main_menu_link (self ):
13+ def click_main_menu_link (self ): # change to check if URL is correct
1414 for _ in range (3 ): # Try up to 3 times
1515 self .page .wait_for_timeout (2000 ) # Wait for 2 seconds before trying (as sometimes this button is clicked as a redirect happens)
1616 if self .main_menu_link .is_visible ():
Original file line number Diff line number Diff line change 1+ from pages .bcss_home_page import *
2+ from pages .login_page import *
3+ from pages .communications_production_page import *
4+ from pages .call_and_recall_page import *
5+ from pages .active_batch_list_page import *
6+ from pages .archived_batch_list_page import *
7+ from pages .navigation_bar_links import *
8+ from pages .subject_screening_page import *
9+ from pages .manage_active_batch_page import *
10+ from pages .invitations_monitoring_page import *
11+ from pages .create_a_plan_page import *
12+ from pages .invitations_plans_page import *
13+ from utils .oracle import *
Original file line number Diff line number Diff line change 33from playwright .sync_api import Page , expect
44import pandas as pd
55import os
6- import sys
7- sys .path .append ("../" )
8- from utils .oracle import *
9- from pages .bcss_home_page import *
10- from pages .login_page import *
11- from pages .communications_production_page import *
12- from pages .call_and_recall_page import *
13- from pages .active_batch_list_page import *
14- from pages .archived_batch_list_page import *
15- from pages .navigation_bar_links import *
16- from pages .subject_screening_page import *
17- from pages .manage_active_batch_page import *
18- from pages .invitations_monitoring_page import *
19- from pages .create_a_plan_page import *
20- from pages .invitations_plans_page import *
6+ from my_pages import *
217
228# To Do:
239# Create more POMs
Original file line number Diff line number Diff line change 11import os
2-
2+ import pytest
33from dotenv import load_dotenv
44from playwright .sync_api import Page , expect
55from pages .login_page import BcssLoginPage
66
7-
87def test_successful_login_to_bcss (page : Page ) -> None :
98 """
109 Confirms that a user with valid credentials can log in to bcss
Original file line number Diff line number Diff line change 22import os
33from dotenv import load_dotenv
44
5+ # Edit to "try:"
6+
57def database_connection_exec (procedure : str ): # To use when "exec xxxx" (stored procedures)
68 load_dotenv ()
79 un = os .getenv ("un" )
@@ -12,6 +14,7 @@ def database_connection_exec(procedure: str): # To use when "exec xxxx" (stored
1214 with connection .cursor () as cursor :
1315 for r in cursor .callproc (procedure ):
1416 print (r )
17+ connection .close ()
1518
1619def database_connection_query (sql : str ): # To use when "select a from b"
1720 load_dotenv ()
@@ -23,4 +26,5 @@ def database_connection_query(sql: str): # To use when "select a from b"
2326 with connection .cursor () as cursor :
2427 for r in cursor .execute (sql ):
2528 print (r )
29+ connection .close ()
2630 return r
You can’t perform that action at this time.
0 commit comments