Skip to content

Commit 1b12926

Browse files
Rahul VatsRahul Vats
authored andcommitted
initial commit to repo
1 parent c0df447 commit 1b12926

39 files changed

+3880
-0
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# QUICKER #
2+
3+
This framework can we used for testing of UI feature with selenium, we can also extent this for API
4+
test using request package
5+
6+
We are using [poetry](https://python-poetry.org/) here as dependency management tool
7+
8+
All the libraries which this framework is dependent on are listed [here](/Users/rahulvats/Documents/Automation/Pytestframwork/PycharmProjects/Quicker/pyproject.toml)
9+
10+
11+
Please follow below steps to get the execution going
12+
**pre-requisite**
13+
1. Need Python version 3.9 or more
14+
2. we should have poetry installed which can be installed using command "pip install poetry"
15+
16+
**Steps to run**
17+
1. Execute below command to install dependencies
18+
poetry install
19+
2. RUn command poetry run pytest --html-report=./report/report.html --browser = chrome
20+
21+
3. results can be checked at Quicker/report/report.html
22+

TestData/EnvironmentDetails.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BASE_URL = "https://www.google.com/"

TestData/SearchData.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class SearchData:
2+
test_search_data = [
3+
{"search_data": "fiserv", "expected_url": "https://www.fiserv.com/"},
4+
{
5+
"search_data": "Testing",
6+
"expected_url": "https://www.ibm.com/topics/software-testing",
7+
},
8+
]

TestData/__init__.py

Whitespace-only changes.

pageObjects/Google.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
from logging import getLogger
2+
3+
import pytest
4+
from selenium.webdriver.common.by import By
5+
import time
6+
from selenium.webdriver.common.keys import Keys
7+
8+
from selenium.webdriver.support.wait import WebDriverWait
9+
from selenium.webdriver.support import expected_conditions as EC
10+
from selenium.webdriver.common.action_chains import ActionChains
11+
from utilities.BaseClass import BaseClass
12+
from utilities.log import get_logger
13+
14+
logger = get_logger()
15+
16+
17+
class GooglePage(BaseClass):
18+
def __init__(self, driver):
19+
self.driver = driver
20+
21+
search_box = (By.XPATH, "//*[@type='search']")
22+
search_results = (By.XPATH, "//div[@class='yuRUbf']/a")
23+
24+
"""This function Perform the google sarch with provided test data
25+
Parameters:
26+
get_data
27+
"""
28+
29+
def perform_google_search(self, get_data):
30+
self.enter_input_by_locator(get_data["search_data"], *GooglePage.search_box)
31+
self.enter_input_by_locator(Keys.RETURN, *GooglePage.search_box)
32+
logger.info("Google searched performed -->{}".format({get_data["search_data"]}))
33+
34+
"""This function return the first test result link
35+
return:
36+
str
37+
"""
38+
39+
def get_first_result_href(self):
40+
search_results = self.driver.find_elements(*GooglePage.search_results)
41+
first_result_link = search_results[0].get_attribute("href")
42+
logger.info(f"first search result is {first_result_link}")
43+
return first_result_link

0 commit comments

Comments
 (0)