Skip to content

Commit

Permalink
Merge branch 'testing/testcases_bdd' of https://github.com/LWJ-Nichol…
Browse files Browse the repository at this point in the history
…as/DevOps_Oct2023_TeamC_Assignment into testing/testcases_bdd
  • Loading branch information
LWJ-Nicholas committed Feb 4, 2024
2 parents 8d2aeaf + 313a351 commit b253e10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
16 changes: 2 additions & 14 deletions test_robotFramework/create_new_account.robot
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ Creating New Account - Failed Username Exists Password New
Sleep 2s
[Teardown] Close Website

# Creating New Account - Failed Username New Password Exists
# [Setup] Launch Website
# Click Element ${create_anchor}
# Wait Until Page Contains Create Account
# Input Text id=username Joyce
# Input Text id=password Testing
# Click Element ${create_btn}
# Sleep 3s
# Wait Until Element Is Visible ${error_msg1}
# Click Element ${cancel_btn}
# Sleep 2s
# [Teardown] Close Website

Creating New Account - Failed Attempt to create weak username
# Username needs to be at least 2 characters
[Setup] Launch Website
Expand Down Expand Up @@ -121,4 +108,5 @@ Creating New Account - Failed Blank Inputs
Wait Until Element Is Visible ${error_msg2}
Click Element ${cancel_btn}
Sleep 2s
[Teardown] Close Website
[Teardown] Close Website

10 changes: 5 additions & 5 deletions test_robotFramework/login_account.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Library SeleniumLibrary
${website_url} http://127.0.0.1:5000
${login_admin_username} Admin
${login_admin_password} password
${login_user_username} Testing
${login_user_password} Testing
${login_user_username} Testing9
${login_user_password} Testing9
${login_btn} xpath=//button[contains(text(),'Login')]
${login_anchor} xpath=//a[contains(text(),'Login')]
${logout_btn} xpath=//a[contains(text(),'Logout')]
${success_msg} xpath=//div[contains(@class, 'alert-success') and contains(normalize-space(text()), 'Logged in successfully!')]
${error_msg1} xpath=//div[contains(@class, 'alert-danger') and contains(normalize-space(text()), 'Username does not exist.')]
${error_msg2} xpath=//div[contains(@class, 'alert-danger') and contains(normalize-space(text()), ' Incorrect password, try again. ')]
${error_msg2} xpath=//div[contains(@class, 'alert-danger') and contains(normalize-space(text()), 'Incorrect password, try again.')]

*** Keywords ***
Launch Website
Expand All @@ -34,7 +34,7 @@ Entering Login Details User - Success
Input Text id=password ${login_user_password}
Click Element ${login_btn}
Sleep 3s
#Wait Until Element Is Visible ${success_msg}
Wait Until Element Is Visible ${success_msg}
Wait Until Page Contains ${login_user_username}
Click Element ${logout_btn}
Click Element ${login_anchor}
Expand Down Expand Up @@ -63,7 +63,7 @@ Entering Login Details - Fail Wrong Username

Entering Login Details - Fail Wrong Password
[Setup] Launch Website
Input Text id=username ${login_user_username}
Input Text id=username ${login_admin_username}
Input Text id=password 123456789
Click Element ${login_btn}
Sleep 2s
Expand Down

0 comments on commit b253e10

Please sign in to comment.