forked from anshulkhare7/python-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwhatsapp.py
More file actions
44 lines (34 loc) · 1.04 KB
/
Copy pathwhatsapp.py
File metadata and controls
44 lines (34 loc) · 1.04 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
import time
from selenium import webdriver
from simon.accounts.pages import LoginPage
from simon.header.pages import HeaderPage
from simon.pages import BasePage
# Creating the driver (browser)
driver = webdriver.Firefox()
driver.maximize_window()
# 1. Login
# and uncheck the remember check box
# (Get your phone ready to read the QR code)
login_page = LoginPage(driver)
login_page.load()
login_page.remember_me = False
time.sleep(7)
# 2. The base page is inherited by all pages
# and here you can check whether any
# page is available on the screen of
# the browser.
# we don't need to load the pages as whatsapp
# web works as one-page web app
base_page = BasePage(driver)
base_page.is_title_matches()
base_page.is_welcome_page_available()
base_page.is_nav_bar_page_available()
base_page.is_search_page_available()
base_page.is_pane_page_available()
# chat is only available after you open one
base_page.is_chat_page_available()
# 3. Logout
header_page = HeaderPage(driver)
header_page.logout()
# Close the browser
driver.quit()