diff options
author | Edan Binshtok <eb578m@intl.att.com> | 2017-11-19 11:50:50 +0200 |
---|---|---|
committer | Edan Binshtok <eb578m@intl.att.com> | 2017-11-19 11:51:04 +0200 |
commit | 71891b3040605103397ffa7fb349215eced3a2c3 (patch) | |
tree | 22dda04edd1b8ee0d0de2a6a260d6d60e42cba25 /tests/uiTests/test_login_with_new_user.py | |
parent | 433a8256e31f755f5e236491bbe39d3db24d6d6d (diff) |
Pep8 another fixes
Add more fixes to pep8
Issue-ID: VVP-25
Change-Id: Icc3bd3977ced2b537c858a9801e04a6bf6d1db05
Signed-off-by: Edan Binshtok <eb578m@intl.att.com>
Diffstat (limited to 'tests/uiTests/test_login_with_new_user.py')
-rw-r--r-- | tests/uiTests/test_login_with_new_user.py | 238 |
1 files changed, 168 insertions, 70 deletions
diff --git a/tests/uiTests/test_login_with_new_user.py b/tests/uiTests/test_login_with_new_user.py index d7d1bda..4cb0578 100644 --- a/tests/uiTests/test_login_with_new_user.py +++ b/tests/uiTests/test_login_with_new_user.py @@ -58,7 +58,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' Create new user login. ''' user_content = API.User.create_new_user() Frontend.User.login( - user_content['email'], Constants.Default.Password.TEXT, Constants.Toast.ID) + user_content['email'], Constants.Default.Password.TEXT, + Constants.Toast.ID) logger.debug("Resend Activation Email Page Opened ") Wait.text_by_id( Constants.Toast.ID, Constants.ActivateAccount.Toast.TEXT) @@ -68,7 +69,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' Negative: Type wrong password in login page. ''' user_content = API.User.create_new_user(activate=True) Frontend.User.login( - user_content['email'], Helper.rand_string("randomString"), Constants.Toast.ID) + user_content['email'], Helper.rand_string("randomString"), + Constants.Toast.ID) Wait.text_by_id(Constants.Toast.ID, Constants.Login.Toast.TEXT) logger.debug( "Message Error(APIUser or Password does not match) Displayed") @@ -78,7 +80,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' Negative: Type wrong password in login page. ''' user_content = API.User.create_new_user(activate=True) Frontend.User.login( - user_content['email'] + "s", Constants.Default.Password.TEXT, Constants.Toast.ID) + user_content['email'] + "s", Constants.Default.Password.TEXT, + Constants.Toast.ID) Wait.text_by_id(Constants.Toast.ID, Constants.Login.Toast.TEXT) logger.debug( "Message Error(APIUser or Password does not match) Displayed") @@ -92,11 +95,15 @@ class TestLoginPageWithNewUser(TestUiBase): Enter.text_by_name(Constants.Login.Password.NAME, "1") Enter.text_by_name(Constants.Login.Password.NAME, "") Wait.text_by_css( - Constants.Login.Password.Error.CSS, Constants.Login.Password.Error.TEXT) + Constants.Login.Password.Error.CSS, + Constants.Login.Password.Error.TEXT) @exception() def test_login_page_dont_have_accaunt_button(self): - ''' Go to login page, click_on on "Don't have an account", verify user is redirected to signup page. ''' + ''' + Go to login page, click_on on "Don't have an account", + verify user is redirected to signup page. + ''' Click.id(Constants.Login.DontHaveAccount.ID) Wait.text_by_css( Constants.Signup.Title.CSS, Constants.Signup.Title.TEXT) @@ -112,7 +119,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' Create user and activate by log-in. ''' user_content = API.User.create_new_user() Frontend.User.login( - user_content['email'], Constants.Default.Password.TEXT, Constants.Toast.ID) + user_content['email'], Constants.Default.Password.TEXT, + Constants.Toast.ID) ''' Resend Activation Email Page Opened ''' Wait.text_by_id( Constants.Toast.ID, Constants.ActivateAccount.Toast.TEXT) @@ -125,7 +133,10 @@ class TestLoginPageWithNewUser(TestUiBase): @exception() def test_invite_existing_user(self): - ''' Create user and VF, login, invite existing user, login with second user and verify user has joined to engagement ''' + ''' + Create user and VF, login, invite existing user, + login with second user and verify user has joined to engagement + ''' user_content = API.VirtualFunction.create_engagement( wait_for_gitlab=False) second_user_content = API.VirtualFunction.create_engagement( @@ -140,15 +151,26 @@ class TestLoginPageWithNewUser(TestUiBase): Click.id(actualVfNameid, wait_for_page=True) Wait.id(Constants.Dashboard.Overview.TeamMember.ID) Frontend.Wizard.invite_team_members_modal(second_user_content['email']) - enguuid = DB.General.select_where("uuid", "ice_engagement", "engagement_manual_id", user_content[ - 'engagement_manual_id'], 1) # Fetch one is_service_provider_contact user ID. - invitation_token = DB.User.select_invitation_token("invitation_token", "ice_invitation", "engagement_uuid", - enguuid, second_user_content['email'], 1) + enguuid = DB.General.select_where( + "uuid", + "ice_engagement", + "engagement_manual_id", + user_content['engagement_manual_id'], + 1) # Fetch one is_service_provider_contact user ID. + invitation_token = DB.User.select_invitation_token( + "invitation_token", + "ice_invitation", + "engagement_uuid", + enguuid, + second_user_content['email'], + 1) inviterURL = Constants.Default.InviteURL.Login.TEXT + invitation_token Frontend.General.re_open(inviterURL) actualVfNameid = "clickable-" + vfFullName Frontend.User.login( - second_user_content['email'], Constants.Default.Password.TEXT, actualVfNameid) + second_user_content['email'], + Constants.Default.Password.TEXT, + actualVfNameid) Wait.modal_to_dissappear() Frontend.Overview.click_on_vf(user_content) Wait.text_by_id(Constants.Dashboard.Overview.Title.ID, vfFullName) @@ -158,9 +180,11 @@ class TestLoginPageWithNewUser(TestUiBase): ''' TC Name: test_invite_new_user_aservice_provider_internal Steps: - Create new NOT-MainServiceProvider APIUser via SignUp request-->Login with This One--> build "activationUrl"--> + Create new NOT-MainServiceProvider APIUser via SignUp request--> + Login with This One--> build "activationUrl"--> Validation of successful activate--> - close Wizard --> Logout from Dashboard -->login-->Open Wizard--> fill all fields in all Tab's(4)--> + close Wizard --> Logout from Dashboard -->login-->Open Wizard--> + fill all fields in all Tab's(4)--> validate second Tab is a "add_service_provider_internal"--> build inviteURL from email--> reopen browser with inviteURL--> Validate Login Form opened --> @@ -172,7 +196,7 @@ class TestLoginPageWithNewUser(TestUiBase): activationUrl = DB.User.get_activation_url(user_content['email']) Frontend.General.re_open(activationUrl) Frontend.User.login( - user_content['email'], Constants.Default.Password.TEXT) # new + user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_id( Constants.Toast.ID, Constants.Dashboard.ActivateMsg.Success.TEXT) Click.id(Constants.Dashboard.Wizard.CloseButton.ID) @@ -181,34 +205,46 @@ class TestLoginPageWithNewUser(TestUiBase): Frontend.User.login( user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_css( - Constants.Dashboard.LeftPanel.Title.CSS, Constants.Dashboard.LeftPanel.Title.TEXT) + Constants.Dashboard.LeftPanel.Title.CSS, + Constants.Dashboard.LeftPanel.Title.TEXT) Wait.id(Constants.Dashboard.Statuses.Title.ID) Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID) # Wizard vfName = Frontend.Wizard.add_vf() - service_provider_internal = Frontend.Wizard.add_service_provider_internal() + service_provider_internal = \ + Frontend.Wizard.add_service_provider_internal() inviteEmail = Helper.rand_invite_email() Frontend.Wizard.invite_team_members(inviteEmail) Frontend.Wizard.add_ssh_key() enguuid = DB.General.select_where("uuid", "ice_vf", "name", vfName, 1) - invitation_token = DB.User.select_invitation_token("invitation_token", "ice_invitation", "engagement_uuid", - enguuid, inviteEmail, 1) + invitation_token = DB.User.select_invitation_token( + "invitation_token", "ice_invitation", "engagement_uuid", + enguuid, inviteEmail, 1) inviterURL = Constants.Default.InviteURL.Signup.TEXT + \ invitation_token + "&email=" + inviteEmail Frontend.General.re_open(inviterURL) actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME) Helper.internal_assert(inviteEmail, actualInvitedEmail) - signUpURLforContact = DB.User.get_contact_signup_url(invitation_token, uuid, service_provider_internal["email"], - service_provider_internal["full_name"], service_provider_internal["phone"], service_provider_internal["company"]) + signUpURLforContact = DB.User.get_contact_signup_url( + invitation_token, + uuid, + service_provider_internal["email"], + service_provider_internal["full_name"], + service_provider_internal["phone"], + service_provider_internal["company"]) Frontend.General.re_open(signUpURLforContact) actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME) Helper.internal_assert( service_provider_internal["email"], actualInvitedEmail) Helper.internal_assert( - "+" + service_provider_internal["phone"], Get.value_by_name(Constants.Signup.Phone.NAME)) + "+" + service_provider_internal["phone"], + Get.value_by_name( + Constants.Signup.Phone.NAME)) Helper.internal_assert( - service_provider_internal["full_name"], Get.value_by_name(Constants.Signup.FullName.NAME)) + service_provider_internal["full_name"], + Get.value_by_name( + Constants.Signup.FullName.NAME)) signupCompany = Get.value_by_name(Constants.Signup.Company.NAME, True) Helper.internal_assert( service_provider_internal["company"], signupCompany) @@ -216,7 +252,8 @@ class TestLoginPageWithNewUser(TestUiBase): @exception() def test_create_2_new_users(self): ''' - Login and activate new user, than reopen browser and loging with new other user - + Login and activate new user, + than reopen browser and loging with new other user - check wizard appears for both Frontend.User. ''' # First APIUser @@ -239,7 +276,7 @@ class TestLoginPageWithNewUser(TestUiBase): logger.debug(activationUrl2) Frontend.General.re_open_not_clean_cache(activationUrl2) Frontend.User.login( - user_content['email'], Constants.Default.Password.TEXT) # new + user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_id( Constants.Toast.ID, Constants.Dashboard.ActivateMsg.Success.TEXT) Click.id(Constants.Dashboard.Wizard.CloseButton.ID) @@ -263,7 +300,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' TC Name: test_add_vendor_contact Steps: - Invite vendor contact and activate the invited user. Validate the invited user has the right VF. + Invite vendor contact and activate the invited user. + Validate the invited user has the right VF. ''' user_content = API.User.create_new_user() # Fetch one user ID. @@ -281,7 +319,8 @@ class TestLoginPageWithNewUser(TestUiBase): Frontend.User.login( user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_css( - Constants.Dashboard.LeftPanel.Title.CSS, Constants.Dashboard.LeftPanel.Title.TEXT) + Constants.Dashboard.LeftPanel.Title.CSS, + Constants.Dashboard.LeftPanel.Title.TEXT) Wait.id(Constants.Dashboard.Statuses.Title.ID) logger.debug("click_on on + Dashboard") Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID) @@ -297,33 +336,56 @@ class TestLoginPageWithNewUser(TestUiBase): engLeadEmail = DB.User.select_el_email(vfName) engagement_manual_id = DB.General.select_where( "engagement_manual_id", "ice_engagement", "uuid", engagement_id, 1) - invitation_token = DB.User.select_invitation_token("invitation_token", "ice_invitation", "engagement_uuid", - engagement_id, vendor_contact["email"], 1) - signUpURLforContact = DB.User.get_contact_signup_url(invitation_token, uuid, vendor_contact["email"], - vendor_contact["full_name"], vendor_contact["phone"], vendor_contact["company"]) + invitation_token = DB.User.select_invitation_token( + "invitation_token", + "ice_invitation", + "engagement_uuid", + engagement_id, + vendor_contact["email"], + 1) + signUpURLforContact = DB.User.get_contact_signup_url( + invitation_token, + uuid, + vendor_contact["email"], + vendor_contact["full_name"], + vendor_contact["phone"], + vendor_contact["company"]) Frontend.General.re_open(signUpURLforContact) actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME) Helper.internal_assert(vendor_contact["email"], actualInvitedEmail) Helper.internal_assert( - "+" + vendor_contact["phone"], Get.value_by_name(Constants.Signup.Phone.NAME)) + "+" + vendor_contact["phone"], + Get.value_by_name( + Constants.Signup.Phone.NAME)) Helper.internal_assert( - vendor_contact["full_name"], Get.value_by_name(Constants.Signup.FullName.NAME)) + vendor_contact["full_name"], + Get.value_by_name( + Constants.Signup.FullName.NAME)) Helper.internal_assert( - vendor_contact["company"], Get.value_by_name(Constants.Signup.Company.NAME)) + vendor_contact["company"], + Get.value_by_name( + Constants.Signup.Company.NAME)) # SignUp for VendorContact user_content['engagement_uuid'] = engagement_id user_content['engagement_manual_id'] = engagement_manual_id user_content['vfName'] = vfName user_content['el_email'] = engLeadEmail - API.User.signup_invited_user(vendor_contact["company"], vendor_contact["email"], invitation_token, - signUpURLforContact, user_content, True) + API.User.signup_invited_user( + vendor_contact["company"], + vendor_contact["email"], + invitation_token, + signUpURLforContact, + user_content, + True) activationUrl2 = DB.User.get_activation_url(vendor_contact["email"]) # Activate for VendorContact myVfName = engagement_manual_id + ": " + vfName actualVfNameid = "clickable-" + myVfName Frontend.General.re_open(activationUrl2) Frontend.User.login( - vendor_contact["email"], Constants.Default.Password.TEXT, actualVfNameid) + vendor_contact["email"], + Constants.Default.Password.TEXT, + actualVfNameid) # Validate opened right VF for VendorContact actualVfName = Get.by_id(actualVfNameid) Helper.internal_assert(myVfName, actualVfName) @@ -333,7 +395,8 @@ class TestLoginPageWithNewUser(TestUiBase): ''' TC Name: test_add_service_provider_internal Steps: - Invite is_service_provider_contact Sponsor and activate the invited user. Validate sponsor has the right VF. + Invite is_service_provider_contact Sponsor and + activate the invited user. Validate sponsor has the right VF. ''' user_content = API.User.create_new_user(company="Amdocs") uuid = DB.General.select_where_email( @@ -350,35 +413,51 @@ class TestLoginPageWithNewUser(TestUiBase): Frontend.User.login( user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_css( - Constants.Dashboard.LeftPanel.Title.CSS, Constants.Dashboard.LeftPanel.Title.TEXT) + Constants.Dashboard.LeftPanel.Title.CSS, + Constants.Dashboard.LeftPanel.Title.TEXT) Wait.id(Constants.Dashboard.Statuses.Title.ID) logger.debug("click_on on + Dashboard") Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID) # Wizard vfName = Frontend.Wizard.add_vf() - service_provider_internal = Frontend.Wizard.add_service_provider_internal() + service_provider_internal = \ + Frontend.Wizard.add_service_provider_internal() inviteEmail = "automationqatt" + \ Helper.rand_string("randomString") + "@gmail.com" Frontend.Wizard.invite_team_members(inviteEmail) Frontend.Wizard.add_ssh_key() enguuid = DB.General.select_where("uuid", "ice_vf", "name", vfName, 1) - invitation_token = DB.User.select_invitation_token("invitation_token", "ice_invitation", "engagement_uuid", - enguuid, inviteEmail, 1) + invitation_token = DB.User.select_invitation_token( + "invitation_token", "ice_invitation", "engagement_uuid", + enguuid, inviteEmail, 1) inviterURL = Constants.Default.InviteURL.Signup.TEXT + \ invitation_token + "&email=" + inviteEmail Frontend.General.re_open(inviterURL) actualInvitedEmail = Get.value_by_name("email") Helper.internal_assert(inviteEmail, actualInvitedEmail) - signUpURLforContact = DB.User.get_contact_signup_url(invitation_token, uuid, service_provider_internal["email"], - service_provider_internal["full_name"], service_provider_internal["phone"], service_provider_internal["company"]) + signUpURLforContact = DB.User.get_contact_signup_url( + invitation_token, + uuid, + service_provider_internal["email"], + service_provider_internal["full_name"], + service_provider_internal["phone"], + service_provider_internal["company"]) Frontend.General.re_open(signUpURLforContact) actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME) Helper.internal_assert( - str("+" + service_provider_internal["phone"]), Get.value_by_name(Constants.Signup.Phone.NAME)) + str( + "+" + + service_provider_internal["phone"]), + Get.value_by_name( + Constants.Signup.Phone.NAME)) Helper.internal_assert( - service_provider_internal["full_name"], Get.value_by_name(Constants.Signup.FullName.NAME)) + service_provider_internal["full_name"], + Get.value_by_name( + Constants.Signup.FullName.NAME)) Helper.internal_assert( - service_provider_internal["company"], Get.value_by_name(Constants.Signup.Company.NAME)) + service_provider_internal["company"], + Get.value_by_name( + Constants.Signup.Company.NAME)) # Fetch one is_service_provider_contact user ID. engagement_id = DB.General.select_where( "engagement_id", "ice_vf", "name", vfName, 1) @@ -386,23 +465,30 @@ class TestLoginPageWithNewUser(TestUiBase): engagement_manual_id = DB.General.select_where( "engagement_manual_id", "ice_engagement", "uuid", engagement_id, 1) - invitation_token = DB.User.select_invitation_token("invitation_token", "ice_invitation", "engagement_uuid", - engagement_id, service_provider_internal["email"], 1) + invitation_token = DB.User.select_invitation_token( + "invitation_token", + "ice_invitation", + "engagement_uuid", + engagement_id, + service_provider_internal["email"], + 1) engLeadEmail = DB.User.select_el_email(vfName) user_content['engagement_uuid'] = engagement_id user_content['engagement_manual_id'] = engagement_manual_id user_content['vfName'] = vfName user_content['el_email'] = engLeadEmail - API.User.signup_invited_user(service_provider_internal["company"], service_provider_internal["email"], invitation_token, - signUpURLforContact, user_content, True) + API.User.signup_invited_user( + service_provider_internal["company"], + service_provider_internal["email"], + invitation_token, + signUpURLforContact, + user_content, + True) activationUrl2 = DB.User.get_activation_url( service_provider_internal["email"]) # Activate for VendorContact - - - engagement_manual_id = DB.General.select_where( "engagement_manual_id", "ice_engagement", "uuid", engagement_id, 1) # Validate opened right VF for VendorContact @@ -410,13 +496,17 @@ class TestLoginPageWithNewUser(TestUiBase): actualVfNameid = "clickable-" + myVfName Frontend.General.re_open(activationUrl2) Frontend.User.login( - service_provider_internal["email"], Constants.Default.Password.TEXT, actualVfNameid) + service_provider_internal["email"], + Constants.Default.Password.TEXT, + actualVfNameid) actualVfName = Get.by_id(actualVfNameid, wait_for_page=True) Helper.internal_assert(myVfName, actualVfName) @exception() def test_Validate_SSHkeyNS(self): - ''' Insert a valid ssh key in wizard, validate "add ssh key" next step marked as completed. ''' + ''' Insert a valid ssh key in wizard, validate "add ssh key" + next step marked as completed. + ''' user_content = API.User.create_new_user() activationUrl = DB.User.get_activation_url(user_content['email']) Frontend.General.re_open(activationUrl) @@ -430,7 +520,8 @@ class TestLoginPageWithNewUser(TestUiBase): Frontend.User.login( user_content['email'], Constants.Default.Password.TEXT) Wait.text_by_css( - Constants.Dashboard.LeftPanel.Title.CSS, Constants.Dashboard.LeftPanel.Title.TEXT) + Constants.Dashboard.LeftPanel.Title.CSS, + Constants.Dashboard.LeftPanel.Title.TEXT) logger.debug("click_on on + Dashboard") Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID) # Wizard @@ -482,8 +573,8 @@ class TestLoginPageWithNewUser(TestUiBase): Helper.internal_assert(user_content['full_name'], actualFullName) Click.id(Constants.Dashboard.Statuses.ID) Frontend.Overview.click_on_vf(user_content) - Helper.internal_assert( - "Current Status", Get.by_css(Constants.Dashboard.Overview.Status.Header.ID)) + Helper.internal_assert("Current Status", Get.by_css( + Constants.Dashboard.Overview.Status.Header.ID)) Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID, "No status update has been provided yet.") Click.id(Constants.Dashboard.Avatar.ID) @@ -495,17 +586,22 @@ class TestLoginPageWithNewUser(TestUiBase): Helper.internal_assert( "Add Status", Get.by_css("h3.modal-title.ng-binding")) Helper.internal_assert( - "Use the form below to add the current status of the engagement.", Get.by_css("span.ng-binding")) + "Use the form below to add the current status of the engagement.", + Get.by_css("span.ng-binding")) Click.css("textarea[name=\"description\"]") Enter.text_by_css( - "textarea[name=\"description\"]", "Add new Status", wait_for_page=True) - Helper.internal_assert( - "Add status", Get.by_id(Constants.Dashboard.DetailedView.VFC.Save_button.ID)) + "textarea[name=\"description\"]", + "Add new Status", + wait_for_page=True) + Helper.internal_assert("Add status", Get.by_id( + Constants.Dashboard.DetailedView.VFC.Save_button.ID)) Click.id( - Constants.Dashboard.DetailedView.VFC.Save_button.ID, wait_for_page=True) + Constants.Dashboard.DetailedView.VFC.Save_button.ID, + wait_for_page=True) Helper.assertTrue("Last updated" in Get.by_id("status-update-details")) Wait.text_by_id( - Constants.Dashboard.Overview.Status.Description.ID, "Add new Status") + Constants.Dashboard.Overview.Status.Description.ID, + "Add new Status") Wait.css(Constants.Dashboard.Overview.Status.Edit.CSS) Wait.modal_to_dissappear() Click.css(Constants.Dashboard.Overview.Status.Edit.CSS) @@ -516,15 +612,17 @@ class TestLoginPageWithNewUser(TestUiBase): Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID) Wait.modal_to_dissappear() Wait.text_by_id( - Constants.Dashboard.Overview.Status.Description.ID, "Update Status") + Constants.Dashboard.Overview.Status.Description.ID, + "Update Status") Frontend.User.logout() Frontend.User.relogin( - user_content['email'], Constants.Default.Password.TEXT) # new + user_content['email'], Constants.Default.Password.TEXT) Frontend.Overview.click_on_vf(user_content) - Helper.internal_assert( - "Current Status", Get.by_css(Constants.Dashboard.Overview.Status.Header.ID)) + Helper.internal_assert("Current Status", Get.by_css( + Constants.Dashboard.Overview.Status.Header.ID)) Wait.text_by_id( - Constants.Dashboard.Overview.Status.Description.ID, "Update Status") + Constants.Dashboard.Overview.Status.Description.ID, + "Update Status") @exception() def test_XSS_script(self): |