Skip to content
Snippets Groups Projects
Commit 0d3f66b3 authored by Jonathan Shahen's avatar Jonathan Shahen
Browse files

Test cases are now fixed.

NOTE: you must add the NEW USER! (see the DIFF on the Users.sql)
parent 82c846dd
No related branches found
No related tags found
No related merge requests found
Showing
with 161 additions and 77 deletions
...@@ -25,6 +25,7 @@ CREATE TABLE public."Users" ( ...@@ -25,6 +25,7 @@ CREATE TABLE public."Users" (
INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (0, 'Debug User', 'debug@thebookworm.com', '$2b$10$AMucDjhYc1I.TWtHUCudb.mcwh5AIkrUQfFyD/wKJ1JqPq6.J6RO.', '2019-02-21 18:27:36.3877', '{}', 'DEBUG', 0); INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (0, 'Debug User', 'debug@thebookworm.com', '$2b$10$AMucDjhYc1I.TWtHUCudb.mcwh5AIkrUQfFyD/wKJ1JqPq6.J6RO.', '2019-02-21 18:27:36.3877', '{}', 'DEBUG', 0);
INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (1, 'Jon Shahen', 'jonathan.shahen@gmail.com', '$2b$10$AMucDjhYc1I.TWtHUCudb.mcwh5AIkrUQfFyD/wKJ1JqPq6.J6RO.', '2019-02-21 18:27:36.3877', '{}', 'Website Signin Page', 1); INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (1, 'Jon Shahen', 'jonathan.shahen@gmail.com', '$2b$10$AMucDjhYc1I.TWtHUCudb.mcwh5AIkrUQfFyD/wKJ1JqPq6.J6RO.', '2019-02-21 18:27:36.3877', '{}', 'Website Signin Page', 1);
INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (3, 'automation_test@gmail.com', 'automation_test@gmail.com', '$2b$10$AMucDjhYc1I.TWtHUCudb.mcwh5AIkrUQfFyD/wKJ1JqPq6.J6RO.', '2019-02-21 18:27:36.3877', '{}', 'Website Signin Page', 1);
INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (2292, 'Whittie Pie', 'AHTRMUOZ3MW5PZMK7BJIYHOPIKNQ@gmail.com', ' ', '2019-03-10 11:39:45.25783', '{}', 'Amazon', 0); INSERT INTO public."Users" (user_id, display_name, email, password_hash, creation_time, preferences_json, created_from, login_allowed) VALUES (2292, 'Whittie Pie', 'AHTRMUOZ3MW5PZMK7BJIYHOPIKNQ@gmail.com', ' ', '2019-03-10 11:39:45.25783', '{}', 'Amazon', 0);
......
...@@ -121,6 +121,8 @@ ALTER TABLE ONLY public."Users" ...@@ -121,6 +121,8 @@ ALTER TABLE ONLY public."Users"
GRANT ALL ON TABLE public."Users" TO ece651_ml; GRANT ALL ON TABLE public."Users" TO ece651_ml;
GRANT ALL ON TABLE public."Users" TO ece651_web; GRANT ALL ON TABLE public."Users" TO ece651_web;
GRANT ALL ON TABLE public."Users" TO ece651_scraper; GRANT ALL ON TABLE public."Users" TO ece651_scraper;
GRANT ALL ON SEQUENCE public."Users_user_id_sequence" TO ece651_web;
GRANT ALL ON SEQUENCE public."Users_user_id_sequence" TO ece651_ml;
--- Reviews --- Reviews
ALTER TABLE ONLY public."Reviews" ALTER TABLE ONLY public."Reviews"
......
...@@ -43,7 +43,7 @@ def grab_url_request(url, headers=DEFAULT_HEADERS, params=None, return_soup=Fals ...@@ -43,7 +43,7 @@ def grab_url_request(url, headers=DEFAULT_HEADERS, params=None, return_soup=Fals
if not driver: if not driver:
chrome_options = Options() chrome_options = Options()
chrome_options.add_argument("--log-level=3") chrome_options.add_argument("--log-level=3")
chrome_options.add_argument("headless") # remove this line if you want to see the browser popup # chrome_options.add_argument("headless") # remove this line if you want to see the browser popup
driver = webdriver.Chrome(options=chrome_options) driver = webdriver.Chrome(options=chrome_options)
driver.get(url) driver.get(url)
...@@ -89,7 +89,7 @@ def search_amazon_for_book(thread_id, book_title, book_author): ...@@ -89,7 +89,7 @@ def search_amazon_for_book(thread_id, book_title, book_author):
all_links = soup.select('a') all_links = soup.select('a')
count_links = 0 count_links = 0
print(f'Number of links found via soup: {len(all_links)}') # print(f'Number of links found via soup: {len(all_links)}')
for a in all_links: for a in all_links:
if not a.has_attr('href'): if not a.has_attr('href'):
continue continue
......
...@@ -13,9 +13,10 @@ class TestAmazonRequests(unittest.TestCase): ...@@ -13,9 +13,10 @@ class TestAmazonRequests(unittest.TestCase):
raise Exception("Must be using Python 3") raise Exception("Must be using Python 3")
self.pp = pprint.PrettyPrinter(indent=4) self.pp = pprint.PrettyPrinter(indent=4)
def tearDown(self): @classmethod
def tearDownClass(cls):
# print('Calling TearDown')
getInfo.close() getInfo.close()
return super().tearDown()
def test_simple_search(self): def test_simple_search(self):
r = getInfo.grab_url_request(getInfo.AMAZON_SEARCH_URL, return_soup=False) r = getInfo.grab_url_request(getInfo.AMAZON_SEARCH_URL, return_soup=False)
...@@ -41,7 +42,7 @@ class TestAmazonRequests(unittest.TestCase): ...@@ -41,7 +42,7 @@ class TestAmazonRequests(unittest.TestCase):
def test_search_Macbeth(self): def test_search_Macbeth(self):
book_url = getInfo.search_amazon_for_book(1,'Macbeth','William Shakespeare') book_url = getInfo.search_amazon_for_book(1,'Macbeth','William Shakespeare')
getInfo.close() # getInfo.close()
self.assertIsNotNone(book_url) self.assertIsNotNone(book_url)
# self.pp.pprint(book_url) # self.pp.pprint(book_url)
......
...@@ -27,5 +27,6 @@ if __name__ == "__main__": ...@@ -27,5 +27,6 @@ if __name__ == "__main__":
abspath = os.path.abspath(__file__) abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath) dname = os.path.dirname(abspath)
os.chdir(dname) os.chdir(dname)
os.chdir('..')
run_all() run_all()
\ No newline at end of file
...@@ -59,5 +59,6 @@ if __name__ == "__main__": ...@@ -59,5 +59,6 @@ if __name__ == "__main__":
abspath = os.path.abspath(__file__) abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath) dname = os.path.dirname(abspath)
os.chdir(dname) os.chdir(dname)
os.chdir('..')
run_all() run_all()
\ No newline at end of file
...@@ -21,7 +21,7 @@ def run_all(): ...@@ -21,7 +21,7 @@ def run_all():
print('\n') print('\n')
print('*'*50) print('*'*50)
print('* UNIT TESTS') print('* SYSTEM TESTS')
print('*'*50) print('*'*50)
run_all_system_tests.run_all() run_all_system_tests.run_all()
......
...@@ -91,6 +91,7 @@ router.post('/signup', async function(req, res, next) { ...@@ -91,6 +91,7 @@ router.post('/signup', async function(req, res, next) {
error = 'Unable to add user to table'; error = 'Unable to add user to table';
} }
} catch (e) { } catch (e) {
console.warn(e);
error = 'Duplicate Email found in table, did you forget your password?'; error = 'Duplicate Email found in table, did you forget your password?';
} }
} else { } else {
......
import os
from configparser import ConfigParser
def config(filename='database.ini', test_filename='database_test.ini', section='postgresql'):
# create a parser
parser = ConfigParser()
# read config file
cwd = os.getcwd()
os.chdir(os.path.dirname(__file__))
if 'TESTENV' in os.environ:
parser.read(test_filename)
else:
parser.read(filename)
os.chdir(cwd)
# get section, default to postgresql
db = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
db[param[0]] = param[1]
else:
raise Exception('Section {0} not found in the {1} file'.format(section, filename))
return db
\ No newline at end of file
[postgresql]
host=localhost
database=ece651
user=ece651_scraper
password=wxJcTdJYUU3mMAsAa5YD
\ No newline at end of file
[postgresql]
host=localhost
database=ece651
user=ece651_scraper
password=wxJcTdJYUU3mMAsAa5YD
\ No newline at end of file
...@@ -101,12 +101,10 @@ class AuthorDetailsTest(unittest.TestCase): ...@@ -101,12 +101,10 @@ class AuthorDetailsTest(unittest.TestCase):
self.driver = webdriver.Chrome() self.driver = webdriver.Chrome()
def test_authordetails(self): def test_authordetails(self):
self.driver.get("http://127.0.0.1:3000/author/1509/Aaron%20Dembski-Bowden") self.driver.get("http://127.0.0.1:3000/author/1509/Aaron%20Dembski-Bowden")
# Case 1 : Verify Routing using matching Title of Author # Case 1 : Verify Routing using matching Title of Author
elem= self.driver.find_element_by_class_name('no-bottom-pm') elem= self.driver.find_element_by_class_name('no-bottom-pm')
name='Aaron Dembski-Bowden' name='Aaron Dembski-Bowden'
...@@ -131,7 +129,9 @@ class AuthorDetailsTest(unittest.TestCase): ...@@ -131,7 +129,9 @@ class AuthorDetailsTest(unittest.TestCase):
bookDeals(self) bookDeals(self)
tearDown(self) def tearDown(self):
if self.driver:
self.driver.quit()
......
...@@ -7,40 +7,60 @@ from selenium.webdriver.common.action_chains import ActionChains ...@@ -7,40 +7,60 @@ from selenium.webdriver.common.action_chains import ActionChains
import unittest import unittest
import psycopg2
from psycopg2.pool import ThreadedConnectionPool
from config import config
driver = None
remove_reviews_sql = 'DELETE FROM "Reviews" where user_id = %s'
def remove_user_reviews(user_id):
try:
params = config()
tcp = ThreadedConnectionPool(1, 10, **params)
conn = tcp.getconn()
cur = conn.cursor()
cur.execute(remove_reviews_sql, (user_id,))
conn.commit()
except Exception as err:
pass
def review(self): def review(self):
elem = self.driver.find_element_by_xpath("//a[contains (@href,'/account/signin')]") global driver
elem = driver.find_element_by_xpath("//a[contains (@href,'/account/signin')]")
elem.click() elem.click()
remove_user_reviews(3)
try: try:
elem = self.driver.find_element_by_id("email") elem = driver.find_element_by_id("email")
elem.send_keys("automation_test@gmail.com") elem.send_keys("automation_test@gmail.com")
elem = self.driver.find_element_by_id("password") elem = driver.find_element_by_id("password")
elem.send_keys("bookworm123") elem.send_keys("password")
login = self.driver.find_element_by_id("login") login = driver.find_element_by_id("login")
login.click() login.click()
except: except:
self.fail('Test Failed: Login to review failed') self.fail('Test Failed: Login to review failed')
try: try:
self.driver.get("http://127.0.0.1:3000/book/372/The%20Horus%20Heresy:%20Master%20of%20Mankind") driver.get("http://127.0.0.1:3000/book/372/The%20Horus%20Heresy:%20Master%20of%20Mankind")
elem = self.driver.find_element_by_xpath("//select[@name='rating']/option[text()='3']") elem = driver.find_element_by_xpath("//select[@name='rating']/option[text()='3']")
elem.click() elem.click()
elem1 = self.driver.find_element_by_class_name('review-comment') elem1 = driver.find_element_by_class_name('review-comment')
elem1.clear() elem1.clear()
elem1.send_keys('This is a test review by automation user') elem1.send_keys('This is a test review by automation user')
elem2 = self.driver.find_element_by_class_name('review-btn') elem2 = driver.find_element_by_class_name('review-btn')
elem2.click() elem2.click()
# review verification # review verification
elem = self.driver.find_element_by_class_name('user-review-text') elem = driver.find_element_by_class_name('user-review-text')
if 'This is a test review by automation user' in elem.text: if 'This is a test review by automation user' in elem.text:
pass pass
else: else:
...@@ -51,23 +71,27 @@ def review(self): ...@@ -51,23 +71,27 @@ def review(self):
self.fail('Test Failed: Review Add failed') self.fail('Test Failed: Review Add failed')
def tearDown(self):
self.driver.quit()
class BookDetailsTest(unittest.TestCase): class BookDetailsTest(unittest.TestCase):
def setUp(self): def setUp(self):
#self.driver = webdriver.Chrome('/home/nasheen/Documents/ECE651/chromedriver') global driver
self.driver = webdriver.Chrome() #driver = webdriver.Chrome('/home/nasheen/Documents/ECE651/chromedriver')
if not driver:
driver = webdriver.Chrome()
def test_bookdetails(self): @classmethod
def tearDownClass(cls):
# print('Calling TearDown')
if driver:
driver.quit()
self.driver.get("http://127.0.0.1:3000/book/372/The%20Horus%20Heresy:%20Master%20of%20Mankind") def test_bookdetails(self):
global driver
driver.get("http://127.0.0.1:3000/book/372/The%20Horus%20Heresy:%20Master%20of%20Mankind")
# Case 1 : Verify Routing using matching ISBN of Book # Case 1 : Verify Routing using matching ISBN of Book
elem = driver.find_element_by_class_name('product-detail')
elem = self.driver.find_element_by_class_name('product-detail')
x = '978-1784967116' x = '978-1784967116'
if x in elem.text: if x in elem.text:
pass pass
...@@ -75,26 +99,23 @@ class BookDetailsTest(unittest.TestCase): ...@@ -75,26 +99,23 @@ class BookDetailsTest(unittest.TestCase):
self.fail('Test Failed: Book detail mismatch') self.fail('Test Failed: Book detail mismatch')
# Case 2 : Verify author information is loaded and correct # Case 2 : Verify author information is loaded and correct
elem = driver.find_element_by_xpath("//*[contains (@href,'/author/1509/Aaron Dembski-Bowden')]")
elem = self.driver.find_element_by_xpath("//*[contains (@href,'/author/1509/Aaron Dembski-Bowden')]")
if 'Aaron Dembski-Bowden' in elem.text: if 'Aaron Dembski-Bowden' in elem.text:
pass pass
else: else:
self.fail('Test Failed: Author mismatch') self.fail('Test Failed: Author mismatch')
# Case 3: Synopsis loaded and correct # Case 3: Synopsis loaded and correct
synopsis='While Horus’ rebellion burns across the galaxy, a very different kind of war rages beneath the Imperial Palace.' synopsis='While Horus’ rebellion burns across the galaxy, a very different kind of war rages beneath the Imperial Palace.'
elem=self.driver.find_element_by_xpath("//p[contains (@class,'font-normal')]") elem=driver.find_element_by_xpath("//p[contains (@class,'font-normal')]")
if synopsis in elem.text: if synopsis in elem.text:
pass pass
else: else:
self.fail('Test Failed: Synopsis mismatch') self.fail('Test Failed: Synopsis mismatch')
# Case 4: Review block verification # Case 4: Review block verification
review_text='Customer Reviews' review_text='Customer Reviews'
elem = self.driver.find_element_by_xpath("//h4[contains (@class,'no-bottom-pm')]") elem = driver.find_element_by_xpath("//h4[contains (@class,'no-bottom-pm')]")
if review_text in elem.text: if review_text in elem.text:
pass pass
else: else:
...@@ -102,18 +123,15 @@ class BookDetailsTest(unittest.TestCase): ...@@ -102,18 +123,15 @@ class BookDetailsTest(unittest.TestCase):
# Case 5 : Thumbnail verification # Case 5 : Thumbnail verification
#cover_image = '/images/book_covers/372.jpeg' #cover_image = '/images/book_covers/372.jpeg'
elem = self.driver.find_element_by_xpath("//img[contains(@src,'372.jpeg')]") elem = driver.find_element_by_xpath("//img[contains(@src,'372.jpeg')]")
if elem.size != 0: if elem.size != 0:
pass pass
else: else:
self.fail('Test Failed: Cover not found') self.fail('Test Failed: Cover not found')
# Case 6: sign in and review # Case 6: sign in and review
elem = driver.find_element_by_class_name('submit-review')
elem = self.driver.find_element_by_class_name('submit-review')
sign_in_review='Please login to write a review for this book' sign_in_review='Please login to write a review for this book'
if sign_in_review in elem.text: if sign_in_review in elem.text:
...@@ -124,12 +142,8 @@ class BookDetailsTest(unittest.TestCase): ...@@ -124,12 +142,8 @@ class BookDetailsTest(unittest.TestCase):
review(self) review(self)
tearDown(self)
if __name__ == '__main__':
unittest.main()
...@@ -8,6 +8,21 @@ from selenium.webdriver.common.action_chains import ActionChains ...@@ -8,6 +8,21 @@ from selenium.webdriver.common.action_chains import ActionChains
import unittest import unittest
import psycopg2
from psycopg2.pool import ThreadedConnectionPool
from config import config
remove_user_by_email_sql = 'DELETE FROM "Users" where email = %s'
def remove_user(email):
try:
params = config()
tcp = ThreadedConnectionPool(1, 10, **params)
conn = tcp.getconn()
cur = conn.cursor()
cur.execute(remove_user_by_email_sql, (email,))
conn.commit()
except Exception as err:
pass
def signup(self): def signup(self):
elem = self.driver.find_element_by_id("signup") elem = self.driver.find_element_by_id("signup")
...@@ -173,28 +188,28 @@ class RegressionTestAuthenticationSystem(unittest.TestCase): ...@@ -173,28 +188,28 @@ class RegressionTestAuthenticationSystem(unittest.TestCase):
elem = self.driver.find_element_by_xpath("//*[contains(text(), 'Sign up')]") elem = self.driver.find_element_by_xpath("//*[contains(text(), 'Sign up')]")
elem.click() elem.click()
######## NOT ALL BROWSERS SUPPORT THIS
#case 1 : signing up without any input #case 1 : signing up without any input
signup(self) # signup(self)
fieldvalidation(self) # fieldvalidation(self)
#case 2: signing up with only name # #case 2: signing up with only name
# elem=self.driver.find_element_by_id("fullname")
elem=self.driver.find_element_by_id("fullname") # elem.send_keys("Test User")
elem.send_keys("Test User") # signup(self)
signup(self) # fieldvalidation(self)
fieldvalidation(self)
# # case 3: signing up with only name and email
# case 3: signing up with only name and email # elem = self.driver.find_element_by_id("email")
elem = self.driver.find_element_by_id("email") # elem.send_keys("tuser@gmail.com")
elem.send_keys("tuser@gmail.com") # signup(self)
signup(self) # fieldvalidation(self)
fieldvalidation(self)
# # case 3: signing up with only name and email and password
# case 3: signing up with only name and email and password # elem = self.driver.find_element_by_id("password")
elem = self.driver.find_element_by_id("password") # elem.send_keys("abcd123")
elem.send_keys("abcd123") # signup(self)
signup(self) # fieldvalidation(self)
fieldvalidation(self)
# case 4: signing up with password mismatch # case 4: signing up with password mismatch
elem = self.driver.find_element_by_id("confirmation_password") elem = self.driver.find_element_by_id("confirmation_password")
...@@ -208,7 +223,7 @@ class RegressionTestAuthenticationSystem(unittest.TestCase): ...@@ -208,7 +223,7 @@ class RegressionTestAuthenticationSystem(unittest.TestCase):
elem.send_keys("Test User06") elem.send_keys("Test User06")
elem = self.driver.find_element_by_id("email") elem = self.driver.find_element_by_id("email")
elem.send_keys("testuser6@gmail.com") elem.send_keys("jonathan.shahen@gmail.com")
elem = self.driver.find_element_by_id("password") elem = self.driver.find_element_by_id("password")
elem.send_keys("usertest04") elem.send_keys("usertest04")
...@@ -220,11 +235,13 @@ class RegressionTestAuthenticationSystem(unittest.TestCase): ...@@ -220,11 +235,13 @@ class RegressionTestAuthenticationSystem(unittest.TestCase):
# case 6: regression user sign up # case 6: regression user sign up
remove_user("regression_DELETE_ME@mail.com")
elem = self.driver.find_element_by_id("fullname") elem = self.driver.find_element_by_id("fullname")
elem.send_keys("Regression Test") elem.send_keys("Regression Test")
elem = self.driver.find_element_by_id("email") elem = self.driver.find_element_by_id("email")
elem.send_keys("regression@mail.com") elem.send_keys("regression_DELETE_ME@mail.com")
elem = self.driver.find_element_by_id("password") elem = self.driver.find_element_by_id("password")
elem.send_keys("password") elem.send_keys("password")
...@@ -291,6 +308,12 @@ class RegressionTestAuthenticationSystem(unittest.TestCase): ...@@ -291,6 +308,12 @@ class RegressionTestAuthenticationSystem(unittest.TestCase):
signin_button(self) signin_button(self)
signin_validation(self) signin_validation(self)
def tearDown(self):
if self.driver:
self.driver.quit()
if __name__ == '__main__':
unittest.main()
...@@ -55,9 +55,9 @@ class Searchtest(unittest.TestCase): ...@@ -55,9 +55,9 @@ class Searchtest(unittest.TestCase):
def setUp(self): def setUp(self):
#self.driver = webdriver.Chrome('/home/nasheen/Documents/ECE651/chromedriver') #self.driver = webdriver.Chrome('/home/nasheen/Documents/ECE651/chromedriver')
self.driver = webdriver.Chrome() self.driver = webdriver.Chrome()
self.driver.get("http://127.0.0.1:3000/")
def test_search(self): def test_search(self):
self.driver.get("http://127.0.0.1:3000/")
search_box = self.driver.find_element_by_class_name("input-field") search_box = self.driver.find_element_by_class_name("input-field")
# case 1: test with positive case: should find result # case 1: test with positive case: should find result
...@@ -79,7 +79,9 @@ class Searchtest(unittest.TestCase): ...@@ -79,7 +79,9 @@ class Searchtest(unittest.TestCase):
searchResultCount(self) searchResultCount(self)
nullResultVerification(self) nullResultVerification(self)
#tearDown(self) def tearDown(self):
if self.driver:
self.driver.quit()
......
...@@ -24,7 +24,7 @@ class TestSignInUpSystem(unittest.TestCase): ...@@ -24,7 +24,7 @@ class TestSignInUpSystem(unittest.TestCase):
elem.send_keys("automation_test23@gmail.com") elem.send_keys("automation_test23@gmail.com")
elem = self.driver.find_element_by_id("password") elem = self.driver.find_element_by_id("password")
elem.send_keys("bookworm123") elem.send_keys("password")
login = self.driver.find_element_by_id("login") login = self.driver.find_element_by_id("login")
login.click() login.click()
...@@ -34,7 +34,7 @@ class TestSignInUpSystem(unittest.TestCase): ...@@ -34,7 +34,7 @@ class TestSignInUpSystem(unittest.TestCase):
elem.send_keys("automation_test@gmail.com") elem.send_keys("automation_test@gmail.com")
elem = self.driver.find_element_by_id("password") elem = self.driver.find_element_by_id("password")
elem.send_keys("bookworm123") elem.send_keys("password")
login = self.driver.find_element_by_id("login") login = self.driver.find_element_by_id("login")
login.click() login.click()
...@@ -46,7 +46,7 @@ class TestSignInUpSystem(unittest.TestCase): ...@@ -46,7 +46,7 @@ class TestSignInUpSystem(unittest.TestCase):
pass pass
if elem: if elem:
if 'Hello Automation User' in elem.text: if 'Hello automation_test@gmail.com' in elem.text:
#self.driver.implicitly_wait(200) #self.driver.implicitly_wait(200)
# print("Test Passed : signin completed") # print("Test Passed : signin completed")
pass pass
......
...@@ -44,10 +44,10 @@ class TestSignInUpSystem(unittest.TestCase): ...@@ -44,10 +44,10 @@ class TestSignInUpSystem(unittest.TestCase):
elem.send_keys("automation_test@gmail.com") elem.send_keys("automation_test@gmail.com")
elem = self.driver.find_element_by_id("password") elem = self.driver.find_element_by_id("password")
elem.send_keys("bookworm123") elem.send_keys("password")
elem = self.driver.find_element_by_id("confirmation_password") elem = self.driver.find_element_by_id("confirmation_password")
elem.send_keys("bookworm123") elem.send_keys("password")
signup = self.driver.find_element_by_id("signup") signup = self.driver.find_element_by_id("signup")
signup.click() signup.click()
...@@ -67,10 +67,12 @@ class TestSignInUpSystem(unittest.TestCase): ...@@ -67,10 +67,12 @@ class TestSignInUpSystem(unittest.TestCase):
if elem_error: if elem_error:
if 'did you forget' in elem_error.text: if 'did you forget' in elem_error.text:
print("Test Passed: Error - User Already Exists") # print("Test Passed: Error - User Already Exists")
pass
elif elem_welcome: elif elem_welcome:
if 'Automation User' in elem_welcome.text: if 'Automation User' in elem_welcome.text:
print ("Test Passed: User created") # print ("Test Passed: User created")
pass
else: else:
self.fail('Test Failed: Wrong Username Displayed') self.fail('Test Failed: Wrong Username Displayed')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment