diff --git a/.gitignore b/.gitignore index e101fd3..7bf0d25 100644 --- a/.gitignore +++ b/.gitignore @@ -130,6 +130,9 @@ debug.log main_file_dummy.py dummy_python_funds.py +.log +logs/ +logs/*.log Reports/*.json Reports/*.png Reports/*.txt diff --git a/Mobile_Testing/Pages/authentication.py b/Mobile_Testing/Pages/authentication.py index cd99435..1cea335 100644 --- a/Mobile_Testing/Pages/authentication.py +++ b/Mobile_Testing/Pages/authentication.py @@ -2,9 +2,6 @@ class AuthenticationPage: - signup_button_id = "com.example.projectx:id/signUp_bt" - login_with_facebook_button_id = "com.example.projectx:id/login_button" - signin_button_id = "com.example.projectx:id/signIn_bt" """ A class used to represent the Authentication Page ... @@ -25,10 +22,14 @@ class AuthenticationPage: click_login_with_facebook_button() Clicks the login with facebook button click_signin_button() - Clicks the sign in button - + Clicks the sign in button + """ + signup_button_id = "com.example.projectx:id/signUp_bt" + login_with_facebook_button_id = "com.example.projectx:id/login_button" + signin_button_id = "com.example.projectx:id/signIn_bt" + def __init__(self, driver): """ Initializes the page elements @@ -41,16 +42,22 @@ def click_signup_button(self): """ Clicks sign up button """ - Helper.find_element_by_id(self.driver, self.signup_button_id).click() + element = Helper.find_element_by_id(self.driver, self.signup_button_id) + if element is not None: + element.click() def click_login_with_facebook_button(self): """ Clicks login with facebook button """ - Helper.find_element_by_id(self.driver, self.login_with_facebook_button_id).click() + element = Helper.find_element_by_id(self.driver, self.login_with_facebook_button_id) + if element is not None: + element.click() def click_signin_button(self): """ Clicks sign in button """ - Helper.find_element_by_id(self.driver, self.signin_button_id).click() \ No newline at end of file + element = Helper.find_element_by_id(self.driver, self.signin_button_id) + if element is not None: + element.click() diff --git a/Mobile_Testing/Pages/home.py b/Mobile_Testing/Pages/home.py index d7a3917..7fb1b01 100644 --- a/Mobile_Testing/Pages/home.py +++ b/Mobile_Testing/Pages/home.py @@ -2,36 +2,89 @@ class HomePage: + """ + A class used to represent the Home Page + ... + Attributes + ---------- + logout_button_id : string + A string containing the id of logout button - logout_button_id = "com.example.projectx:id/logOut" - playlist_button_id = "com.example.projectx:id/openPlaylist" - play_music_button_id = "com.example.projectx:id/playMusic" + new_releases_button_id : string + A string containing the id of new releases button - """ - A class used to represent the Home Page - ... - Attributes - ---------- - logout_button_id : string - A string containing the id of logout button - - playlist_button_id : string - A string containing the id of playlist button - - play_music_button_id : string - A string containing the id of playlist button - - Methods - ------- - click_logout_button(self) - Clicks on the logout button + liked_tracks_button_id : string + A string containing the id of liked tracks button + + popular_tracks_button_id : string + A string containing the id of popular tracks button + + recommended_tracks_id : string + A string containing the id of recommended tracks button + + about_button_id : string + A string containing the id of about button + + home_button_id : string + A string containing the id of home button + + search_button_id : string + A string containing the id of search button + + library_button_id : string + A string containing the id of library button + + premium_button_id : string + A string containing the id of premium button + + + Methods + ------- + + click_logout_button() + Clicks on the logout button + + click_new_releases_button() + Clicks on the new releases button + + click_liked_tracks_button() + Clicks on the liked tracks button + + click_popular_tracks_button() + Clicks on the popular tracks button + + click_recommended_tracks() + Clicks on the recommended tracks + + click_about_button() + Clicks on the about button + + click_home_button() + Clicks on the home button + + click_search_button() + Clicks on the search button + + click_library_button() + Clicks on the library button + + + click_premium_button() + Clicks on the premium button + + """ + logout_button_id = "com.example.projectx:id/logOut" + new_releases_button_id = "com.example.projectx:id/newReleases" + liked_tracks_button_id = "com.example.projectx:id/likedTracks" + popular_tracks_button_id = "com.example.projectx:id/popular" + recommended_tracks_id = "com.example.projectx:id/recommended" + about_button_id = "com.example.projectx:id/about" + home_button_id = "com.example.projectx:id/navigation_home" + search_button_id = "com.example.projectx:id/navigation_dashboard" + library_button_id = "com.example.projectx:id/navigation_notifications" + premium_button_id = "com.example.projectx:id/premium" - click_playlist_button() - Clicks on the logout button - click_play_music_button() - Clicks on the play music button - """ def __init__(self, driver): """ Initializes the page elements @@ -44,16 +97,78 @@ def click_logout_button(self): """ Clicks on the logout button """ - Helper.find_element_by_id(self.driver, self.logout_button_id).click() + element = Helper.find_element_by_id(self.driver, self.logout_button_id) + if element is not None: + element.click() + + def click_new_releases_button(self): + """ + Clicks on the new releases button + """ + element = Helper.find_element_by_id(self.driver, self.new_releases_button_id) + if element is not None: + element.click() + + def click_liked_tracks_button(self): + """ + Clicks on the liked tracks button + """ + element = Helper.find_element_by_id(self.driver, self.liked_tracks_button_id) + if element is not None: + element.click() + + def click_popular_tracks_button(self): + """ + Clicks on the popular tracks button + """ + element = Helper.find_element_by_id(self.driver, self.popular_tracks_button_id) + if element is not None: + element.click() + + def click_recommended_tracks(self): + """ + Clicks on the recommended tracks + """ + element = Helper.find_element_by_id(self.driver, self.recommended_tracks_id) + if element is not None: + element.click() + + def click_about_button(self): + """ + Clicks on the about button + """ + element = Helper.find_element_by_id(self.driver, self.about_button_id) + if element is not None: + element.click() + + def click_home_button(self): + """ + Clicks on the home button + """ + element = Helper.find_element_by_id(self.driver, self.home_button_id) + if element is not None: + element.click() + + def click_search_button(self): + """ + Clicks on the search button + """ + element = Helper.find_element_by_id(self.driver, self.search_button_id) + if element is not None: + element.click() - def click_playlist_button(self): + def click_library_button(self): """ - Clicks on the playlist button + Clicks on the library button """ - Helper.find_element_by_id(self.driver, self.playlist_button_id).click() + element = Helper.find_element_by_id(self.driver, self.library_button_id) + if element is not None: + element.click() - def click_play_music_button(self): + def click_premium_button(self): """ - Clicks on the play music button + Clicks on the premium button """ - Helper.find_element_by_id(self.driver, self.play_music_button_id).click() + element = Helper.find_element_by_id(self.driver, self.premium_button_id) + if element is not None: + element.click() diff --git a/Mobile_Testing/Pages/login.py b/Mobile_Testing/Pages/login.py index f9f7b8c..2f7ddb2 100644 --- a/Mobile_Testing/Pages/login.py +++ b/Mobile_Testing/Pages/login.py @@ -2,10 +2,6 @@ class LoginPage: - email_text_field_id = "com.example.projectx:id/email_et" - password_text_field_id = "com.example.projectx:id/password_et" - login_button_id = "com.example.projectx:id/login_bt" - """ A class used to represent the Login Page ... @@ -23,14 +19,17 @@ class LoginPage: ------- fill_email() Fills the email field with the gievn string - + fill_password() fills the password field with the give string click_login() clicks the login password do_the_login() - given an email and password this function makes a sign in + given an email and password this function makes a sign in """ + email_text_field_id = "com.example.projectx:id/email_et" + password_text_field_id = "com.example.projectx:id/password_et" + login_button_id = "com.example.projectx:id/login_bt" def __init__(self, driver): """ @@ -46,7 +45,9 @@ def fill_email(self, email): :param email : the string that is filled in the text box :type email: string """ - Helper.find_element_by_id(self.driver, self.email_text_field_id).send_keys(email) + element = Helper.find_element_by_id(self.driver, self.email_text_field_id) + if element is not None: + element.send_keys(email) def fill_password(self, password): """ @@ -54,13 +55,17 @@ def fill_password(self, password): :param password : the string that is filled in the text box :type password: string """ - Helper.find_element_by_id(self.driver, self.password_text_field_id).send_keys(password) + element = Helper.find_element_by_id(self.driver, self.password_text_field_id) + if element is not None: + element.send_keys(password) def click_login(self): """ clicks the login button """ - Helper.find_element_by_id(self.driver, self.login_button_id).click() + element = Helper.find_element_by_id(self.driver, self.login_button_id) + if element is not None: + element.click() def do_the_login(self, email, password): """ diff --git a/Mobile_Testing/Pages/play_music.py b/Mobile_Testing/Pages/player.py similarity index 95% rename from Mobile_Testing/Pages/play_music.py rename to Mobile_Testing/Pages/player.py index 36e6189..930f865 100644 --- a/Mobile_Testing/Pages/play_music.py +++ b/Mobile_Testing/Pages/player.py @@ -2,19 +2,6 @@ class PlayMusicPage: - - play_song_id = "com.example.projectx:id/playSong_ib" - previous_song_id = "com.example.projectx:id/previousSong_ib" - next_song_id = "com.example.projectx:id/nextSong_ib" - love_song_id = "com.example.projectx:id/likeButton_ib" - download_song_id = "com.example.projectx:id/downloadButton_ib" - repeat_song_id = "com.example.projectx:id/repeatButton_ib" - share_song_id = "com.example.projectx:id/shareButton_ib" - help_button_id = "com.example.projectx:id/more_ib" - minimize_player_id = "com.example.projectx:id/collapse_ib" - black_list_song_id = "com.example.projectx:id/blackListSong_ib" - - """ A class used to represent the Play Song Page ... @@ -23,11 +10,11 @@ class PlayMusicPage: play_song_id : string id of play song button previous_song_id : string - id of previous song button + id of previous song button next_song_id : string id of next song button love_song_id : string - id of love song button + id of love song button download_song_id : string id of download song button repeat_song_id : string @@ -47,6 +34,17 @@ class PlayMusicPage: None """ + play_song_id = "com.example.projectx:id/playSong_ib" + previous_song_id = "com.example.projectx:id/previousSong_ib" + next_song_id = "com.example.projectx:id/nextSong_ib" + love_song_id = "com.example.projectx:id/likeButton_ib" + download_song_id = "com.example.projectx:id/downloadButton_ib" + repeat_song_id = "com.example.projectx:id/repeatButton_ib" + share_song_id = "com.example.projectx:id/shareButton_ib" + help_button_id = "com.example.projectx:id/more_ib" + minimize_player_id = "com.example.projectx:id/collapse_ib" + black_list_song_id = "com.example.projectx:id/blackListSong_ib" + def __init__(self, driver): """ Initializes the page elements @@ -54,4 +52,3 @@ def __init__(self, driver): :type driver: WebDriver """ self.driver = driver - diff --git a/Mobile_Testing/Pages/signup.py b/Mobile_Testing/Pages/signup.py index 63e3b9b..de2eb97 100644 --- a/Mobile_Testing/Pages/signup.py +++ b/Mobile_Testing/Pages/signup.py @@ -2,21 +2,12 @@ class SignupPage: - - name_text_field_id = "com.example.projectx:id/signUpName_et" - email_text_field_id = "com.example.projectx:id/signUpEmail_et" - password_text_field_id = "com.example.projectx:id/signUpPassword_et" - age_text_field_id = "com.example.projectx:id/signUpAge_et" - male_gender_check_box_id = "com.example.projectx:id/signUpMale_rb" - female_gender_check_box_id = "com.example.projectx:id/signUpFemale_rb" - create_user_button_id = "com.example.projectx:id/createUser_bt" - """ A class used to represent the Sign up Page ... Attributes ---------- - + name_text_field_id : string id of the name text box email_text_field_id : string @@ -39,7 +30,7 @@ class SignupPage: fill_email() fills email text box fill_password() - fills password text box + fills password text box fill_age() fills age check box choose_male() @@ -52,6 +43,14 @@ class SignupPage: do_the_signup() does the whole signup process """ + name_text_field_id = "com.example.projectx:id/signUpName_et" + email_text_field_id = "com.example.projectx:id/signUpEmail_et" + password_text_field_id = "com.example.projectx:id/signUpPassword_et" + age_text_field_id = "com.example.projectx:id/signUpAge_et" + male_gender_check_box_id = "com.example.projectx:id/signUpMale_rb" + female_gender_check_box_id = "com.example.projectx:id/signUpFemale_rb" + create_user_button_id = "com.example.projectx:id/createUser_bt" + def __init__(self, driver): """ Initializes the page elements @@ -66,7 +65,9 @@ def fill_name(self, name): :param name : the string that is filled in the text box :type name: string """ - Helper.find_element_by_id(self.driver, self.name_text_field_id).send_keys(name) + element = Helper.find_element_by_id(self.driver, self.name_text_field_id) + if element is not None: + element.send_keys(name) def fill_email(self, email): """ @@ -74,7 +75,9 @@ def fill_email(self, email): :param email : the string that is filled in the text box :type email: string """ - Helper.find_element_by_id(self.driver, self.email_text_field_id).send_keys(email) + element = Helper.find_element_by_id(self.driver, self.email_text_field_id) + if element is not None: + element.send_keys(email) def fill_password(self, password): """ @@ -82,7 +85,9 @@ def fill_password(self, password): :param password : the string that is filled in the text box :type password: string """ - Helper.find_element_by_id(self.driver, self.password_text_field_id).send_keys(password) + element = Helper.find_element_by_id(self.driver, self.password_text_field_id) + if element is not None: + element.send_keys(password) def fill_age(self, age): """ @@ -90,25 +95,33 @@ def fill_age(self, age): :param age : the int that is filled in the text box :type age: int """ - Helper.find_element_by_id(self.driver, self.age_text_field_id).send_keys(age) + element = Helper.find_element_by_id(self.driver, self.age_text_field_id) + if element is not None: + element.send_keys(age) def choose_male(self): """ chooses male gender """ - Helper.find_element_by_id(self.driver, self.male_gender_check_box_id).click() + element = Helper.find_element_by_id(self.driver, self.male_gender_check_box_id) + if element is not None: + element.click() def choose_female(self): """ chooses female gender """ - Helper.find_element_by_id(self.driver, self.female_gender_check_box_id).click() + element = Helper.find_element_by_id(self.driver, self.female_gender_check_box_id) + if element is not None: + element.click() def click_create_user(self): """ clicks create user button """ - Helper.find_element_by_id(self.driver, self.create_user_button_id).click() + element = Helper.find_element_by_id(self.driver, self.create_user_button_id) + if element is not None: + element.click() def do_the_signup(self, name, email, password, age, gender): """ diff --git a/Mobile_Testing/Tests/test_authentication.py b/Mobile_Testing/Tests/test_authentication.py index 3e7b58e..ea74a54 100644 --- a/Mobile_Testing/Tests/test_authentication.py +++ b/Mobile_Testing/Tests/test_authentication.py @@ -13,6 +13,26 @@ @allure.feature("Authentication Testing") @allure.severity(allure.severity_level.BLOCKER) class TestAuthentication: + """ + A class used to represent the Authentication test + ... + Attributes + ---------- + driver: webdriver + A web driver element to control the android app + + Methods + ------- + + test_case_1() + Clicks on the Sign up button and checks that it works + test_case_2() + Clicks on the Login button and checks that it works + test_case_3() + Checks that Facebook sign in button is available + + """ + driver = None @pytest.yield_fixture @@ -42,6 +62,7 @@ def test_case_1(self, setup): ap.click_signup_button() if Helper.element_exists_by_id(self.driver, SignupPage.name_text_field_id): + Helper.report_allure(self.driver, "Sign up Page entered") assert True else: print(self.driver.current_activity) @@ -66,6 +87,7 @@ def test_case_2(self, setup): ap.click_signin_button() if Helper.element_exists_by_id(self.driver, LoginPage.email_text_field_id): + Helper.report_allure(self.driver, "Login Page entered") assert True else: print(self.driver.current_activity) @@ -88,8 +110,9 @@ def test_case_3(self, setup): """ ap = AuthenticationPage(self.driver) if Helper.element_exists_by_id(self.driver, ap.login_with_facebook_button_id): + Helper.report_allure(self.driver, "Facebook Page available") assert True else: print(self.driver.current_activity) - Helper.report_allure(self.driver, "Facebook Page not entered") + Helper.report_allure(self.driver, "Facebook Page not available") assert False diff --git a/Mobile_Testing/Tests/test_extra.py b/Mobile_Testing/Tests/test_extra.py new file mode 100644 index 0000000..63e9b52 --- /dev/null +++ b/Mobile_Testing/Tests/test_extra.py @@ -0,0 +1,94 @@ +from appium import webdriver +import pytest +from Mobile_Testing.helper import Helper, Constants +from Mobile_Testing.Pages.authentication import AuthenticationPage +from Mobile_Testing.Pages.signup import SignupPage +from Mobile_Testing.Pages.login import LoginPage +from Mobile_Testing.Pages.home import HomePage +from Mobile_Testing.Pages.player import PlayMusicPage +from allure_commons.types import AttachmentType +import allure +import time + + +@allure.parent_suite("End to End testing - Android") +@allure.suite("Extra Testing") +@allure.feature("Extra Testing") +@allure.severity(allure.severity_level.MINOR) +class TestPlayer: + """ + A class used to represent the Authentication test + ... + Attributes + ---------- + driver: webdriver + A web driver element to control the android app + + Methods + ------- + + test_case_1() + checking the artist button + """ + driver = None + + @pytest.yield_fixture + def setup(self): + """ + initiates the driver + """ + self.driver = Helper.driver_init() + yield + self.driver.quit() + + # Test #1 ->checking the artist button + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Extra Tests") + @allure.sub_suite("checking the artist button") + @allure.title("checking the artist button") + @allure.description("checking the artist button") + @pytest.mark.Do + @pytest.mark.Extra + @pytest.mark.Test1 + def test_case_1(self, setup): + """ + checking the artist button + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_search_button() + time.sleep(2) + open_artist_button = Helper.find_element_by_id(self.driver, "com.example.projectx:id/openArtist") + if open_artist_button.is_displayed() and open_artist_button.is_enabled(): + Helper.report_allure(self.driver, "Extra test1 passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Extra test1 failed") + assert False + open_artist_button.click() + + artist_image = Helper.find_element_by_id(self.driver, "com.example.projectx:id/hostImage") + if artist_image.is_displayed() and artist_image.is_enabled(): + Helper.report_allure(self.driver, "Extra test2 passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Extra test2 failed") + assert False + artist_image.click() + + artist_bio = Helper.find_element_by_id(self.driver, "com.example.projectx:id/artistBio") + if artist_bio.is_displayed() and artist_bio.is_enabled(): + Helper.report_allure(self.driver, "Extra test3 passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Extra test3 failed") + assert False + artist_bio.click() diff --git a/Mobile_Testing/Tests/test_home.py b/Mobile_Testing/Tests/test_home.py index 17b0810..2daab8b 100644 --- a/Mobile_Testing/Tests/test_home.py +++ b/Mobile_Testing/Tests/test_home.py @@ -1,20 +1,50 @@ from appium import webdriver import pytest -from Mobile_Testing.helper import Helper,Constants +from Mobile_Testing.helper import Helper, Constants from Mobile_Testing.Pages.authentication import AuthenticationPage from Mobile_Testing.Pages.signup import SignupPage from Mobile_Testing.Pages.login import LoginPage from Mobile_Testing.Pages.home import HomePage -from Mobile_Testing.Pages.play_music import PlayMusicPage +from Mobile_Testing.Pages.player import PlayMusicPage from allure_commons.types import AttachmentType import allure +import time @allure.parent_suite("End to End testing - Android") @allure.suite("Home Page Testing") @allure.feature("Home Page Testing") @allure.severity(allure.severity_level.BLOCKER) -class TestAuthentication: +class TestHome: + """ + A class used to represent the Home page test + ... + Attributes + ---------- + driver: webdriver + A web driver element to control the android app + + Methods + ------- + + test_case_1() + Clicks on the log out button and checks that it works + test_case_2() + checking the New releases works + test_case_3() + checking the Liked tracks works + test_case_4() + checking the Popular tracks works + test_case_5() + checking the Recommended tracks works + test_case_6() + checking the About works + test_case_7() + checking the Home works + test_case_8() + checking the Search works + + """ driver = None @pytest.yield_fixture @@ -26,81 +56,234 @@ def setup(self): yield self.driver.quit() - # Test #1 ->checking that play music works + # Test #1 ->checking that Logout music works + @allure.severity(allure.severity_level.BLOCKER) @allure.story("Home Page Tests") - @allure.sub_suite("Play Music clicking") - @allure.title("Play Music clicking") - @allure.description("Play Music clicking and check that it works") + @allure.sub_suite("Logout clicking") + @allure.title("Logout clicking") + @allure.description("Logout clicking and check that it works") @pytest.mark.Do @pytest.mark.HomePage @pytest.mark.Test1 def test_case_1(self, setup): """ - clicks on the play music button and checks that it works + Clicks on the log out button and checks that it works """ ap = AuthenticationPage(self.driver) ap.click_signin_button() lp = LoginPage(self.driver) lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) hp = HomePage(self.driver) - hp.click_play_music_button() - if Helper.element_exists_by_id(self.driver, PlayMusicPage.play_song_id): + hp.click_logout_button() + if Helper.element_exists_by_id(self.driver, ap.signin_button_id): + Helper.report_allure(self.driver, "Home page test passed") assert True else: print(self.driver.current_activity) Helper.report_allure(self.driver, "Home page test failed") assert False - # Test #2 ->checking that Logout music works + # Test #2 ->checking that new releases works + @allure.severity(allure.severity_level.BLOCKER) @allure.story("Home Page Tests") - @allure.sub_suite("Logout clicking") - @allure.title("Logout clicking") - @allure.description("Logout clicking and check that it works") + @allure.sub_suite("New releases clicking") + @allure.title("New releases clicking") + @allure.description("New releases clicking and check that it works") @pytest.mark.Do @pytest.mark.HomePage @pytest.mark.Test2 def test_case_2(self, setup): """ - Clicks on the log out button and checks that it works + checking the New releases works """ ap = AuthenticationPage(self.driver) ap.click_signin_button() lp = LoginPage(self.driver) lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) hp = HomePage(self.driver) - hp.click_play_music_button() - if Helper.element_exists_by_id(self.driver, HomePage.play_music_button_id()): + time.sleep(10) + hp.click_new_releases_button() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Home page test failed") assert False else: + Helper.report_allure(self.driver, "Home page test passed") assert True + # Test #3 ->checking that liked tracks works - # Test #3 ->checking that Logout music works @allure.severity(allure.severity_level.BLOCKER) @allure.story("Home Page Tests") - @allure.sub_suite("PlayList clicking") - @allure.title("PlayList clicking") - @allure.description("PlayList clicking and check that it works") + @allure.sub_suite("Liked tracks clicking") + @allure.title("Liked tracks clicking") + @allure.description("Liked tracks clicking and check that it works") @pytest.mark.Do @pytest.mark.HomePage @pytest.mark.Test3 def test_case_3(self, setup): """ - Clicks on the Playlist button and checks that it works + checking the Liked tracks works + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_liked_tracks_button() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Home page test failed") + assert False + else: + Helper.report_allure(self.driver, "Home page test passed") + assert True + + # Test #4 ->checking that popular works + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Home Page Tests") + @allure.sub_suite("Popular tracks clicking") + @allure.title("Popular tracks clicking") + @allure.description("Popular tracks clicking and check that it works") + @pytest.mark.Do + @pytest.mark.HomePage + @pytest.mark.Test4 + def test_case_4(self, setup): + """ + checking the Popular tracks works + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_popular_tracks_button() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Home page test failed") + assert False + else: + Helper.report_allure(self.driver, "Home page test passed") + assert True + + # Test #5 ->checking that recommended works + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Home Page Tests") + @allure.sub_suite("Recommended tracks clicking") + @allure.title("Recommended tracks clicking") + @allure.description("Recommended tracks clicking and check that it works") + @pytest.mark.Do + @pytest.mark.HomePage + @pytest.mark.Test5 + def test_case_5(self, setup): + """ + checking the Recommended tracks works + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Home page test failed") + assert False + else: + Helper.report_allure(self.driver, "Home page test passed") + assert True + + # Test #6 ->checking that about works + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Home Page Tests") + @allure.sub_suite("About clicking") + @allure.title("About clicking") + @allure.description("About clicking and check that it works") + @pytest.mark.Do + @pytest.mark.HomePage + @pytest.mark.Test6 + def test_case_6(self, setup): + """ + checking the About works + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_about_button() + time.sleep(2) + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Home page test failed") + assert False + else: + Helper.report_allure(self.driver, "Home page test passed") + assert True + + # Test #7 ->checking that Home works + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Home Page Tests") + @allure.sub_suite("Home clicking") + @allure.title("Home clicking") + @allure.description("Home clicking and check that it works") + @pytest.mark.Do + @pytest.mark.HomePage + @pytest.mark.Test7 + def test_case_7(self, setup): + """ + checking the Home works + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_home_button() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): + Helper.report_allure(self.driver, "Home page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Home page test failed") + assert False + + # Test #8 ->checking that search works + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Home Page Tests") + @allure.sub_suite("Search clicking") + @allure.title("Search clicking") + @allure.description("Search clicking and check that it works") + @pytest.mark.Do + @pytest.mark.HomePage + @pytest.mark.Test8 + def test_case_8(self, setup): + """ + checking the Search works """ ap = AuthenticationPage(self.driver) ap.click_signin_button() lp = LoginPage(self.driver) lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) hp = HomePage(self.driver) - hp.click_play_music_button() - if Helper.element_exists_by_id(self.driver, HomePage.play_music_button_id()): + time.sleep(10) + hp.click_search_button() + if Helper.element_exists_by_id(self.driver, HomePage.about_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Home page test failed") assert False else: - assert True \ No newline at end of file + Helper.report_allure(self.driver, "Home page test passed") + assert True diff --git a/Mobile_Testing/Tests/test_login.py b/Mobile_Testing/Tests/test_login.py index 7a877fd..35dd630 100644 --- a/Mobile_Testing/Tests/test_login.py +++ b/Mobile_Testing/Tests/test_login.py @@ -1,5 +1,5 @@ from appium import webdriver -from Mobile_Testing.helper import Helper,Constants +from Mobile_Testing.helper import Helper, Constants from Mobile_Testing.Pages.authentication import AuthenticationPage from Mobile_Testing.Pages.login import LoginPage from Mobile_Testing.Pages.home import HomePage @@ -12,9 +12,34 @@ @allure.suite("Login Testing") @allure.feature("Login Testing") @allure.severity(allure.severity_level.BLOCKER) -class TestAuthentication: - driver = None +class TestLogin: + """ + A class used to represent the Login page test + ... + Attributes + ---------- + driver: webdriver + A web driver element to control the android app + + Methods + ------- + test_case_1() + Login correctly + test_case_2() + Login with wrong email + test_case_3() + Login with wrong email format + test_case_4() + Login with no email + test_case_5() + Login with wrong password + test_case_6() + Login with no password + test_case_7() + Login with no password & email + """ + driver = None @pytest.yield_fixture def setup(self): @@ -30,7 +55,7 @@ def setup(self): @allure.story("Login Tests") @allure.sub_suite("Login correctly") @allure.title("Login correctly") - @allure.description("Logging in with correct format with "+Constants.correct_credentials["email"] + ", " + @allure.description("Logging in with correct format with " + Constants.correct_credentials["email"] + ", " + Constants.correct_credentials["password"]) @pytest.mark.Do @pytest.mark.Login @@ -44,6 +69,7 @@ def test_case_1(self, setup): lp = LoginPage(self.driver) lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): + Helper.report_allure(self.driver, "Login test passed") assert True else: print(self.driver.current_activity) @@ -72,6 +98,7 @@ def test_case_2(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True # Test #3 ->Logging in with wrong email format @@ -96,6 +123,7 @@ def test_case_3(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True # Test #4 ->Logging in with no email @@ -120,6 +148,7 @@ def test_case_4(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True # Test #5 ->Logging in with wrong password @@ -144,6 +173,7 @@ def test_case_5(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True # Test #6 ->Logging in with no password @@ -168,6 +198,7 @@ def test_case_6(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True # Test #7 ->Logging in with no password & email @@ -192,6 +223,5 @@ def test_case_7(self, setup): Helper.report_allure(self.driver, "Login test Failed") assert False else: + Helper.report_allure(self.driver, "Login test passed") assert True - - diff --git a/Mobile_Testing/Tests/test_player.py b/Mobile_Testing/Tests/test_player.py new file mode 100644 index 0000000..bd00539 --- /dev/null +++ b/Mobile_Testing/Tests/test_player.py @@ -0,0 +1,391 @@ +from appium import webdriver +import pytest +from Mobile_Testing.helper import Helper, Constants +from Mobile_Testing.Pages.authentication import AuthenticationPage +from Mobile_Testing.Pages.signup import SignupPage +from Mobile_Testing.Pages.login import LoginPage +from Mobile_Testing.Pages.home import HomePage +from Mobile_Testing.Pages.player import PlayMusicPage +from allure_commons.types import AttachmentType +import allure +import time + + +@allure.parent_suite("End to End testing - Android") +@allure.suite("Player Page Testing") +@allure.feature("Player Page Testing") +@allure.severity(allure.severity_level.CRITICAL) +class TestPlayer: + """ + A class used to represent the Login page test + ... + Attributes + ---------- + driver: webdriver + A web driver element to control the android app + + Methods + ------- + + test_case_1() + Checks that play button is visible and enabled + test_case_2() + Checks that Previous button is visible and enabled + test_case_3() + Checks that Next button is visible and enabled + test_case_4() + Checks that Love button is visible and enabled + test_case_5() + Checks that Download button is visible and enabled + test_case_6() + Checks that Repeat button is visible and enabled + test_case_7() + Checks that Share button is visible and enabled + test_case_8() + Checks that minimize button is working + test_case_9() + Checks that Minimize button is visible and enabled + test_case_10() + Checks that Blacklist button is visible and enabled + """ + driver = None + + @pytest.yield_fixture + def setup(self): + """ + initiates the driver + """ + self.driver = Helper.driver_init() + yield + self.driver.quit() + + # Test #1 ->checking the play button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Play button checking") + @allure.title("Play button checking") + @allure.description("Checking that the Play button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test1 + def test_case_1(self, setup): + """ + Checks that play button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(8) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.play_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #2 ->checking the previous button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Previous button checking") + @allure.title("Previous button checking") + @allure.description("Checking that the Previous button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test2 + def test_case_2(self, setup): + """ + Checks that Previous button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.previous_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #3 ->checking the Next button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Next button checking") + @allure.title("Next button checking") + @allure.description("Checking that the Next button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test3 + def test_case_3(self, setup): + """ + Checks that Next button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.next_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #4 ->checking the Love button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Love button checking") + @allure.title("Love button checking") + @allure.description("Checking that the Love button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test4 + def test_case_4(self, setup): + """ + Checks that Love button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.love_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #5 ->checking the Download button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Download button checking") + @allure.title("Download button checking") + @allure.description("Checking that the Download button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test5 + def test_case_5(self, setup): + """ + Checks that Download button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.download_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #6 ->checking the repeat button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Repeat button checking") + @allure.title("Repeat button checking") + @allure.description("Checking that the repeat button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test6 + def test_case_6(self, setup): + """ + Checks that Repeat button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.repeat_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #7 ->checking the Share button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Share button checking") + @allure.title("Share button checking") + @allure.description("Checking that the Share button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test7 + def test_case_7(self, setup): + """ + Checks that Share button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.share_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #8 ->checking the minimize button is working + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Minimize button clicking") + @allure.title("Minimize button checking") + @allure.description("Checking that the Minimize button is working") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test8 + def test_case_8(self, setup): + """ + Checks that minimize button is working + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.minimize_player_id) + element.click() + if Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #9 ->checking the minimize button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Minimize button checking") + @allure.title("Minimize button checking") + @allure.description("Checking that the Minimize button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test9 + def test_case_9(self, setup): + """ + Checks that Minimize button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.minimize_player_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False + + # Test #10 ->checking the blacklist button is visible + + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Player Page Tests") + @allure.sub_suite("Blacklist button checking") + @allure.title("Blacklist button checking") + @allure.description("Checking that the Blacklist button is visible") + @pytest.mark.Do + @pytest.mark.Player + @pytest.mark.Test10 + def test_case_10(self, setup): + """ + Checks that Blacklist button is visible and enabled + """ + ap = AuthenticationPage(self.driver) + ap.click_signin_button() + lp = LoginPage(self.driver) + lp.do_the_login(Constants.correct_credentials["email"], Constants.correct_credentials["password"]) + hp = HomePage(self.driver) + time.sleep(10) + hp.click_recommended_tracks() + time.sleep(2) + Helper.find_element_by_xpath(self.driver, Constants.first_song_playlist).click() + time.sleep(2) + element = Helper.find_element_by_id(self.driver, PlayMusicPage.black_list_song_id) + if element.is_displayed() and element.is_enabled(): + Helper.report_allure(self.driver, "Player page test passed") + assert True + else: + print(self.driver.current_activity) + Helper.report_allure(self.driver, "Player page test failed") + assert False diff --git a/Mobile_Testing/Tests/test_signup.py b/Mobile_Testing/Tests/test_signup.py index f1eba60..a57403c 100644 --- a/Mobile_Testing/Tests/test_signup.py +++ b/Mobile_Testing/Tests/test_signup.py @@ -1,5 +1,5 @@ from appium import webdriver -from Mobile_Testing.helper import Helper +from Mobile_Testing.helper import Helper, Constants from Mobile_Testing.Pages.authentication import AuthenticationPage from Mobile_Testing.Pages.signup import SignupPage from Mobile_Testing.Pages.home import HomePage @@ -14,7 +14,50 @@ @allure.suite("Signup Testing") @allure.feature("Signup Testing") @allure.severity(allure.severity_level.BLOCKER) -class TestAuthentication: +class TestSignup: + """ + A class used to represent the Login page test + ... + Attributes + ---------- + driver : webdriver + A web driver element to control the android app + my_factory : Faker + An object that produces fake data + name : string + A randomly generated name + email : string + A randomly generated email + password : string + A randomly generated password + Methods + ------- + + test_case_1() + Signs up correctly + test_case_2() + Signs up with same email + test_case_3() + Signs up with no email + test_case_4() + Signs up with no name + test_case_5() + Signs up with no password + test_case_6() + Signs up with no age + test_case_7() + Signs up with female gender + test_case_8() + Signs up with wrong name format + test_case_9() + Signs up with wrong email format + test_case_10() + Signs up with -ve age + test_case_11() + Signs up with 0 age + test_case_12() + Signs up with 999 age + """ driver = None my_factory = Faker() my_factory.random.seed(int(round(time.time() * 1000))) @@ -22,13 +65,15 @@ class TestAuthentication: email = my_factory.email() password = my_factory.password() - @pytest.yield_fixture def setup(self): """ initiates the driver """ self.driver = Helper.driver_init() + self.name = self.my_factory.name() + self.email = self.my_factory.email() + self.password = self.my_factory.password() yield self.driver.quit() @@ -37,8 +82,7 @@ def setup(self): @allure.story("Signup Tests") @allure.sub_suite("Sign up correctly") @allure.title("Sign up correctly") - @allure.description("Signing up with correct format with " + name + "," - + email + "," + password+",22,M") + @allure.description("Signing up with correct format ") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test1 @@ -51,6 +95,7 @@ def test_case_1(self, setup): sp = SignupPage(self.driver) sp.do_the_signup(self.name, self.email, self.password, "22", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): + Helper.report_allure(self.driver, "Sign up test Passed") assert True else: print(self.driver.current_activity) @@ -60,26 +105,27 @@ def test_case_1(self, setup): # Test #2 ->Signing up with already registered email @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") - @allure.sub_suite("Sign up with same email ") - @allure.title("Signs up with same email ") - @allure.description("Signs up with same email format with " + name + "," - + email + "," + password+",22, M") + @allure.sub_suite("Sign up with existing email ") + @allure.title("Signs up with existing email ") + @allure.description("Signs up with existing email") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test2 def test_case_2(self, setup): """ - Signs up with same email + Signs up with existing email """ ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup(self.name, self.email, self.password, "22", "M") + sp.do_the_signup(self.name, Constants.correct_credentials["email"], Constants.correct_credentials["password"], + "22", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True # Test #3 ->Signing up with no email @@ -87,7 +133,7 @@ def test_case_2(self, setup): @allure.story("Signup Tests") @allure.sub_suite("Sign up with no email ") @allure.title("Signs up with no email ") - @allure.description("Signs up with no email format with Kamel, "", Kimo2010, 21, M") + @allure.description("Signs up with no email ") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test3 @@ -98,21 +144,21 @@ def test_case_3(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("Kamel", "", "Kimo2010", "21", "M") + sp.do_the_signup(self.name, "", self.password, "21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - # Test #4 ->Signing up with no name @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with no name ") @allure.title("Signs up with no name ") - @allure.description("Signs up with no name format with "",kamelmohsenkamel@gmail.com , Kimo2010, 21, M") + @allure.description("Signs up with no name ") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test4 @@ -123,21 +169,21 @@ def test_case_4(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("", "kamelmohsenkamel@gmail.com", "Kimo2010", "21", "M") + sp.do_the_signup("", self.email, self.password, "21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - - # Test #5 ->Signing up with no name + # Test #5 ->Signing up with no password @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with no password ") @allure.title("Signs up with no password ") - @allure.description("Signs up with no password format with Kamel,kamelmohsenkamel@gmail.com , "", 21, M") + @allure.description("Signs up with no password ") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test5 @@ -148,21 +194,21 @@ def test_case_5(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("Kamel", "kamelmohsenkamel@gmail.com", "", "21", "M") + sp.do_the_signup(self.name, self.email, "", "21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - # Test #6 ->Signing up with no age @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with no age ") @allure.title("Signs up with no age ") - @allure.description("Signs up with no age format with Kamel,kamelmohsenkamel@gmail.com , Kimo2010, "", M") + @allure.description("Signs up with no age") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test6 @@ -173,21 +219,21 @@ def test_case_6(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("Kamel", "kamelmohsenkamel@gmail.com", "Kimo2010", "", "M") + sp.do_the_signup(self.name, self.email, self.password, "", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - # Test #7 ->Signing up with female gender @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with female gender ") @allure.title("Signs up with female gender ") - @allure.description("Signs up with female gender format with Kamel,kamelmohsenkamel@gmail.com , Kimo2010, 21, F") + @allure.description("Signs up with female") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test7 @@ -198,21 +244,21 @@ def test_case_7(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("Kamel", "kamelmohsenkamel@gmail.com", "Kimo2010", "21", "F") + sp.do_the_signup(self.name, self.email, self.password, "21", "F") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): + Helper.report_allure(self.driver, "Sign up test Passed") assert True else: print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False - # Test #8 ->Signing up with wrong name @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with wrong name format") @allure.title("Signs up with wrong name format") - @allure.description("Signs up with wrong name format with @!@#!@,kamelmohsenkamel@gmail.com , Kimo2010, 21, M") + @allure.description("Signs up with wrong name format") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test8 @@ -223,22 +269,21 @@ def test_case_8(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("@!@#!@", "kamelmohsenkamel@gmail.com", "Kimo2010", "21", "M") + sp.do_the_signup("@!@#!@", self.email, self.password, "21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - - # Test #9 ->Signing up with wrong email format @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with wrong email format") @allure.title("Signs up with wrong email format") - @allure.description("Signs up with wrong email format with kamel,kamelmohsenkamelgmail.com , Kimo2010, 21, M") + @allure.description("Signs up with wrong email format") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test9 @@ -249,20 +294,21 @@ def test_case_9(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("kamel", "kamelmohsenkamelgmail.com", "Kimo2010", "21", "M") + sp.do_the_signup(self.name, self.name, self.password, "21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True -# Test #10 ->Signing up with -ve age + # Test #10 ->Signing up with -ve age @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with -ve age ") @allure.title("Signs up with -ve age ") - @allure.description("Signs up with -ve age with kamel,kamelmohsenkamel@gmail.com , Kimo2010, -21, M") + @allure.description("Signs up with -ve age") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test10 @@ -273,21 +319,21 @@ def test_case_10(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("kamel", "kamelmohsenkamel@gmail.com", "Kimo2010", "-21", "M") + sp.do_the_signup(self.name, self.email, self.password, "-21", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True - -# Test #11 ->Signing up with 0 age + # Test #11 ->Signing up with 0 age @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with 0 age ") @allure.title("Signs up with 0 age ") - @allure.description("Signs up with 0 age with kamel,kamelmohsenkamel@gmail.com , Kimo2010, 0, M") + @allure.description("Signs up with 0 age ") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test11 @@ -298,20 +344,21 @@ def test_case_11(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("kamel", "kamelmohsenkamel@gmail.com", "Kimo2010", "0", "M") + sp.do_the_signup(self.name, self.email, self.password, "0", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: + Helper.report_allure(self.driver, "Sign up test Passed") assert True -# Test #12 ->Signing up with 999 age + # Test #12 ->Signing up with 999 age @allure.severity(allure.severity_level.BLOCKER) @allure.story("Signup Tests") @allure.sub_suite("Sign up with 999 age ") @allure.title("Signs up with 999 age ") - @allure.description("Signs up with 999 age with kamel,kamelmohsenkamel@gmail.com , Kimo2010, 999, M") + @allure.description("Signs up with 999 age") @pytest.mark.Do @pytest.mark.Signup @pytest.mark.Test12 @@ -322,10 +369,11 @@ def test_case_12(self, setup): ap = AuthenticationPage(self.driver) ap.click_signup_button() sp = SignupPage(self.driver) - sp.do_the_signup("kamel", "kamelmohsenkamel@gmail.com", "Kimo2010", "999", "M") + sp.do_the_signup(self.name, self.email, self.password, "999", "M") if Helper.element_exists_by_id(self.driver, HomePage.logout_button_id): print(self.driver.current_activity) Helper.report_allure(self.driver, "Sign up test Failed") assert False else: - assert True \ No newline at end of file + Helper.report_allure(self.driver, "Sign up test Passed") + assert True diff --git a/Mobile_Testing/helper.py b/Mobile_Testing/helper.py index a4a241f..5bb5f7b 100644 --- a/Mobile_Testing/helper.py +++ b/Mobile_Testing/helper.py @@ -5,79 +5,189 @@ class Helper: + """ + A class used to represent the Login page test + ... + Attributes + ---------- + None + Methods + ------- + + driver_init() + Initiates the web driver + element_exists_by_id() + Safely checks that element exist by id + element_exists_by_accessibility_id() + Safely checks that element exist by accessibility id + element_exists_by_xpath() + Safely checks that element exist by xpath + find_element_by_xpath() + Safely find element by xpath + find_element_by_id() + Safely find element by id + find_element_by_accessibility_id() + Safely find element by accessibility id + screenshot() + takes a screen shot of the app + report_allure() + attach the screen shot to allure report + + """ @staticmethod def driver_init(): - driver = webdriver.Remote("http://localhost:4723/wd/hub", Constants.desired_cap) + """ + initiates the driver + """ + driver = webdriver.Remote("http://localhost:4723/wd/hub", Constants.desired_cap, keep_alive=False) driver.implicitly_wait(10) return driver @staticmethod def element_exists_by_id(driver, _id): + """ + Safely checks that element exist by id + :param driver: driver that will find the element + :type driver: WebDriver + :param _id: id of the element + :type _id string + :return: Boolean + """ try: driver.find_element_by_id(_id) + driver.implicitly_wait(5) except NoSuchElementException: return False return True @staticmethod def element_exists_by_accessibility_id(driver, accessibility_id): + """ + Safely checks that element exist by accessibility id + :param driver: driver that will find the element + :type driver: WebDriver + :param accessibility_id: accessibility id of the element + :type accessibility_id string + :return: Boolean + """ try: driver.find_element_by_accessibility_id(accessibility_id) + driver.implicitly_wait(5) except NoSuchElementException: return False return True @staticmethod def element_exists_by_xpath(driver, xpath): + """ + Safely checks that element exist by id + :param driver: driver that will find the element + :type driver: WebDriver + :param xpath: xpath of the element + :type xpath string + :return: Boolean + """ try: driver.find_element_by_xpath(xpath) + driver.implicitly_wait(5) except NoSuchElementException: return False return True @staticmethod def find_element_by_xpath(driver, xpath): + """ + Safely find that element by xpath + :param driver: driver that will find the element + :type driver: WebDriver + :param xpath: id of the element + :type xpath string + :return: Boolean + """ try: element = driver.find_element_by_xpath(xpath) + driver.implicitly_wait(5) return element except NoSuchElementException: return None @staticmethod def find_element_by_id(driver, _id): + """ + Safely find that element by id + :param driver: driver that will find the element + :type driver: WebDriver + :param _id: id of the element + :type _id string + :return: Boolean + """ try: element = driver.find_element_by_id(_id) + driver.implicitly_wait(5) return element except NoSuchElementException: return None @staticmethod def find_element_by_accessibility_id(driver, accessibility_id): + """ + Safely find that element by accessibility id + :param driver: driver that will find the element + :type driver: WebDriver + :param accessibility_id: id of the element + :type accessibility_id string + :return: Boolean + """ try: element = driver.find_element_by_xpath(accessibility_id) + driver.implicitly_wait(5) return element except NoSuchElementException: return None @staticmethod def screenshot(driver): + """ + takes a screen shot of the app + """ return driver.get_screenshot_as_png() @staticmethod def report_allure(driver, msg): + """ + attach the screen shot to allure report + """ allure.attach(Helper.screenshot(driver), msg, attachment_type=AttachmentType.PNG) class Constants: - desired_cap = { - "deviceName": "AndroidEmulator", - "platformName": "Android", - "app": "/Users/KIMO/AndroidStudioProjects/ProjectX/app/build/outputs/apk/debug/app-debug.apk", - "appWaitActivity": ".authentication.AuthenticationPage", - "appWaitPackage": "com.example.projectx" - } + """ + A class used to represent the Login page test + ... + Attributes + ---------- + desired_cap : dictionary + The details of your device + correct_credentials : dictionary + The correct credentials for login + first_song_playlist : string + the xpath fo the first element in playlist + + Methods + ------- + None + + """ + + # desired_cap = { + # "deviceName": "AndroidEmulator", + # "platformName": "Android", + # "app": "/Users/KIMO/AndroidStudioProjects/ProjectX/app/build/outputs/apk/debug/app-debug.apk", + # "appWaitActivity": ".authentication.AuthenticationPage", + # "appWaitPackage": "com.example.projectx" + # } # desired_cap = { # "deviceName": "samsung-sm_g955f-ce11171b62faecd00c", # "platformName": "Android", @@ -85,7 +195,15 @@ class Constants: # "appWaitActivity": ".authentication.AuthenticationPage", # "appWaitPackage": "com.example.projectx" # } + desired_cap = { + "deviceName": "samsung-sm_a207f-R9WM91DQY1J", + "platformName": "Android", + "app": "/Users/KIMO/AndroidStudioProjects/ProjectX/app/build/outputs/apk/debug/app-debug.apk", + "appWaitActivity": ".authentication.AuthenticationPage", + "appWaitPackage": "com.example.projectx" + } correct_credentials = { "email": "abdallah@gmail.com", - "password": "123456" + "password": "1234567" } + first_song_playlist = "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[1]/android.widget.RelativeLayout" diff --git a/Mobile_Testing/initiater.txt b/Mobile_Testing/initiater.txt deleted file mode 100644 index 5fc9230..0000000 --- a/Mobile_Testing/initiater.txt +++ /dev/null @@ -1 +0,0 @@ -all android test files goes here diff --git a/README.md b/README.md index 51e73f4..10108a9 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,119 @@ # Testing Web + Android application testing code for Project_X (Spotify Mock) +---------------------------------------------------------------------------- +For Android Testing ONLY!!!! -See command_to_use.txt for the cmd commands to use to run the tests and install and freeze dependencies and open Report in allure local host +You need to install SDK files as this have to be done manually +Then install appium using : +npm install -g appium -1-First you install the requirements using the following command +Then you run appium using the command +appium +OR you can use the appium desktop App: +open the desktop App then press start + + + +Then you open the helper.py and manually write the name of you device in the CONSTANTS->desired_capabilities at the bottom of the file +!!!!!HINT: sometimes you need to run the app first on the target device using Android Studio +!!!!!HINT: You can get the name of your device from android studio + +then we start to initiate our testing dependencies by foloowing this steps: +!!!!!PS:(it is preferred to use pycharm to create virtual env and then follow the steps below) + +---------------------------------------------------------------------------- + + + +1-First you install the requirements using the following commands: pip3 install -r requirements.txt + + +---------------------------------------------------------------------------- + + 2-Second run the tests using the following commands -python3 -m pytest --alluredir="./Reports" ./Mobile_Testing/Tests/ -m Do -python3 -m pytest --alluredir="./Reports" ./Web_Testing/Tests/ -m Do + +Recommended: + + +For Web Testing: +sudo bash run_web_tests.sh +or +sudo sh run_web_tests.sh + +For Mobile Testing: +sudo bash run_mobile_tests.sh +or +sudo sh run_mobile_tests.sh + + + + +Not Recommended: (can be used to run separate tests) + + +For Web Testing: + +(i.e)This runs all the web tests: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Web_Testing/Tests/ -m Do + +(i.e)This runs tests for specific function: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Web_Testing/Tests/test_login.py -m Do + +(i.e)This runs specific test for specific function: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Web_Testing/Tests/test_login.py -m Test2 + + + + +For Mobile Testing: + +(i.e)This runs all the mobile tests: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Mobile_Testing/Tests/ -m Do + +(i.e)This runs tests for specific function: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Mobile_Testing/Tests/test_login.py -m Do + +(i.e)This runs specific test for specific function: +python3 -m pytest --alluredir="./Reports/All_Reports/allurefiles" ./Mobile_Testing/Tests/test_login.py -m Test2 + +---------------------------------------------------------------------------- + + 3-Third you generate the word and pdf Report using the following Command -allure-docx --pdf Reports Test_Results.docx +{ +!!!!!!!!Hint Run this first!!!!!!!! +pip3 install git+https://github.com/typhoon-hil/allure-docx.git +} +Recommended: + +For Web Testing: +sudo bash generate_web_reports.sh +or +sudo sh generate_web_reports.sh + +For Mobile Testing: +sudo bash generate_mobile_reports.sh +or +sudo sh generate_mobile_reports.sh + +***** + +Not Recommended: + +(i.e)This generates the report to a word file only: +allure-docx ./Reports/All_Reports/allurefiles Test_Results.docx + + +(i.e)This generates the report to a word file and pdf: +allure-docx --pdf ./Reports/All_Reports/allurefiles Test_Results.docx + +---------------------------------------------------------------------------- 4-(Optional)Fourth you run the allure server on chrome browser using the following command allure serve "./Reports" diff --git a/Reports/All_Reports/Final_Report.docx b/Reports/All_Reports/Final_Report.docx new file mode 100644 index 0000000..08b8bd1 Binary files /dev/null and b/Reports/All_Reports/Final_Report.docx differ diff --git a/Reports/Mobile_Reports/Authentication_Reports/Authentication_Report.docx b/Reports/Mobile_Reports/Authentication_Reports/Authentication_Report.docx new file mode 100644 index 0000000..6eec28e Binary files /dev/null and b/Reports/Mobile_Reports/Authentication_Reports/Authentication_Report.docx differ diff --git a/Reports/Mobile_Reports/Final_Mobile_Report.docx b/Reports/Mobile_Reports/Final_Mobile_Report.docx new file mode 100644 index 0000000..c859284 Binary files /dev/null and b/Reports/Mobile_Reports/Final_Mobile_Report.docx differ diff --git a/Reports/Mobile_Reports/Final_Mobile_Report_Manual.docx b/Reports/Mobile_Reports/Final_Mobile_Report_Manual.docx new file mode 100644 index 0000000..edb6fb9 Binary files /dev/null and b/Reports/Mobile_Reports/Final_Mobile_Report_Manual.docx differ diff --git a/Reports/Mobile_Reports/Final_Web_Report.docx b/Reports/Mobile_Reports/Final_Web_Report.docx new file mode 100644 index 0000000..d55fbe2 Binary files /dev/null and b/Reports/Mobile_Reports/Final_Web_Report.docx differ diff --git a/Reports/Mobile_Reports/Home_Reports/Home_Report.docx b/Reports/Mobile_Reports/Home_Reports/Home_Report.docx new file mode 100644 index 0000000..b886780 Binary files /dev/null and b/Reports/Mobile_Reports/Home_Reports/Home_Report.docx differ diff --git a/Reports/Mobile_Reports/Login_Reports/Login_Report.docx b/Reports/Mobile_Reports/Login_Reports/Login_Report.docx new file mode 100644 index 0000000..7882024 Binary files /dev/null and b/Reports/Mobile_Reports/Login_Reports/Login_Report.docx differ diff --git a/Reports/Mobile_Reports/Player_Reports/Player_Report.docx b/Reports/Mobile_Reports/Player_Reports/Player_Report.docx new file mode 100644 index 0000000..626e910 Binary files /dev/null and b/Reports/Mobile_Reports/Player_Reports/Player_Report.docx differ diff --git a/Reports/Mobile_Reports/Signup_Reports/Signup_Report.docx b/Reports/Mobile_Reports/Signup_Reports/Signup_Report.docx new file mode 100644 index 0000000..5f7d06e Binary files /dev/null and b/Reports/Mobile_Reports/Signup_Reports/Signup_Report.docx differ diff --git a/Reports/Mobile_Reports/extra_Reports/Extra_Report.docx b/Reports/Mobile_Reports/extra_Reports/Extra_Report.docx new file mode 100644 index 0000000..a16300c Binary files /dev/null and b/Reports/Mobile_Reports/extra_Reports/Extra_Report.docx differ diff --git a/Reports/Web_Reports/Account_Overview_Reports/Account_Overview_Report.docx b/Reports/Web_Reports/Account_Overview_Reports/Account_Overview_Report.docx new file mode 100644 index 0000000..9e7d560 Binary files /dev/null and b/Reports/Web_Reports/Account_Overview_Reports/Account_Overview_Report.docx differ diff --git a/Reports/Web_Reports/Artist_Reports/Artist_Report.docx b/Reports/Web_Reports/Artist_Reports/Artist_Report.docx new file mode 100644 index 0000000..1c5490a Binary files /dev/null and b/Reports/Web_Reports/Artist_Reports/Artist_Report.docx differ diff --git a/Reports/Web_Reports/Change_Password_Reports/Login_Report.docx b/Reports/Web_Reports/Change_Password_Reports/Login_Report.docx new file mode 100644 index 0000000..f779431 Binary files /dev/null and b/Reports/Web_Reports/Change_Password_Reports/Login_Report.docx differ diff --git a/Reports/Web_Reports/Final_Web_Report.docx b/Reports/Web_Reports/Final_Web_Report.docx new file mode 100644 index 0000000..c5f428d Binary files /dev/null and b/Reports/Web_Reports/Final_Web_Report.docx differ diff --git a/Reports/Web_Reports/Liked_Songs_Reports/Liked_Songs_Report.docx b/Reports/Web_Reports/Liked_Songs_Reports/Liked_Songs_Report.docx new file mode 100644 index 0000000..6033d8a Binary files /dev/null and b/Reports/Web_Reports/Liked_Songs_Reports/Liked_Songs_Report.docx differ diff --git a/Reports/Web_Reports/Logged_Out_Home_Reports/Logged_Out_Home_Report.docx b/Reports/Web_Reports/Logged_Out_Home_Reports/Logged_Out_Home_Report.docx new file mode 100644 index 0000000..58e7327 Binary files /dev/null and b/Reports/Web_Reports/Logged_Out_Home_Reports/Logged_Out_Home_Report.docx differ diff --git a/Reports/Web_Reports/Login_Reports/Login_Report.docx b/Reports/Web_Reports/Login_Reports/Login_Report.docx new file mode 100644 index 0000000..a9b87a8 Binary files /dev/null and b/Reports/Web_Reports/Login_Reports/Login_Report.docx differ diff --git a/Reports/Web_Reports/Playlist_Reports/Playlist_Report.docx b/Reports/Web_Reports/Playlist_Reports/Playlist_Report.docx new file mode 100644 index 0000000..e10727f Binary files /dev/null and b/Reports/Web_Reports/Playlist_Reports/Playlist_Report.docx differ diff --git a/Reports/Web_Reports/Premium_Reports/Premium_Report.docx b/Reports/Web_Reports/Premium_Reports/Premium_Report.docx new file mode 100644 index 0000000..c669d26 Binary files /dev/null and b/Reports/Web_Reports/Premium_Reports/Premium_Report.docx differ diff --git a/Reports/Web_Reports/Signup_Reports/Signup_Report.docx b/Reports/Web_Reports/Signup_Reports/Signup_Report.docx new file mode 100644 index 0000000..4de4a80 Binary files /dev/null and b/Reports/Web_Reports/Signup_Reports/Signup_Report.docx differ diff --git a/Reports/Web_Reports/Web_Player_Home_Reports/Web_Player_Home_Report.docx b/Reports/Web_Reports/Web_Player_Home_Reports/Web_Player_Home_Report.docx new file mode 100644 index 0000000..a9717ba Binary files /dev/null and b/Reports/Web_Reports/Web_Player_Home_Reports/Web_Player_Home_Report.docx differ diff --git a/Reports/Web_Reports/Your_Library_Reports/Your_Library_Report.docx b/Reports/Web_Reports/Your_Library_Reports/Your_Library_Report.docx new file mode 100644 index 0000000..1bc2b64 Binary files /dev/null and b/Reports/Web_Reports/Your_Library_Reports/Your_Library_Report.docx differ diff --git a/Reports/webplayertest/087f6cff-9623-4b37-806d-637e07108b33-attachment.png b/Reports/webplayertest/087f6cff-9623-4b37-806d-637e07108b33-attachment.png deleted file mode 100644 index c65643d..0000000 Binary files a/Reports/webplayertest/087f6cff-9623-4b37-806d-637e07108b33-attachment.png and /dev/null differ diff --git a/Reports/webplayertest/0ec18faa-f0aa-4dfe-b73d-b4366bf3070f-result.json b/Reports/webplayertest/0ec18faa-f0aa-4dfe-b73d-b4366bf3070f-result.json deleted file mode 100644 index ab9aa36..0000000 --- a/Reports/webplayertest/0ec18faa-f0aa-4dfe-b73d-b4366bf3070f-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Your Library Button", "status": "broken", "statusDetails": {"message": "AttributeError: 'WebPlayerHome' object has no attribute 'driver'", "trace": "self = , setup_initial = None\n\n @allure.severity(allure.severity_level.BLOCKER)\n @allure.story(\"Testing Your Library Button\")\n @allure.title(\"Your Library Button\")\n @allure.description(\"Testing Your Library Button\")\n @pytest.mark.Do\n @pytest.mark.Signup\n def test_case_1(self, setup_initial):\n lp = LoginPage(self.driver)\n lp.login_to_spotify(\"test1@test.com\", \"test123\")\n time.sleep(3)\n self.driver.get(self.helper.base_url + \"webplayer/home\")\n time.sleep(3)\n> web_player_home = WebPlayerHome(self.driver)\n\nWeb_Testing\\Tests\\test_webplayerHome.py:66: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nWeb_Testing\\Pages\\WebPlayerHome.py:8: in __init__\n super().__init__()\nWeb_Testing\\Pages\\WebPlayerMenu.py:6: in __init__\n self.home_link = self.find_element_by_xpath(\"//text()[.='Home']/ancestor::a[1]\")\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = , xpath = \"//text()[.='Home']/ancestor::a[1]\"\n\n def find_element_by_xpath(self, xpath):\n \"\"\"\n finds the element with the given xpath\n \n :param xpath: element xpath\n :type xpath: str\n \n :returns: a WebDriver element associated with the given xpath\n :rtype: WebDriver element\n \"\"\"\n try:\n> element = self.driver.find_element_by_xpath(xpath)\nE AttributeError: 'WebPlayerHome' object has no attribute 'driver'\n\nWeb_Testing\\helperClasses.py:317: AttributeError"}, "description": "Testing Your Library Button", "attachments": [{"name": "stdout", "source": "d18797d1-2094-4c54-9cef-1c4e43d453ec-attachment.txt", "type": "text/plain"}], "start": 1586306597684, "stop": 1586306610252, "uuid": "3486d773-a75c-4dae-9f39-dbc6cae2fb89", "historyId": "ead4221241c268294500211ca0f34e3c", "testCaseId": "e580b9d3fce43b08772662efcb19dbd7", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_1", "labels": [{"name": "severity", "value": "blocker"}, {"name": "suite", "value": "Web Player Home"}, {"name": "story", "value": "Testing Your Library Button"}, {"name": "feature", "value": "Web Player Home Page"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "15708-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/2c26f295-7288-4c05-9e9f-ece09e5d63b0-attachment.png b/Reports/webplayertest/2c26f295-7288-4c05-9e9f-ece09e5d63b0-attachment.png deleted file mode 100644 index bab69d8..0000000 Binary files a/Reports/webplayertest/2c26f295-7288-4c05-9e9f-ece09e5d63b0-attachment.png and /dev/null differ diff --git a/Reports/webplayertest/38cf19a5-377c-4d2e-ae60-1cad216087c7-result.json b/Reports/webplayertest/38cf19a5-377c-4d2e-ae60-1cad216087c7-result.json deleted file mode 100644 index 6b54a4a..0000000 --- a/Reports/webplayertest/38cf19a5-377c-4d2e-ae60-1cad216087c7-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Liked Songs Button", "status": "passed", "description": "Testing Liked Songs Button", "attachments": [{"name": "SUCCESS: Liked Songs button is functional", "source": "2c26f295-7288-4c05-9e9f-ece09e5d63b0-attachment.png", "type": "image/png"}], "start": 1586306810112, "stop": 1586306814865, "uuid": "049c1317-c4b0-43fa-92fc-f379848a325b", "historyId": "83a984e19a40ce4f4174d5fed9d902fd", "testCaseId": "d94176ae48ce758f51b8e5b42a2bcbf2", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_2", "labels": [{"name": "feature", "value": "Web Player Home Page"}, {"name": "story", "value": "Testing Liked Songs Button"}, {"name": "suite", "value": "Web Player Home"}, {"name": "severity", "value": "blocker"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "16208-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/3b0f0a7c-62ab-49c8-91c9-f034e943efff-attachment.png b/Reports/webplayertest/3b0f0a7c-62ab-49c8-91c9-f034e943efff-attachment.png deleted file mode 100644 index bab69d8..0000000 Binary files a/Reports/webplayertest/3b0f0a7c-62ab-49c8-91c9-f034e943efff-attachment.png and /dev/null differ diff --git a/Reports/webplayertest/3dc2b374-f4d4-4371-8b70-0432ac2ac69f-attachment.txt b/Reports/webplayertest/3dc2b374-f4d4-4371-8b70-0432ac2ac69f-attachment.txt deleted file mode 100644 index e871178..0000000 --- a/Reports/webplayertest/3dc2b374-f4d4-4371-8b70-0432ac2ac69f-attachment.txt +++ /dev/null @@ -1,2 +0,0 @@ -Successfully logged in -INTERNAL ERROR: Account overview email is not matching the login email: Login email = test1@test.com, Overview email = diff --git a/Reports/webplayertest/453bbe57-c168-4ae0-bcb2-20183a3df988-result.json b/Reports/webplayertest/453bbe57-c168-4ae0-bcb2-20183a3df988-result.json deleted file mode 100644 index 18971a8..0000000 --- a/Reports/webplayertest/453bbe57-c168-4ae0-bcb2-20183a3df988-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Liked Songs Button", "status": "broken", "statusDetails": {"message": "AttributeError: 'WebPlayerHome' object has no attribute 'driver'", "trace": "self = , setup = None\n\n @allure.severity(allure.severity_level.BLOCKER)\n @allure.story(\"Testing Liked Songs Button\")\n @allure.title(\"Liked Songs Button\")\n @allure.description(\"Testing Liked Songs Button\")\n @pytest.mark.Do\n @pytest.mark.Signup\n def test_case_2(self, setup):\n time.sleep(2)\n> web_player_home = WebPlayerHome(self.driver)\n\nWeb_Testing\\Tests\\test_webplayerHome.py:85: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nWeb_Testing\\Pages\\WebPlayerHome.py:8: in __init__\n super().__init__()\nWeb_Testing\\Pages\\WebPlayerMenu.py:6: in __init__\n self.home_link = self.find_element_by_xpath(\"//text()[.='Home']/ancestor::a[1]\")\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = , xpath = \"//text()[.='Home']/ancestor::a[1]\"\n\n def find_element_by_xpath(self, xpath):\n \"\"\"\n finds the element with the given xpath\n \n :param xpath: element xpath\n :type xpath: str\n \n :returns: a WebDriver element associated with the given xpath\n :rtype: WebDriver element\n \"\"\"\n try:\n> element = self.driver.find_element_by_xpath(xpath)\nE AttributeError: 'WebPlayerHome' object has no attribute 'driver'\n\nWeb_Testing\\helperClasses.py:317: AttributeError"}, "description": "Testing Liked Songs Button", "start": 1586306612091, "stop": 1586306614094, "uuid": "ca3c1a13-e789-4684-b77e-703f1a7faefb", "historyId": "83a984e19a40ce4f4174d5fed9d902fd", "testCaseId": "d94176ae48ce758f51b8e5b42a2bcbf2", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_2", "labels": [{"name": "severity", "value": "blocker"}, {"name": "suite", "value": "Web Player Home"}, {"name": "feature", "value": "Web Player Home Page"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "story", "value": "Testing Liked Songs Button"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "15708-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/50611ad3-1228-4638-bc81-82e5ab43eeaa-container.json b/Reports/webplayertest/50611ad3-1228-4638-bc81-82e5ab43eeaa-container.json deleted file mode 100644 index 032a1dd..0000000 --- a/Reports/webplayertest/50611ad3-1228-4638-bc81-82e5ab43eeaa-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "d868e18d-11a4-490c-8347-5004382643e3", "children": ["637f121f-03e6-4c6d-bfa4-f3ef0aff0573"], "befores": [{"name": "setup_initial", "status": "passed", "start": 1586306910938, "stop": 1586306912779}], "afters": [{"name": "setup_initial::0", "status": "passed", "start": 1586306927361, "stop": 1586306929011}], "start": 1586306910938, "stop": 1586306929011} \ No newline at end of file diff --git a/Reports/webplayertest/741baa77-b372-4cdc-950f-51411830ee35-attachment.txt b/Reports/webplayertest/741baa77-b372-4cdc-950f-51411830ee35-attachment.txt deleted file mode 100644 index e871178..0000000 --- a/Reports/webplayertest/741baa77-b372-4cdc-950f-51411830ee35-attachment.txt +++ /dev/null @@ -1,2 +0,0 @@ -Successfully logged in -INTERNAL ERROR: Account overview email is not matching the login email: Login email = test1@test.com, Overview email = diff --git a/Reports/webplayertest/7e1b1471-2626-4c3d-859f-19ad8ef37070-result.json b/Reports/webplayertest/7e1b1471-2626-4c3d-859f-19ad8ef37070-result.json deleted file mode 100644 index 347125a..0000000 --- a/Reports/webplayertest/7e1b1471-2626-4c3d-859f-19ad8ef37070-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Your Library Button", "status": "failed", "statusDetails": {"message": "AssertionError: assert False", "trace": "self = , setup_initial = None\n\n @allure.severity(allure.severity_level.BLOCKER)\n @allure.story(\"Testing Your Library Button\")\n @allure.title(\"Your Library Button\")\n @allure.description(\"Testing Your Library Button\")\n @pytest.mark.Do\n @pytest.mark.Signup\n def test_case_1(self, setup_initial):\n lp = LoginPage(self.driver)\n lp.login_to_spotify(\"test1@test.com\", \"test123\")\n time.sleep(3)\n self.driver.get(self.helper.base_url + \"webplayer/home\")\n time.sleep(3)\n web_player_home = WebPlayerHome(self.driver)\n web_player_home.your_library_button.click()\n time.sleep(2)\n if web_player_home.is_in_your_library():\n self.helper.report_allure(\"SUCCESS: Your Library button is functional\")\n assert True\n else:\n self.helper.report_allure(\"FAILURE: Your Library button is not functional\")\n> assert False\nE assert False\n\nWeb_Testing\\Tests\\test_webplayerHome.py:74: AssertionError"}, "description": "Testing Your Library Button", "attachments": [{"name": "FAILURE: Your Library button is not functional", "source": "cef04541-fcc3-4ff1-bf5e-2c38c22261a2-attachment.png", "type": "image/png"}, {"name": "stdout", "source": "3dc2b374-f4d4-4371-8b70-0432ac2ac69f-attachment.txt", "type": "text/plain"}], "start": 1586306912779, "stop": 1586306927321, "uuid": "637f121f-03e6-4c6d-bfa4-f3ef0aff0573", "historyId": "ead4221241c268294500211ca0f34e3c", "testCaseId": "e580b9d3fce43b08772662efcb19dbd7", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_1", "labels": [{"name": "feature", "value": "Web Player Home Page"}, {"name": "story", "value": "Testing Your Library Button"}, {"name": "suite", "value": "Web Player Home"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "severity", "value": "blocker"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "32-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/8deaae2d-a1d6-4477-9960-20bda94ad62d-container.json b/Reports/webplayertest/8deaae2d-a1d6-4477-9960-20bda94ad62d-container.json deleted file mode 100644 index 18f3de7..0000000 --- a/Reports/webplayertest/8deaae2d-a1d6-4477-9960-20bda94ad62d-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "276029b5-880b-4085-bb46-2fe910963fe0", "children": ["049c1317-c4b0-43fa-92fc-f379848a325b"], "befores": [{"name": "setup", "status": "passed", "start": 1586306809712, "stop": 1586306810112}], "afters": [{"name": "setup::0", "status": "passed", "start": 1586306814865, "stop": 1586306817365}], "start": 1586306809712, "stop": 1586306817365} \ No newline at end of file diff --git a/Reports/webplayertest/9c39bc12-8b4d-4c3e-ac1c-1cc7f43917b1-container.json b/Reports/webplayertest/9c39bc12-8b4d-4c3e-ac1c-1cc7f43917b1-container.json deleted file mode 100644 index 2bba9cb..0000000 --- a/Reports/webplayertest/9c39bc12-8b4d-4c3e-ac1c-1cc7f43917b1-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "bcda0fb1-9dd6-4f24-8de3-a34d624083cc", "children": ["3486d773-a75c-4dae-9f39-dbc6cae2fb89"], "befores": [{"name": "setup_initial", "status": "passed", "start": 1586306595514, "stop": 1586306597675}], "afters": [{"name": "setup_initial::0", "status": "passed", "start": 1586306610322, "stop": 1586306611512}], "start": 1586306595514, "stop": 1586306611512} \ No newline at end of file diff --git a/Reports/webplayertest/a1e878b3-063b-40d9-a109-c8afb62e67f2-container.json b/Reports/webplayertest/a1e878b3-063b-40d9-a109-c8afb62e67f2-container.json deleted file mode 100644 index a0f4d92..0000000 --- a/Reports/webplayertest/a1e878b3-063b-40d9-a109-c8afb62e67f2-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "bec621be-e1ff-4d99-8268-368a52d6ba56", "children": ["6871f9f5-9d0e-498c-8e1b-c2b02b425098"], "befores": [{"name": "setup", "status": "passed", "start": 1586306929051, "stop": 1586306929421}], "afters": [{"name": "setup::0", "status": "passed", "start": 1586306934148, "stop": 1586306936788}], "start": 1586306929051, "stop": 1586306936788} \ No newline at end of file diff --git a/Reports/webplayertest/b0d39bae-303d-4f75-911a-7fcb4c6dff09-result.json b/Reports/webplayertest/b0d39bae-303d-4f75-911a-7fcb4c6dff09-result.json deleted file mode 100644 index 6439b05..0000000 --- a/Reports/webplayertest/b0d39bae-303d-4f75-911a-7fcb4c6dff09-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Liked Songs Button", "status": "passed", "description": "Testing Liked Songs Button", "attachments": [{"name": "SUCCESS: Liked Songs button is functional", "source": "3b0f0a7c-62ab-49c8-91c9-f034e943efff-attachment.png", "type": "image/png"}], "start": 1586306929431, "stop": 1586306934148, "uuid": "6871f9f5-9d0e-498c-8e1b-c2b02b425098", "historyId": "83a984e19a40ce4f4174d5fed9d902fd", "testCaseId": "d94176ae48ce758f51b8e5b42a2bcbf2", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_2", "labels": [{"name": "feature", "value": "Web Player Home Page"}, {"name": "suite", "value": "Web Player Home"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "severity", "value": "blocker"}, {"name": "story", "value": "Testing Liked Songs Button"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "32-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/c142703a-4b04-4fec-8006-8112db40d32e-result.json b/Reports/webplayertest/c142703a-4b04-4fec-8006-8112db40d32e-result.json deleted file mode 100644 index c077a73..0000000 --- a/Reports/webplayertest/c142703a-4b04-4fec-8006-8112db40d32e-result.json +++ /dev/null @@ -1 +0,0 @@ -{"name": "Your Library Button", "status": "failed", "statusDetails": {"message": "AssertionError: assert False", "trace": "self = , setup_initial = None\n\n @allure.severity(allure.severity_level.BLOCKER)\n @allure.story(\"Testing Your Library Button\")\n @allure.title(\"Your Library Button\")\n @allure.description(\"Testing Your Library Button\")\n @pytest.mark.Do\n @pytest.mark.Signup\n def test_case_1(self, setup_initial):\n lp = LoginPage(self.driver)\n lp.login_to_spotify(\"test1@test.com\", \"test123\")\n time.sleep(3)\n self.driver.get(self.helper.base_url + \"webplayer/home\")\n time.sleep(3)\n web_player_home = WebPlayerHome(self.driver)\n web_player_home.your_library_button.click()\n time.sleep(2)\n if web_player_home.is_in_your_library():\n self.helper.report_allure(\"SUCCESS: Your Library button is functional\")\n assert True\n else:\n self.helper.report_allure(\"FAILURE: Your Library button is not functional\")\n> assert False\nE assert False\n\nWeb_Testing\\Tests\\test_webplayerHome.py:74: AssertionError"}, "description": "Testing Your Library Button", "attachments": [{"name": "FAILURE: Your Library button is not functional", "source": "087f6cff-9623-4b37-806d-637e07108b33-attachment.png", "type": "image/png"}, {"name": "stdout", "source": "741baa77-b372-4cdc-950f-51411830ee35-attachment.txt", "type": "text/plain"}], "start": 1586306793215, "stop": 1586306808412, "uuid": "c2fb5556-7284-4c37-8e9e-85b3fe111a01", "historyId": "ead4221241c268294500211ca0f34e3c", "testCaseId": "e580b9d3fce43b08772662efcb19dbd7", "fullName": "Web_Testing.Tests.test_webplayerHome.TestWebPlayerHome#test_case_1", "labels": [{"name": "feature", "value": "Web Player Home Page"}, {"name": "suite", "value": "Web Player Home"}, {"name": "severity", "value": "blocker"}, {"name": "parentSuite", "value": "End to End testing"}, {"name": "story", "value": "Testing Your Library Button"}, {"name": "tag", "value": "Do"}, {"name": "tag", "value": "Signup"}, {"name": "subSuite", "value": "TestWebPlayerHome"}, {"name": "host", "value": "LAPTOP-8H6HECEC"}, {"name": "thread", "value": "16208-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "Web_Testing.Tests.test_webplayerHome"}]} \ No newline at end of file diff --git a/Reports/webplayertest/cef04541-fcc3-4ff1-bf5e-2c38c22261a2-attachment.png b/Reports/webplayertest/cef04541-fcc3-4ff1-bf5e-2c38c22261a2-attachment.png deleted file mode 100644 index c65643d..0000000 Binary files a/Reports/webplayertest/cef04541-fcc3-4ff1-bf5e-2c38c22261a2-attachment.png and /dev/null differ diff --git a/Reports/webplayertest/d18797d1-2094-4c54-9cef-1c4e43d453ec-attachment.txt b/Reports/webplayertest/d18797d1-2094-4c54-9cef-1c4e43d453ec-attachment.txt deleted file mode 100644 index e871178..0000000 --- a/Reports/webplayertest/d18797d1-2094-4c54-9cef-1c4e43d453ec-attachment.txt +++ /dev/null @@ -1,2 +0,0 @@ -Successfully logged in -INTERNAL ERROR: Account overview email is not matching the login email: Login email = test1@test.com, Overview email = diff --git a/Reports/webplayertest/d3a9d6b5-6f92-432e-a7c8-01f08456f6a7-container.json b/Reports/webplayertest/d3a9d6b5-6f92-432e-a7c8-01f08456f6a7-container.json deleted file mode 100644 index cda9d3a..0000000 --- a/Reports/webplayertest/d3a9d6b5-6f92-432e-a7c8-01f08456f6a7-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "5db08901-3a2f-4a47-94b6-c5892792d86e", "children": ["ca3c1a13-e789-4684-b77e-703f1a7faefb"], "befores": [{"name": "setup", "status": "passed", "start": 1586306611512, "stop": 1586306612084}], "afters": [{"name": "setup::0", "status": "passed", "start": 1586306614124, "stop": 1586306616946}], "start": 1586306611512, "stop": 1586306616946} \ No newline at end of file diff --git a/Reports/webplayertest/ddc0fe9e-4b42-4ac0-8fae-ac5b152fda2a-container.json b/Reports/webplayertest/ddc0fe9e-4b42-4ac0-8fae-ac5b152fda2a-container.json deleted file mode 100644 index 83b084f..0000000 --- a/Reports/webplayertest/ddc0fe9e-4b42-4ac0-8fae-ac5b152fda2a-container.json +++ /dev/null @@ -1 +0,0 @@ -{"uuid": "20e0a2b8-bc49-4893-9c3b-feb81a0ccdb5", "children": ["c2fb5556-7284-4c37-8e9e-85b3fe111a01"], "befores": [{"name": "setup_initial", "status": "passed", "start": 1586306791108, "stop": 1586306793214}], "afters": [{"name": "setup_initial::0", "status": "passed", "start": 1586306808462, "stop": 1586306809702}], "start": 1586306791108, "stop": 1586306809702} \ No newline at end of file diff --git a/SigninReports.docx b/SigninReports.docx deleted file mode 100644 index 9894912..0000000 Binary files a/SigninReports.docx and /dev/null differ diff --git a/Test_Results.docx b/Test_Results.docx deleted file mode 100644 index d3e67ea..0000000 Binary files a/Test_Results.docx and /dev/null differ diff --git a/Test_Results.pdf b/Test_Results.pdf deleted file mode 100644 index 27ea7fb..0000000 Binary files a/Test_Results.pdf and /dev/null differ diff --git a/Web_Testing/Pages/AccountOverviewPage.py b/Web_Testing/Pages/AccountOverviewPage.py index 700e7d5..c109e36 100644 --- a/Web_Testing/Pages/AccountOverviewPage.py +++ b/Web_Testing/Pages/AccountOverviewPage.py @@ -28,8 +28,6 @@ class AccountOverviewPage(WebHelper): A string containing the link text of Help link premium_link_txt : string A string containing the link text of Premium link - get_premium_btn : string - A string containing the link text of Get Premium button account_overview_link : string A string containing the xpath of Account Overview button edit_profile_link : string @@ -77,8 +75,6 @@ class AccountOverviewPage(WebHelper): Clicks Help button click_premium_link() Clicks Premium button - click_get_premium_btn() - Clicks Get Premium button click_account_overview() Clicks Account Overview button click_edit_profile() @@ -105,6 +101,8 @@ class AccountOverviewPage(WebHelper): Checks if username is same as username given is_correct_email(email) Checks if email is same as email given + premium_check(premium) + check if premium status exist with premium account is_correct_age(age) Checks if age is same as age given is_page_initialized() @@ -121,7 +119,6 @@ class AccountOverviewPage(WebHelper): download_link_txt = "Download" help_link_txt = "Help" premium_link_txt = "Premium" - get_premium_btn = "GET PREMIUM" account_overview_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[2]" edit_profile_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[3]" change_password_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[4]" @@ -193,10 +190,6 @@ def click_premium_link(self): """Clicks Premium button""" self.click_button_safe(self.find_element_by_link_text(self.premium_link_txt)) - def click_get_premium_btn(self): - """Clicks Get Premium button""" - self.click_button_safe(self.find_element_by_link_text(self.get_premium_btn)) - def click_account_overview(self): """Clicks Account Overview button""" self.click_button_safe(self.find_element_by_xpath(self.account_overview_link)) @@ -286,6 +279,22 @@ def is_correct_email(self, email): else: return False + def premium_check(self, premium): + """ + check if premium status exist with premium account + + :param premium: premium account or not + :type: bool + + :return: true if join premium button don't exist when premium is true and exist when premium is false + :type: bool + """ + if (premium is True and self.find_element_by_link_text(self.join_premium_btn) is None) or ( + premium is False and self.find_element_by_link_text(self.join_premium_btn) is not None): + return True + else: + return False + def is_correct_age(self, age): """ Checks if age is same as age given @@ -310,7 +319,7 @@ def is_page_initialized(self): """ return self.get_account_overview_email() is not None - def account_overview_check(self, email, age, username): + def account_overview_check(self, email, age, username, premium): """ Checks if information on Account Overview page is correct @@ -323,6 +332,9 @@ def account_overview_check(self, email, age, username): :param username : The username of the login user :type username: str + :param premium : premium account or not + :type premium: bool + :returns: a boolean True if the information in account overview page is correct :rtype: bool @@ -333,7 +345,8 @@ def account_overview_check(self, email, age, username): # if open account overview page successfully if self.is_page_initialized(): # if all information is correct - if self.is_correct_email(email) and self.is_correct_age(age) and self.is_correct_username(username): + if self.is_correct_email(email) and self.is_correct_age(age) and self.is_correct_username( + username) and self.premium_check(premium): return True # if all or some information is wrong else: @@ -342,10 +355,12 @@ def account_overview_check(self, email, age, username): print("wrong email") # if age is not the same as given age if not self.is_correct_age(age): - print("wrong age "+age+" account "+self.age) + print("wrong age " + age + " account " + self.age) # if username is not the same as given username if not self.is_correct_username(username): print("wrong username") + if not self.premium_check(premium): + print("premium isn't right") return False # if can't open account overview page else: diff --git a/Web_Testing/Pages/ChangePasswordPage.py b/Web_Testing/Pages/ChangePasswordPage.py index c358dce..ae6f618 100644 --- a/Web_Testing/Pages/ChangePasswordPage.py +++ b/Web_Testing/Pages/ChangePasswordPage.py @@ -52,6 +52,3 @@ def change_password(self, new_password, confirm_password) -> bool: dangers_visible = self.is_dangers_visible() return not dangers_visible - - - diff --git a/Web_Testing/Pages/EditProfilePage.py b/Web_Testing/Pages/EditProfilePage.py index cc5a990..2cf82ca 100644 --- a/Web_Testing/Pages/EditProfilePage.py +++ b/Web_Testing/Pages/EditProfilePage.py @@ -10,8 +10,10 @@ def __init__(self, driver): self.email_text = self.find_element_by_id("email") self.username_text = self.find_element_by_id("ID") self.age_text = self.find_element_by_id("age") - self.cancel_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[2]/div[2]/div/div[2]/div/form/div[4]/div[1]/button/a") - self.save_changes_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[2]/div[2]/div/div[2]/div/form/div[4]/div[2]/button") + self.cancel_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[2]/div[2]/div/div[2]/div/form/div[4]/div[1]/button/a") + self.save_changes_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[2]/div[2]/div/div[2]/div/form/div[4]/div[2]/button") def clear_all(self): self.clear_txt_safe(self.email_text) @@ -24,5 +26,3 @@ def edit_profile(self, username: str, email: str, age: int): self.fill(self.age_text, str(age)) self.save_changes_btn.click() - - diff --git a/Web_Testing/Pages/LikedSongs.py b/Web_Testing/Pages/LikedSongs.py new file mode 100644 index 0000000..b6c6ade --- /dev/null +++ b/Web_Testing/Pages/LikedSongs.py @@ -0,0 +1,137 @@ +import time + +from Web_Testing.Pages.WebPlayerMenu import WebPlayerMenu +from collections import defaultdict + + +class LikedSongs(WebPlayerMenu): + """ + A class representing the Web Player's Liked songs + ... + + Attributes + ---------- + profile_btn : string + A string containing the xpath of profile button + logout_btn : string + A string containing the xpath of log out button + account_btn : string + A string containing the link text of account button + upgrade_btn : string + A string containing the link text of upgrade button + playlist_cards : string + A string containing the class name of playlist cards + no_of_songs_xpath : string + A string containing the xpath of number of song in the playlist + playlist_name_class_name : string + A string containing the class name of playlist's name in the playlist page + songs_container : string + A string containing the class name of songs in the playlist + no_of_songs : integer + An integer containing the number of songs displayed in the playlist page + playlist_name_card : string + A sting containing the name of the play list from the playlist card + page_left_btn : WebDriverElement + a Web driver element representing the Page left button + page_right_btn : WebDriverElement + a Web driver element representing the Page right button + + Methods + ------- + click_liked_songs() + Clicks the Liked Songs Play button in the card + click_liked_songs_txt() + Clicks the Liked Songs Text button in the card + check_liked_songs_click() + Checks if clicking the Liked Songs card goes to the right page + check_card_click(card_no, report_allure) + Checks if clicking a playlist card goes to the right page + + """ + + profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li/li/div[1]/button" + logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li/li/div[2]/button[3]/button" + account_btn = "Account" + upgrade_btn = "UPGRADE" + no_of_songs_xpath = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[2]/div[2]/div/p" + songs_container = "TrackListContainer" + no_of_songs = 0 + page_left_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a" + page_right_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[2]/button/a" + + def __init__(self, driver): + """ + Initializes the page elements + + :param driver : the driver to which the super class' driver is to be set + :type driver: WebDriver + """ + super().__init__(driver) + + def click_profile(self): + """Clicks Profile button""" + self.click_button_safe(self.find_element_by_xpath(self.profile_btn)) + + def click_account(self): + """Clicks Account button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_link_text(self.account_btn)) + + def click_logout_button(self): + """Clicks Logout button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_xpath(self.logout_btn)) + + def check_upgrade(self, premium): + """ + check the upgrade button existence with the type of the account + + :param premium: boolean to show if this account is premium or not + :type: bool + + :return: true if join premium button don't exist when premium is true and exist when premium is false + :type: bool + """ + if (premium is True and self.find_element_by_link_text(self.upgrade_btn) is None) or ( + premium is False and self.find_element_by_link_text(self.upgrade_btn) is not None): + return True + else: + return False + + def click_upgrade(self): + """Clicks upgrade button""" + self.click_button_safe(self.find_element_by_link_text(self.upgrade_btn)) + + def click_webplayer(self): + self.click_button_safe(self.find_element_by_link_text("Web Player")) + + def click_page_left(self): + """Clicks page left button""" + self.click_button_safe(self.find_element_by_xpath(self.page_left_btn)) + + def click_page_right(self): + """Clicks page right button""" + self.click_button_safe(self.find_element_by_xpath(self.page_right_btn)) + + def check_liked_songs(self): + """ + Checks if clicking a playlist card goes to the right playlist + + :param card_no: the playlist's card number + :type card_no: int + + :param report_allure: a boolean that represents whether or not to report the result to allure + :type report_allure: bool + + :returns: a boolean True if clicking the Playlist card goes to the right playlist, False otherwise + :rtype: bool + """ + no_of_songs_txt = self.find_element_by_xpath(self.no_of_songs_xpath).text.split(" ")[0] + print(no_of_songs_txt) + print("\n") + self.no_of_songs = len(self.find_elements_by_class_name(self.songs_container)) - 3 + print(str(self.no_of_songs)) + if no_of_songs_txt != str(self.no_of_songs): + return False + else: + return True diff --git a/Web_Testing/Pages/LoggedOutHome.py b/Web_Testing/Pages/LoggedOutHome.py index ddec852..8cac0d4 100644 --- a/Web_Testing/Pages/LoggedOutHome.py +++ b/Web_Testing/Pages/LoggedOutHome.py @@ -1,4 +1,3 @@ - from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.common.keys import Keys @@ -39,7 +38,10 @@ 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): """ Initializes the page elements @@ -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") @@ -71,3 +74,9 @@ 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) diff --git a/Web_Testing/Pages/LoginPage.py b/Web_Testing/Pages/LoginPage.py index a3c4eef..8ba09d7 100644 --- a/Web_Testing/Pages/LoginPage.py +++ b/Web_Testing/Pages/LoginPage.py @@ -1,4 +1,3 @@ - from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.common.keys import Keys @@ -131,10 +130,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): """ @@ -176,8 +176,8 @@ def login_to_spotify(self, email, password): # timeout for login timeout = 4 try: - self.clear_credentials() # clear email and password fields - self.set_credentials(email, password) # set email and password fields + self.clear_credentials() # clear email and password fields + self.set_credentials(email, password) # set email and password fields self.click_login() time.sleep(timeout) @@ -217,4 +217,3 @@ def login_to_spotify(self, email, password): # any other error that cause test to fail except: return False - diff --git a/Web_Testing/Pages/SignupPage.py b/Web_Testing/Pages/SignupPage.py index 55aea7c..183885a 100644 --- a/Web_Testing/Pages/SignupPage.py +++ b/Web_Testing/Pages/SignupPage.py @@ -1,4 +1,3 @@ - from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, TimeoutException from selenium.webdriver.common.keys import Keys @@ -11,7 +10,6 @@ class SignupPage(WebHelper): - """ A class used to represent the Login Page @@ -91,6 +89,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") @@ -240,7 +239,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 @@ -319,8 +319,9 @@ def signup_to_spotify(self, profile): print("Could not find Account overview elements") # Account overview email is not the same as the provided login email but logged in successfully elif account_overview_email != profile.email: - print("INTERNAL ERROR: Account overview email is not matching the signup/login email: Login email = " - + profile.email + ", Overview email = " + account_overview_email) + print( + "INTERNAL ERROR: Account overview email is not matching the signup/login email: Login email = " + + profile.email + ", Overview email = " + account_overview_email) else: print("SUCCESS: Account overview email is the same as the provided login email") diff --git a/Web_Testing/Pages/WebPlayerHome.py b/Web_Testing/Pages/WebPlayerHome.py index eda7c63..acda1a8 100644 --- a/Web_Testing/Pages/WebPlayerHome.py +++ b/Web_Testing/Pages/WebPlayerHome.py @@ -2,8 +2,8 @@ from Web_Testing.helperClasses import WebHelper import time -class WebPlayerHome(WebPlayerMenu): +class WebPlayerHome(WebPlayerMenu): """ A class used to represent the Web Player Home ... @@ -83,7 +83,6 @@ def __init__(self, driver): self.all_headers = self.find_elements_by_class_name("HeaderAboveGrid") self.header_names_to_cards = self.map_headers_to_cards(self.all_headers, self.all_cards) - def is_in_your_library(self) -> bool: """ Checks if currently in Your Library Page @@ -204,13 +203,15 @@ def check_card_click(self, category_name, card_no, report_allure: bool): card_text = splitted_card_text[0] + " " + splitted_card_text[1] card.click() time.sleep(4) - playlist_info_name = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[1]/div/div[2]/div/div[1]/span") + playlist_info_name = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[1]/div/div[2]/div/div[1]/span") if playlist_info_name is None: return False if playlist_info_name.text != card_text and report_allure: - self.report_allure("ERROR: Playlist name is not the same as the card name. Card name = " + card_text + ", Playlist name = " + playlist_info_name.text) + self.report_allure( + "ERROR: Playlist name is not the same as the card name. Card name = " + card_text + ", Playlist name = " + playlist_info_name.text) return self.url_has("webplayer/nowplay") @@ -231,15 +232,12 @@ def click_login(self): """ Clicks the login button """ - (self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li[2]/button")).click() + (self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li[2]/button")).click() def click_signup(self): """ Clicks the signup button """ - (self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li[1]/button")).click() - - - - - + (self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li[1]/button")).click() diff --git a/Web_Testing/Pages/WebPlayerLibrary.py b/Web_Testing/Pages/WebPlayerLibrary.py index 38f3e83..982652b 100644 --- a/Web_Testing/Pages/WebPlayerLibrary.py +++ b/Web_Testing/Pages/WebPlayerLibrary.py @@ -5,7 +5,6 @@ class WebPlayerLibrary(WebPlayerMenu): - """ A class representing the Web Player's Your Library Page ... @@ -51,14 +50,20 @@ def __init__(self, driver): """ super().__init__(driver) self.create_new_playlist_button = self.find_element_by_xpath("//button[text()='Create new playlist']") - self.profile_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/button/a") - self.logout_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/div/button[2]/button") - self.account_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/div/button[1]/a") + self.profile_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/button/a") + self.logout_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/div/button[2]/button") + self.account_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div/div/div[1]/div[2]/div[2]/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/ul/li/li/div/button[1]/a") self.liked_songs = self.find_element_by_class_name("LikedSongs") self.library_cards = self.find_elements_by_class_name("CardsLibrary") - self.page_left_btn = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a") - self.page_right_btn = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[2]/button/a") -# TrackListHeader Body + self.page_left_btn = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a") + self.page_right_btn = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[2]/button/a") + + # TrackListHeader Body def click_liked_songs(self): """ @@ -66,7 +71,8 @@ def click_liked_songs(self): """ self.hover_to_element(self.liked_songs) time.sleep(2) - liked_songs_btn = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[2]/div/div/button") + liked_songs_btn = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[2]/div/div/button") if liked_songs_btn is not None: liked_songs_btn.click() @@ -74,7 +80,8 @@ def click_liked_songs_txt(self): """ Clicks the Liked Songs Text button in the card """ - liked_btn_txt = self.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[1]/div[2]/div[1]/div/a/span") + liked_btn_txt = self.find_element_by_xpath( + "/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[1]/div[2]/div[1]/div/a/span") if liked_btn_txt is None: return @@ -87,7 +94,8 @@ def check_liked_songs_click(self): :returns: a boolean True if clicking the Liked Songs card goes to the right page, False otherwise :rtype: bool """ - songs_text_before = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[1]/div[2]/div[2]/div/div") + songs_text_before = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div[1]/div[2]/div[2]/div/div") no_of_songs_before = "0" if songs_text_before is not None: songs_arr_before = songs_text_before.text.split(" ") @@ -97,7 +105,8 @@ def check_liked_songs_click(self): self.driver.get(self.base_url + "webplayer/likedplay") time.sleep(4) no_of_songs = 0 - songs_text = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[2]/div[2]/div/p") + songs_text = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[2]/div[2]/div/p") if songs_text is not None: songs_text_arr = songs_text.text.split(" ") no_of_songs = songs_text_arr[0] @@ -133,16 +142,14 @@ def check_card_click(self, card_no, report_allure: bool): card_text = splitted_card_text[0] + " " + splitted_card_text[1] card.click() time.sleep(4) - playlist_info_name = self.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[1]/div/div[2]/div/div[1]/span") + playlist_info_name = self.find_element_by_xpath( + "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[1]/div/div[2]/div/div[1]/span") if playlist_info_name is None: return False if playlist_info_name.text != card_text and report_allure: - self.report_allure("ERROR: Playlist name is not the same as the card name. Card name = " + card_text + ", Playlist name = " + playlist_info_name.text) + self.report_allure( + "ERROR: Playlist name is not the same as the card name. Card name = " + card_text + ", Playlist name = " + playlist_info_name.text) return self.url_has("webplayer/nowplay") - - - - diff --git a/Web_Testing/Pages/WebPlayerMenu.py b/Web_Testing/Pages/WebPlayerMenu.py index 129ed51..f630552 100644 --- a/Web_Testing/Pages/WebPlayerMenu.py +++ b/Web_Testing/Pages/WebPlayerMenu.py @@ -6,7 +6,6 @@ class WebPlayerMenu(WebHelper): - """ A class used to represent the Web Player Menu ... @@ -86,7 +85,8 @@ def click_logout(self): Clicks Logout button in profile list """ self.find_element_by_xpath(self.profile_menu_xpath).click() - logout_btn_element = WebDriverWait(self.driver, 30).until(EC.element_to_be_clickable((By.XPATH, self.logout_btn_xpath))) + logout_btn_element = WebDriverWait(self.driver, 30).until( + EC.element_to_be_clickable((By.XPATH, self.logout_btn_xpath))) logout_btn_element.click() def click_your_library(self): @@ -127,5 +127,3 @@ def click_home(self): Clicks Home button in web player menu """ self.find_element_by_xpath(self.home_xpath).click() - - diff --git a/Web_Testing/Pages/WebPlayerPlaylist.py b/Web_Testing/Pages/WebPlayerPlaylist.py new file mode 100644 index 0000000..c906194 --- /dev/null +++ b/Web_Testing/Pages/WebPlayerPlaylist.py @@ -0,0 +1,177 @@ +import time + +from Web_Testing.Pages.WebPlayerMenu import WebPlayerMenu +from collections import defaultdict + + +class WebPlayerPlaylist(WebPlayerMenu): + """ + A class representing the Web Player's playlist + ... + + Attributes + ---------- + profile_btn : string + A string containing the xpath of profile button + logout_btn : string + A string containing the xpath of log out button + account_btn : string + A string containing the link text of account button + upgrade_btn : string + A string containing the link text of upgrade button + playlist_cards : string + A string containing the class name of playlist cards + no_of_songs_xpath : string + A string containing the xpath of number of song in the playlist + playlist_name_class_name : string + A string containing the class name of playlist's name in the playlist page + songs_container : string + A string containing the class name of songs in the playlist + no_of_songs : integer + An integer containing the number of songs displayed in the playlist page + playlist_name_card : string + A sting containing the name of the play list from the playlist card + page_left_btn : WebDriverElement + a Web driver element representing the Page left button + page_right_btn : WebDriverElement + a Web driver element representing the Page right button + + Methods + ------- + click_liked_songs() + Clicks the Liked Songs Play button in the card + click_liked_songs_txt() + Clicks the Liked Songs Text button in the card + check_liked_songs_click() + Checks if clicking the Liked Songs card goes to the right page + check_card_click(card_no, report_allure) + Checks if clicking a playlist card goes to the right page + + """ + + profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li[2]/li/div[1]/button" + logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li[2]/li/div[2]/button[3]/button" + account_btn = "Account" + playlist_cards = "CardsLibrary" + upgrade_btn = "UPGRADE" + no_of_songs_xpath = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[2]/div[2]/div/p" + playlist_name_class_name = "TrackListHeader mo info Name" + songs_container = "TrackListContainer" + no_of_songs = 0 + playlist_name_card = "cardTitle row" + page_left_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a" + page_right_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[2]/button/a" + + def __init__(self, driver): + """ + Initializes the page elements + + :param driver : the driver to which the super class' driver is to be set + :type driver: WebDriver + """ + super().__init__(driver) + self.library_cards = self.find_elements_by_class_name("CardsLibrary") + + def click_profile(self): + """Clicks Profile button""" + self.click_button_safe(self.find_element_by_xpath(self.profile_btn)) + + def click_account(self): + """Clicks Account button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_link_text(self.account_btn)) + + def click_logout_button(self): + """Clicks Logout button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_xpath(self.logout_btn)) + + def check_upgrade(self, premium): + """ + check the upgrade button existence with the type of the account + + :param premium: boolean to show if this account is premium or not + :type: bool + + :return: true if join premium button don't exist when premium is true and exist when premium is false + :type: bool + """ + if (premium is True and self.find_element_by_link_text(self.upgrade_btn) is None) or ( + premium is False and self.find_element_by_link_text(self.upgrade_btn) is not None): + return True + else: + return False + + def click_upgrade(self): + """Clicks upgrade button""" + self.click_button_safe(self.find_element_by_link_text(self.upgrade_btn)) + + def click_webplayer(self): + self.click_button_safe(self.find_element_by_link_text("Web Player")) + + def click_page_left(self): + """Clicks page left button""" + self.click_button_safe(self.find_element_by_xpath(self.page_left_btn)) + + def click_page_right(self): + """Clicks page right button""" + self.click_button_safe(self.find_element_by_xpath(self.page_right_btn)) + + def click_playlist_play_btn(self, card_no: int = 0): + """ + Clicks the playlist Play button in the card + :param card_no: the card number of the playlist + :type card_no: int + """ + card = None + try: + card = self.library_cards[card_no] + except: + return + if card is None: + card.click() + + def check_playlist(self, card_no, report_allure: bool): + """ + Checks if clicking a playlist card goes to the right playlist + + :param card_no: the playlist's card number + :type card_no: int + + :param report_allure: a boolean that represents whether or not to report the result to allure + :type report_allure: bool + + :returns: a boolean True if clicking the Playlist card goes to the right playlist, False otherwise + :rtype: bool + """ + card = None + try: + card = self.library_cards[card_no] + except: + if report_allure: + self.report_allure("ERROR: This card number is not available", self.driver) + return False + splitted_card_text = card.text.split(" ") + print(splitted_card_text) + card_text = splitted_card_text[0] + " " + splitted_card_text[1] + card.click() + time.sleep(4) + no_of_songs_txt_arr = self.find_element_by_xpath(self.no_of_songs_xpath).text.split(" ") + no_of_songs_txt = no_of_songs_txt_arr[0] + songs_container_arr = self.find_elements_by_class_name(self.songs_container) + songs_container_text_arr = list() + for item in songs_container_arr: + songs_container_text_arr.append(item.text) + + songs_container_text_arr = list(dict.fromkeys(songs_container_text_arr)) + self.no_of_songs = len(songs_container_text_arr) + print(songs_container_arr[0].text) + # print(songs_container_arr[1].text) + print(self.no_of_songs) + print(no_of_songs_txt) + print() + print(songs_container_text_arr) + if no_of_songs_txt != str(self.no_of_songs): + return False + else: + return True diff --git a/Web_Testing/Pages/artist.py b/Web_Testing/Pages/artist.py new file mode 100644 index 0000000..73ba5c5 --- /dev/null +++ b/Web_Testing/Pages/artist.py @@ -0,0 +1,128 @@ +import time + +from Web_Testing.Pages.WebPlayerMenu import WebPlayerMenu +from collections import defaultdict + + +class Artist(WebPlayerMenu): + """ + A class representing the Web Player's playlist + ... + + Attributes + ---------- + profile_btn : string + A string containing the xpath of profile button + logout_btn : string + A string containing the xpath of log out button + account_btn : string + A string containing the link text of account button + follow_btn : string + A string containing follow button + artist_name : string + A string containing the class name of artist name in the artist page + artist_name_about : string + A string containing the class name of artist name in the about page + about : string + A string containing the xpath of about button + playlist_name_card : string + A sting containing the name of the play list from the playlist card + page_left_btn : WebDriverElement + a Web driver element representing the Page left button + page_right_btn : WebDriverElement + a Web driver element representing the Page right button + + """ + + profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li[2]/li/div[1]/button" + logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div/div/nav/ul[2]/li[2]/li/div[2]/button[3]/button" + account_btn = "Account" + follow_btn = "//*[@id='followButton']" + about = "/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div[3]/button[3]" + page_left_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a" + page_right_btn = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[2]/button/a" + artist_name = "Header1" + artist_name_about = "//*[@id='bio-body']" + artist_link = "Artists" + artist_image = "//*[@id='root']/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[2]/div/div/div/div/div/div[2]/div/div/button/a/div/div[1]/div/div/div/div/img" + + def __init__(self, driver): + """ + Initializes the page elements + + :param driver : the driver to which the super class' driver is to be set + :type driver: WebDriver + """ + super().__init__(driver) + + def click_artist(self): + """Clicks artist button""" + self.click_button_safe(self.find_element_by_link_text(self.artist_link)) + + def click_profile(self): + """Clicks Profile button""" + self.click_button_safe(self.find_element_by_xpath(self.profile_btn)) + + def click_account(self): + """Clicks Account button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_link_text(self.account_btn)) + + def click_logout_button(self): + """Clicks Logout button in profile list""" + self.click_profile() + self.click_button_safe(self.find_element_by_xpath(self.logout_btn)) + + def click_related_artist(self): + self.click_button_safe(self.find_element_by_xpath(self.related_artist)) + + def check_follow(self): + """ + check clicking follow button + + :return: true if follow button change to unfollow + :type: bool + """ + + self.click_button_safe(self.find_element_by_xpath(self.artist_image)) + time.sleep(6) + self.click_follow() + time.sleep(3) + print(self.find_element_by_xpath(self.follow_btn).text) + if self.find_element_by_xpath(self.follow_btn).text == "UNFOLLOW": + return True + else: + return False + + def click_follow(self): + """Clicks follow button""" + self.click_button_safe(self.find_element_by_xpath(self.follow_btn)) + + def click_webplayer(self): + self.click_button_safe(self.find_element_by_link_text("Web Player")) + + def click_page_left(self): + """Clicks page left button""" + self.click_button_safe(self.find_element_by_xpath(self.page_left_btn)) + + def click_page_right(self): + """Clicks page right button""" + self.click_button_safe(self.find_element_by_xpath(self.page_right_btn)) + + def click_about(self): + self.click_button_safe(self.find_element_by_xpath(self.about)) + + def check_about(self): + self.click_button_safe(self.find_element_by_xpath(self.artist_image)) + time.sleep(6) + self.click_about() + time.sleep(6) + about_split = self.find_element_by_xpath(self.artist_name_about).text.split(" ") + name = about_split[0] + " " + about_split[1] + print(name) + print("\n") + print(self.find_element_by_class_name(self.artist_name).text) + if self.find_element_by_class_name(self.artist_name).text == name: + return True + else: + return False diff --git a/Web_Testing/Pages/premium.py b/Web_Testing/Pages/premium.py index 781de0c..381609c 100644 --- a/Web_Testing/Pages/premium.py +++ b/Web_Testing/Pages/premium.py @@ -1,6 +1,9 @@ import time from Web_Testing.helperClasses import WebHelper +from Web_Testing.Pages import AccountOverviewPage + + class PremiumPage(WebHelper): """ A class used to represent Premium Page @@ -21,15 +24,27 @@ class PremiumPage(WebHelper): A string containing the link text of Download link help_link_txt : string A string containing the link text of Help link - home_link_txt : string + premium_link_txt : string A string containing the link text of Premium link get_premium_btn_1 : string A string containing the xpath of Get Premium button get_premium_btn_2 : string A string containing the xpath of Get Premium button + claim_btn : string + A string containing the xpath of Claim button in pop up window + claim_btn : string + A string containing the xpath of Cancel Premium button in pop up window Methods ------- + check_claim_btn_visible() + check visibility of claim button + check_cancel_premium_btn_visible() + check visibility of cancel premium button + click_claim() + Clicks Claim button + click_cancel_premium() + Clicks Cancel Premium button click_spotify_logo() Clicks logo of spotify click_profile() @@ -42,8 +57,8 @@ class PremiumPage(WebHelper): Clicks Download button click_help_link() Clicks Help button - click_home_link() - Clicks Home button + click_premium_link() + Clicks Premium button click_get_premium_btn_1() Clicks Get Premium top button click_get_premium_btn_2() @@ -56,9 +71,11 @@ class PremiumPage(WebHelper): profile_btn = "//*[@id='root']/div/div/div/div[1]/div/nav/div/ul/li[8]/li/a" download_link_txt = "Download" help_link_txt = "Help" - home_link_txt = "Home" + premium_link_txt = "Premium" get_premium_button_1 = "//*[@id='root']/div/div/div/div[2]/p/button" get_premium_button_2 = "//*[@id='root']/div/div/div/div[3]/p/button" + claim_btn = "/html/body/div[2]/div/div[1]/div/div/div/div[3]/button[1]" + cancel_premium_btn = "/html/body/div[2]/div/div[1]/div/div/div/div[3]/button[2]" def __init__(self, driver): """ @@ -69,6 +86,40 @@ def __init__(self, driver): """ self.set_driver(driver) + def check_claim_btn_visible(self): + """ + check visibility of claim button + + :return:True if claim button is visible + :type: bool + """ + if self.find_element_by_xpath(self.claim_btn).isDisplayed(): + return True + else: + return False + + def check_cancel_premium_btn_visible(self): + """ + check visibility of cancel premium button + + :return:True if cancel premium button is visible + :type: bool + """ + if self.find_element_by_xpath(self.cancel_premium_btn).isDisplayed(): + return True + else: + return False + + def click_claim(self, alert): + """Clicks Claim button""" + if self.check_claim_premium(): + alert.click_button_safe(alert.find_element_by_xpath(self.claim_btn)) + + def click_cancel_premium(self): + """Clicks Cancel Premium button""" + if self.check_cancel_premium_btn_visible(): + self.click_button_safe(self.find_element_by_xpath(self.cancel_premium_btn)) + def click_spotify_logo(self): """Clicks Spotify logo""" self.click_button_safe(self.find_element_by_xpath(self.spotify_logo)) @@ -95,9 +146,9 @@ def click_help_link(self): """Clicks Help button""" self.click_button_safe(self.find_element_by_link_text(self.help_link_txt)) - def click_home_link(self): + def click_premium_link(self): """Clicks Home button""" - self.click_button_safe(self.find_element_by_link_text(self.home_link_txt)) + self.click_button_safe(self.find_element_by_link_text(self.premium_link_txt)) def click_get_premium_button_1(self): """Clicks Get Premium top button """ @@ -107,4 +158,17 @@ def click_get_premium_button_2(self): """Clicks Get Premium second button""" self.click_button_safe(self.find_element_by_xpath(self.get_premium_button_2)) - + def check_claim_premium(self): + try: + self.click_get_premium_button_1() + alert = self.driver.switch_to.alert + self.check_claim_premium(alert) + time.sleep(4) + acc = AccountOverviewPage(self.driver) + self.driver.get(WebHelper().get_account_overview_url()) + if acc.premium_check(True): + return True + else: + return False + except: + exit('Testing failed to make claim premium') diff --git a/Web_Testing/Tests/test_accountoverview.py b/Web_Testing/Tests/test_accountoverview.py index 3a7047f..42713e9 100644 --- a/Web_Testing/Tests/test_accountoverview.py +++ b/Web_Testing/Tests/test_accountoverview.py @@ -25,7 +25,7 @@ @allure.severity(allure.severity_level.CRITICAL) class TestAccountOverview: # TODO: change Firefox executable path to your needs - driver = WebHelper().chrome_driver_init() + driver = WebHelper().firefox_driver_init() account_overview_page = AccountOverviewPage(driver) def login_first(self): @@ -79,7 +79,8 @@ def test_case_1(self, setup_check_information): self.driver.implicitly_wait(3) if self.account_overview_page.account_overview_check("test9@test.com", ConstantsClass().calculate_age("test9@test.com"), - ConstantsClass().get_name("test9@test.com")): + ConstantsClass().get_name("test9@test.com"), + ConstantsClass().get_premium("test9@test.com")): WebHelper().report_allure("SUCCESS: All information is correct", self.driver) assert True else: @@ -161,30 +162,12 @@ def test_case_5(self, setup): # Test #6 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") - @allure.sub_suite("Clicking get premium link") - @allure.title("Clicking get premium button") - @allure.description("Clicking get premium button") - @pytest.mark.Do - @pytest.mark.AccountOverview - def test_case_6(self, setup): - self.account_overview_page.click_get_premium_btn() - self.driver.implicitly_wait(3) - if self.driver.current_url == WebHelper().get_premium_url(): - WebHelper().report_allure("Get premium button functional", self.driver) - assert True - else: - WebHelper().report_allure("Get premium link not functional", self.driver) - assert False - - # Test #7 ->Checking that all buttons and links work - @allure.severity(allure.severity_level.BLOCKER) - @allure.story("Account Overview tests") @allure.sub_suite("Clicking account overview link") @allure.title("Clicking account overview link") @allure.description("Clicking account overview link") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_7(self, setup): + def test_case_6(self, setup): self.account_overview_page.click_account_overview() self.driver.implicitly_wait(3) if self.driver.current_url == WebHelper().get_account_overview_url(): @@ -194,7 +177,7 @@ def test_case_7(self, setup): WebHelper().report_allure("Account Overview link not functional", self.driver) assert False - # Test #8 ->Checking that all buttons and links work + # Test #7 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking edit profile link") @@ -202,7 +185,7 @@ def test_case_7(self, setup): @allure.description("Clicking edit profile link") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_8(self, setup): + def test_case_7(self, setup): self.account_overview_page.click_edit_profile() self.driver.implicitly_wait(3) if self.driver.current_url == WebHelper().get_account_edit_url(): @@ -212,7 +195,7 @@ def test_case_8(self, setup): WebHelper().report_allure("Edit Profile link not functional", self.driver) assert False - # Test #9 ->Checking that all buttons and links work + # Test #8 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking change password link") @@ -220,7 +203,7 @@ def test_case_8(self, setup): @allure.description("Clicking change password link") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_9(self, setup): + def test_case_8(self, setup): self.account_overview_page.click_change_password() self.driver.implicitly_wait(3) if self.driver.current_url == WebHelper().get_account_changepassword_url(): @@ -230,7 +213,7 @@ def test_case_9(self, setup): WebHelper().report_allure("Change Password link not functional", self.driver) assert False - # Test #10 ->Checking that all buttons and links work + # Test #9 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking recover playlists link") @@ -238,17 +221,17 @@ def test_case_9(self, setup): @allure.description("Clicking recover playlists link") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_10(self, setup): + def test_case_9(self, setup): self.account_overview_page.click_recover_playlists() self.driver.implicitly_wait(3) - if self.driver.current_url == "http://localhost:3000": + if self.driver.current_url == WebHelper().get_account_overview_url(): WebHelper().report_allure("Recover Playlists link functional", self.driver) assert True else: WebHelper().report_allure("Recover Playlists link not functional", self.driver) assert False - # Test #11 ->Checking that all buttons and links work + # Test #10 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking redeem link") @@ -256,17 +239,17 @@ def test_case_10(self, setup): @allure.description("Clicking redeem link") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_11(self, setup): + def test_case_10(self, setup): self.account_overview_page.click_redeem_link() self.driver.implicitly_wait(3) - if self.driver.current_url == "http://localhost:3000": + if self.driver.current_url == WebHelper().get_account_overview_url(): WebHelper().report_allure("Redeem link functional", self.driver) assert True else: WebHelper().report_allure("Redeem link not functional", self.driver) assert False - # Test #12 ->Checking that all buttons and links work + # Test #11 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking join premium button") @@ -274,17 +257,21 @@ def test_case_11(self, setup): @allure.description("Clicking join premium button") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_12(self, setup): - self.account_overview_page.click_join_premium_btn() - self.driver.implicitly_wait(3) - if self.driver.current_url == WebHelper().get_premium_url(): - WebHelper().report_allure("join premium button functional", self.driver) + def test_case_11(self, setup): + if ConstantsClass().get_premium("test9@test.com") is False: + self.account_overview_page.click_join_premium_btn() + self.driver.implicitly_wait(3) + if self.driver.current_url == WebHelper().get_premium_url(): + WebHelper().report_allure("join premium button functional", self.driver) + assert True + else: + WebHelper().report_allure("join premium button not functional", self.driver) + assert False + elif ConstantsClass().get_premium("test9@test.com") is True: + WebHelper().report_allure("join premium doesn't exist as account is already premium", self.driver) assert True - else: - WebHelper().report_allure("join premium button not functional", self.driver) - assert False - # Test #13 ->Checking that all buttons and links work + # Test #12 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking edit profile button") @@ -292,7 +279,7 @@ def test_case_12(self, setup): @allure.description("Clicking edit profile button") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_13(self, setup): + def test_case_12(self, setup): self.account_overview_page.click_edit_profile_btn() self.driver.implicitly_wait(3) if self.driver.current_url == WebHelper().get_account_edit_url(): @@ -302,7 +289,7 @@ def test_case_13(self, setup): WebHelper().report_allure("edit profile button not functional", self.driver) assert False - # Test #14 ->Checking that all buttons and links work + # Test #13 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview Tests") @allure.sub_suite("Clicking logout link") @@ -310,17 +297,17 @@ def test_case_13(self, setup): @allure.description("Clicking logout link") @pytest.mark.Do @pytest.mark.AccounOverview - def test_case_14(self, setup): + def test_case_13(self, setup): self.account_overview_page.click_logout() self.driver.implicitly_wait(3) - if self.driver.current_url == WebHelper().get_login_url(): + if self.driver.current_url == WebHelper().get_signup_url(): WebHelper().report_allure("Logout link functional", self.driver) assert True else: WebHelper().report_allure("Logout link not functional", self.driver) assert False - # Test #15 ->Checking that all buttons and links work + # Test #14 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Account Overview tests") @allure.sub_suite("Clicking sign out button") @@ -328,10 +315,10 @@ def test_case_14(self, setup): @allure.description("Clicking sign out button") @pytest.mark.Do @pytest.mark.AccountOverview - def test_case_15(self, setup_final): + def test_case_14(self, setup_final): self.account_overview_page.click_signout_btn() self.driver.implicitly_wait(3) - if self.driver.current_url == "http://localhost:3000/signup": + if self.driver.current_url == WebHelper().get_login_url(): WebHelper().report_allure("sign out button functional", self.driver) assert True else: diff --git a/Web_Testing/Tests/test_artist.py b/Web_Testing/Tests/test_artist.py new file mode 100644 index 0000000..73db0da --- /dev/null +++ b/Web_Testing/Tests/test_artist.py @@ -0,0 +1,117 @@ +""" +Premium page Testing + +This script tests the premium page buttons and report the results to allure + +This script requires `allure` and `pytest` be installed within the Python environment you are running this script in +""" +import time + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys +from webdriver_manager.firefox import GeckoDriverManager +from allure_commons.types import AttachmentType +import allure +import pytest + +from Web_Testing.helperClasses import WebHelper, ConstantsClass + +from Web_Testing.Pages.LoginPage import LoginPage + +from Web_Testing.Pages.WebPlayerPlaylist import WebPlayerPlaylist + +from Web_Testing.Pages.WebPlayerHome import WebPlayerHome + +from Web_Testing.Pages.artist import Artist + + +@allure.parent_suite("End to End testing") +@allure.suite("Playlist page test") +@allure.feature("Playlist page test") +@allure.severity(allure.severity_level.CRITICAL) +class TestPlaylist: + # TODO: change Firefox executable path to your needs + driver = WebHelper().firefox_driver_init() + helper = WebHelper() + helper.set_driver(driver) + artist = Artist(driver) + + def login_first(self): + lp = LoginPage(self.driver) + lp.set_credentials("abdallah@gmail.com", ConstantsClass().get_pass("abdallah@gmail.com")) + lp.click_login() + self.driver.implicitly_wait(3) + self.playlist.click_webplayer() + self.driver.implicitly_wait(3) + + @pytest.yield_fixture + def setup_initial(self): + self.driver.get(self.helper.get_login_url()) + self.driver.maximize_window() + yield + self.driver.refresh() + + @pytest.yield_fixture + def setup(self): + self.driver.get(self.helper.base_url + "webplayer/librarypage") + self.driver.maximize_window() + yield + # self.driver.close() + + @pytest.yield_fixture + def setup_final(self): + self.driver.get(self.helper.base_url + "webplayer/librarypage") + self.driver.maximize_window() + yield + self.driver.close() + + # Test #1 -> Play Button + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Testing Play Button") + @allure.title("Playlist Play Button") + @allure.description("Testing Playlist Play Button") + @pytest.mark.Do + @pytest.mark.YourLibrary + def test_case_1(self, setup_initial): + time.sleep(3) + lp = LoginPage(self.driver) + lp.login_to_spotify("abdallah@gmail.com", "123456") + time.sleep(3) + self.driver.get(self.helper.base_url + "webplayer/home") + time.sleep(3) + web_player_home = WebPlayerHome(self.driver) + web_player_home.click_your_library() + self.artist.click_artist() + time.sleep(5) + if self.artist.check_about(): + self.helper.report_allure("SUCCESS: Artist Bio is right") + assert True + else: + self.helper.report_allure("FAILURE: Artist Bio is wrong") + assert False + + # Test #2 -> Play Button + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Testing follow Button") + @allure.title("artist follow Button") + @allure.description("Testing artist follow Button") + @pytest.mark.Do + @pytest.mark.YourLibrary + def test_case_2(self, setup_final): + time.sleep(3) + lp = LoginPage(self.driver) + lp.login_to_spotify("abdallah@gmail.com", "123456") + time.sleep(3) + self.driver.get(self.helper.base_url + "webplayer/home") + time.sleep(3) + web_player_home = WebPlayerHome(self.driver) + web_player_home.click_your_library() + self.artist.click_artist() + time.sleep(5) + if self.artist.check_follow(): + self.helper.report_allure("SUCCESS: follow button is functional") + assert True + else: + self.helper.report_allure("FAILURE: follow button is functional") + assert False diff --git a/Web_Testing/Tests/test_changePassword.py b/Web_Testing/Tests/test_changePassword.py index f28b093..3113d07 100644 --- a/Web_Testing/Tests/test_changePassword.py +++ b/Web_Testing/Tests/test_changePassword.py @@ -1,4 +1,3 @@ - """ Home Page Testing @@ -55,7 +54,7 @@ def setup_final(self): yield self.driver.close() -# Test #1 -> Change password with empty password + # Test #1 -> Change password with empty password @allure.severity(allure.severity_level.BLOCKER) @allure.story("Testing change password with empty password") @allure.title("Change Password with empty password") @@ -100,8 +99,7 @@ def test_case_1(self, setup_initial): assert (not did_login_new) - -# Test #2 -> Change Password with empty confirmation password + # Test #2 -> Change Password with empty confirmation password @allure.severity(allure.severity_level.BLOCKER) @allure.story("Change Password with empty confirmation password") @allure.title("Change Password with empty confirmation password") @@ -114,7 +112,8 @@ def test_case_2(self, setup): text_dangers_appeared = not did_change_password if not text_dangers_appeared: - self.helper.report_allure("ERROR: Text warnings did not appear with empty confirmation password", self.driver) + self.helper.report_allure("ERROR: Text warnings did not appear with empty confirmation password", + self.driver) else: self.helper.report_allure("SUCCESS: Text warnings appeared with empty confirmation password", self.driver) @@ -152,9 +151,11 @@ def test_case_3(self, setup): text_dangers_appeared = not did_change_password if not text_dangers_appeared: - self.helper.report_allure("ERROR: Text warnings did not appear with different confirmation password", self.driver) + self.helper.report_allure("ERROR: Text warnings did not appear with different confirmation password", + self.driver) else: - self.helper.report_allure("SUCCESS: Text warnings appeared with different confirmation password", self.driver) + self.helper.report_allure("SUCCESS: Text warnings appeared with different confirmation password", + self.driver) self.driver.get(self.helper.get_account_overview_url()) time.sleep(2) @@ -178,7 +179,7 @@ def test_case_3(self, setup): assert (not did_login_new) -# Test #4 -> Change Password with correct credentials + # Test #4 -> Change Password with correct credentials @allure.severity(allure.severity_level.BLOCKER) @allure.story("Change Password with correct credentials") @allure.title("Change Password with correct credentials") diff --git a/Web_Testing/Tests/test_likedsongs.py b/Web_Testing/Tests/test_likedsongs.py new file mode 100644 index 0000000..35c8756 --- /dev/null +++ b/Web_Testing/Tests/test_likedsongs.py @@ -0,0 +1,68 @@ +""" +Premium page Testing + +This script tests the premium page buttons and report the results to allure + +This script requires `allure` and `pytest` be installed within the Python environment you are running this script in +""" +import time + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys +from webdriver_manager.firefox import GeckoDriverManager +from allure_commons.types import AttachmentType +import allure +import pytest + +from Web_Testing.helperClasses import WebHelper, ConstantsClass + +from Web_Testing.Pages.LoginPage import LoginPage + +from Web_Testing.Pages.WebPlayerPlaylist import WebPlayerPlaylist + +from Web_Testing.Pages.WebPlayerHome import WebPlayerHome + +from Web_Testing.Pages.LikedSongs import LikedSongs + + +@allure.parent_suite("End to End testing") +@allure.suite("Playlist page test") +@allure.feature("Playlist page test") +@allure.severity(allure.severity_level.CRITICAL) +class TestLikedSongs: + # TODO: change Firefox executable path to your needs + driver = WebHelper().firefox_driver_init() + helper = WebHelper() + helper.set_driver(driver) + liked_songs = LikedSongs(driver) + + @pytest.yield_fixture + def setup(self): + self.driver.get(self.helper.get_login_url()) + self.driver.maximize_window() + yield + self.driver.close() + + # Test #1 -> Check Liked Songs + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Testing Play Button") + @allure.title("Playlist Play Button") + @allure.description("Testing Playlist Play Button") + @pytest.mark.Do + @pytest.mark.YourLibrary + def test_case_1(self, setup): + time.sleep(3) + lp = LoginPage(self.driver) + lp.login_to_spotify("abdallah@gmail.com", "123456") + time.sleep(3) + self.driver.get(self.helper.base_url + "webplayer/home") + time.sleep(3) + web_player_home = WebPlayerHome(self.driver) + web_player_home.click_liked_songs() + if self.liked_songs.check_liked_songs(): + self.helper.report_allure("SUCCESS: Liked Songs are correct") + assert True + else: + self.helper.report_allure("FAILURE: Liked Songs are not correct") + assert False diff --git a/Web_Testing/Tests/tests_loggedOutHome.py b/Web_Testing/Tests/test_loggedOutHome.py similarity index 84% rename from Web_Testing/Tests/tests_loggedOutHome.py rename to Web_Testing/Tests/test_loggedOutHome.py index 934795e..bdf64b9 100644 --- a/Web_Testing/Tests/tests_loggedOutHome.py +++ b/Web_Testing/Tests/test_loggedOutHome.py @@ -1,4 +1,3 @@ - """ Home Page Testing @@ -6,7 +5,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 @@ -22,8 +21,8 @@ @allure.feature("Home Page") @allure.severity(allure.severity_level.BLOCKER) class TestLoggedOutHome: - driver = WebHelper().firefox_driver_init() + @pytest.yield_fixture def setup(self): self.driver.get(WebHelper().get_home_url()) @@ -37,7 +36,7 @@ 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") @@ -45,10 +44,9 @@ def setup_final(self): @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) @@ -57,7 +55,7 @@ def test_case_1(self, setup): WebHelper().report_allure("Signup button failed", self.driver) assert False -# Test #2 -> Testing Login Button + # Test #2 -> Testing Login Button @allure.severity(allure.severity_level.BLOCKER) @allure.story("Login Button") @allure.title("Testing Login Button") @@ -65,7 +63,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) @@ -74,7 +74,7 @@ def test_case_2(self, setup): WebHelper().report_allure("Login button failed", self.driver) assert False -# Test #3 -> Testing Premium Button + # Test #3 -> Testing Premium Button @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium Button") @allure.title("Testing Premium Button") @@ -82,9 +82,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 diff --git a/Web_Testing/Tests/test_login.py b/Web_Testing/Tests/test_login.py index 1203575..f8d2a42 100644 --- a/Web_Testing/Tests/test_login.py +++ b/Web_Testing/Tests/test_login.py @@ -1,4 +1,3 @@ - """ Login Testing @@ -7,7 +6,6 @@ This script requires `allure` and `pytest` be installed within the Python environment you are running this script in """ - import allure import pytest @@ -17,12 +15,12 @@ import time from Web_Testing.helperClasses import WebHelper + @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: - driver = WebHelper().firefox_driver_init() link = WebHelper().get_login_url() correct_emails = ["test1@test.com", "test2@test.com", "test3@test.com"] @@ -111,7 +109,8 @@ def test_case_3(self, setup): @allure.story("Failing login") @allure.sub_suite("Login with wrong password") @allure.title("Login with wrong password") - @allure.description("Signing in with the following credentials email : kamelmohsenkamel@gmail.com & password: wrong password") + @allure.description( + "Signing in with the following credentials email : kamelmohsenkamel@gmail.com & password: wrong password") @pytest.mark.Do @pytest.mark.Login def test_case_4(self, setup): @@ -245,11 +244,12 @@ 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) assert True - - diff --git a/Web_Testing/Tests/test_playlist.py b/Web_Testing/Tests/test_playlist.py new file mode 100644 index 0000000..29b54ed --- /dev/null +++ b/Web_Testing/Tests/test_playlist.py @@ -0,0 +1,90 @@ +""" +Premium page Testing + +This script tests the premium page buttons and report the results to allure + +This script requires `allure` and `pytest` be installed within the Python environment you are running this script in +""" +import time + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys +from webdriver_manager.firefox import GeckoDriverManager +from allure_commons.types import AttachmentType +import allure +import pytest + +from Web_Testing.helperClasses import WebHelper, ConstantsClass + +from Web_Testing.Pages.LoginPage import LoginPage + +from Web_Testing.Pages.WebPlayerPlaylist import WebPlayerPlaylist + +from Web_Testing.Pages.WebPlayerHome import WebPlayerHome + + +@allure.parent_suite("End to End testing") +@allure.suite("Playlist page test") +@allure.feature("Playlist page test") +@allure.severity(allure.severity_level.CRITICAL) +class TestPlaylist: + # TODO: change Firefox executable path to your needs + driver = WebHelper().firefox_driver_init() + helper = WebHelper() + helper.set_driver(driver) + + def login_first(self): + lp = LoginPage(self.driver) + lp.set_credentials("abdallah@gmail.com", ConstantsClass().get_pass("abdallah@gmail.com")) + lp.click_login() + self.driver.implicitly_wait(3) + self.playlist.click_webplayer() + self.driver.implicitly_wait(3) + + @pytest.yield_fixture + def setup_initial(self): + self.driver.get(self.helper.get_login_url()) + self.driver.maximize_window() + yield + self.driver.close() + + @pytest.yield_fixture + def setup(self): + self.driver.get(self.helper.base_url + "webplayer/librarypage") + self.driver.maximize_window() + yield + # self.driver.close() + + @pytest.yield_fixture + def setup_final(self): + self.driver.get(self.helper.base_url + "webplayer/librarypage") + self.driver.maximize_window() + yield + self.driver.close() + + # Test #1 -> Play Button + @allure.severity(allure.severity_level.BLOCKER) + @allure.story("Testing Play Button") + @allure.title("Playlist Play Button") + @allure.description("Testing Playlist Play Button") + @pytest.mark.Do + @pytest.mark.YourLibrary + def test_case_1(self, setup_initial): + time.sleep(3) + lp = LoginPage(self.driver) + lp.login_to_spotify("abdallah@gmail.com", "123456") + time.sleep(3) + self.driver.get(self.helper.base_url + "webplayer/home") + time.sleep(3) + web_player_home = WebPlayerHome(self.driver) + web_player_home.click_your_library() + time.sleep(3) + playlist = WebPlayerPlaylist(self.driver) + time.sleep(2) + if playlist.check_playlist(0, True): + self.helper.report_allure("SUCCESS:Playlist card goes to the right playlist") + assert True + else: + self.helper.report_allure("FAILURE: Playlist card doesn't go to the right playlist") + assert False diff --git a/Web_Testing/Tests/test_premium.py b/Web_Testing/Tests/test_premium.py index 7de9a12..f7b91fa 100644 --- a/Web_Testing/Tests/test_premium.py +++ b/Web_Testing/Tests/test_premium.py @@ -1,4 +1,3 @@ - """ Premium page Testing @@ -18,6 +17,11 @@ import time from Web_Testing.helperClasses import WebHelper, ConstantsClass +from Web_Testing.Pages.LoggedOutHome import LoggedOutHome +from Web_Testing.Pages.LoginPage import LoginPage + +from Web_Testing.Pages.AccountOverviewPage import AccountOverviewPage + @allure.parent_suite("End to End testing") @allure.suite("Premium page test") @@ -25,9 +29,27 @@ @allure.severity(allure.severity_level.CRITICAL) class TestPremium: # TODO: change Firefox executable path to your needs - driver = WebHelper().chrome_driver_init() + driver = WebHelper().firefox_driver_init() pp = PremiumPage(driver) + def login_first(self): + lp = LoginPage(self.driver) + lp.set_credentials("test9@test.com", ConstantsClass().get_pass("test9@test.com")) + lp.click_login() + self.driver.implicitly_wait(3) + account_overview_page = AccountOverviewPage(self.driver) + account_overview_page.click_premium_link() + + @pytest.yield_fixture + def setup_begin(self): + self.driver.get(WebHelper().get_login_url()) + self.driver.maximize_window() + self.login_first() + yield + self.driver.delete_all_cookies() + self.driver.refresh() + self.driver.delete_all_cookies() + @pytest.yield_fixture def setup(self): self.driver.get(WebHelper().get_premium_url()) @@ -44,7 +66,40 @@ def setup_final(self): yield self.driver.close() - # Test #1 ->Checking that all buttons and links work + # Test #1 ->Checking that get premium works and change account to premium + @allure.severity(allure.severity_level.CRITICAL) + @allure.story("Premium tests") + @allure.sub_suite("change to premium account") + @allure.title("change to premium account") + @allure.description("change to premium account") + @pytest.mark.Do + @pytest.mark.Premium + def test_case_1(self, setup_begin): + if self.pp.check_claim_premium(): + WebHelper().report_allure("Change to premium account successfully", self.driver) + assert True + else: + WebHelper().report_allure("Fail to change to premium account ", self.driver) + assert False + + # # Test #2 ->Checking that all buttons and links work + # @allure.severity(allure.severity_level.BLOCKER) + # @allure.story("Premium tests") + # @allure.sub_suite("Clicking get premium link") + # @allure.title("Clicking get premium link") + # @allure.description("Clicking get premium link") + # @pytest.mark.Do + # @pytest.mark.Premium + # def test_case_2(self, setup): + # self.pp.click_get_premium_button_2() + # if self.driver.current_url == WebHelper().get_premium_url(): + # WebHelper().report_allure("Get Premium button functional", self.driver) + # assert True + # else: + # WebHelper().report_allure("Get Premium button not functional", self.driver) + # assert False + + # Test #3 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") @allure.sub_suite("Spotify logo") @@ -52,16 +107,16 @@ def setup_final(self): @allure.description("Spotify logo") @pytest.mark.Do @pytest.mark.Premium - def test_case_1(self, setup): + def test_case_3(self, setup): self.pp.click_spotify_logo() - if self.driver.current_url == WebHelper().get_signup_url(): + if self.driver.current_url == WebHelper().get_home_url(): WebHelper().report_allure("Spotify logo functional", self.driver) assert True else: WebHelper().report_allure("Spotify logo not functional", self.driver) assert False - # Test #2 ->Checking that all buttons and links work + # Test #4 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") @allure.sub_suite("Clicking account link") @@ -69,7 +124,7 @@ def test_case_1(self, setup): @allure.description("Clicking account link") @pytest.mark.Do @pytest.mark.Premium - def test_case_2(self, setup): + def test_case_4(self, setup): self.pp.click_account() if self.driver.current_url == WebHelper().get_account_overview_url(): WebHelper().report_allure("Account link functional", self.driver) @@ -79,7 +134,7 @@ def test_case_2(self, setup): WebHelper().report_allure("Account link not functional", self.driver) assert False - # Test #3 ->Checking that all buttons and links work + # Test #5 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") @allure.sub_suite("Clicking Download link") @@ -87,7 +142,7 @@ def test_case_2(self, setup): @allure.description("Clicking Download link") @pytest.mark.Do @pytest.mark.Premium - def test_case_3(self, setup): + def test_case_5(self, setup): self.pp.click_download_link() if self.driver.current_url == WebHelper().get_home_url(): WebHelper().report_allure("Download link functional", self.driver) @@ -96,7 +151,7 @@ def test_case_3(self, setup): WebHelper().report_allure("Download link not functional", self.driver) assert False - # Test #4 ->Checking that all buttons and links work + # Test #6 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") @allure.sub_suite("Clicking help link") @@ -104,7 +159,7 @@ def test_case_3(self, setup): @allure.description("Clicking help link") @pytest.mark.Do @pytest.mark.Premium - def test_case_4(self, setup): + def test_case_6(self, setup): self.pp.click_help_link() if self.driver.current_url == WebHelper().get_home_url(): WebHelper().report_allure("Help link functional", self.driver) @@ -113,24 +168,24 @@ def test_case_4(self, setup): WebHelper().report_allure("Help link not functional", self.driver) assert False - # Test #5 ->Checking that all buttons and links work + # Test #7 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") - @allure.sub_suite("Clicking home link") - @allure.title("Clicking home link") - @allure.description("Clicking home link") + @allure.sub_suite("Clicking premium link") + @allure.title("Clicking premium link") + @allure.description("Clicking premium link") @pytest.mark.Do @pytest.mark.Premium - def test_case_5(self, setup): - self.pp.click_home_link() - if self.driver.current_url == WebHelper().get_home_url(): - WebHelper().report_allure("Home link functional", self.driver) + def test_case_7(self, setup): + self.pp.click_premium_link() + if self.driver.current_url == WebHelper().get_premium_url(): + WebHelper().report_allure("Premium link functional", self.driver) assert True else: - WebHelper().report_allure("Home link not functional", self.driver) + WebHelper().report_allure("Premium link not functional", self.driver) assert False - # Test #6 ->Checking that all buttons and links work + # Test #8 ->Checking that all buttons and links work @allure.severity(allure.severity_level.BLOCKER) @allure.story("Premium tests") @allure.sub_suite("Clicking logout link") @@ -138,45 +193,11 @@ def test_case_5(self, setup): @allure.description("Clicking logout link") @pytest.mark.Do @pytest.mark.Premium - def test_case_6(self, setup): + def test_case_8(self, setup_final): self.pp.click_logout_button() - if self.driver.current_url == WebHelper().get_login_url(): + if self.driver.current_url == WebHelper().get_signup_url(): WebHelper().report_allure("Logout button functional", self.driver) assert True else: WebHelper().report_allure("Logout button not functional", self.driver) assert False - - # Test #7 ->Checking that all buttons and links work - @allure.severity(allure.severity_level.BLOCKER) - @allure.story("Premium tests") - @allure.sub_suite("Clicking get premium link") - @allure.title("Clicking get premium link") - @allure.description("Clicking get premium link") - @pytest.mark.Do - @pytest.mark.Premium - def test_case_7(self, setup): - self.pp.click_get_premium_button_1() - if self.driver.current_url == WebHelper().get_premium_url(): - WebHelper().report_allure("Get Premium button functional", self.driver) - assert True - else: - WebHelper().report_allure("Get Premium button not functional", self.driver) - assert False - - # Test #8 ->Checking that all buttons and links work - @allure.severity(allure.severity_level.BLOCKER) - @allure.story("Premium tests") - @allure.sub_suite("Clicking get premium link") - @allure.title("Clicking get premium link") - @allure.description("Clicking get premium link") - @pytest.mark.Do - @pytest.mark.Premium - def test_case_8(self, setup_final): - self.pp.click_get_premium_button_2() - if self.driver.current_url == WebHelper().get_premium_url(): - WebHelper().report_allure("Get Premium button functional", self.driver) - assert True - else: - WebHelper().report_allure("Get Premium button not functional", self.driver) - assert False \ No newline at end of file diff --git a/Web_Testing/Tests/test_signup.py b/Web_Testing/Tests/test_signup.py index eec8c2e..aae7e30 100644 --- a/Web_Testing/Tests/test_signup.py +++ b/Web_Testing/Tests/test_signup.py @@ -1,4 +1,3 @@ - """ Signup Testing @@ -24,7 +23,6 @@ @allure.feature("Signup Tests") @allure.severity(allure.severity_level.BLOCKER) class TestSignup: - # TODO: change Chrome executable path to your needs driver = WebHelper().firefox_driver_init() correct_emails = ["test54@test.com"] @@ -48,7 +46,7 @@ def setup_final(self): yield self.driver.close() -# Test #1 -> Different Confirmation email + # Test #1 -> Different Confirmation email @allure.severity(allure.severity_level.BLOCKER) @allure.story("Failing Signup") @allure.sub_suite("Sign up with different confirmation email") @@ -66,7 +64,8 @@ def test_case_1(self, setup): constants = ConstantsClass() emails = constants.get_test_emails() - profile = Profile(emails[0], "test_pass", "Mohammad Osama", DOB(31, 1, 2002), Gender.MALE, "another_email@hotmail.com") + profile = Profile(emails[0], "test_pass", "Mohammad Osama", DOB(31, 1, 2002), Gender.MALE, + "another_email@hotmail.com") if sp.signup_to_spotify(profile): WebHelper().report_allure("ERROR: Sign up proceeded with different confirmation email", self.driver) @@ -75,7 +74,7 @@ def test_case_1(self, setup): WebHelper().report_allure("SUCCESS: Sign up unsuccessful with different confirmation email", self.driver) assert True -# Test #2 -> Empty Email + # Test #2 -> Empty Email @allure.severity(allure.severity_level.BLOCKER) @allure.story("Failing Signup") @allure.sub_suite("Signup with empty email") @@ -97,7 +96,7 @@ def test_case_2(self, setup): WebHelper().report_allure("SUCCESS: Sign up stopped with empty email", self.driver) assert True -# Test #3 -> Already Registered Email + # Test #3 -> Already Registered Email @allure.severity(allure.severity_level.BLOCKER) @allure.story("Failing signup") @allure.sub_suite("Signup with already registered email") @@ -125,7 +124,8 @@ 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): @@ -141,7 +141,7 @@ def test_case_4(self, setup): WebHelper().report_allure("ERROR: Sign up did not proceed with correct credentials and values", self.driver) assert False -# Test #5 -> Empty Password + # Test #5 -> Empty Password @allure.severity(allure.severity_level.BLOCKER) @allure.story("Failing Signup") @allure.sub_suite("Signup with empty password") @@ -287,10 +287,12 @@ def test_case_11(self, setup): sp = SignupPage(self.driver) 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.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) 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) @@ -316,4 +318,3 @@ def test_case_12(self, setup_final): else: WebHelper().report_allure("SUCCESS: Sign up stopped with invalid age values", self.driver) assert True - diff --git a/Web_Testing/Tests/test_webplayerHome.py b/Web_Testing/Tests/test_webplayerHome.py index 36d69a2..3ca0fdd 100644 --- a/Web_Testing/Tests/test_webplayerHome.py +++ b/Web_Testing/Tests/test_webplayerHome.py @@ -218,5 +218,3 @@ def test_case_9(self, setup_final): else: self.helper.report_allure("FAILURE: Login button is not functional") assert False - - diff --git a/Web_Testing/Tests/test_yourLibrary.py b/Web_Testing/Tests/test_yourLibrary.py index fb035a3..b43b386 100644 --- a/Web_Testing/Tests/test_yourLibrary.py +++ b/Web_Testing/Tests/test_yourLibrary.py @@ -75,7 +75,7 @@ def test_case_1(self, setup_initial): self.helper.report_allure("FAILURE: Your Library Liked songs cards are not functional") assert False -# Test #2 -> Playlists Cards + # Test #2 -> Playlists Cards @allure.severity(allure.severity_level.BLOCKER) @allure.story("Testing Your Library playlists cards") @allure.title("Playlists cards") @@ -116,7 +116,7 @@ def test_case_3(self, setup): self.helper.report_allure("FAILURE: The Liked Songs Card button in your Library page is not functional") assert False -# Test #4 -> Your Library Button with empty playlist + # Test #4 -> Your Library Button with empty playlist @allure.severity(allure.severity_level.BLOCKER) @allure.story("Testing Your Library Liked Songs Play Button with empty playlist") @allure.title("Liked Songs Play Button with empty playlist") @@ -142,5 +142,3 @@ def test_case_4(self, setup_final): assert True else: assert False - - diff --git a/Web_Testing/helperClasses.py b/Web_Testing/helperClasses.py index d03ab95..59090b6 100644 --- a/Web_Testing/helperClasses.py +++ b/Web_Testing/helperClasses.py @@ -190,15 +190,6 @@ def get_account_changepassword_url(self): """ return self.base_url + "account/changepassword" - def get_signup_url(self): - """ - gets the sign up url of the website - - :returns: the sign up url of the website - :rtype: str - """ - return self.base_url + "signup" - def set_driver(self, driver): """ sets the class' driver with the input driver @@ -216,6 +207,7 @@ def chrome_driver_init(self): :returns: the class' driver :rtype: WebDriver """ + self.driver = webdriver.Chrome(ChromeDriverManager().install()) return self.driver @@ -226,6 +218,7 @@ def firefox_driver_init(self): :returns: the class' driver :rtype: WebDriver """ + self.driver = webdriver.Firefox(executable_path=GeckoDriverManager().install()) return self.driver @@ -748,8 +741,12 @@ class Profile: gender : Gender the user's gender + Methods + ------- + + """ - def __init__(self, email, password, name, dob, gender, c_email=''): + def __init__(self, email, password, name, dob, gender, premium=False, c_email=''): """ Initializes the user's profile with the provided parameters @@ -770,6 +767,9 @@ def __init__(self, email, password, name, dob, gender, c_email=''): :param gender: the user's gender :type gender: Gender + :param premium: the account's premium + :type premium: bool + :param c_email: the user's confirmation email (default is '') :type c_email: str """ @@ -781,6 +781,17 @@ def __init__(self, email, password, name, dob, gender, c_email=''): self.name = name self.dob = dob self.gender = gender + self.premium = premium + + def set_premium(self,new_premium): + """ + Set premium of the profile + + :param:new_premium: new premium status to be set + :type: bool + + """ + self.premium = new_premium class ConstantsClass: @@ -833,47 +844,52 @@ def __init__(self): , "test4@test.com" : Profile("test4@test.com" , "test456" - , "Testing TeamX", DOB(21, 2, 1950), Gender.MALE, "email_different@test.com") + , "Testing TeamX", DOB(21, 2, 1950), Gender.MALE, c_email="email_different@test.com") , "test50@test.com" : Profile("test50@test.com" , "test505152" - , "Testing Team 50", DOB(21, 2, 1950), Gender.MALE, "test50@test.com") + , "Testing Team 50", DOB(21, 2, 1950), Gender.MALE, c_email="test50@test.com") , "test51@test.com" : Profile("test51@test.com" , "test505152" - , "Testing Team 51", DOB(21, 2, 1950), Gender.MALE, "test51@test.com") + , "Testing Team 51", DOB(21, 2, 1950), Gender.MALE, c_email="test51@test.com") , "test53@test.com" : Profile("test53@test.com" , "test535455" - , "Testing Team 53", DOB(21, 2, 1970), Gender.MALE, "test53@test.com") + , "Testing Team 53", DOB(21, 2, 1970), Gender.MALE, c_email="test53@test.com") , "test54@test.com" : Profile("test54@test.com" , "test545556" - , "Testing Team 54", DOB(21, 2, 1970), Gender.MALE, "test54@test.com") + , "Testing Team 54", DOB(21, 2, 1970), Gender.MALE, c_email="test54@test.com") , "test55@test.com" : Profile("test55@test.com" , "test555657" - , "Testing Team 55", DOB(21, 2, 1970), Gender.MALE, "test55@test.com") + , "Testing Team 55", DOB(21, 2, 1970), Gender.MALE, c_email="test55@test.com") , "test56@test.com" : Profile("test56@test.com" , "test565758" - , "Testing Team 56", DOB(21, 2, 1970), Gender.MALE, "test56@test.com") + , "Testing Team 56", DOB(21, 2, 1970), Gender.MALE, c_email="test56@test.com") , "test57@test.com" : Profile("test57@test.com" , "test575859" - , "Testing Team 57", DOB(21, 2, 1970), Gender.MALE, "test57@test.com") + , "Testing Team 57", DOB(21, 2, 1970), Gender.MALE, c_email="test57@test.com") , "test58@test.com" : Profile("test58@test.com" , "test585960" - , "Testing Team 58", DOB(21, 2, 1970), Gender.FEMALE, "test58@test.com") + , "Testing Team 58", DOB(21, 2, 1970), Gender.FEMALE, c_email="test58@test.com") , "test59@test.com" : Profile("test59@test.com" , "test596061" - , "Testing Team 59", DOB(21, 2, 1979), Gender.FEMALE, "test59@test.com") + , "Testing Team 59", DOB(21, 2, 1979), Gender.FEMALE, c_email="test59@test.com") ,"test9@test.com" : Profile("test9@test.com" , "test789" - , "Testing Team 9", DOB(21, 2, 1980), Gender.MALE, "test9@test.com") + , "Testing Team 9", DOB(21, 2, 1980), Gender.MALE, c_email="test9@test.com"), + "abdallah@gmail.com": + Profile("abdallah@gmail.com" + , "123456" + , "Ahmed", DOB(21, 2, 1980), Gender.MALE,True, + c_email="abdallah@gmail.com") } def get_test_emails(self): @@ -936,6 +952,18 @@ def get_name(self, email): """ return self.test_accounts_to_profiles.get(email).name + def get_premium(self, email): + """ + gets the premium for the provided email + + :param email: the user's email + :type email: str + + :returns: the premium of the user with the provided email + :rtype: bool + """ + return self.test_accounts_to_profiles.get(email).premium + def get_profile(self, email): """ gets the profile for the provided email diff --git a/clean.sh b/clean.sh new file mode 100644 index 0000000..4ceac7e --- /dev/null +++ b/clean.sh @@ -0,0 +1,7 @@ +#!/bin/bash + + + +find ./Reports -type f -name '*.txt' -delete +find ./Reports -type f -name '*.png' -delete +find ./Reports -type f -name '*.json' -delete \ No newline at end of file diff --git a/commands.txt b/commands.txt deleted file mode 100644 index 3be6f87..0000000 --- a/commands.txt +++ /dev/null @@ -1,15 +0,0 @@ -1) -python3 -m pytest --alluredir="./Reports" ./Mobile_Testing/Tests/ -m Do -python -m pytest --alluredir="./Reports" ./Web_Testing/Tests/ -m Do - -2) -allure serve "./Reports" or allure-docx --pdf Reports Test_Results.docx - -3) -pip3 freeze > requirements.txt - -4) -pip3 install -r requirements.txt - -5) -python3 -m pytest --alluredir="./Reports" ./Tests/ -m Do diff --git a/documentation/Mobile/Helper/__init__.html b/documentation/Mobile/Helper/__init__.html new file mode 100644 index 0000000..08eaac2 --- /dev/null +++ b/documentation/Mobile/Helper/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Mobile/Helper/helper.html b/documentation/Mobile/Helper/helper.html new file mode 100644 index 0000000..27b88f6 --- /dev/null +++ b/documentation/Mobile/Helper/helper.html @@ -0,0 +1,168 @@ + +Python: module helper + + + + + +
 
+ 
helper
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/helper.py
+

+

+ + + + + +
 
+Modules
       
allure
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
Constants +
Helper +
+
+
+

+ + + + + + + +
 
+class Constants(builtins.object)
    A class used to represent the Login page test
+ ...
+ Attributes
+ ----------
+desired_cap : dictionary
+        The details of your device
+correct_credentials : dictionary
+        The correct credentials for login
+first_song_playlist : string
+        the xpath fo the first element in playlist

+ Methods
+ -------
+    None
 
 Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
correct_credentials = {'email': 'abdallah@gmail.com', 'password': '1234567'}
+ +
desired_cap = {'app': '/Users/KIMO/AndroidStudioProjects/ProjectX/app/build/outputs/apk/debug/app-debug.apk', 'appWaitActivity': '.authentication.AuthenticationPage', 'appWaitPackage': 'com.example.projectx', 'deviceName': 'samsung-sm_a207f-R9WM91DQY1J', 'platformName': 'Android'}
+ +
first_song_playlist = '/hierarchy/android.widget.FrameLayout/android.wi...dget.FrameLayout[1]/android.widget.RelativeLayout'
+ +

+ + + + + + + +
 
+class Helper(builtins.object)
      A class used to represent the Login page test
+   ...
+   Attributes
+   ----------
+None

+   Methods
+   -------

+   driver_init()
+        Initiates the web driver
+   element_exists_by_id()
+        Safely checks that element exist by id
+   element_exists_by_accessibility_id()
+        Safely checks that element exist by accessibility id
+   element_exists_by_xpath()
+        Safely checks that element exist by xpath
+   find_element_by_xpath()
+        Safely find element by xpath
+   find_element_by_id()
+        Safely find element by id
+   find_element_by_accessibility_id()
+        Safely find element by accessibility id
+   screenshot()
+        takes a screen shot of the app
+   report_allure()
+        attach the screen shot to allure report
 
 Static methods defined here:
+
driver_init()
initiates the driver
+ +
element_exists_by_accessibility_id(driver, accessibility_id)
Safely checks that element exist by accessibility id
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param accessibility_id: accessibility id of the element
+:type accessibility_id string
+:return: Boolean
+ +
element_exists_by_id(driver, _id)
Safely checks that element exist by id
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param _id: id of the element
+:type _id string
+:return: Boolean
+ +
element_exists_by_xpath(driver, xpath)
Safely checks that element exist by id
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param xpath: xpath of the element
+:type xpath string
+:return: Boolean
+ +
find_element_by_accessibility_id(driver, accessibility_id)
Safely find that element by accessibility id
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param accessibility_id: id of the element
+:type accessibility_id string
+:return: Boolean
+ +
find_element_by_id(driver, _id)
Safely find that element by id
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param _id: id of the element
+:type _id string
+:return: Boolean
+ +
find_element_by_xpath(driver, xpath)
Safely find that element by xpath
+:param driver: driver that will find the element
+:type driver: WebDriver
+:param xpath: id of the element
+:type xpath string
+:return: Boolean
+ +
report_allure(driver, msg)
attach the screen shot to allure report
+ +
screenshot(driver)
takes a screen shot of the app
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ \ No newline at end of file diff --git a/documentation/Mobile/Pages/__init__.html b/documentation/Mobile/Pages/__init__.html new file mode 100644 index 0000000..9e5cfcc --- /dev/null +++ b/documentation/Mobile/Pages/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Mobile/Pages/authentication.html b/documentation/Mobile/Pages/authentication.html new file mode 100644 index 0000000..110055b --- /dev/null +++ b/documentation/Mobile/Pages/authentication.html @@ -0,0 +1,86 @@ + +Python: module authentication + + + + + +
 
+ 
authentication
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/authentication.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
AuthenticationPage +
+
+
+

+ + + + + + + +
 
+class AuthenticationPage(builtins.object)
   AuthenticationPage(driver)

+A class used to represent the Authentication Page
+...
+Attributes
+----------

+signup_button_id : string
+    A string containing the id of Sign up button
+login_with_facebook_button_id : string
+    A string containing the id of login with facebook button
+signin_button_id : string
+    A string containing the id of sign in button

+Methods
+-------
+click_signup_button()
+    Clicks the sign up button
+click_login_with_facebook_button()
+    Clicks the login with facebook button
+click_signin_button()
+    Clicks the sign in button
 
 Methods defined here:
+
__init__(self, driver)
Initializes the page elements
+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
click_login_with_facebook_button(self)
Clicks login with facebook  button
+ +
click_signin_button(self)
Clicks sign in button
+ +
click_signup_button(self)
Clicks sign up button
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
login_with_facebook_button_id = 'com.example.projectx:id/login_button'
+ +
signin_button_id = 'com.example.projectx:id/signIn_bt'
+ +
signup_button_id = 'com.example.projectx:id/signUp_bt'
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Pages/home.html b/documentation/Mobile/Pages/home.html new file mode 100644 index 0000000..8345221 --- /dev/null +++ b/documentation/Mobile/Pages/home.html @@ -0,0 +1,162 @@ + +Python: module home + + + + + +
 
+ 
home
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/home.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
HomePage +
+
+
+

+ + + + + + + +
 
+class HomePage(builtins.object)
   HomePage(driver)

+A class used to represent the Home Page
+...
+Attributes
+----------
+logout_button_id : string
+    A string containing the id of logout button

+new_releases_button_id : string
+    A string containing the id of new releases button

+liked_tracks_button_id : string
+    A string containing the id of liked tracks button

+popular_tracks_button_id : string
+    A string containing the id of popular tracks button

+recommended_tracks_id : string
+    A string containing the id of recommended tracks button

+about_button_id : string
+    A string containing the id of about button

+home_button_id : string
+    A string containing the id of home button

+search_button_id : string
+    A string containing the id of search button

+library_button_id : string
+    A string containing the id of library button

+premium_button_id : string
+    A string containing the id of premium button


+Methods
+-------

+click_logout_button()
+    Clicks on the logout button

+click_new_releases_button()
+    Clicks on the new releases button

+click_liked_tracks_button()
+    Clicks on the liked tracks button

+click_popular_tracks_button()
+    Clicks on the popular tracks button

+click_recommended_tracks()
+    Clicks on the recommended tracks

+click_about_button()
+    Clicks on the about button

+click_home_button()
+    Clicks on the home button

+click_search_button()
+    Clicks on the search button

+click_library_button()
+    Clicks on the library button


+click_premium_button()
+    Clicks on the premium button
 
 Methods defined here:
+
__init__(self, driver)
Initializes the page elements
+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
click_about_button(self)
Clicks on the about button
+ +
click_home_button(self)
Clicks on the home button
+ +
click_library_button(self)
Clicks on the library button
+ +
click_liked_tracks_button(self)
Clicks on the liked tracks button
+ +
click_logout_button(self)
Clicks on the logout button
+ +
click_new_releases_button(self)
Clicks on the new releases button
+ +
click_popular_tracks_button(self)
Clicks on the popular tracks button
+ +
click_premium_button(self)
Clicks on the premium button
+ +
click_recommended_tracks(self)
Clicks on the recommended tracks
+ +
click_search_button(self)
Clicks on the search button
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
about_button_id = 'com.example.projectx:id/about'
+ +
home_button_id = 'com.example.projectx:id/navigation_home'
+ +
library_button_id = 'com.example.projectx:id/navigation_notifications'
+ +
liked_tracks_button_id = 'com.example.projectx:id/likedTracks'
+ +
logout_button_id = 'com.example.projectx:id/logOut'
+ +
new_releases_button_id = 'com.example.projectx:id/newReleases'
+ +
popular_tracks_button_id = 'com.example.projectx:id/popular'
+ +
premium_button_id = 'com.example.projectx:id/premium'
+ +
recommended_tracks_id = 'com.example.projectx:id/recommended'
+ +
search_button_id = 'com.example.projectx:id/navigation_dashboard'
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Pages/login.html b/documentation/Mobile/Pages/login.html new file mode 100644 index 0000000..a35779d --- /dev/null +++ b/documentation/Mobile/Pages/login.html @@ -0,0 +1,99 @@ + +Python: module login + + + + + +
 
+ 
login
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/login.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
LoginPage +
+
+
+

+ + + + + + + +
 
+class LoginPage(builtins.object)
   LoginPage(driver)

+A class used to represent the Login Page
+...
+Attributes
+----------
+email_text_field_id : string
+    id of the email text field
+password_text_field_id : string
+    id of the password text field
+login_button_id : string
+    id of the login button


+Methods
+-------
+fill_email()
+    Fills the email field with the gievn string

+fill_password()
+    fills the password field with the give string
+click_login()
+    clicks the login password
+do_the_login()
+    given an email and password this function makes a sign in
 
 Methods defined here:
+
__init__(self, driver)
Initializes the page elements
+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
click_login(self)
clicks the login button
+ +
do_the_login(self, email, password)
makes a login process
+:param email : the string that is filled in the text box
+:type email: string
+:param password : the string that is filled in the text box
+:type password: string
+ +
fill_email(self, email)
fills the email text box
+:param email : the string that is filled in the text box
+:type email: string
+ +
fill_password(self, password)
fills the password text box
+:param password : the string that is filled in the text box
+:type password: string
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
email_text_field_id = 'com.example.projectx:id/email_et'
+ +
login_button_id = 'com.example.projectx:id/login_bt'
+ +
password_text_field_id = 'com.example.projectx:id/password_et'
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Pages/player.html b/documentation/Mobile/Pages/player.html new file mode 100644 index 0000000..137e189 --- /dev/null +++ b/documentation/Mobile/Pages/player.html @@ -0,0 +1,103 @@ + +Python: module player + + + + + +
 
+ 
player
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/player.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
PlayMusicPage +
+
+
+

+ + + + + + + +
 
+class PlayMusicPage(builtins.object)
   PlayMusicPage(driver)

+A class used to represent the Play Song Page
+...
+Attributes
+----------
+play_song_id : string
+    id of play song button
+previous_song_id : string
+    id of previous  song button
+next_song_id : string
+    id of next song button
+love_song_id : string
+    id of love song button
+download_song_id : string
+    id of download song button
+repeat_song_id : string
+    id of repeat song button
+share_song_id : string
+    id of share song button
+help_button_id : string
+    id of help button
+minimize_player_id : string
+    id of minimize player button
+black_list_song_id : string
+    id of block song button


+Methods
+-------
+    None
 
 Methods defined here:
+
__init__(self, driver)
Initializes the page elements
+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
black_list_song_id = 'com.example.projectx:id/blackListSong_ib'
+ +
download_song_id = 'com.example.projectx:id/downloadButton_ib'
+ +
help_button_id = 'com.example.projectx:id/more_ib'
+ +
love_song_id = 'com.example.projectx:id/likeButton_ib'
+ +
minimize_player_id = 'com.example.projectx:id/collapse_ib'
+ +
next_song_id = 'com.example.projectx:id/nextSong_ib'
+ +
play_song_id = 'com.example.projectx:id/playSong_ib'
+ +
previous_song_id = 'com.example.projectx:id/previousSong_ib'
+ +
repeat_song_id = 'com.example.projectx:id/repeatButton_ib'
+ +
share_song_id = 'com.example.projectx:id/shareButton_ib'
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Pages/signup.html b/documentation/Mobile/Pages/signup.html new file mode 100644 index 0000000..a2b503c --- /dev/null +++ b/documentation/Mobile/Pages/signup.html @@ -0,0 +1,143 @@ + +Python: module signup + + + + + +
 
+ 
signup
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Pages/signup.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
SignupPage +
+
+
+

+ + + + + + + +
 
+class SignupPage(builtins.object)
   SignupPage(driver)

+A class used to represent the Sign up Page
+...
+Attributes
+----------

+name_text_field_id : string
+    id of the name text box
+email_text_field_id : string
+    id of the email text box
+password_text_field_id : string
+    id of the password text box
+age_text_field_id : string
+    id of the age text box
+male_gender_check_box_id : string
+    id of the male check box
+female_gender_check_box_id : string
+    id of the female check box
+create_user_button_id : string
+    id of the create user button

+Methods
+-------
+fill_name()
+    fills name text box
+fill_email()
+    fills email text box
+fill_password()
+    fills password text box
+fill_age()
+    fills age check box
+choose_male()
+    choose male checkbox
+choose_female()
+    choose female checkbox

+click_create_user()
+    clicks the create button
+do_the_signup()
+    does the whole signup process
 
 Methods defined here:
+
__init__(self, driver)
Initializes the page elements
+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
choose_female(self)
chooses female gender
+ +
choose_male(self)
chooses male gender
+ +
click_create_user(self)
clicks create user button
+ +
do_the_signup(self, name, email, password, age, gender)
does the whole sign up process using given info
+:param name : the string that is filled in the text box
+:type name: string
+:param email : the string that is filled in the text box
+:type email: string
+fills the password text box
+:param password : the string that is filled in the text box
+:type password: string
+ fills the age text box
+:param age : the int that is filled in the text box
+:type age: int
+:param gender : the gender chosen
+:type age: string
+ +
fill_age(self, age)
fills the age text box
+:param age : the int that is filled in the text box
+:type age: int
+ +
fill_email(self, email)
fills the email text box
+:param email : the string that is filled in the text box
+:type email: string
+ +
fill_name(self, name)
fills the name text box
+:param name : the string that is filled in the text box
+:type name: string
+ +
fill_password(self, password)
fills the password text box
+:param password : the string that is filled in the text box
+:type password: string
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
age_text_field_id = 'com.example.projectx:id/signUpAge_et'
+ +
create_user_button_id = 'com.example.projectx:id/createUser_bt'
+ +
email_text_field_id = 'com.example.projectx:id/signUpEmail_et'
+ +
female_gender_check_box_id = 'com.example.projectx:id/signUpFemale_rb'
+ +
male_gender_check_box_id = 'com.example.projectx:id/signUpMale_rb'
+ +
name_text_field_id = 'com.example.projectx:id/signUpName_et'
+ +
password_text_field_id = 'com.example.projectx:id/signUpPassword_et'
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/__init__.html b/documentation/Mobile/Tests/__init__.html new file mode 100644 index 0000000..ebccb60 --- /dev/null +++ b/documentation/Mobile/Tests/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_authentication.html b/documentation/Mobile/Tests/test_authentication.html new file mode 100644 index 0000000..b702ec9 --- /dev/null +++ b/documentation/Mobile/Tests/test_authentication.html @@ -0,0 +1,84 @@ + +Python: module test_authentication + + + + + +
 
+ 
test_authentication
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_authentication.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestAuthentication +
+
+
+

+ + + + + + + +
 
+class TestAuthentication(builtins.object)
   A class used to represent the Authentication test
+...
+Attributes
+----------
+driver: webdriver
+     A web driver element to control the android app

+Methods
+-------

+test_case_1()
+      Clicks on the Sign up button and checks that it works
+test_case_2()
+     Clicks on the Login button and checks that it works
+test_case_3()
+     Checks that Facebook sign in button is available
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
Clicks on the Sign up button and checks that it works
+ +
test_case_2(self, setup)
Clicks on the Login button and checks that it works
+ +
test_case_3(self, setup)
Checks that Facebook sign in button is available
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_extra.html b/documentation/Mobile/Tests/test_extra.html new file mode 100644 index 0000000..35c4bcf --- /dev/null +++ b/documentation/Mobile/Tests/test_extra.html @@ -0,0 +1,77 @@ + +Python: module test_extra + + + + + +
 
+ 
test_extra
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_extra.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestPlayer +
+
+
+

+ + + + + + + +
 
+class TestPlayer(builtins.object)
   A class used to represent the Authentication test
+...
+Attributes
+----------
+driver: webdriver
+     A web driver element to control the android app

+Methods
+-------

+test_case_1()
+     checking the artist button
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
checking the artist button
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_home.html b/documentation/Mobile/Tests/test_home.html new file mode 100644 index 0000000..b97052c --- /dev/null +++ b/documentation/Mobile/Tests/test_home.html @@ -0,0 +1,105 @@ + +Python: module test_home + + + + + +
 
+ 
test_home
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_home.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestHome +
+
+
+

+ + + + + + + +
 
+class TestHome(builtins.object)
   A class used to represent the Home page test
+...
+Attributes
+----------
+driver: webdriver
+     A web driver element to control the android app

+Methods
+-------

+test_case_1()
+     Clicks on the log out button and checks that it works
+test_case_2()
+     checking the New  releases works
+test_case_3()
+     checking the Liked tracks works
+test_case_4()
+     checking the Popular tracks works
+test_case_5()
+     checking the Recommended tracks works
+test_case_6()
+     checking the About works
+test_case_7()
+     checking the Home works
+test_case_8()
+     checking the Search works
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
Clicks on the log out button and checks that it works
+ +
test_case_2(self, setup)
checking the New  releases works
+ +
test_case_3(self, setup)
checking the Liked tracks works
+ +
test_case_4(self, setup)
checking the Popular tracks works
+ +
test_case_5(self, setup)
checking the Recommended tracks works
+ +
test_case_6(self, setup)
checking the About works
+ +
test_case_7(self, setup)
checking the Home works
+ +
test_case_8(self, setup)
checking the Search works
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_login.html b/documentation/Mobile/Tests/test_login.html new file mode 100644 index 0000000..648fb81 --- /dev/null +++ b/documentation/Mobile/Tests/test_login.html @@ -0,0 +1,100 @@ + +Python: module test_login + + + + + +
 
+ 
test_login
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_login.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestLogin +
+
+
+

+ + + + + + + +
 
+class TestLogin(builtins.object)
   A class used to represent the Login page test
+...
+Attributes
+----------
+driver: webdriver
+     A web driver element to control the android app

+Methods
+-------

+test_case_1()
+     Login correctly
+test_case_2()
+     Login with wrong email
+test_case_3()
+     Login  with wrong email format
+test_case_4()
+     Login  with no email
+test_case_5()
+     Login  with wrong password
+test_case_6()
+     Login  with no password
+test_case_7()
+     Login  with no  password & email
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
Login correctly
+ +
test_case_2(self, setup)
Login with wrong email
+ +
test_case_3(self, setup)
Login  with wrong email format
+ +
test_case_4(self, setup)
Login  with no email
+ +
test_case_5(self, setup)
Login  with wrong password
+ +
test_case_6(self, setup)
Login  with no password
+ +
test_case_7(self, setup)
Login  with no  password & email
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_player.html b/documentation/Mobile/Tests/test_player.html new file mode 100644 index 0000000..e7bd6f6 --- /dev/null +++ b/documentation/Mobile/Tests/test_player.html @@ -0,0 +1,113 @@ + +Python: module test_player + + + + + +
 
+ 
test_player
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_player.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestPlayer +
+
+
+

+ + + + + + + +
 
+class TestPlayer(builtins.object)
   A class used to represent the Login page test
+...
+Attributes
+----------
+driver: webdriver
+     A web driver element to control the android app

+Methods
+-------

+test_case_1()
+     Checks that play button is visible and enabled
+test_case_2()
+     Checks that Previous button is visible and enabled
+test_case_3()
+     Checks that Next button is visible and enabled
+test_case_4()
+     Checks that Love button is visible and enabled
+test_case_5()
+     Checks that Download button is visible and enabled
+test_case_6()
+     Checks that Repeat button is visible and enabled
+test_case_7()
+     Checks that Share button is visible and enabled
+test_case_8()
+     Checks that minimize button is  working
+test_case_9()
+     Checks that Minimize button is visible and enabled
+test_case_10()
+     Checks that Blacklist button is visible and enabled
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
Checks that play button is visible and enabled
+ +
test_case_10(self, setup)
Checks that Blacklist button is visible and enabled
+ +
test_case_2(self, setup)
Checks that Previous button is visible and enabled
+ +
test_case_3(self, setup)
Checks that Next button is visible and enabled
+ +
test_case_4(self, setup)
Checks that Love button is visible and enabled
+ +
test_case_5(self, setup)
Checks that Download button is visible and enabled
+ +
test_case_6(self, setup)
Checks that Repeat button is visible and enabled
+ +
test_case_7(self, setup)
Checks that Share button is visible and enabled
+ +
test_case_8(self, setup)
Checks that minimize button is  working
+ +
test_case_9(self, setup)
Checks that Minimize button is visible and enabled
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +

+ \ No newline at end of file diff --git a/documentation/Mobile/Tests/test_signup.html b/documentation/Mobile/Tests/test_signup.html new file mode 100644 index 0000000..f9d10fd --- /dev/null +++ b/documentation/Mobile/Tests/test_signup.html @@ -0,0 +1,136 @@ + +Python: module test_signup + + + + + +
 
+ 
test_signup
index
/Users/KIMO/Desktop/Testing/Mobile_Testing/Tests/test_signup.py
+

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
appium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestSignup +
+
+
+

+ + + + + + + +
 
+class TestSignup(builtins.object)
   A class used to represent the Login page test
+...
+Attributes
+----------
+driver : webdriver
+     A web driver element to control the android app
+my_factory : Faker
+     An object that produces fake data
+name : string
+     A randomly generated name
+email : string
+     A randomly generated email
+password : string
+     A randomly generated password
+Methods
+-------

+test_case_1()
+     Signs up correctly
+test_case_2()
+     Signs up with same email
+test_case_3()
+     Signs up with no email
+test_case_4()
+     Signs up with no name
+test_case_5()
+     Signs up with no password
+test_case_6()
+     Signs up with no age
+test_case_7()
+     Signs up with female gender
+test_case_8()
+     Signs up with wrong name format
+test_case_9()
+     Signs up with wrong email format
+test_case_10()
+     Signs up with -ve age
+test_case_11()
+     Signs up with 0 age
+test_case_12()
+     Signs up with 999 age
 
 Methods defined here:
+
setup(self)
initiates the driver
+ +
test_case_1(self, setup)
Signs up correctly
+ +
test_case_10(self, setup)
Signs up with -ve age
+ +
test_case_11(self, setup)
Signs up with 0 age
+ +
test_case_12(self, setup)
Signs up with 999 age
+ +
test_case_2(self, setup)
Signs up with existing email
+ +
test_case_3(self, setup)
Signs up with no email
+ +
test_case_4(self, setup)
Signs up with no name
+ +
test_case_5(self, setup)
Signs up with no password
+ +
test_case_6(self, setup)
Signs up with no age
+ +
test_case_7(self, setup)
Signs up with female gender
+ +
test_case_8(self, setup)
Signs up with wrong name format
+ +
test_case_9(self, setup)
Signs up with wrong email format
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = None
+ +
email = 'leecynthia@gilmore.com'
+ +
my_factory = <faker.proxy.Faker object>
+ +
name = 'Mr. Bryan Walters'
+ +
password = 'N#N0E6IwY6'
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/AccountOverviewPage.html b/documentation/Web/Pages/AccountOverviewPage.html new file mode 100644 index 0000000..b04a968 --- /dev/null +++ b/documentation/Web/Pages/AccountOverviewPage.html @@ -0,0 +1,598 @@ + +Python: module AccountOverviewPage + + + + + +
 
+ 
AccountOverviewPage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/AccountOverviewPage.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
AccountOverviewPage +
+
+
+

+ + + + + + + +
 
+class AccountOverviewPage(Web_Testing.helperClasses.WebHelper)
   AccountOverviewPage(driver)

+A class used to represent Account Overview Page

+...

+Attributes
+----------
+spotify_logo : string
+    A string containing the xpath of spotify's logo
+profile_btn : string
+    A string containing the xpath of Profile button
+account_btn : string
+    A string containing the link text of Account link in profile option list
+logout_btn : string
+    A string containing the xpath of Logout button
+download_link_txt : string
+     A string containing the link text of Download link
+help_link_txt : string
+     A string containing the link text of Help link
+premium_link_txt : string
+    A string containing the link text of Premium link
+account_overview_link : string
+    A string containing the xpath of Account Overview button
+edit_profile_link : string
+    A string containing the xpath of Edit Profile button
+change_password_link : string
+    A string containing the xpath of Change Passwword button
+recover_playlists_link : string
+    A string containing the xpath of Recover Playlist button
+redeem_link : string
+    A string containing the xpath of Redeem button
+join_premium_btn : string
+    A string containing the link text of Join Premium button
+edit_profile_btn : string
+    A string containing the link text of Edit Profile button
+sign_out_btn : string
+    A string containing the link text of Sign Out button
+username_txt_xpath : string
+    A string containing the xpath of Username text
+email_txt_xpath : string
+    A string containing the xpath of Email text
+age_txt_xpath : string
+    A string containing the xpath of Age text
+username : string
+    A string containing username of the user
+email : sting
+    A string containing email of the user
+age : string
+    A string containing age of the user

+Methods
+-------
+initialize_account_overview_elements()
+    Initialize username, email and age with the information in the account overview page
+click_spotify_logo()
+    Clicks logo of spotify
+click_profile()
+    Clicks Profile button
+click_account()
+    Clicks Account button in profile list
+click_logout()
+    Clicks Logout button in profile list
+click_download_link()
+    Clicks Download button
+click_help_link()
+    Clicks Help button
+click_premium_link()
+    Clicks Premium button
+click_account_overview()
+    Clicks Account Overview button
+click_edit_profile()
+    Clicks Edit Profile link
+click_change_password()
+    Clicks Change Password button
+click_recover_playlists()
+    Clicks recover Playlists button
+click_redeem_link()
+    Clicks Redeem button
+click_edit_profile_btn()
+    Clicks Edit Profile button
+click_join_premium_btn()
+    Clicks Join Premium button
+click_signout_btn()
+    Clicks Sign Out button
+get_account_overview_username()
+    get username
+get_account_overview_email()
+    get email
+get_account_overview_age()
+    get age
+is_correct_username(username)
+    Checks if username is same as username given
+is_correct_email(email)
+    Checks if email is same as email given
+premium_check(premium)
+    check if premium status exist with premium account
+is_correct_age(age)
+    Checks if age is same as age given
+is_page_initialized()
+    Checks if currently on Account Overview page
+is_in_account_overview()
+    Checks if currently on Account Overview page
+account_overview_check(email, age, username)
+    Checks if information on Account Overview page is correct
 
 
Method resolution order:
+
AccountOverviewPage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
account_overview_check(self, email, age, username, premium)
Checks if information on Account Overview page is correct

+:param email : The email used for login
+:type email: str

+:param age : age of the login user
+:type age: str

+:param username : The username of the login user
+:type username: str

+:param premium : premium account or not
+:type premium: bool

+:returns: a boolean True if the information in account overview page is correct
+:rtype: bool

+:raises NoSuchElementException : If a Web Driver element cannot be found in the page
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_account_overview(self)
Clicks Account Overview button
+ +
click_change_password(self)
Clicks Change Password button
+ +
click_download_link(self)
Clicks Download button
+ +
click_edit_profile(self)
Clicks Edit Profile link
+ +
click_edit_profile_btn(self)
Clicks Edit Profile button
+ +
click_help_link(self)
Clicks Help button
+ +
click_join_premium_btn(self)
Clicks Join Premium button
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_premium_link(self)
Clicks Premium button
+ +
click_profile(self)
Clicks Profile button
+ +
click_recover_playlists(self)
Clicks Recover Playlists button
+ +
click_redeem_link(self)
Clicks Redeem button
+ +
click_signout_btn(self)
Clicks Sign Out button
+ +
click_spotify_logo(self)
Clicks logo of spotify
+ +
get_account_overview_age(self)
get age

+:return: age in the account overview page
+:rtype: str
+ +
get_account_overview_email(self)
get email

+:return: email in the account overview page
+:rtype: str
+ +
get_account_overview_username(self)
get username

+:return: username in the account overview page
+:rtype: str
+ +
initialize_account_overview_elements(self)
Initialize username, email and age with the information in the account overview page
+ +
is_correct_age(self, age)
Checks if age is same as age given

+:param age : the age to be compared
+:type age: str

+:return: a boolean True if age in the account overview page is equal given age
+:rtype: bool
+ +
is_correct_email(self, email)
Checks if email is same as email given

+:param email : the email to be compared
+:type email: str

+:return: a boolean True if email in the account overview page is equal given email
+:rtype: bool
+ +
is_correct_username(self, username)
Checks if username is same as username given

+:param username : the username to be compared
+:type username: str

+:return: a boolean True if username in the account overview page is equal given username
+:rtype: bool
+ +
is_page_initialized(self)
Checks if currently on Account Overview page

+:return: a boolean if currently in account overview
+:rtype: bool
+ +
premium_check(self, premium)
check if premium status exist with premium account

+:param premium: premium account or not
+:type: bool

+:return: true if join premium button don't exist when premium is true and exist when premium is false
+:type: bool
+ +
+Data and other attributes defined here:
+
account_btn = 'Account'
+ +
account_overview_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[2]"
+ +
age_txt_xpath = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[2]/div/div[3]/div/div[3]/div[2]"
+ +
change_password_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[4]"
+ +
download_link_txt = 'Download'
+ +
edit_profile_btn = 'EDIT PROFILE'
+ +
edit_profile_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[3]"
+ +
email_txt_xpath = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[2]/div/div[3]/div/div[2]/div[2]"
+ +
help_link_txt = 'Help'
+ +
join_premium_btn = 'JOIN PREMIUM'
+ +
logout_btn = "//*[@id='root']/div/div/div/div[1]/div/nav/div/ul/li[8]/li/div/button[2]/button"
+ +
premium_link_txt = 'Premium'
+ +
profile_btn = "//*[@id='root']/div/div/div/div[1]/div/nav/div/ul/li[8]/li/a"
+ +
recover_playlists_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[5]"
+ +
redeem_link = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[1]/div/a[6]"
+ +
sign_out_btn = 'SIGN OUT'
+ +
spotify_logo = "//*[@id='root']/div/div/div/div[1]/div/nav/a/img"
+ +
username_txt_xpath = "//*[@id='root']/div/div/div/div[2]/div[2]/div/div[2]/div/div[3]/div/div[1]/div[2]"
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/ChangePasswordPage.html b/documentation/Web/Pages/ChangePasswordPage.html new file mode 100644 index 0000000..3fcd3da --- /dev/null +++ b/documentation/Web/Pages/ChangePasswordPage.html @@ -0,0 +1,464 @@ + +Python: module ChangePasswordPage + + + + + +
 
+ 
ChangePasswordPage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/ChangePasswordPage.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
ChangePasswordPage +
+
+
+

+ + + + + + + +
 
+class ChangePasswordPage(Web_Testing.helperClasses.WebHelper)
   ChangePasswordPage(driver)

+A class used to provide helper function to ease testing

+...

+Attributes
+----------
+base_url : str
+    holds the base url for the website
+month_dict : dict
+    a dictionary that maps the month name to month number
+driver : WebDriver
+    holds the web driver of the class

+Methods
+-------
+get_login_url(email)
+    gets the login url of the website
+get_signup_url(email)
+    gets the signup url of the website
+get_premium_url(email)
+    gets the premium url of the website
+get_home_url(email)
+    gets the home url of the website
+get_account_overview_url(email)
+    gets the account overview url of the website
+get_account_edit_url(email)
+    gets the account edit url of the website
+get_account_changepassword_url()
+    gets the change password url of the website
+get_signup_url()
+    gets the sign up url of the website
+set_driver(driver)
+    sets the class' driver with the input driver
+chrome_driver_init()
+    initializes the chrome driver
+firefox_driver_init()
+    initializes the firefox driver
+get_driver()
+    gets the class' driver
+url_has(text, driver=None)
+    checks if the current driver url contains the input text
+element_exists_by_xpath(xpath)
+    Checks if an element exists with the input xpath
+element_exists_by_class(class_name)
+    Checks if an element exists with the input class name
+element_exists_by_id(vid)
+    Checks if an element exists with the input id
+find_element_by_xpath(xpath)
+    finds the element with the given xpath
+find_elements_by_xpath(xpath)
+    finds the elements with the given xpath
+find_element_by_class_name(class_name)
+    finds the element with the given class name
+find_elements_by_class_name(class_name, driver=None)
+    finds the elements with the given class name
+find_element_by_id(vid)
+    finds the element with the given id
+find_elements_by_id(vid)
+    finds the elements with the given id
+find_element_by_name(vname)
+    finds the element with the given name
+find_elements_by_name(vname)
+    finds the elements with the given name
+find_element_by_link_text(link_txt)
+    finds the element with the given link text
+find_elements_by_link_text(link_txt)
+    finds the elements with the given link text
+select_element_by_index(element, index)
+    selects an option from the provided element using a given index
+select_element_by_text(element, text)
+    selects an option from the provided element using a given text
+hover_to_element(element, driver)
+    Hovers the mouse over an element
+get_month_dict()
+    gets the month name to month number dictionary
+get_month_name_from(in_val)
+    gets the month name from the input month number
+get_month_val_from(name)
+    gets the month number from the input month name
+click_button(btn)
+    clicks on the given button
+fill(txt_element, text)
+    fills the provided text field with the given text
+clear_txt(txt_element)
+    clears the given text field
+click_button_safe(btn)
+    safely clicks on the given button without causing a crash
+fill_safe(txt_element, text)
+    safely fills the provided text field with the given text without causing a crash
+clear_txt_safe(txt_element)
+    safely clears the given text field without causing a crash
+screenshot(driver)
+    takes a screenshot of the website using the given driver
+report_allure(msg, driver=None)
+    attaches a screenshot to allure's report with a given message
 
 
Method resolution order:
+
ChangePasswordPage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the class' driver to None
+ +
change_password(self, new_password, confirm_password) -> bool
changes the user's password

+:param new_password: the new password of the user
+:type new_password: str

+:param confirm_password: the confirmation password
+:type confirm_password: str

+:returns: a boolean True if succeeded to change password, False otherwise
+:rtype: bool
+ +
clear_all(self)
clears all text fields in the page
+ +
is_dangers_visible(self) -> bool
checks if text dangers/warnings are visible

+:returns: a boolean True if visible, False otherwise
+:rtype: bool
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/EditProfilePage.html b/documentation/Web/Pages/EditProfilePage.html new file mode 100644 index 0000000..9305fd4 --- /dev/null +++ b/documentation/Web/Pages/EditProfilePage.html @@ -0,0 +1,450 @@ + +Python: module EditProfilePage + + + + + +
 
+ 
EditProfilePage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/EditProfilePage.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
EditProfilePage +
+
+
+

+ + + + + + + +
 
+class EditProfilePage(Web_Testing.helperClasses.WebHelper)
   EditProfilePage(driver)

+A class used to provide helper function to ease testing

+...

+Attributes
+----------
+base_url : str
+    holds the base url for the website
+month_dict : dict
+    a dictionary that maps the month name to month number
+driver : WebDriver
+    holds the web driver of the class

+Methods
+-------
+get_login_url(email)
+    gets the login url of the website
+get_signup_url(email)
+    gets the signup url of the website
+get_premium_url(email)
+    gets the premium url of the website
+get_home_url(email)
+    gets the home url of the website
+get_account_overview_url(email)
+    gets the account overview url of the website
+get_account_edit_url(email)
+    gets the account edit url of the website
+get_account_changepassword_url()
+    gets the change password url of the website
+get_signup_url()
+    gets the sign up url of the website
+set_driver(driver)
+    sets the class' driver with the input driver
+chrome_driver_init()
+    initializes the chrome driver
+firefox_driver_init()
+    initializes the firefox driver
+get_driver()
+    gets the class' driver
+url_has(text, driver=None)
+    checks if the current driver url contains the input text
+element_exists_by_xpath(xpath)
+    Checks if an element exists with the input xpath
+element_exists_by_class(class_name)
+    Checks if an element exists with the input class name
+element_exists_by_id(vid)
+    Checks if an element exists with the input id
+find_element_by_xpath(xpath)
+    finds the element with the given xpath
+find_elements_by_xpath(xpath)
+    finds the elements with the given xpath
+find_element_by_class_name(class_name)
+    finds the element with the given class name
+find_elements_by_class_name(class_name, driver=None)
+    finds the elements with the given class name
+find_element_by_id(vid)
+    finds the element with the given id
+find_elements_by_id(vid)
+    finds the elements with the given id
+find_element_by_name(vname)
+    finds the element with the given name
+find_elements_by_name(vname)
+    finds the elements with the given name
+find_element_by_link_text(link_txt)
+    finds the element with the given link text
+find_elements_by_link_text(link_txt)
+    finds the elements with the given link text
+select_element_by_index(element, index)
+    selects an option from the provided element using a given index
+select_element_by_text(element, text)
+    selects an option from the provided element using a given text
+hover_to_element(element, driver)
+    Hovers the mouse over an element
+get_month_dict()
+    gets the month name to month number dictionary
+get_month_name_from(in_val)
+    gets the month name from the input month number
+get_month_val_from(name)
+    gets the month number from the input month name
+click_button(btn)
+    clicks on the given button
+fill(txt_element, text)
+    fills the provided text field with the given text
+clear_txt(txt_element)
+    clears the given text field
+click_button_safe(btn)
+    safely clicks on the given button without causing a crash
+fill_safe(txt_element, text)
+    safely fills the provided text field with the given text without causing a crash
+clear_txt_safe(txt_element)
+    safely clears the given text field without causing a crash
+screenshot(driver)
+    takes a screenshot of the website using the given driver
+report_allure(msg, driver=None)
+    attaches a screenshot to allure's report with a given message
 
 
Method resolution order:
+
EditProfilePage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the class' driver to None
+ +
clear_all(self)
+ +
edit_profile(self, username: str, email: str, age: int)
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/LikedSongs.html b/documentation/Web/Pages/LikedSongs.html new file mode 100644 index 0000000..4351e9e --- /dev/null +++ b/documentation/Web/Pages/LikedSongs.html @@ -0,0 +1,480 @@ + +Python: module LikedSongs + + + + + +
 
+ 
LikedSongs
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/LikedSongs.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu(Web_Testing.helperClasses.WebHelper) +
+
+
LikedSongs +
+
+
+

+ + + + + + + +
 
+class LikedSongs(Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu)
   LikedSongs(driver)

+A class representing the Web Player's Liked songs
+...

+Attributes
+----------
+profile_btn : string
+      A string containing the xpath of profile button
+logout_btn : string
+      A string containing the xpath of log out button
+account_btn : string
+      A string containing the link text of account button
+upgrade_btn : string
+      A string containing the link text of upgrade button
+playlist_cards : string
+      A string containing the class name of playlist cards
+no_of_songs_xpath : string
+      A string containing the xpath of number of song in the playlist
+playlist_name_class_name : string
+      A string containing the class name of playlist's name in the playlist page
+songs_container : string
+      A string containing the class name of songs in the playlist
+no_of_songs : integer
+      An integer containing the number of songs displayed in the playlist page
+playlist_name_card : string
+     A sting containing the name of the play list from the playlist card
+page_left_btn : WebDriverElement
+     a Web driver element representing the Page left button
+page_right_btn : WebDriverElement
+     a Web driver element representing the Page right button

+Methods
+-------
+click_liked_songs()
+    Clicks the Liked Songs Play button in the card
+click_liked_songs_txt()
+    Clicks the Liked Songs Text button in the card
+check_liked_songs_click()
+    Checks if clicking the Liked Songs card goes to the right page
+check_card_click(card_no, report_allure)
+    Checks if clicking a playlist card goes to the right page
 
 
Method resolution order:
+
LikedSongs
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_liked_songs(self)
Checks if clicking a playlist card goes to the right playlist

+:param card_no: the playlist's card number
+:type card_no: int

+:param report_allure: a boolean that represents whether or not to report the result to allure
+:type report_allure: bool

+:returns: a boolean True if clicking the Playlist card goes to the right playlist, False otherwise
+:rtype: bool
+ +
check_upgrade(self, premium)
check the upgrade button existence with the type of the account

+:param premium: boolean to show if this account is premium or not
+:type: bool

+:return: true if join premium button don't exist when premium is true and exist when premium is false
+:type: bool
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_logout_button(self)
Clicks Logout button in profile list
+ +
click_page_left(self)
Clicks page left button
+ +
click_page_right(self)
Clicks page right button
+ +
click_profile(self)
Clicks Profile button
+ +
click_upgrade(self)
Clicks upgrade button
+ +
click_webplayer(self)
+ +
+Data and other attributes defined here:
+
account_btn = 'Account'
+ +
logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...v/div/div/nav/ul[2]/li/li/div[2]/button[3]/button"
+ +
no_of_songs = 0
+ +
no_of_songs_xpath = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...ion/div/div/div[1]/div/header/div[2]/div[2]/div/p"
+ +
page_left_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[1]/button/a'
+ +
page_right_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[2]/button/a'
+ +
profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...div/div/div/div/div/nav/ul[2]/li/li/div[1]/button"
+ +
songs_container = 'TrackListContainer'
+ +
upgrade_btn = 'UPGRADE'
+ +
+Methods inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_liked_songs(self)
Clicks Liked Songs button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/LoggedOutHome.html b/documentation/Web/Pages/LoggedOutHome.html new file mode 100644 index 0000000..475cb4b --- /dev/null +++ b/documentation/Web/Pages/LoggedOutHome.html @@ -0,0 +1,393 @@ + +Python: module LoggedOutHome + + + + + +
 
+ 
LoggedOutHome
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/LoggedOutHome.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
LoggedOutHome +
+
+
+

+ + + + + + + +
 
+class LoggedOutHome(Web_Testing.helperClasses.WebHelper)
   LoggedOutHome(driver)

+A class used to represent the Login Page

+...

+Attributes
+----------
+tb_download_btn : WebDriverElement
+    a Web Driver element representing the Download button
+tb_help_btn : WebDriverElement
+    a Web Driver element representing the help button
+tb_premium_btn : WebDriverElement
+    a Web Driver element representing the premium button
+getspotify_btn : WebDriverElement
+    a Web Driver element representing the get spotify button
+fb_btn : WebDriverElement
+    a Web Driver element representing the facebook page link button
+twitter_btn : WebDriverElement
+    a Web Driver element representing the twitter page link button
+tb_signup_btn : WebDriverElement
+    a Web Driver element representing the Signup button
+tb_login_btn : WebDriverElement
+    a Web Driver element representing the Login button

+Methods
+-------
+click_signup()
+    Clicks on the signup button
+click_login()
+    Clicks on the login button
+click_premium()
+    Clicks on the premium button
 
 
Method resolution order:
+
LoggedOutHome
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
click_login(self)
Clicks on the login button
+ +
click_premium(self)
Clicks on the premium button
+ +
click_signup(self)
Clicks on the signup button
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/LoginPage.html b/documentation/Web/Pages/LoginPage.html new file mode 100644 index 0000000..e76aa21 --- /dev/null +++ b/documentation/Web/Pages/LoginPage.html @@ -0,0 +1,451 @@ + +Python: module LoginPage + + + + + +
 
+ 
LoginPage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/LoginPage.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
LoginPage +
+
+
+

+ + + + + + + +
 
+class LoginPage(Web_Testing.helperClasses.WebHelper)
   LoginPage(driver)

+A class used to represent the Login Page

+...

+Attributes
+----------
+fb_btn : WebDriverElement
+    a Web Driver element representing the Login with Facebook button
+email_txt : WebDriverElement
+    a Web Driver element representing the Email Text Field
+pass_txt : WebDriverElement
+    a Web Driver element representing the Password Text Field
+login_btn : WebDriverElement
+    a Web Driver element representing the Login button
+forgot_pass_btn : WebDriverElement
+    a Web Driver element representing the Forgot Password button
+signup_btn : WebDriverElement
+    a Web Driver element representing the Signup button
+text_danger : WebDriverElement
+    a Web Driver element representing the Text Field warnings

+Methods
+-------
+set_email(email)
+    Fills the email text field with the given email
+set_password(password)
+    Fills the password text field with the given password
+clear_credentials()
+    Clears the email and password text fields
+set_credentials(email, password)
+    Set the email and password text fields with the given email and password
+click_signup()
+    Clicks on the signup button
+click_login()
+    Clicks on the login button
+invalid_user_text_appeared()
+    Checks if the "Invalid username/password" text appeared
+check_login_page()
+    Checks if currently on login page
+is_in_account_overview()
+    Checks if currently on Account Overview page
+login_to_spotify(email, password)
+    Login with the given email and password
 
 
Method resolution order:
+
LoginPage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_login_page(self)
Checks if currently in login page

+:returns: a boolean if currently in login page
+:rtype: bool
+ +
clear_credentials(self)
Clears the email and password text fields
+ +
click_login(self)
Clicks on the login button
+ +
click_signup(self)
Clicks on the signup button
+ +
invalid_user_text_appeared(self)
Checks if the "Invalid username/password" text appeared

+:returns: a boolean if the invalid user text has appeared
+:rtype: bool
+ +
is_in_account_overview(self)
Checks if currently in Account Overview page

+:returns: a boolean if currently in account overview
+:rtype: bool
+ +
login_to_spotify(self, email, password)
Login with the given email and password

+:param email : The email used for login
+:type email: str

+:param password : The password used for login
+:type password: str

+:returns: a boolean True if succeeded to login
+:rtype: bool

+:raises NoSuchElementException : If a Web Driver element cannot be found in the page
+ +
set_credentials(self, email, password)
Set the email and password text fields with the given email and password

+:param email : The email to fill the text field with
+:type email: str

+:param password : The password to fill the text field with
+:type password: str
+ +
set_email(self, email)
Fills the email text field with the given email

+:param email : The email to fill the text field with
+:type email: str
+ +
set_password(self, password)
Fills the password text field with the given password

+:param password : The password to fill the text field with
+:type password: str
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/SignupPage.html b/documentation/Web/Pages/SignupPage.html new file mode 100644 index 0000000..631cb75 --- /dev/null +++ b/documentation/Web/Pages/SignupPage.html @@ -0,0 +1,507 @@ + +Python: module SignupPage + + + + + +
 
+ 
SignupPage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/SignupPage.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
SignupPage +
+
+
+

+ + + + + + + +
 
+class SignupPage(Web_Testing.helperClasses.WebHelper)
   SignupPage(driver)

+A class used to represent the Login Page

+...

+Attributes
+----------
+signup_with_facebook : WebDriverElement
+    a Web Driver element representing the Signup with Facebook button
+email_txt : WebDriverElement
+    a Web Driver element representing the Email Text Field
+confirm_email_txt : WebDriverElement
+    a Web Driver element representing the Confirm Email Text Field
+password_txt : WebDriverElement
+    a Web Driver element representing the Password Text Field
+display_name_txt : WebDriverElement
+    a Web Driver element representing the username Text Field
+dob_day_txt : WebDriverElement
+    a Web Driver element representing birth date day Text Field
+dob_month_txt : WebDriverElement
+    a Web Driver element representing birth month day Text Field
+dob_year_txt : WebDriverElement
+    a Web Driver element representing birth year day Text Field
+radio_btns : WebDriverElement
+    a Web Driver element representing the gender radio buttons
+gender_male : WebDriverElement
+    a Web Driver element representing the male radio button
+gender_female : WebDriverElement
+    a Web Driver element representing the female radio button
+signup : WebDriverElement
+    a Web Driver element representing the Signup button
+login : WebDriverElement
+    a Web Driver element representing the Login button

+Methods
+-------
+check_signup_page()
+    Checks if currently in signup page
+select_month_by_text(month)
+    selects the given month from the birth date month drop down
+select_month_by_index(m_index)
+    selects the given index from the birth date month drop down
+set_email(email)
+    Fills the email text field with the given email
+set_confirm_email(email)
+    Fills the confirm email text field with the given email
+set_password(password)
+    Fills the password text field with the given password
+clear_credentials()
+    Clears the email, confirm email and password text fields
+clear_all()
+    Clears all text fields in th page
+set_dob(dob)
+    Fills the birth date day, month and year text fields
+set_credentials(email, conf_email, password)
+    Set the email, confirm email and password text fields with the given email, conf_email and password
+select_gender(gender)
+    Selects a gender radio button based on the given gender
+click_signup()
+    Clicks on the signup button
+is_text_dangers_visible()
+    Checks if any warning texts appeared/visible
+is_in_login_page()
+    Checks if currently in login page
+is_in_account_overview()
+    Checks if currently in Account Overview page
+click_login()
+    Clicks on the login button
+signup_to_spotify(profile)
+    sign up with the given user profile
 
 
Method resolution order:
+
SignupPage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_signup_page(self)
Checks if currently in signup page

+:returns: a boolean if currently in signup page
+:rtype: bool
+ +
clear_all(self)
Clears all text fields in th page
+ +
clear_credentials(self)
Clears the email, confirm email and password text fields
+ +
click_login(self)
Clicks on the login button
+ +
click_signup(self)
Clicks on the signup button
+ +
is_in_account_overview(self)
Checks if currently in Account Overview page

+:returns: a boolean if currently in Account Overview page
+:rtype: bool
+ +
is_in_login_page(self)
Checks if currently in login page

+:returns: a boolean if currently in login page
+:rtype: bool
+ +
is_text_dangers_visible(self)
Checks if any warning texts appeared/visible

+:returns: a boolean True if the warnings appeared, False otherwise
+:rtype: bool
+ +
select_gender(self, gender)
Selects a gender radio button based on the given gender

+:param gender: the user's gender
+:type gender: Gender
+ +
select_month_by_index(self, m_index)
selects the given index from the birth date month drop down

+:param m_index: the month number
+:type m_index: int
+ +
select_month_by_text(self, month)
selects the given month from the birth date month drop down

+:param month: the month name
+:type month: str
+ +
set_confirm_email(self, email)
Fills the confirm email text field with the given email

+:param email: the user's confirmation email
+:type email: str
+ +
set_credentials(self, email, conf_email, password)
Set the email, confirm email and password text fields with the given email, conf_email and password

+:param email: the user's email
+:type email: str

+:param conf_email: the user's confirmation email
+:type conf_email: str

+:param password: the user's password
+:type password: str
+ +
set_dob(self, dob)
Fills the birth date day, month and year text fields

+:param dob: the dob object holding the birth date day, month and year
+:type dob: DOB
+ +
set_email(self, email)
Fills the email text field with the given email

+:param email: the user's email
+:type email: str
+ +
set_password(self, password)
Fills the password text field with the given password

+:param password: the user's password
+:type password: str
+ +
signup_to_spotify(self, profile)
sign up with the given user profile

+:param profile: the user's profile
+:type profile: Profile

+:returns: a boolean True if succeeded to signup, False otherwise
+:rtype: bool
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/StatusPage.html b/documentation/Web/Pages/StatusPage.html new file mode 100644 index 0000000..7d2c1e2 --- /dev/null +++ b/documentation/Web/Pages/StatusPage.html @@ -0,0 +1,71 @@ + +Python: module StatusPage + + + + + +
 
+ 
StatusPage
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/StatusPage.py
+

+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
StatusPage +
+
+
+

+ + + + + + + +
 
+class StatusPage(builtins.object)
   StatusPage(driver)

+
 
 Methods defined here:
+
__init__(self, driver)
Initialize self.  See help(type(self)) for accurate signature.
+ +
check_status_page(self)
+ +
click_account_overview_link(self)
+ +
click_log_out_button(self)
+ +
click_logo(self)
+ +
click_web_player_link(self)
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
account_overview_link = "//a[text()='Account Overview']"
+ +
log_out_button = "//button[text()='Log Out']"
+ +
spotify_logo = "//a[@title='Spotify']"
+ +
web_player_link = "//*[@id='app']/body/div/div[2]/div/div/div[4]/div/a"
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/WebPlayerHome.html b/documentation/Web/Pages/WebPlayerHome.html new file mode 100644 index 0000000..b1c4da8 --- /dev/null +++ b/documentation/Web/Pages/WebPlayerHome.html @@ -0,0 +1,506 @@ + +Python: module WebPlayerHome + + + + + +
 
+ 
WebPlayerHome
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/WebPlayerHome.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu(Web_Testing.helperClasses.WebHelper) +
+
+
WebPlayerHome +
+
+
+

+ + + + + + + +
 
+class WebPlayerHome(Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu)
   WebPlayerHome(driver)

+A class used to represent the Web Player Home
+...

+Attributes
+----------
+upgrade_link : WebDriverElement
+     a Web driver element representing the upgrade button
+spotify_logo : WebDriverElement
+     a Web driver element representing the spotify logo
+signup_btn : WebDriverElement
+     a Web driver element representing the signup button
+login_btn : WebDriverElement
+     a Web driver element representing the login button
+signup_popup_btn : WebDriverElement
+     a Web driver element representing the signup button that appears in the popup window
+login_popup_btn : WebDriverElement
+     a Web driver element representing the login button that appears in the popup window
+close_popup_btn : WebDriverElement
+     a Web driver element representing the close button that appears in the popup window
+popup_window : WebDriverElement
+     a Web driver element representing the popup window
+all_cards : list
+     a list of all the cards available in the home page
+all_headers : list
+     a list of all the headers/categories available in the home page
+header_names_to_cards : dict
+     a dict that maps the header names/categories to the list of cards in this category


+Methods
+-------
+is_in_your_library()
+    Checks if currently in Your Library Page
+is_in_liked_songs()
+    Checks if currently in Liked Songs Page
+initialize_popup_window()
+    Initializes the elements of the popup window
+is_popup_window_visible()
+    Checks if the popup menu is visible
+map_headers_to_cards(all_headers, all_cards)
+    Return a dict that maps the header names/categories to the list of cards in this category
+get_cards_for_header(all_cards, y_pos_header)
+    Returns a list of cards corresponding to a header's y position
+get_cards_of(category)
+    Returns a list of cards for a given category name
+check_card_click(category_name, card_no, report_allure)
+    Checks if clicking a card goes to the correct page
+check_sign_out()
+    Checks sign out and popup window that appears after the sign out
+click_login()
+    Clicks the login button
+click_signup()
+    Clicks the signup button
 
 
Method resolution order:
+
WebPlayerHome
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_card_click(self, category_name, card_no, report_allure: bool)
Checks if clicking a card goes to the correct page

+:param category_name: the name of the category to click a card from
+:type category_name: str

+:param card_no: the card number in the given category
+:type card_no: int

+:param report_allure: a boolean that represents whether or not to report the result to allure
+:type report_allure: bool

+:returns: a boolean True if went to the correct page, False otherwise
+:rtype: bool
+ +
check_sign_out(self) -> bool
Checks sign out and popup window that appears after the sign out

+:returns: a boolean True if signout is successful and popup appeared, False otherwise
+:rtype: bool
+ +
click_login(self)
Clicks the login button
+ +
click_signup(self)
Clicks the signup button
+ +
get_cards_for_header(self, all_cards, y_pos_header)
Gets a list of cards corresponding to a header's y position

+:param all_cards: list of all the cards in the page
+:type all_cards: list

+:param y_pos_header: the y position of the given header to get the cards of
+:type y_pos_header: int

+:returns: a list of cards for the given header's y position
+ +
get_cards_of(self, category)
Gets a list of cards corresponding to a category name

+:param category: the category name to get the cards of
+:type category: str

+:returns: a list of cards for the given header's name/category
+ +
initialize_popup_window(self)
Initializes the elements of the popup window
+ +
is_in_liked_songs(self) -> bool
Checks if currently in Liked Songs Page
+:returns: a boolean True if currently in Liked Songs page, False otherwise
+:rtype: bool
+ +
is_in_your_library(self) -> bool
Checks if currently in Your Library Page
+:returns: a boolean True if currently in Your Library page, False otherwise
+:rtype: bool
+ +
is_popup_window_visible(self)
Checks if the popup menu is visible
+:return: a boolean True if the popup menu is visible, False otherwise
+:rtype: bool
+ +
map_headers_to_cards(self, all_headers, all_cards)
Gets a dict that maps the header names/categories to the list of cards in this category
+:param all_headers: list of all the header elements in the page
+:type all_headers: list

+:param all_cards: list of all the cards in the page
+:type all_cards: list

+:returns: a dict that maps the header names/categories to the list of cards in this category
+:rtype: dict
+ +
+Methods inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
click_account(self)
Clicks Account button in profile list
+ +
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_liked_songs(self)
Clicks Liked Songs button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/WebPlayerLibrary.html b/documentation/Web/Pages/WebPlayerLibrary.html new file mode 100644 index 0000000..05913d9 --- /dev/null +++ b/documentation/Web/Pages/WebPlayerLibrary.html @@ -0,0 +1,439 @@ + +Python: module WebPlayerLibrary + + + + + +
 
+ 
WebPlayerLibrary
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/WebPlayerLibrary.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu(Web_Testing.helperClasses.WebHelper) +
+
+
WebPlayerLibrary +
+
+
+

+ + + + + + + +
 
+class WebPlayerLibrary(Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu)
   WebPlayerLibrary(driver)

+A class representing the Web Player's Your Library Page
+...

+Attributes
+----------
+create_new_playlist_button : WebDriverElement
+     a Web driver element representing the Create new playlist button
+profile_btn : WebDriverElement
+     a Web driver element representing the profile drop down button button
+logout_btn : WebDriverElement
+     a Web driver element representing the logout button
+account_btn : WebDriverElement
+     a Web driver element representing the Account button
+liked_songs : WebDriverElement
+     a Web driver element representing the Liked Songs button
+library_cards : WebDriverElement
+     a Web driver element representing the Library cards button
+page_left_btn : WebDriverElement
+     a Web driver element representing the Page left button
+page_right_btn : WebDriverElement
+     a Web driver element representing the Page right button

+Methods
+-------
+click_liked_songs()
+    Clicks the Liked Songs Play button in the card
+click_liked_songs_txt()
+    Clicks the Liked Songs Text button in the card
+check_liked_songs_click()
+    Checks if clicking the Liked Songs card goes to the right page
+check_card_click(card_no, report_allure)
+    Checks if clicking a playlist card goes to the right page
 
 
Method resolution order:
+
WebPlayerLibrary
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_card_click(self, card_no, report_allure: bool)
Checks if clicking a playlist card goes to the right page

+:param card_no: the playlist's card number
+:type card_no: int

+:param report_allure: a boolean that represents whether or not to report the result to allure
+:type report_allure: bool

+:returns: a boolean True if clicking the Playlist card goes to the right page, False otherwise
+:rtype: bool
+ +
check_liked_songs_click(self)
Checks if clicking the Liked Songs card goes to the right page

+:returns: a boolean True if clicking the Liked Songs card goes to the right page, False otherwise
+:rtype: bool
+ +
click_liked_songs(self)
Clicks the Liked Songs Play button in the card
+ +
click_liked_songs_txt(self)
Clicks the Liked Songs Text button in the card
+ +
+Methods inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
click_account(self)
Clicks Account button in profile list
+ +
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/WebPlayerMenu.html b/documentation/Web/Pages/WebPlayerMenu.html new file mode 100644 index 0000000..0f81f07 --- /dev/null +++ b/documentation/Web/Pages/WebPlayerMenu.html @@ -0,0 +1,433 @@ + +Python: module WebPlayerMenu + + + + + +
 
+ 
WebPlayerMenu
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/WebPlayerMenu.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
WebPlayerMenu +
+
+
+

+ + + + + + + +
 
+class WebPlayerMenu(Web_Testing.helperClasses.WebHelper)
   WebPlayerMenu(driver)

+A class used to represent the Web Player Menu
+...

+Attributes
+----------
+home_xpath : str
+     a string representing the home button xpath
+search_xpath : str
+    a string representing the search button xpath
+your_library_xpath : str
+    a string representing Your Library button xpath
+liked_songs_xpath : str
+    a string representing the Liked Songs button xpath
+create_playlist_xpath : str
+    a string representing the Create Playlist button xpath
+profile_menu_xpath : str
+    a string representing the Profile dropdown button xpath
+logout_btn_xpath : str
+    a string representing the logout button xpath
+account_btn_xpath : str
+    a string representing the account button xpath
+home_link : WebDriverElement
+    a Web Driver element representing the home button
+your_library_button : WebDriverElement
+    a Web Driver element representing Your Library button
+liked_songs_link : WebDriverElement
+    a Web Driver element representing the Liked Songs button
+profile_btn : WebDriverElement
+    a Web Driver element representing the Profile button


+Methods
+-------
+click_logout()
+    Clicks Logout button in profile list
+click_your_library()
+    Clicks Your Library button in web player menu
+click_account()
+    Clicks Account button in profile list
+click_liked_songs()
+    Clicks Liked Songs button in web player menu
+click_search()
+    Clicks Search button in web player menu
+click_create_playlist()
+    Clicks Create playlist button in web player menu
+click_home()
+    Clicks Home button in web player menu
 
 
Method resolution order:
+
WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_liked_songs(self)
Clicks Liked Songs button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes defined here:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/WebPlayerPlaylist.html b/documentation/Web/Pages/WebPlayerPlaylist.html new file mode 100644 index 0000000..4a23afe --- /dev/null +++ b/documentation/Web/Pages/WebPlayerPlaylist.html @@ -0,0 +1,490 @@ + +Python: module WebPlayerPlaylist + + + + + +
 
+ 
WebPlayerPlaylist
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/WebPlayerPlaylist.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu(Web_Testing.helperClasses.WebHelper) +
+
+
WebPlayerPlaylist +
+
+
+

+ + + + + + + +
 
+class WebPlayerPlaylist(Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu)
   WebPlayerPlaylist(driver)

+A class representing the Web Player's playlist
+...

+Attributes
+----------
+profile_btn : string
+      A string containing the xpath of profile button
+logout_btn : string
+      A string containing the xpath of log out button
+account_btn : string
+      A string containing the link text of account button
+upgrade_btn : string
+      A string containing the link text of upgrade button
+playlist_cards : string
+      A string containing the class name of playlist cards
+no_of_songs_xpath : string
+      A string containing the xpath of number of song in the playlist
+playlist_name_class_name : string
+      A string containing the class name of playlist's name in the playlist page
+songs_container : string
+      A string containing the class name of songs in the playlist
+no_of_songs : integer
+      An integer containing the number of songs displayed in the playlist page
+playlist_name_card : string
+     A sting containing the name of the play list from the playlist card
+page_left_btn : WebDriverElement
+     a Web driver element representing the Page left button
+page_right_btn : WebDriverElement
+     a Web driver element representing the Page right button

+Methods
+-------
+click_liked_songs()
+    Clicks the Liked Songs Play button in the card
+click_liked_songs_txt()
+    Clicks the Liked Songs Text button in the card
+check_liked_songs_click()
+    Checks if clicking the Liked Songs card goes to the right page
+check_card_click(card_no, report_allure)
+    Checks if clicking a playlist card goes to the right page
 
 
Method resolution order:
+
WebPlayerPlaylist
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_playlist(self, card_no, report_allure: bool)
Checks if clicking a playlist card goes to the right playlist

+:param card_no: the playlist's card number
+:type card_no: int

+:param report_allure: a boolean that represents whether or not to report the result to allure
+:type report_allure: bool

+:returns: a boolean True if clicking the Playlist card goes to the right playlist, False otherwise
+:rtype: bool
+ +
check_upgrade(self, premium)
check the upgrade button existence with the type of the account

+:param premium: boolean to show if this account is premium or not
+:type: bool

+:return: true if join premium button don't exist when premium is true and exist when premium is false
+:type: bool
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_logout_button(self)
Clicks Logout button in profile list
+ +
click_page_left(self)
Clicks page left button
+ +
click_page_right(self)
Clicks page right button
+ +
click_playlist_play_btn(self, card_no: int = 0)
Clicks the playlist Play button in the card
+:param card_no: the card number of the playlist
+:type card_no: int
+ +
click_profile(self)
Clicks Profile button
+ +
click_upgrade(self)
Clicks upgrade button
+ +
click_webplayer(self)
+ +
+Data and other attributes defined here:
+
account_btn = 'Account'
+ +
logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...iv/div/nav/ul[2]/li[2]/li/div[2]/button[3]/button"
+ +
no_of_songs = 0
+ +
no_of_songs_xpath = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...ion/div/div/div[1]/div/header/div[2]/div[2]/div/p"
+ +
page_left_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[1]/button/a'
+ +
page_right_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[2]/button/a'
+ +
playlist_cards = 'CardsLibrary'
+ +
playlist_name_card = 'cardTitle row'
+ +
playlist_name_class_name = 'TrackListHeader mo info Name'
+ +
profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2.../div/div/div/div/nav/ul[2]/li[2]/li/div[1]/button"
+ +
songs_container = 'TrackListContainer'
+ +
upgrade_btn = 'UPGRADE'
+ +
+Methods inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_liked_songs(self)
Clicks Liked Songs button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/__init__.html b/documentation/Web/Pages/__init__.html new file mode 100644 index 0000000..e4feedd --- /dev/null +++ b/documentation/Web/Pages/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Web/Pages/artist.html b/documentation/Web/Pages/artist.html new file mode 100644 index 0000000..3f6a3f4 --- /dev/null +++ b/documentation/Web/Pages/artist.html @@ -0,0 +1,463 @@ + +Python: module artist + + + + + +
 
+ 
artist
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/artist.py
+

+

+ + + + + +
 
+Modules
       
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu(Web_Testing.helperClasses.WebHelper) +
+
+
Artist +
+
+
+

+ + + + + + + +
 
+class Artist(Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu)
   Artist(driver)

+A class representing the Web Player's playlist
+...

+Attributes
+----------
+profile_btn : string
+      A string containing the xpath of profile button
+logout_btn : string
+      A string containing the xpath of log out button
+account_btn : string
+      A string containing the link text of account button
+follow_btn : string
+      A string containing follow button
+artist_name : string
+      A string containing the class name of artist name in the artist page
+artist_name_about : string
+      A string containing the class name of artist name in the about page
+about : string
+      A string containing the xpath of about button
+playlist_name_card : string
+     A sting containing the name of the play list from the playlist card
+page_left_btn : WebDriverElement
+     a Web driver element representing the Page left button
+page_right_btn : WebDriverElement
+     a Web driver element representing the Page right button
 
 
Method resolution order:
+
Artist
+
Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_about(self)
+ +
check_follow(self)
check clicking follow button

+:return: true if follow button change to unfollow
+:type: bool
+ +
click_about(self)
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_artist(self)
Clicks artist button
+ +
click_follow(self)
Clicks follow button
+ +
click_logout_button(self)
Clicks Logout button in profile list
+ +
click_page_left(self)
Clicks page left button
+ +
click_page_right(self)
Clicks page right button
+ +
click_profile(self)
Clicks Profile button
+ +
click_related_artist(self)
+ +
click_webplayer(self)
+ +
+Data and other attributes defined here:
+
about = '/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/div/div[3]/button[3]'
+ +
account_btn = 'Account'
+ +
artist_image = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...]/div/div/button/a/div/div[1]/div/div/div/div/img"
+ +
artist_link = 'Artists'
+ +
artist_name = 'Header1'
+ +
artist_name_about = "//*[@id='bio-body']"
+ +
follow_btn = "//*[@id='followButton']"
+ +
logout_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2...iv/div/nav/ul[2]/li[2]/li/div[2]/button[3]/button"
+ +
page_left_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[1]/button/a'
+ +
page_right_btn = '/html/body/div/div/div/div/div[1]/div/div/div[2].../div/div[1]/div/nav/div/div/div/ul/li[2]/button/a'
+ +
profile_btn = "//*[@id='root']/div/div/div/div[1]/div/div/div[2.../div/div/div/div/nav/ul[2]/li[2]/li/div[1]/button"
+ +
+Methods inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
click_create_playlist(self)
Clicks Create playlist button in web player menu
+ +
click_home(self)
Clicks Home button in web player menu
+ +
click_liked_songs(self)
Clicks Liked Songs button in web player menu
+ +
click_logout(self)
Clicks Logout button in profile list
+ +
click_search(self)
Clicks Search button in web player menu
+ +
click_your_library(self)
Clicks Your Library button in web player menu
+ +
+Data and other attributes inherited from Web_Testing.Pages.WebPlayerMenu.WebPlayerMenu:
+
account_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...div[1]/div/div/nav/ul[2]/li/li/div[2]/button[1]/a'
+ +
create_playlist_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[1]'
+ +
home_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[2]'
+ +
liked_songs_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/div/a[2]'
+ +
logout_btn_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button'
+ +
profile_menu_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[2]...iv/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a'
+ +
search_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/a[3]'
+ +
your_library_xpath = '/html/body/div/div/div/div/div[1]/div/div/div[1]/div/button'
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Pages/premium.html b/documentation/Web/Pages/premium.html new file mode 100644 index 0000000..18bbc82 --- /dev/null +++ b/documentation/Web/Pages/premium.html @@ -0,0 +1,470 @@ + +Python: module premium + + + + + +
 
+ 
premium
index
/Users/KIMO/Desktop/Testing/Web_Testing/Pages/premium.py
+

+

+ + + + + +
 
+Modules
       
Web_Testing.Pages.AccountOverviewPage
+
time
+

+ + + + + +
 
+Classes
       
+
Web_Testing.helperClasses.WebHelper(builtins.object) +
+
+
PremiumPage +
+
+
+

+ + + + + + + +
 
+class PremiumPage(Web_Testing.helperClasses.WebHelper)
   PremiumPage(driver)

+A class used to represent Premium Page

+...

+Attributes
+----------
+spotify_logo : string
+    A string containing the xpath of spotify's logo
+profile_btn : string
+    A string containing the xpath of Profile button
+account_btn : string
+    A string containing the link text of Account link in profile option list
+logout_btn : string
+    A string containing the xpath of Logout button
+download_link_txt : string
+     A string containing the link text of Download link
+help_link_txt : string
+     A string containing the link text of Help link
+premium_link_txt : string
+    A string containing the link text of Premium link
+get_premium_btn_1 : string
+    A string containing the xpath of Get Premium button
+get_premium_btn_2 : string
+    A string containing the xpath of Get Premium button
+claim_btn : string
+    A string containing the xpath of Claim button in pop up window
+claim_btn : string
+    A string containing the xpath of Cancel Premium button in pop up window

+Methods
+-------
+check_claim_btn_visible()
+     check visibility of claim button
+check_cancel_premium_btn_visible()
+     check visibility of cancel premium button
+click_claim()
+      Clicks Claim button
+click_cancel_premium()
+      Clicks Cancel Premium button
+click_spotify_logo()
+     Clicks logo of spotify
+click_profile()
+     Clicks Profile button
+click_account()
+     Clicks Account button in profile list
+click_logout()
+     Clicks Logout button in profile list
+click_download_link()
+     Clicks Download button
+click_help_link()
+     Clicks Help button
+click_premium_link()
+     Clicks Premium button
+click_get_premium_btn_1()
+     Clicks Get Premium top button
+click_get_premium_btn_2()
+     Clicks Get Premium second button
 
 
Method resolution order:
+
PremiumPage
+
Web_Testing.helperClasses.WebHelper
+
builtins.object
+
+
+Methods defined here:
+
__init__(self, driver)
Initializes the page elements

+:param driver : the driver to which the super class' driver is to be set
+:type driver: WebDriver
+ +
check_cancel_premium_btn_visible(self)
check visibility of cancel premium button

+:return:True if cancel premium button is visible
+:type: bool
+ +
check_claim_btn_visible(self)
check visibility of claim button

+:return:True if claim button is visible
+:type: bool
+ +
check_claim_premium(self)
+ +
click_account(self)
Clicks Account button in profile list
+ +
click_cancel_premium(self)
Clicks Cancel Premium button
+ +
click_claim(self, alert)
Clicks Claim button
+ +
click_download_link(self)
Clicks Download button
+ +
click_get_premium_button_1(self)
Clicks Get Premium top button
+ +
click_get_premium_button_2(self)
Clicks Get Premium second button
+ +
click_help_link(self)
Clicks Help button
+ +
click_logout_button(self)
Clicks Logout button in profile list
+ +
click_premium_link(self)
Clicks Home button
+ +
click_profile(self)
Clicks Profile button
+ +
click_spotify_logo(self)
Clicks Spotify logo
+ +
+Data and other attributes defined here:
+
account_btn = 'Account'
+ +
cancel_premium_btn = '/html/body/div[2]/div/div[1]/div/div/div/div[3]/button[2]'
+ +
claim_btn = '/html/body/div[2]/div/div[1]/div/div/div/div[3]/button[1]'
+ +
download_link_txt = 'Download'
+ +
get_premium_button_1 = "//*[@id='root']/div/div/div/div[2]/p/button"
+ +
get_premium_button_2 = "//*[@id='root']/div/div/div/div[3]/p/button"
+ +
help_link_txt = 'Help'
+ +
logout_btn = "//*[@id='root']/div/div/div/div[1]/div/nav/div/ul/li[8]/li/div/button[2]/button"
+ +
premium_link_txt = 'Premium'
+ +
profile_btn = "//*[@id='root']/div/div/div/div[1]/div/nav/div/ul/li[8]/li/a"
+ +
spotify_logo = "//img[@src='https://encrypted-tbn0.gstatic.com/i...nPgQKW4JLrNcSFhPFCLHz3t8kT1pZl0PVkLYsa8FoScWYda']"
+ +
+Methods inherited from Web_Testing.helperClasses.WebHelper:
+
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors inherited from Web_Testing.helperClasses.WebHelper:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes inherited from Web_Testing.helperClasses.WebHelper:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Tests/__init__.html b/documentation/Web/Tests/__init__.html new file mode 100644 index 0000000..b2233c3 --- /dev/null +++ b/documentation/Web/Tests/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Web/Tests/test_accountoverview.html b/documentation/Web/Tests/test_accountoverview.html new file mode 100644 index 0000000..6801e7f --- /dev/null +++ b/documentation/Web/Tests/test_accountoverview.html @@ -0,0 +1,102 @@ + +Python: module test_accountoverview + + + + + +
 
+ 
test_accountoverview
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/test_accountoverview.py
+

Account Overview Testing

+This script tests the account overview page information and buttons and report the results to allure

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

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestAccountOverview +
+
+
+

+ + + + + +
 
+class TestAccountOverview(builtins.object)
    Methods defined here:
+
login_first(self)
+ +
setup(self)
+ +
setup_check_information(self)
+ +
setup_final(self)
+ +
test_case_1(self, setup_check_information)
# Test #1 ->Check all information in account overview page
+ +
test_case_10(self, setup)
# Test #10 ->Checking that all buttons and links work
+ +
test_case_11(self, setup)
# Test #11 ->Checking that all buttons and links work
+ +
test_case_12(self, setup)
# Test #12 ->Checking that all buttons and links work
+ +
test_case_13(self, setup)
# Test #13 ->Checking that all buttons and links work
+ +
test_case_14(self, setup_final)
# Test #14 ->Checking that all buttons and links work
+ +
test_case_2(self, setup)
# Test #2 ->Checking that all buttons and links work
+ +
test_case_3(self, setup)
# Test #3 ->Checking that all buttons and links work
+ +
test_case_4(self, setup)
# Test #4 ->Checking that all buttons and links work
+ +
test_case_5(self, setup)
# Test #5 ->Checking that all buttons and links work
+ +
test_case_6(self, setup)
# Test #6 ->Checking that all buttons and links work
+ +
test_case_7(self, setup)
# Test #7 ->Checking that all buttons and links work
+ +
test_case_8(self, setup)
# Test #8 ->Checking that all buttons and links work
+ +
test_case_9(self, setup)
# Test #9 ->Checking that all buttons and links work
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
account_overview_page = <Web_Testing.Pages.AccountOverviewPage.AccountOverviewPage object>
+ +
driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="574f47620f1f9a158610e4adc5365261")>
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Tests/test_artist.html b/documentation/Web/Tests/test_artist.html new file mode 100644 index 0000000..ee90185 --- /dev/null +++ b/documentation/Web/Tests/test_artist.html @@ -0,0 +1,80 @@ + +Python: module test_artist + + + + + +
 
+ 
test_artist
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/test_artist.py
+

Premium page Testing

+This script tests the premium page buttons and report the results to allure

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

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestPlaylist +
+
+
+

+ + + + + +
 
+class TestPlaylist(builtins.object)
    Methods defined here:
+
login_first(self)
+ +
setup(self)
+ +
setup_final(self)
+ +
setup_initial(self)
+ +
test_case_1(self, setup_initial)
# Test #1 -> Play Button
+ +
test_case_2(self, setup_final)
# Test #2 -> Play Button
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
artist = <Web_Testing.Pages.artist.Artist object>
+ +
driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="09d30cbf0cfda84d3a87af555f5a8831")>
+ +
helper = <Web_Testing.helperClasses.WebHelper object>
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Tests/test_likedsongs.html b/documentation/Web/Tests/test_likedsongs.html new file mode 100644 index 0000000..dfc2ab2 --- /dev/null +++ b/documentation/Web/Tests/test_likedsongs.html @@ -0,0 +1,72 @@ + +Python: module test_likedsongs + + + + + +
 
+ 
test_likedsongs
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/test_likedsongs.py
+

Premium page Testing

+This script tests the premium page buttons and report the results to allure

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

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestLikedSongs +
+
+
+

+ + + + + +
 
+class TestLikedSongs(builtins.object)
    Methods defined here:
+
setup(self)
+ +
test_case_1(self, setup)
# Test #1 -> Check Liked Songs
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="57d790c3a2d95744bd7f4ad6c5d911cb")>
+ +
helper = <Web_Testing.helperClasses.WebHelper object>
+ +
liked_songs = <Web_Testing.Pages.LikedSongs.LikedSongs object>
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Tests/test_playlist.html b/documentation/Web/Tests/test_playlist.html new file mode 100644 index 0000000..68934f5 --- /dev/null +++ b/documentation/Web/Tests/test_playlist.html @@ -0,0 +1,76 @@ + +Python: module test_playlist + + + + + +
 
+ 
test_playlist
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/test_playlist.py
+

Premium page Testing

+This script tests the premium page buttons and report the results to allure

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

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestPlaylist +
+
+
+

+ + + + + +
 
+class TestPlaylist(builtins.object)
    Methods defined here:
+
login_first(self)
+ +
setup(self)
+ +
setup_final(self)
+ +
setup_initial(self)
+ +
test_case_1(self, setup_initial)
# Test #1 -> Play Button
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="8aa91c346891f1e3bac91fc4fc2e5031")>
+ +
helper = <Web_Testing.helperClasses.WebHelper object>
+ +

+ \ No newline at end of file diff --git a/documentation/Web/Tests/test_premium.html b/documentation/Web/Tests/test_premium.html new file mode 100644 index 0000000..94006db --- /dev/null +++ b/documentation/Web/Tests/test_premium.html @@ -0,0 +1,88 @@ + +Python: module test_premium + + + + + +
 
+ 
test_premium
index
/Users/KIMO/Desktop/Testing/Web_Testing/Tests/test_premium.py
+

Premium page Testing

+This script tests the premium page buttons and report the results to allure

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

+

+ + + + + +
 
+Modules
       
allure
+
pytest
+
time
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
TestPremium +
+
+
+

+ + + + + +
 
+class TestPremium(builtins.object)
    Methods defined here:
+
login_first(self)
+ +
setup(self)
+ +
setup_begin(self)
+ +
setup_final(self)
+ +
test_case_1(self, setup_begin)
# Test #1 ->Checking that get premium works and change account to premium
+ +
test_case_3(self, setup)
# Test #3 ->Checking that all buttons and links work
+ +
test_case_4(self, setup)
# Test #4 ->Checking that all buttons and links work
+ +
test_case_5(self, setup)
# Test #5 ->Checking that all buttons and links work
+ +
test_case_6(self, setup)
# Test #6 ->Checking that all buttons and links work
+ +
test_case_7(self, setup)
# Test #7 ->Checking that all buttons and links work
+ +
test_case_8(self, setup_final)
# Test #8 ->Checking that all buttons and links work
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
driver = <selenium.webdriver.chrome.webdriver.WebDriver (session="15bae8ef20fffa8c833e820ef2746ee8")>
+ +
pp = <Web_Testing.Pages.premium.PremiumPage object>
+ +

+ \ No newline at end of file diff --git a/documentation/Web/helper/__init__.html b/documentation/Web/helper/__init__.html new file mode 100644 index 0000000..952b926 --- /dev/null +++ b/documentation/Web/helper/__init__.html @@ -0,0 +1,14 @@ + +Python: module __init__ + + + + + +
 
+ 
__init__
index
/Users/KIMO/Desktop/Testing/Web_Testing/__init__.py
+

+ + \ No newline at end of file diff --git a/documentation/Web/helper/helperClasses.html b/documentation/Web/helper/helperClasses.html new file mode 100644 index 0000000..1a813ee --- /dev/null +++ b/documentation/Web/helper/helperClasses.html @@ -0,0 +1,753 @@ + +Python: module helperClasses + + + + + +
 
+ 
helperClasses
index
/Users/KIMO/Desktop/Testing/Web_Testing/helperClasses.py
+

+

+ + + + + +
 
+Modules
       
selenium.webdriver.support.expected_conditions
+allure
+
datetime
+enum
+
selenium.webdriver
+

+ + + + + +
 
+Classes
       
+
builtins.object +
+
+
ConstantsClass +
DOB +
Profile +
WebHelper +
+
+
enum.Enum(builtins.object) +
+
+
Gender +
by +
+
+
+

+ + + + + + + +
 
+class ConstantsClass(builtins.object)
   A class used to represent any constants needed to be accessed

+Attributes
+----------
+delay_time : int
+    the user's email
+test_accounts_to_profiles : dict
+    a dictionary mapping an email to a Profile

+Methods
+-------
+get_test_emails()
+    gets all the emails used for testing
+get_pass(email)
+    gets the password for the provided email
+get_dob(email)
+    gets the date of birth for the provided email
+get_name(email)
+    gets the name for the provided email
+get_profile(email)
+    gets the profile for the provided email
 
 Methods defined here:
+
__init__(self)
Initializes the constants needed
+ +
calculate_age(self, email)
Calculate age of the provided mail

+ :param email: the user's email
+:type email: str

+:returns: the age of the user with the provided email
+:rtype: str
+ +
get_dob(self, email)
gets the date of birth for the provided email

+:param email: the user's email
+:type email: str

+:returns: the birth date of the user with the provided email
+:rtype: DOB
+ +
get_name(self, email)
gets the name for the provided email

+:param email: the user's email
+:type email: str

+:returns: the name of the user with the provided email
+:rtype: str
+ +
get_pass(self, email)
gets the password for the provided email

+:param email: the user's email
+:type email: str

+:returns: the password for the provided email
+:rtype: str
+ +
get_premium(self, email)
gets the premium for the provided email

+:param email: the user's email
+:type email: str

+:returns: the premium of the user with the provided email
+:rtype: bool
+ +
get_profile(self, email)
gets the profile for the provided email

+:param email: the user's email
+:type email: str

+:returns: the profile of the user with the provided email
+:rtype: Profile
+ +
get_test_emails(self)
gets all the emails used for testing

+:returns: a list of emails used for testing
+:rtype: list
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class DOB(builtins.object)
   DOB(day, month, year)

+A class used to represent the date of birth
+...

+Attributes
+----------
+day : str
+    the birth date day
+month : str
+    the birth date month
+year : str
+    the birth date year

+Methods
+-------
+is_equal(dob)
+        Checks if the class' date of birth (day, month, year) is equal to the given date of birth
+get_age()
+        Gets the age from the current birth date
 
 Methods defined here:
+
__init__(self, day, month, year)
Initializes the day, month and year

+:param day: birth date day
+:type day: int

+:param month: birth date month
+:type month: int

+:param year: birth date year
+:type year: int
+ +
get_age(self)
Gets the age from the current birth date
+:returns: the user's age
+:rtype: int
+ +
is_equal(self, dob)
Checks if the class' date of birth (day, month, year) is equal to the given date of birth

+:param dob: the date of birth to be compared
+:type dob: DOB
+:returns: a boolean True if the given birth date is equal to the class' birth date
+:rtype: bool
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class Gender(enum.Enum)
   Gender(value, names=None, *, module=None, qualname=None, type=None, start=1)

+A class used for representing the gender of the user
 
 
Method resolution order:
+
Gender
+
enum.Enum
+
builtins.object
+
+
+Data and other attributes defined here:
+
FEMALE = <Gender.FEMALE: 'Female'>
+ +
MALE = <Gender.MALE: 'Male'>
+ +
UNSELECTED = <Gender.UNSELECTED: 'Un selected'>
+ +
+Data descriptors inherited from enum.Enum:
+
name
+
The name of the Enum member.
+
+
value
+
The value of the Enum member.
+
+
+Readonly properties inherited from enum.EnumMeta:
+
__members__
+
Returns a mapping of member name->value.

+This mapping lists all enum members, including aliases. Note that this
+is a read-only view of the internal mapping.
+
+

+ + + + + + + +
 
+class Profile(builtins.object)
   Profile(email, password, name, dob, gender, premium=False, c_email='')

+A class used to represent the user's profile
+...

+Attributes
+----------
+email : str
+    the user's email
+c_email : str
+    the user's confirmation email
+password : str
+    the user's password
+name : str
+    the user's name
+dob : DOB
+    the user's date of birth
+gender : Gender
+    the user's gender

+Methods
+-------
 
 Methods defined here:
+
__init__(self, email, password, name, dob, gender, premium=False, c_email='')
Initializes the user's profile with the provided parameters

+If the parameter `c_email` is '', it sets the c_email = email

+:param email: the user's email
+:type email: str

+:param password: the user's password
+:type password: str

+:param name: the user's name
+:type name: str

+:param dob: the user's date of birth
+:type dob: DOB

+:param gender: the user's gender
+:type gender: Gender

+:param premium: the account's premium
+:type premium: bool

+:param c_email: the user's confirmation email (default is '')
+:type c_email: str
+ +
set_premium(self, new_premium)
Set premium of the profile

+:param:new_premium: new premium status to be set
+:type: bool
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+

+ + + + + + + +
 
+class WebHelper(builtins.object)
   A class used to provide helper function to ease testing

+...

+Attributes
+----------
+base_url : str
+    holds the base url for the website
+month_dict : dict
+    a dictionary that maps the month name to month number
+driver : WebDriver
+    holds the web driver of the class

+Methods
+-------
+get_login_url(email)
+    gets the login url of the website
+get_signup_url(email)
+    gets the signup url of the website
+get_premium_url(email)
+    gets the premium url of the website
+get_home_url(email)
+    gets the home url of the website
+get_account_overview_url(email)
+    gets the account overview url of the website
+get_account_edit_url(email)
+    gets the account edit url of the website
+get_account_changepassword_url()
+    gets the change password url of the website
+get_signup_url()
+    gets the sign up url of the website
+set_driver(driver)
+    sets the class' driver with the input driver
+chrome_driver_init()
+    initializes the chrome driver
+firefox_driver_init()
+    initializes the firefox driver
+get_driver()
+    gets the class' driver
+url_has(text, driver=None)
+    checks if the current driver url contains the input text
+element_exists_by_xpath(xpath)
+    Checks if an element exists with the input xpath
+element_exists_by_class(class_name)
+    Checks if an element exists with the input class name
+element_exists_by_id(vid)
+    Checks if an element exists with the input id
+find_element_by_xpath(xpath)
+    finds the element with the given xpath
+find_elements_by_xpath(xpath)
+    finds the elements with the given xpath
+find_element_by_class_name(class_name)
+    finds the element with the given class name
+find_elements_by_class_name(class_name, driver=None)
+    finds the elements with the given class name
+find_element_by_id(vid)
+    finds the element with the given id
+find_elements_by_id(vid)
+    finds the elements with the given id
+find_element_by_name(vname)
+    finds the element with the given name
+find_elements_by_name(vname)
+    finds the elements with the given name
+find_element_by_link_text(link_txt)
+    finds the element with the given link text
+find_elements_by_link_text(link_txt)
+    finds the elements with the given link text
+select_element_by_index(element, index)
+    selects an option from the provided element using a given index
+select_element_by_text(element, text)
+    selects an option from the provided element using a given text
+hover_to_element(element, driver)
+    Hovers the mouse over an element
+get_month_dict()
+    gets the month name to month number dictionary
+get_month_name_from(in_val)
+    gets the month name from the input month number
+get_month_val_from(name)
+    gets the month number from the input month name
+click_button(btn)
+    clicks on the given button
+fill(txt_element, text)
+    fills the provided text field with the given text
+clear_txt(txt_element)
+    clears the given text field
+click_button_safe(btn)
+    safely clicks on the given button without causing a crash
+fill_safe(txt_element, text)
+    safely fills the provided text field with the given text without causing a crash
+clear_txt_safe(txt_element)
+    safely clears the given text field without causing a crash
+screenshot(driver)
+    takes a screenshot of the website using the given driver
+report_allure(msg, driver=None)
+    attaches a screenshot to allure's report with a given message
 
 Methods defined here:
+
__init__(self)
Initializes the class' driver to None
+ +
chrome_driver_init(self)
initializes the chrome driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
clear_txt(self, txt_element)
clears the given text field

+:param txt_element: The text field from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
clear_txt_safe(self, txt_element)
safely clears the given text field without causing a crash

+:param txt_element: the element from which the text is to be cleared
+:type txt_element: WebDriver element
+ +
click_button(self, btn)
clicks on the given button

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
click_button_safe(self, btn)
safely clicks on the given button without causing a crash

+:param btn: The button to be clicked
+:type btn: WebDriver element
+ +
element_exists_by_class(self, class_name)
Checks if an element exists with the input class name

+:param class_name: element class name
+:type class_name: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_id(self, vid)
Checks if an element exists with the input id

+:param vid: element id
+:type vid: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
element_exists_by_xpath(self, xpath)
Checks if an element exists with the input xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a boolean to check if the element exists or not
+:rtype: bool
+ +
fill(self, txt_element, text)
the element to which the text is to be filled

+:param txt_element:
+:type txt_element: WebDriver element

+:param text: The text used to fill the text field
+:type text: str
+ +
fill_safe(self, txt_element, text)
safely fills the provided text field with the given text without causing a crash

+:param txt_element: the element to which the text is to be filled
+:type txt_element: WebDriver element

+:param text: the text used to fill the text field
+:type text: str
+ +
find_element_by_class_name(self, class_name)
finds the element with the given class name

+:param class_name: element class name
+:type class_name: str

+:returns: a WebDriver element associated with the given class name
+:rtype: WebDriver element
+ +
find_element_by_id(self, vid)
"
+finds the element with the given id

+:param vid: element id
+:type vid: str

+:returns: a WebDriver element associated with the given id
+:rtype: WebDriver element
+ +
find_element_by_link_text(self, link_txt)
finds the element with the given link text

+:param link_txt: element link text
+:type link_txt: str

+:returns: a WebDriver element associated with the given link text
+:rtype: WebDriver element
+ +
find_element_by_name(self, vname)
finds the element with the given name

+:param vname: element name
+:type vname: str

+:returns: a WebDriver element associated with the given name
+:rtype: WebDriver element
+ +
find_element_by_xpath(self, xpath)
finds the element with the given xpath

+:param xpath: element xpath
+:type xpath: str

+:returns: a WebDriver element associated with the given xpath
+:rtype: WebDriver element
+ +
find_elements_by_class_name(self, class_name, driver=None)
"
+finds the elements with the given class name

+If the argument `driver` is not passed in, the class' driver is used

+:param class_name: elements class name
+:type class_name: str

+:param driver: the driver from which to retrieve the element (default is None)
+:type driver: WebDriver

+:returns: a list containing the WebDriver elements associated with the given class name
+:rtype: list
+ +
find_elements_by_id(self, vid)
"
+finds the elements with the given id

+:param vid: elements id
+:type vid: str

+:returns: a list containing the WebDriver elements associated with the given id
+:rtype: list
+ +
find_elements_by_link_text(self, link_txt)
finds the elements with the given link text

+:param link_txt: elements link text
+:type link_txt: str

+:returns: a list containing the WebDriver elements associated with the given link text
+:rtype: list
+ +
find_elements_by_name(self, vname)
finds the elements with the given name

+:param vname: elements name
+:type vname: str

+:returns: a list containing the WebDriver elements associated with the given name
+:rtype: list
+ +
find_elements_by_xpath(self, xpath)
finds the elements with the given xpath

+:param xpath: elements xpath
+:type xpath: str

+:returns: a list containing the WebDriver elements associated with the given xpath
+:rtype: list
+ +
firefox_driver_init(self)
initializes the firefox driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_account_changepassword_url(self)
gets the change password url of the website

+:returns: the change password url of the website
+:rtype: str
+ +
get_account_edit_url(self)
gets the edit account url of the website

+:returns: the edit account url of the website
+:rtype: str
+ +
get_account_overview_url(self)
gets the account overview url of the website

+:returns: the account overview url of the website
+:rtype: str
+ +
get_driver(self)
gets the class' driver

+:returns: the class' driver
+:rtype: WebDriver
+ +
get_home_url(self)
gets the home url of the website

+:returns: the home url of the website
+:rtype: str
+ +
get_login_url(self)
gets the login url of the website

+:returns: the login url of the website
+:rtype: str
+ +
get_month_dict(self)
gets the month name to month number dictionary

+:returns: a dictionary mapping the month names to month numbers
+:rtype: dict
+ +
get_month_name_from(self, in_val)
:param in_val: month number
+:type in_val: int

+:returns: the month name
+:rtype: str
+ +
get_month_val_from(self, name)
gets the month number from the input month name

+:param name: the name of the month
+:type name: str

+:returns: the month number
+:rtype: int
+ +
get_premium_url(self)
gets the premium url of the website

+:returns: the premium url of the website
+:rtype: str
+ +
get_signup_url(self)
gets the sign up url of the website

+:returns: the sign up url of the website
+:rtype: str
+ +
hover_to_element(self, element, driver=None)
Hovers the mouse over an element

+If the argument `driver` is not passed, the driver will be set to the class' driver

+:param element: the web element that the mouse will hover over
+:type element: WebDriver element
+:param driver: the web driver (default is None)
+:type driver: WebDriver
+ +
report_allure(self, msg, driver=None)
"
+attaches a screenshot to allure's report

+If the argument `driver` is not passed in, the class' driver is used

+:param msg: the message used to be attached with the screenshot
+:type msg: str

+:param driver: the driver used to take a screenshot from (default is None)
+:type driver: WebDriver
+ +
screenshot(self, driver)
takes a screenshot of the website using the given driver

+:param driver: the driver used to take the screenshot from
+:type driver: WebDriver

+:returns: image screenshot
+:rtype: png image
+ +
select_element_by_index(self, element, index)
selects an option from the provided element using a given index

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param index: the index of the item to be selected
+:type index: int
+ +
select_element_by_text(self, element, text)
selects an option from the provided element using a given text

+:param element: the element from which the item is to be selected
+:type element: WebDriver element

+:param text: the text to be selected
+:type text: str
+ +
set_driver(self, driver)
sets the class' driver with the input driver

+:param driver: the driver to which the class' driver is to be set
+:type driver: WebDriver
+ +
url_has(self, text, driver=None)
checks if the current driver url contains the input text

+If the argument `driver` is not passed in, the class' driver is used

+:param text: the text to be compared with the driver's current url
+:type text: str

+:param driver: the driver from which to retrieve the url (default is None)
+:type driver: WebDriver

+:returns: a boolean to check if the current driver's url contains the input text or not
+:rtype: bool
+ +
+Data descriptors defined here:
+
__dict__
+
dictionary for instance variables (if defined)
+
+
__weakref__
+
list of weak references to the object (if defined)
+
+
+Data and other attributes defined here:
+
base_url = 'http://ec2-3-21-218-250.us-east-2.compute.amazonaws.com/'
+ +
month_dict = {'April': 4, 'August': 8, 'December': 12, 'February': 2, 'January': 1, 'July': 7, 'June': 6, 'March': 3, 'May': 5, 'November': 11, ...}
+ +

+ + + + + + + +
 
+class by(enum.Enum)
   by(value, names=None, *, module=None, qualname=None, type=None, start=1)

+A class used for representing the different constants for finding a webdriver element
 
 
Method resolution order:
+
by
+
enum.Enum
+
builtins.object
+
+
+Data and other attributes defined here:
+
CLASS_NAME = <by.CLASS_NAME: 3>
+ +
ID = <by.ID: 1>
+ +
LINK_TEXT = <by.LINK_TEXT: 4>
+ +
XPATH = <by.XPATH: 2>
+ +
+Data descriptors inherited from enum.Enum:
+
name
+
The name of the Enum member.
+
+
value
+
The value of the Enum member.
+
+
+Readonly properties inherited from enum.EnumMeta:
+
__members__
+
Returns a mapping of member name->value.

+This mapping lists all enum members, including aliases. Note that this
+is a read-only view of the internal mapping.
+
+

+ \ No newline at end of file diff --git a/generate_documentation.sh b/generate_documentation.sh new file mode 100644 index 0000000..d66b2e5 --- /dev/null +++ b/generate_documentation.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +#Connects to virtual environment +source venv/bin/activate + + +rm -rf ./Documentation +mkdir -p Documentation + +mkdir -p Documentation/Mobile +mkdir -p Documentation/Mobile/Helper +mkdir -p Documentation/Mobile/Tests +mkdir -p Documentation/Mobile/Pages + +mkdir -p Documentation/Web +mkdir -p Documentation/Web/helper +mkdir -p Documentation/Web/Tests +mkdir -p Documentation/Web/Pages + + + +python -m pydoc -w ./Mobile_Testing/*.py +mv *.html Documentation/Mobile/Helper + +python -m pydoc -w ./Mobile_Testing/Tests/*.py +mv *.html Documentation/Mobile/Tests + +python -m pydoc -w ./Mobile_Testing/Pages/*.py +mv *.html Documentation/Mobile/Pages + + +python -m pydoc -w ./Web_Testing/*.py +mv *.html Documentation/Web/Helper + +python -m pydoc -w ./Web_Testing/Tests/*.py +mv *.html Documentation/Web/Tests + +python -m pydoc -w ./Web_Testing/Pages/*.py +mv *.html Documentation/Web/Pages diff --git a/generate_mobile_reports.sh b/generate_mobile_reports.sh new file mode 100644 index 0000000..ad6f339 --- /dev/null +++ b/generate_mobile_reports.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +#Connects to virtual environment +source venv/bin/activate + + + + +allure-docx --title="Login" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Login_Reports/allurefiles ./Reports/Mobile_Reports/Login_Reports/Login_Report.docx + +allure-docx --title="Authentication" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Authentication_Reports/allurefiles ./Reports/Mobile_Reports/Authentication_Reports/Authentication_Report.docx + +allure-docx --title="Extra" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Extra_Reports/allurefiles ./Reports/Mobile_Reports/Extra_Reports/Extra_Report.docx + +allure-docx --title="Home" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Home_Reports/allurefiles ./Reports/Mobile_Reports/Home_Reports/Home_Report.docx + +allure-docx --title="Player" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Player_Reports/allurefiles ./Reports/Mobile_Reports/Player_Reports/Player_Report.docx + +allure-docx --title="Signup" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/Signup_Reports/allurefiles ./Reports/Mobile_Reports/Signup_Reports/Signup_Report.docx + +allure-docx --title="ProjectX" --logo=./logo.jpg --logo-height=2 ./Reports/All_Reports/allurefiles ./Reports/All_Reports/Final_Report.docx + +allure-docx --title="Mobile" --logo=./logo.jpg --logo-height=2 ./Reports/Mobile_Reports/allurefiles ./Reports/Mobile_Reports/Final_Mobile_Report.docx + + diff --git a/generate_web_reports.sh b/generate_web_reports.sh new file mode 100644 index 0000000..f5e81be --- /dev/null +++ b/generate_web_reports.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#Connects to virtual environment +source venv/bin/activate + + +allure-docx --title="Login" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Login_Reports/allurefiles ./Reports/Web_Reports/Login_Reports/Login_Report.docx + +allure-docx --title="Account Overview" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Account_Overview_Reports/allurefiles ./Reports/Web_Reports/Account_Overview_Reports/Account_Overview_Report.docx + +allure-docx --title="Artist" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Artist_Reports/allurefiles ./Reports/Web_Reports/Artist_Reports/Artist_Report.docx + +allure-docx --title="Change Password" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Change_Password_Reports/allurefiles ./Reports/Web_Reports/Change_Password_Reports/Login_Report.docx + +allure-docx --title="Liked Songs" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Liked_Songs_Reports/allurefiles ./Reports/Web_Reports/Liked_Songs_Reports/Liked_Songs_Report.docx + +allure-docx --title="Logged Out" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Logged_Out_Home_Reports/allurefiles ./Reports/Web_Reports/Logged_Out_Home_Reports/Logged_Out_Home_Report.docx + +allure-docx --title="Playlist" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Playlist_Reports/allurefiles ./Reports/Web_Reports/Playlist_Reports/Playlist_Report.docx + +allure-docx --title="Premium" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Premium_Reports/allurefiles ./Reports/Web_Reports/Premium_Reports/Premium_Report.docx + +allure-docx --title="Signup" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Signup_Reports/allurefiles ./Reports/Web_Reports/Signup_Reports/Signup_Report.docx + +allure-docx --title="Web Player" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Web_Player_Home_Reports/allurefiles ./Reports/Web_Reports/Web_Player_Home_Reports/Web_Player_Home_Report.docx + +allure-docx --title="Your Library" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/Your_Library_Reports/allurefiles ./Reports/Web_Reports/Your_Library_Reports/Your_Library_Report.docx + +allure-docx --title="ProjectX" --logo=./logo.jpg --logo-height=2 ./Reports/All_Reports/allurefiles ./Reports/All_Reports/Final_Report.docx + +allure-docx --title="Web" --logo=./logo.jpg --logo-height=2 ./Reports/Web_Reports/allurefiles ./Reports/Web_Reports/Final_Web_Report.docx diff --git a/logo.jpg b/logo.jpg new file mode 100644 index 0000000..f79b0a5 Binary files /dev/null and b/logo.jpg differ diff --git a/main_file_dummy.py b/main_file_dummy.py deleted file mode 100644 index dc04847..0000000 --- a/main_file_dummy.py +++ /dev/null @@ -1,116 +0,0 @@ -from selenium import webdriver -from selenium.webdriver.common.by import By -from selenium.webdriver.common.keys import Keys -from selenium.webdriver.support.wait import WebDriverWait -from selenium.webdriver.support import expected_conditions as EC - -from Web_Testing.Pages.WebPlayerHome import WebPlayerHome -from Web_Testing.Pages.WebPlayerMenu import WebPlayerMenu -from Web_Testing.helperClasses import WebHelper -from Web_Testing.helperClasses import ConstantsClass -from Web_Testing.Pages.LoginPage import LoginPage -from Web_Testing.Pages.SignupPage import SignupPage -from Web_Testing.helperClasses import DOB -from Web_Testing.Pages.AccountOverviewPage import AccountOverviewPage -from Web_Testing.Pages.WebPlayerLibrary import WebPlayerLibrary -from collections import defaultdict -import time - - -def get_cards_for_header(all_cards: list, y_pos_header): - cards_list = list() - for card in all_cards: - y_pos_card = card.location.get('y') - diff = y_pos_card - y_pos_header - if 50 <= diff <= 100: - cards_list.append(card) - - return cards_list - - -def map_headers_to_cards(all_headers, all_cards): - header_names_to_cards = dict() - if (all_headers is None) or (all_cards is None): - return header_names_to_cards - for header in all_headers: - y_pos = header.location.get('y') - header_names_to_cards[header.text] = get_cards_for_header(all_cards, y_pos) - return header_names_to_cards - - -helper = WebHelper() -driver: webdriver.Firefox = helper.firefox_driver_init() -helper.set_driver(driver) -driver.maximize_window() -time.sleep(3) -driver.get(helper.get_login_url()) -time.sleep(3) -lp = LoginPage(driver) -lp.set_credentials("test1@test.com", "test123") -lp.click_login() -time.sleep(5) -driver.get(helper.base_url + "webplayer/home") -time.sleep(5) -# profile_btn = helper.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li/li/div[1]/button/a") -# profile_btn.click() -# logout_btn_xpath = "/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[2]/li/li/div[2]/button[3]/button" -# logout_btn_element = WebDriverWait(driver, 30).until(EC.element_to_be_clickable((By.XPATH, logout_btn_xpath))) -# logout_btn_element.click() -lib_menu = WebPlayerMenu(driver) -# test_back = helper.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[1]/li[1]/button/a") -# test_back = helper.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div[1]/div/div/nav/ul[1]/li[2]/button/a") - -lib_menu.click_your_library() -time.sleep(2) -lib_menu.click_liked_songs() -time.sleep(2) -songs_no_par = driver.find_element_by_xpath("/html/body/div[1]/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[2]/div[2]/div/p") -songs_no_arr = songs_no_par.text.split(" ") -print(songs_no_arr[0]) - -# test_back = helper.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/div/div/div[1]/div/nav/div/div/div/ul/li[1]/button/a") -# test_back.click() - -# webplayer = WebPlayerLibrary(driver) -# webplayer.click_liked_songs() -# time.sleep(10) -# liked_songs = helper.find_element_by_class_name("LikedSongs") -# library_cards = helper.find_elements_by_class_name("CardsLibrary") -# library_cards[0].click() -# time.sleep(3) -# elements = driver.find_elements_by_xpath("/html[1]/body[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[1]/div[2]/div[1]/div[1]/section[1]/div[1]/section[1]/div[1]/div[1]/div[1]/div[1]/header[1]/div[2]/div[1]") -# elements = helper.find_elements_by_class_name("textMenuWrapper", driver) -# for e in elements: -# print(e.text) -# -# te = helper.find_element_by_xpath("/html/body/div/div/div/div/div[1]/div/div/div[2]/div/div/section/div/section/div/div/div[1]/div/header/div[1]/div/div[2]/div/div[1]/span") -# if te is not None: -# print("teeeee") -# print(te.text) - - - - - -# tp = WebPlayerHome(driver) -# p1 = tp.get_playlist_card(1, 1) -# print(p1) -# all_cards = helper.find_elements_by_class_name("CardsHome") -# if all_cards is not None: -# print(len(all_cards)) -# for card in all_cards: -# # print(card.text) -# print(card.location.get('y')) -# -# all_headers = helper.find_elements_by_class_name("HeaderAboveGrid") -# if all_headers is not None: -# print(len(all_headers)) -# for header in all_headers: -# print(header.text) -# print(header.location.get('y')) -# -# # if all_cards is not None: -# # all_cards[0].click() -# test_map = map_headers_to_cards(all_headers, all_cards) -# for key in test_map.keys(): -# print(test_map.get(key)) diff --git a/requirements.txt b/requirements.txt index 49fd199..a2646cf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,28 @@ +alabaster==0.7.12 allure-pytest==2.8.11 allure-python-commons==2.8.11 Appium-Python-Client==0.50 atomicwrites==1.3.0 attrs==19.3.0 +Babel==2.8.0 behave==1.2.6 certifi==2019.11.28 +cffi==1.14.0 chardet==3.0.4 colorama==0.4.3 configparser==4.0.2 crayons==0.3.0 +cryptography==2.9 +docutils==0.16 et-xmlfile==1.0.1 +Faker==4.0.2 html-testRunner==1.2.1 idna==2.9 +imagesize==1.2.0 jdcal==1.4.1 Jinja2==2.11.1 +Mako==1.1.2 +Markdown==3.2.1 MarkupSafe==1.1.1 more-itertools==8.2.0 openpyxl==3.0.3 @@ -21,16 +30,32 @@ packaging==20.3 parse==1.15.0 parse-type==0.5.2 path==13.2.0 +pdoc==0.3.2 +pdoc3==0.7.5 pluggy==0.13.1 py==1.8.1 py2exe==0.9.2.2 +pycparser==2.20 +Pygments==2.6.1 +pyOpenSSL==19.1.0 pyparsing==2.4.6 pytest==5.3.5 pytest-html==2.0.1 pytest-metadata==1.8.0 +python-dateutil==2.8.1 +pytz==2019.3 requests==2.23.0 selenium==3.141.0 six==1.14.0 +snowballstemmer==2.0.0 +Sphinx==3.0.0 +sphinxcontrib-applehelp==1.0.2 +sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-htmlhelp==1.0.3 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-serializinghtml==1.1.4 +text-unidecode==1.3 urllib3==1.25.8 wcwidth==0.1.8 -webdriver-manager==2.3.0 \ No newline at end of file +webdriver-manager==2.3.0 diff --git a/run_mobile_tests.sh b/run_mobile_tests.sh new file mode 100644 index 0000000..9be0e7a --- /dev/null +++ b/run_mobile_tests.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +#Connects to virtual environment +source venv/bin/activate + +path="/Users/KIMO/Desktop/Testing/" +sel="Do" + + +#Makes Login_Reports directory +rm -rf ./Reports/Mobile_Reports/Login_Reports/ +mkdir ./Reports/Mobile_Reports/Login_Reports +#Makes Login_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Login_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Login_Reports/allurefiles" ./Mobile_Testing/Tests/test_login.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Login_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Login_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles + + +#Makes Authentication_Reports directory +rm -rf ./Reports/Mobile_Reports/Authentication_Reports/ +mkdir ./Reports/Mobile_Reports/Authentication_Reports +#Makes Authentication_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Authentication_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Authentication_Reports/allurefiles" ./Mobile_Testing/Tests/test_authentication.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Authentication_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Authentication_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles + +#Makes Extra_Reports directory +rm -rf ./Reports/Mobile_Reports/Extra_Reports/ +mkdir ./Reports/Mobile_Reports/Extra_Reports +#Makes Extra_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Extra_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Extra_Reports/allurefiles" ./Mobile_Testing/Tests/test_extra.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Extra_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Extra_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles + +#Makes Home_Reports directory +rm -rf ./Reports/Mobile_Reports/Home_Reports/ +mkdir ./Reports/Mobile_Reports/Home_Reports +#Makes Home_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Home_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Home_Reports/allurefiles" ./Mobile_Testing/Tests/test_home.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Home_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Home_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles + +#Makes Player_Reports directory +rm -rf ./Reports/Mobile_Reports/Player_Reports/ +mkdir ./Reports/Mobile_Reports/Player_Reports +#Makes Player_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Player_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Player_Reports/allurefiles" ./Mobile_Testing/Tests/test_player.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Player_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Player_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles + +#Makes Signup_Reports directory +rm -rf ./Reports/Mobile_Reports/Signup_Reports/ +mkdir ./Reports/Mobile_Reports/Signup_Reports +#Makes Signup_Reports/allurefiles directory +mkdir ./Reports/Mobile_Reports/Signup_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Mobile_Reports/Signup_Reports/allurefiles" ./Mobile_Testing/Tests/test_signup.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Mobile_Reports/Signup_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Mobile_Reports/Signup_Reports/allurefiles/. $path/Reports/Mobile_Reports/allurefiles diff --git a/run_web_tests.sh b/run_web_tests.sh new file mode 100644 index 0000000..bff161e --- /dev/null +++ b/run_web_tests.sh @@ -0,0 +1,128 @@ +#!/bin/bash + +#Connects to virtual environment +source venv/bin/activate + +path="/Users/KIMO/Desktop/Testing/" +sel="Do" + +#Makes Login_Reports directory +rm -rf ./Reports/Web_Reports/Login_Reports/ +mkdir ./Reports/Web_Reports/Login_Reports +#Makes Login_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Login_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Login_Reports/allurefiles" ./Web_Testing/Tests/test_login.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Login_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Login_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Account_OverView_Reports directory +rm -rf ./Reports/Web_Reports/Account_Overview_Reports/ +mkdir ./Reports/Web_Reports/Account_Overview_Reports +#Makes Account_Overview_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Account_Overview_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Account_Overview_Reports/allurefiles" ./Web_Testing/Tests/test_accountoverview.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Account_Overview_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Account_Overview_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Artist_Reports directory +rm -rf ./Reports/Web_Reports/Artist_Reports/ +mkdir ./Reports/Web_Reports/Artist_Reports +#Makes Artist_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Artist_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Artist_Reports/allurefiles" ./Web_Testing/Tests/test_artist.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Artist_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Artist_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Change_Password_Reports directory +rm -rf ./Reports/Web_Reports/Change_Password_Reports/ +mkdir ./Reports/Web_Reports/Change_Password_Reports +#Makes Change_Password_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Change_Password_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Change_Password_Reports/allurefiles" ./Web_Testing/Tests/test_changePassword.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Change_Password_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Change_Password_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Liked_Songs_Reports directory +rm -rf ./Reports/Web_Reports/Liked_Songs_Reports/ +mkdir ./Reports/Web_Reports/Liked_Songs_Reports +#Makes Liked_Songs_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Liked_Songs_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Liked_Songs_Reports/allurefiles" ./Web_Testing/Tests/test_likedsongs.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Liked_Songs_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Liked_Songs_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Logged_Out_Home_Reports directory +rm -rf ./Reports/Web_Reports/Logged_Out_Home_Reports/ +mkdir ./Reports/Web_Reports/Logged_Out_Home_Reports +#Makes Logged_Out_Home_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Logged_Out_Home_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Logged_Out_Home_Reports/allurefiles" ./Web_Testing/Tests/test_loggedOutHome.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Logged_Out_Home_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Logged_Out_Home_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Playlist_Reports directory +rm -rf ./Reports/Web_Reports/Playlist_Reports/ +mkdir ./Reports/Web_Reports/Playlist_Reports +#Makes Playlist_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Playlist_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Playlist_Reports/allurefiles" ./Web_Testing/Tests/test_playlist.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Playlist_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Playlist_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Premium_Reports directory +rm -rf ./Reports/Web_Reports/Premium_Reports/ +mkdir ./Reports/Web_Reports/Premium_Reports +#Makes Premium_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Premium_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Premium_Reports/allurefiles" ./Web_Testing/Tests/test_premium.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Premium_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Premium_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Signup_Reports directory +rm -rf ./Reports/Web_Reports/Signup_Reports/ +mkdir ./Reports/Web_Reports/Signup_Reports +#Makes Signup_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Signup_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Signup_Reports/allurefiles" ./Web_Testing/Tests/test_signup.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Signup_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Signup_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Web_Player_Home_Reports directory +rm -rf ./Reports/Web_Reports/Web_Player_Home_Reports/ +mkdir ./Reports/Web_Reports/Web_Player_Home_Reports +#Makes Web_Player_Home_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Web_Player_Home_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Web_Player_Home_Reports/allurefiles" ./Web_Testing/Tests/test_webplayerHome.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Web_Player_Home_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Web_Player_Home_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles + +#Makes Your_Library_Reports directory +rm -rf ./Reports/Web_Reports/Your_Library_Reports/ +mkdir ./Reports/Web_Reports/Your_Library_Reports +#Makes Your_Library_Reports/allurefiles directory +mkdir ./Reports/Web_Reports/Your_Library_Reports/allurefiles +#Runs tests for this function +python3 -m pytest --alluredir="./Reports/Web_Reports/Your_Library_Reports/allurefiles" ./Web_Testing/Tests/test_yourLibrary.py -m $sel +#Copies allure files to all more general palce +cp -a $path/Reports/Web_Reports/Your_Library_Reports/allurefiles/. $path/Reports/All_Reports/allurefiles +cp -a $path/Reports/Web_Reports/Your_Library_Reports/allurefiles/. $path/Reports/Web_Reports/allurefiles \ No newline at end of file