-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathArticlePrevButtonClick.py
More file actions
48 lines (41 loc) · 1.93 KB
/
ArticlePrevButtonClick.py
File metadata and controls
48 lines (41 loc) · 1.93 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
import unittest
import time
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
class signup(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.url_basic = "http://172.17.0.1:7000/"
def test_community_view(self):
user = "root"
pwd = "root1234"
title = "Selenium Test Cases"
delay = 20
driver = webdriver.Firefox()
driver.maximize_window() # For maximizing window
driver.get("http://172.17.0.1:7000/")
driver.find_element_by_xpath('//a [@href="/login/?next=/"]').click()
driver.get("http://172.17.0.1:7000/login/?next=/")
elem = driver.find_element_by_id("id_username")
elem.send_keys(user)
elem = driver.find_element_by_id("id_password")
elem.send_keys(pwd)
driver.find_element_by_class_name('btn-block').click()
driver.find_element_by_xpath('//a [@href="/communities/"]').click()
driver.find_element_by_xpath('//a [@href="/community-view/1/"]').click()
driver.find_element_by_xpath("//button [@type='button' and @data-target='#modalCreate']").click()
driver.find_element_by_xpath("//button [@type='button' and @data-target='#modalCreateArticle']").click()
driver.find_element_by_id("exampleCheck1").click()
driver.find_element_by_xpath("/html/body/div[4]/div/div/div[2]/div[2]/div[3]/div/div/div[3]/button[2]").click() # T and C Dialog Box Yes Button
elem = driver.find_element_by_id("title")
elem.send_keys(title)
driver.find_element_by_id("create").click()
time.sleep(10)
driver.find_element_by_xpath("/html/body/div[4]/div/form/button").click() #Etherpad 'Prev' Button Check
driver.find_element_by_class_name("img-responsive")
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()