-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathFeed for draft to visible.py
More file actions
35 lines (29 loc) · 1.28 KB
/
Feed for draft to visible.py
File metadata and controls
35 lines (29 loc) · 1.28 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
__author__= 'shubh'
import unittest
from decouple import config
from selenium import webdriver
class signup(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
def test_draftToVisisbleState(self):
driver = webdriver.Firefox()
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT'))
driver.find_element_by_xpath('//a [@href="/login/?next=/"]').click()
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT') + '/login/?next=/')
elem = driver.find_element_by_id("id_username")
user = config('NOTIFICATION_USER').split(',')
elem.send_keys(user[0])
elem = driver.find_element_by_id("id_password")
elem.send_keys(config('NOTIFICATION_PASSWORD'))
driver.find_element_by_class_name('btn-block').click()
driver.get(config('IP_ADDRESS') + '/mydashboard/')
driver.find_element_by_xpath('//a [@href="/article-view/4/"]').click()
driver.find_element_by_xpath('//a [@href="/article-edit/4/"]').click()
#make the id as visible of the button of visible in html file
driver.find_element_by_id('publish').click()
driver.find_element_by_xpath('//a [@href="/community-view/2/"]').click()
driver.find_element_by_xpath('//a [@href="/community_feed/2/"]').click()
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()