python+unittest simple automation framework

from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By
from Exercise_konwledge.test_login.common import *
import unittest

class Test_ThinkSns(unittest.TestCase):
    pass

    @classmethod
    def setUpClass(cls) -> None:
        pass
    
    
    @classmethod
    def tearDownClass(cls) -> None:
        pass
    
    
    
    def test_user_login_success:
        pass
import unittest
from unittest import TestSuite, TextTestRunner


class TestUserLogin(unittest.TestCase):

    def test_login_success(self):
        pass

    def test_login_fail_using_wrong_password(self):
        pass

    def test_login_fail_using_not_exists_email(self):
        pass


if __name__ == '__main__':
    # Create a test suite object (package)
    s = TestSuite()

    # Add "test case objects" to this test suite one by one in a custom order
    s.addTests([TestUserLogin("test_login_fail_using_wrong_password"), TestUserLogin("test_login_fail_using_not_exists_email")])
    s.addTest(TestUserLogin("test_login_success"))

    # Create a test runner that executes all test cases in the test suite
    r = TextTestRunner(verbosity=2)
    r.run(s)

Guess you like

Origin blog.csdn.net/weixin_55944621/article/details/123426406