From ad2c996b1ce9ffe14497a5789a71fe1fa460db5e Mon Sep 17 00:00:00 2001 From: sapprotim Date: Sun, 21 Jun 2026 15:44:37 +0600 Subject: [PATCH] Remove hardcoded credentials and add .gitignore for security Replace real email, password, and OTP in negative-test cases with generic placeholders. Add root .gitignore to permanently block Excel credential files and other secrets from being committed. Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 29 +++++++++++++++++++++++++++++ Login_logout/test_login_logout.py | 6 +++--- 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f97d72 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +# Credentials & secrets +*.xlsx +*.xls +*.env +*.env.* +secrets.* +credentials.* +login*info* + +# Python +__pycache__/ +*.py[cod] +*.pyo +.pytest_cache/ +.coverage +htmlcov/ + +# Screenshots & reports (local test output) +screenshots/ +reports/ + +# IDE +.idea/ +.vscode/ +*.iml + +# OS +.DS_Store +Thumbs.db diff --git a/Login_logout/test_login_logout.py b/Login_logout/test_login_logout.py index 206b203..581652e 100644 --- a/Login_logout/test_login_logout.py +++ b/Login_logout/test_login_logout.py @@ -81,7 +81,7 @@ def pytest_runtest_makereport(item, call): def test_login_with_invalid_user(login, take_screenshot): driver = login - driver.find_element(By.XPATH, "//div[@class='login-form']//div[1]//label[1]").send_keys("clhstms+clh@connectedlife.i") + driver.find_element(By.XPATH, "//div[@class='login-form']//div[1]//label[1]").send_keys("invalid_user@example.com") driver.find_element(By.XPATH, "//div[@class='divisions']//div[2]//label[1]//input[1]").send_keys(facility_pass) driver.find_element(By.XPATH, "//input[@value='Sign In']").click() message = driver.find_element(By.XPATH, "//*[@id='loginForm']/div[3]").text @@ -94,7 +94,7 @@ def test_login_with_invalid_user(login, take_screenshot): def test_login_with_invalid_password(login, take_screenshot): driver = login driver.find_element(By.XPATH, "//div[@class='login-form']//div[1]//label[1]").send_keys(facility_userid) - driver.find_element(By.XPATH, "//div[@class='divisions']//div[2]//label[1]//input[1]").send_keys("CoLifeUatSTM@123") + driver.find_element(By.XPATH, "//div[@class='divisions']//div[2]//label[1]//input[1]").send_keys("WrongPassword@000") driver.find_element(By.XPATH, "//input[@value='Sign In']").click() message = driver.find_element(By.XPATH, "//*[@id='loginForm']/div[3]").text assert message == "Incorrect username or password. Please try again." @@ -117,7 +117,7 @@ def test_login_with_valid_userid_password(login, take_screenshot): def test_invalid_otp(loginfinal, take_screenshot): driver = loginfinal - driver.find_element(By.XPATH, "//input[@id='inp']").send_keys("369633") + driver.find_element(By.XPATH, "//input[@id='inp']").send_keys("000000") driver.find_element(By.XPATH, "//input[@value='Submit']").click() message = driver.find_element(By.XPATH, "//*[@id='pinForm']/div[2]").text assert message == "Back to Log in"