From ca91845fa08ca7fec5b74e3b9e7efffe8b26de54 Mon Sep 17 00:00:00 2001 From: eshfaq-ux <64083614+eshfaq-ux@users.noreply.github.com> Date: Fri, 8 Aug 2025 23:41:44 +0530 Subject: [PATCH] feat: Add generated.test.js --- generated.test.js | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 generated.test.js diff --git a/generated.test.js b/generated.test.js new file mode 100644 index 0000000..a8d6bdf --- /dev/null +++ b/generated.test.js @@ -0,0 +1,48 @@ +```python +import pytest +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC + +# Configure webdriver (replace with your preferred browser and path) +driver = webdriver.Chrome() + +def test_navigation_and_content(): + driver.get("https://tech-recruit.github.io") # Replace with actual URL + + # Training Section + training_link = WebDriverWait(driver, 10).until( + EC.element_to_be_clickable((By.LINK_TEXT, "Training")) + ) + training_link.click() + assert "Training" in driver.title #check if the title contains training + # Add assertions to check for specific content on the Training page. Example: + assert WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "training-content"))).is_displayed() + + + # Placement Section + driver.back() # Navigate back to the home page. + placement_link = WebDriverWait(driver, 10).until( + EC.element_to_be_clickable((By.LINK_TEXT, "Placement")) + ) + placement_link.click() + assert "Placement" in driver.title #check if the title contains placement + # Add assertions to check for specific content on the Placement page. Example: + assert WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "placement-content"))).is_displayed() + + + # About Us Section + driver.back() # Navigate back to the home page. + about_link = WebDriverWait(driver, 10).until( + EC.element_to_be_clickable((By.LINK_TEXT, "About Us")) #Update with the actual link text if different + ) + about_link.click() + assert "About Us" in driver.title #check if the title contains About Us + # Add assertions to check for specific content on the About Us page. Example: + assert WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "about-us-content"))).is_displayed() + + + driver.quit() + +```