Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b5736fc
- Added even more test cases
mohdos Apr 11, 2020
ce043df
Done phase 3 with Documentation no Report yet
kamelMohsen Apr 11, 2020
d06c71a
Done phase 3 with Documentation no Report yet
kamelMohsen Apr 11, 2020
99e9bd9
Added Report
kamelMohsen Apr 11, 2020
8219329
update tests
eman-gamal Apr 11, 2020
b81c305
Add liked Songs and Playlist
eman-gamal Apr 11, 2020
2f73dab
Fixed some tests+ fixed Documentation
kamelMohsen Apr 11, 2020
13f5fc2
Fixed some tests+ fixed Documentation
kamelMohsen Apr 11, 2020
ad7b6dd
added reeports
kamelMohsen Apr 11, 2020
672f1ca
- Added docx Report for Front End
mohdos Apr 11, 2020
3960f26
Add artist
eman-gamal Apr 11, 2020
42ec10e
Add artist
eman-gamal Apr 11, 2020
caa1abe
Merge branch 'phase2' of https://github.com/Project-X9/Testing into p…
eman-gamal Apr 11, 2020
9a664b9
- Fixed playlist tests bugs
mohdos Apr 11, 2020
1629ffb
added documentation for the project
kamelMohsen Apr 11, 2020
b646597
Generated pdf report
kamelMohsen Apr 11, 2020
6667226
Merge branch 'phase2' of https://github.com/Project-X9/Testing into p…
kamelMohsen Apr 11, 2020
7933d52
- Added pdf report
mohdos Apr 11, 2020
ddab59c
added documentation for the project
kamelMohsen Apr 11, 2020
0b6810e
Generated pdf report
kamelMohsen Apr 11, 2020
85c6d94
added dependincies
kamelMohsen Apr 11, 2020
5944655
added complete documentation for the project
kamelMohsen Apr 11, 2020
3a160eb
Added documentation
kamelMohsen Apr 11, 2020
04aeb65
added missing Dependency
kamelMohsen Apr 12, 2020
66e71a1
added missing Dependency again
kamelMohsen Apr 12, 2020
55324f3
Added initial randoms
kamelMohsen Apr 12, 2020
33e76ea
Restructured the project
kamelMohsen Apr 13, 2020
f53c526
Added logo to tests
kamelMohsen Apr 13, 2020
090e007
Done
kamelMohsen Apr 13, 2020
735627b
- Made all tests on Firefox
mtm19 Apr 17, 2020
8348c7d
- Fixed a typo in helperClasses
mohdos Apr 18, 2020
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
10 changes: 10 additions & 0 deletions Web_Testing/Pages/LoggedOutHome.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class LoggedOutHome(WebHelper):
Clicks on the signup button
click_login()
Clicks on the login button
click_premium()
Clicks on the premium button
"""
def __init__(self, driver):
"""
Expand All @@ -47,6 +49,7 @@ def __init__(self, driver):
:param driver : the driver to which the super class' driver is to be set
:type driver: WebDriver
"""
super().__init__()
# tb refers to Toolbar, tb_.. refers to Toolbar elements
self.set_driver(driver)
self.tb_login_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/nav/div/div/ul/li[6]/a")
Expand All @@ -71,3 +74,10 @@ def click_signup(self):
"""
self.click_button_safe(self.tb_signup_btn)

def click_premium(self):
"""
Clicks on the premium button
"""
prem_btn = self.find_element_by_xpath("/html/body/div/div/div/div/nav/div/div/ul/li[1]/a")
self.click_button_safe(prem_btn)

7 changes: 4 additions & 3 deletions Web_Testing/Pages/LoginPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,11 @@ def invalid_user_text_appeared(self):
:rtype: bool
"""
self.incorrect_user_text = self.find_element_by_id("invalid")
if self.incorrect_user_text is None:
text_dangers = self.find_elements_by_class_name('text-danger')
try:
return ((text_dangers is not None) and (len(text_dangers) > 0)) or (self.incorrect_user_text is not None)
except:
return False
else:
return True

def check_login_page(self):
"""
Expand Down
4 changes: 3 additions & 1 deletion Web_Testing/Pages/SignupPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def __init__(self, driver):
:param driver : the driver to which the super class' driver is to be set
:type driver: WebDriver
"""
super().__init__()
self.driver = driver
self.signup_with_facebook = self.find_element_by_class_name("facebookButton metro")
self.email_txt = self.find_element_by_id("email")
Expand Down Expand Up @@ -240,7 +241,8 @@ def is_text_dangers_visible(self):
"""
try:
text_dangers = self.find_elements_by_class_name('text-danger')
return len(text_dangers) > 0
text_invalid = self.find_element_by_id("invalid")
return ((text_dangers is not None) and (len(text_dangers) > 0)) or (text_invalid is not None)
except:
return False

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

This script requires `allure` and `pytest` be installed within the Python environment you are running this script in
"""

import time

import allure
import pytest
Expand All @@ -24,6 +24,7 @@
class TestLoggedOutHome:

driver = WebHelper().firefox_driver_init()

@pytest.yield_fixture
def setup(self):
self.driver.get(WebHelper().get_home_url())
Expand All @@ -37,18 +38,17 @@ def setup_final(self):
yield
self.driver.close()

# Test #1 -> Different Confirmation email
# Test #1 -> Signup button
@allure.severity(allure.severity_level.BLOCKER)
@allure.story("Clicking Signup")
@allure.title("Testing Sign up Button")
@allure.description("Testing Sign up button")
@pytest.mark.Do
@pytest.mark.LoggedOutHome
def test_case_1(self, setup):
# logged_out_home = LoggedOutHome(self.driver)
# logged_out_home.tb_signup_btn.click()
self.driver.find_element_by_link_text("Sign up").click()
self.driver.implicitly_wait(3)
logged_out_home = LoggedOutHome(self.driver)
logged_out_home.click_signup()
time.sleep(2)
sp = SignupPage(self.driver)
if sp.check_signup_page():
WebHelper().report_allure("Signup button working", self.driver)
Expand All @@ -65,7 +65,9 @@ def test_case_1(self, setup):
@pytest.mark.Do
@pytest.mark.LoggedOutHome
def test_case_2(self, setup):
self.driver.find_element_by_link_text("Log In").click()
logged_out_home = LoggedOutHome(self.driver)
logged_out_home.click_login()
time.sleep(2)
sp = LoginPage(self.driver)
if sp.check_login_page():
WebHelper().report_allure("Login button working", self.driver)
Expand All @@ -82,9 +84,9 @@ def test_case_2(self, setup):
@pytest.mark.Do
@pytest.mark.LoggedOutHome
def test_case_3(self, setup_final):
self.driver.find_element_by_link_text("Premium").click()
self.driver.implicitly_wait(3)

logged_out_home = LoggedOutHome(self.driver)
logged_out_home.click_premium()
time.sleep(2)
if str(self.driver.current_url).find('premium') != -1:
WebHelper().report_allure("Premium button working", self.driver)
assert True
Expand Down
8 changes: 5 additions & 3 deletions Web_Testing/Tests/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

@allure.parent_suite("End to End testing")
@allure.suite("Login Tests")
@allure.feature("Log in Tests")
@allure.feature("Login Tests")
@allure.severity(allure.severity_level.BLOCKER)
class TestLogin:

Expand Down Expand Up @@ -245,8 +245,10 @@ def test_case_10(self, setup_final):
self.driver.refresh()
lp = LoginPage(self.driver)

if (lp.email_txt is None) or (lp.pass_txt is None) or (lp.login_btn is None):
WebHelper().report_allure("ERROR: Elements are not available after refresh", self.driver)
if (lp.email_txt is None) or (lp.pass_txt is None) or (lp.login_btn is None) or (lp.invalid_user_text_appeared()):
WebHelper().report_allure(
"ERROR: Elements are not available after refresh OR Invalid text warnings appeared after refresh"
, self.driver)
assert False
else:
WebHelper().report_allure("SUCCESS: Elements are available after refresh", self.driver)
Expand Down
8 changes: 5 additions & 3 deletions Web_Testing/Tests/test_signup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_case_3(self, setup):
@allure.story("Succes Signup")
@allure.sub_suite("Sign up with correct credentials and values")
@allure.title("Sign up with correct credentials and values")
@allure.description("Signing up with the following credentials and values -> Email: test1@test.com, Pass: test123")
@allure.description("Signing up with the following credentials and values -> Email: test54@test.com, Pass: test545556")
@pytest.mark.Do
@pytest.mark.Signup
def test_case_4(self, setup):
Expand Down Expand Up @@ -289,8 +289,10 @@ def test_case_11(self, setup):
if (sp.email_txt is None) or (sp.password_txt is None) or (sp.confirm_email_txt is None) \
or (sp.display_name_txt is None) or (sp.dob_day_txt is None) or (sp.dob_month_txt is None)\
or (sp.dob_year_txt is None) or (sp.gender_male is None) or (sp.gender_female is None)\
or (sp.signup is None):
WebHelper().report_allure("ERROR: Elements are not available after refresh", self.driver)
or (sp.signup is None) or (sp.is_text_dangers_visible()):
WebHelper().report_allure(
"ERROR: Some elements are not available after refresh OR Invalid text warnings appeared after refresh"
, self.driver)
assert False
else:
WebHelper().report_allure("SUCCESS: Elements are available after refresh", self.driver)
Expand Down