-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathGroup private to visible.py
More file actions
45 lines (39 loc) · 1.77 KB
/
Group private to visible.py
File metadata and controls
45 lines (39 loc) · 1.77 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
__author__= 'shubh'
import unittest
from decouple import config
from selenium import webdriver
class signup(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Firefox()
def login(self,var,driver):
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[var])
elem = driver.find_element_by_id("id_password")
elem.send_keys(config('NOTIFICATION_PASSWORD'))
driver.find_element_by_class_name('btn-block').click()
def test_draftToVisisbleState(self):
driver = webdriver.Firefox()
self.login(0,driver)
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT') + '/mydashboard/')
driver.find_element_by_xpath('//a [@href="/article-view/8/"]').click()
driver.find_element_by_xpath('//a [@href="/article-edit/8/"]').click()
driver.find_element_by_id('publish').click()
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT') + '/communities/')
driver.find_element_by_xpath('//a [@href="/community-view/2/"]').click()
driver.find_element_by_xpath('//a [@href="/group-view/1/"]').click()
driver.find_element_by_xpath('//a [@href="/group-feed/1/"]').click()
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT') + '/logout/')
for i in range(1,4):
self.login(i,driver)
driver.find_element_by_xpath('//a [@href="/notifications/"]').click()
driver.get(config('IP_ADDRESS') + ":" + config('NOTIFICATION_PORT') + '/logout/')
@classmethod
def tearDown(cls):
cls.driver.quit()
if __name__ == '__main__':
unittest.main()