-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTS07_Footer_Testcases.py
More file actions
70 lines (50 loc) · 2.01 KB
/
TS07_Footer_Testcases.py
File metadata and controls
70 lines (50 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from selenium.webdriver import Chrome,ActionChains
import time
from selenium.webdriver.common.by import By
# Test case for testing the functionality of the search bar by typing inside it
def searching_bar():
# Initialize the browser
browser = Chrome()
browser.get("https://oportunitatisicariere.ro/")
browser.maximize_window() # Use maximize_window() instead of fullscreen
time.sleep(2)
#scroll to the bottom of the page to see the footer
browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
time.sleep(2)
# TC01 - Verify the LInkedin button :
linkedin = browser.find_element(By.XPATH, '//footer//a[contains(@href,"linkedin.com")]')
linkedin.click()
time.sleep(3)
# Switch to the new window that opened
original_window = browser.current_window_handle
all_windows = browser.window_handles
# Assume the new window is the last one opened
for window in all_windows:
if window != original_window:
browser.switch_to.window(window)
break
time.sleep(2)
browser.close()
browser.switch_to.window(original_window)
time.sleep(2)
# TC02 - Verify the Instagram button :
instagramIcon = browser.find_element(By.XPATH, '//footer//a[contains(@href,"https://www.instagram.com/")]')
instagramIcon.click()
time.sleep(3)
# Switch to the new window that opened
original_window = browser.current_window_handle
all_windows = browser.window_handles
# Assume the new window is the last one opened
for window in all_windows:
if window != original_window:
browser.switch_to.window(window)
break
time.sleep(2)
browser.close()
browser.switch_to.window(original_window)
time.sleep(2)
# TC03 - Verify the functionality of "Asociatia Oportunitati si cariere" link
asociationLink = browser.find_element(By.XPATH,'//footer//h4[contains(text(),"ASOCIAȚIA OPORTUNITĂȚI ȘI CARIERE")]')
asociationLink.click()
time.sleep(2)
searching_bar()