Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test cases for reputation #14

Open
wants to merge 6 commits into
base: reputation
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,445 changes: 1,445 additions & 0 deletions test/geckodriver.log

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions test/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Reputation_System(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()

def test_login_test(self):
driver = self.driver
driver.find_element_by_link_text('Log In').click()
username = driver.find_element_by_id('id_username')
password = driver.find_element_by_id('id_password')
username.clear()
password.clear()
username.send_keys("karthik")
password.send_keys("kaushik123")
driver.find_element_by_class_name('btn-block').click()
driver.find_element_by_class_name('dropdown-toggle').text

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()


30 changes: 30 additions & 0 deletions test/test1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()

def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
#driver.find_element_by_id('id_username').send_keys('amu')
#driver.find_element_by_id('id_password').send_keys('!!Killerbee8')
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[0].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions test/test2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()

def test_Log_in(self):
#driver = self.driver
#driver.find_element_by_id('id_username').send_keys('amu')
#driver.find_element_by_id('id_password').send_keys('!!Killerbee8')
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[1].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
29 changes: 29 additions & 0 deletions test/test3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()

def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[0].click()
driver.find_elements_by_css_selector('#my_form>button')[0].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
29 changes: 29 additions & 0 deletions test/test4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()

def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[1].click()
driver.find_elements_by_css_selector('#my_form>button')[1].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
30 changes: 30 additions & 0 deletions test/test5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()


def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[0].click()
driver.find_elements_by_css_selector('#my_form>button')[1].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
30 changes: 30 additions & 0 deletions test/test6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()


def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[1].click()
driver.find_elements_by_css_selector('#my_form>button')[0].click()

def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
30 changes: 30 additions & 0 deletions test/test7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()


def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[2].click()


def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
31 changes: 31 additions & 0 deletions test/test8.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import unittest
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys

class Log_in(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get("http://" + config('IP_ADDRESS') + ':' + config('REPUTATION_PORT'))
self.driver.maximize_window()


def test_Log_in(self):
driver = self.driver
username = driver.get(config('REPUTATION_USER')).split(',')
elem = driver.find_element_by_id('id_username')
elem.send_keys(username[0])
password = driver.get(config('REPUTATION_PASSWORD'))
elem = driver.find_element_by_id('id_password')
elem.send_keys(password)
driver.find_element_by_id('log_in_btn').click()
driver.get("http://127.0.0.1:8000/article-view/4/")
driver.find_elements_by_css_selector('#my_form>button')[2].click()
driver.find_elements_by_css_selector('#my_form>button')[2].click()


def tearDown(self):
self.driver.quit()

if __name__ == '__main__':
unittest.main()
12 changes: 9 additions & 3 deletions testcases/LoginCorrectCredentialsTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

import unittest
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

class LoginCorrect(unittest.TestCase):

class LoginCorrect(unittest.TestCase):

def setUp(self):
self.driver = webdriver.Firefox()
self.driver = webdriver.Remote(command_executor='http://10.129.132.104:4444/wd/hub', desired_capabilities=DesiredCapabilities.FIREFOX)
#self.driver = webdriver.Firefox()


def test_LoginCorrect(self):
user ="testuser"
pwd= "collaborative"
driver = webdriver.Firefox()
driver = webdriver.Remote(command_executor='http://10.129.132.104:4444/wd/hub', desired_capabilities=DesiredCapabilities.FIREFOX)

#driver = webdriver.Firefox()
driver.get("http://10.129.26.119//login")
elem = driver.find_element_by_id("id_username")
elem.send_keys(user)
Expand Down