a script to do login test with automation using selenium pytest
website used (https://id.blooket.com/login)
- Python 3.10.6
- selenium 4.4.3
- ChromeDriver 106.0.5249.61
- pytest 7.1.3
- pytest-html 3.1.1
- pytest-html-reporter 0.2.9
- User imports library
- User create a list to accommodate invalid user data named "Account"
- User write @pytest.fixture to group steps / code that is run repeatedly and create function setup()
- User create function test_login_success() for login successfully
- User write @pytest.mark.parametrize to call list Account
- User create function test_login_unsuccess() for login failed
- Open terminal
- Make sure the file path location is correct
- Type "pytest -v automation-login.py"
- If you want get the report, type "pytest -v automation-login.py --html=login-report.html"
- Then press enter
You will see the result in Terminal: If Success, you will see green text with information 'PASSED'. If Fail, you will see red text with text with information 'FAILED'
if you already have pytest-html you will get a report like this https://shidqiadiatma.github.io/web_automation_testing_using_pytest/login-report.html
and if you already have pytest-html-reporter you will get a report like this https://shidqiadiatma.github.io/web_automation_testing_using_pytest/pytest_html_report.html#dashboard