论坛系统自动化测试实战

测试计划

测试产品 :论坛系统、测试论坛系统中每一个界面的所有功能。

测试工具:selenium+python编写自动化测试脚本

测试目的

通过编写自动化测试脚本找出该项目中存在的bug及其可优化点。注意本次测试仅测试论坛系统的功能部分,未涉及界面测试、性能测试等其他测试内容。主要待测试页面有:注册页面、登录页面、论坛首页、论坛编辑页、论坛详情页、我的帖子页、个人中心页等

测试用例

论坛注册页面

论坛登录页面

论坛首页

论坛编辑页

论坛详情页

我的帖子页

个人中心页

执行测试用例

注册页面测试

python 复制代码
# ForumSignin.py
from common.Utils import driver
from selenium.webdriver.common.by import By


class ForumSignin:
    url = None
    driver = None
    def __init__(self):
        self.url = 'http://127.0.0.1:58080/sign-up.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_elements(self):
        #检查标题
        ele = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > h2')
        assert ele.text == '用户注册'
        #检查用户名输入框
        ele = self.driver.find_elements(By.ID, 'username')
        assert ele != None
        #检查昵称框
        ele = self.driver.find_elements(By.ID, 'nickname')
        assert ele != None
        #检查密码框
        ele = self.driver.find_elements(By.ID, 'password')
        assert ele != None
        #检查确认密码框
        ele = self.driver.find_elements(By.ID, 'passwordRepeat')
        assert ele != None
        #检查服务条款按钮
        ele = self.driver.find_elements(By.ID, 'policy')
        assert ele != None
        #检查注册按钮
        ele = self.driver.find_elements(By.ID, 'submit')
        assert ele != None


    def sign_in_success(self):
        #填写用户名
        self.driver.find_element(By.ID, 'username').send_keys('username')
        #填写昵称
        self.driver.find_element(By.ID, 'nickname').send_keys('nickname')
        #填写密码
        self.driver.find_element(By.ID, 'password').send_keys('password')
        #填写确认密码
        self.driver.find_element(By.ID, 'passwordRepeat').send_keys('password')
        #确认条款
        self.driver.find_element(By.ID, 'policy').click()
        #点击提交
        self.driver.find_element(By.ID, 'submit').click()
        #注册成功--返回登录页面
        element = self.driver.find_element(By.CSS_SELECTOR, 'body > div > div > div > div:nth-child(1) > div > div.card.card-md > div > h2')
        assert element.text == '用户登录'

    def sign_in_fail(self):
        #未输入用户名
        self.driver.find_element(By.ID, 'username').clear()
        #未输入昵称
        self.driver.find_element(By.ID, 'nickname').clear()
        #未输入密码
        self.driver.find_element(By.ID, 'password').clear()
        #未输入确认密码
        self.driver.find_element(By.ID, 'passwordRepeat').clear()

        #点击注册按钮
        self.driver.find_element(By.ID, 'submit').click()
        #检查是否提示用户名不能为空
        ele = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > div:nth-child(2) > div')
        assert ele.text == '用户名不能为空'
        #检查是否提示昵称不能为空
        ele = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > div:nth-child(3) > div')
        assert ele.text == '昵称不能为空'
        #检查是否提示密码不能为空
        ele = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > div:nth-child(4) > div > div')
        assert ele.text == '密码不能为空'
        #检查是否提示请检查确认密码
        ele = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > div:nth-child(5) > div > div')
        assert ele.text == '请检查确认密码'


    def others(self):
        self.driver.find_element(By.CSS_SELECTOR, 'body > div > div > div.text-center.text-muted.mt-3 > a').click()
        element = self.driver.find_element(By.CSS_SELECTOR, 'body > div > div > div > div:nth-child(1) > div > div.card.card-md > div > h2')
        assert element.text == '用户登录'
        self.driver.back()

登录页面测试

python 复制代码
# ForumLogin.py
from common.Utils import driver
from selenium.webdriver.common.by import By


class ForumLogin():
    url = None
    driver = None
    def __init__(self):
        self.url = 'http://127.0.0.1:58080/sign-in.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_elements(self):
        #检查用户名输入框
        text = self.driver.find_element(By.ID, 'username').get_attribute('placeholder')
        assert text == '请输入用户名'
        #检查密码输入框
        text = self.driver.find_element(By.ID, 'password').get_attribute('placeholder')
        assert text == '请输入密码'
        #检查登录按钮
        text = self.driver.find_element(By.ID, 'submit').text
        assert text == '登录'
        #检查注册页面跳转按钮
        text = self.driver.find_element(By.CSS_SELECTOR, 'body > div > div > div > div:nth-child(1) > div > div.text-center.text-muted.mt-3 > a').text
        assert text == '点击注册'

    def login_success(self):
        #输入正确的用户名和密码
        self.driver.find_element(By.ID, 'username').send_keys('username')
        self.driver.find_element(By.ID, 'password').send_keys('password')
        #点击登录
        self.driver.find_element(By.ID, 'submit').click()
        #检查是否登录成功
        text = self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').text
        assert text == '首页'


    def login_fail001(self):
        #用户名和密码为空
        self.driver.find_element(By.ID, 'username').clear()
        self.driver.find_element(By.ID, 'password').clear()
        #点击登录
        self.driver.find_element(By.ID, 'submit').click()
        #检查是否提示错误信息
        text = self.driver.find_element(By.CSS_SELECTOR, '#signInForm > div.mb-3 > div').text
        assert text == '用户名不能为空'
        text = self.driver.find_element(By.CSS_SELECTOR, '#signInForm > div.mb-2 > div > div').text
        assert text == '密码不能为空'


    def login_fail002(self):
        # 用户名正确,密码错误
        self.driver.find_element(By.ID, 'username').clear()
        self.driver.find_element(By.ID, 'password').clear()

        #
        self.driver.find_element(By.ID, 'username').send_keys('username')
        self.driver.find_element(By.ID, 'password').send_keys('password')
        # 点击登录
        self.driver.find_element(By.ID, 'submit').click()

        # 检查是否提示错误信息 -- 暂时不做介绍
        # text = self.driver.find_element(By.CSS_SELECTOR, 'body > div.jq-toast-wrap.bottom-right > div').text()
        # assert text == ''


    def login_fail003(self):
        # 用户名错误,密码正确
        self.driver.find_element(By.ID, 'username').clear()
        self.driver.find_element(By.ID, 'password').clear()

        #
        self.driver.find_element(By.ID, 'username').send_keys('failusername')
        self.driver.find_element(By.ID, 'password').send_keys('rightpassword')
        # 点击登录
        self.driver.find_element(By.ID, 'submit').click()

        # 检查是否提示错误信息 -- 暂时不做介绍
        # text = self.driver.find_element(By.CSS_SELECTOR, 'body > div.jq-toast-wrap.bottom-right > div').text()
        # assert text == ''


    def others(self):
        #点击登录下方注册按钮,检查是否跳转至注册页
        self.driver.find_element(By.CSS_SELECTOR, 'body > div.page.page-center > div > div > div:nth-child(1) > div > div.text-center.text-muted.mt-3 > a').click()
        element = self.driver.find_element(By.CSS_SELECTOR, '#signUpForm > div > h2')
        assert element.text == '用户注册'
        self.driver.back()

论坛主页测试

python 复制代码
# ForumMainPage
import time
from selenium.webdriver.common.by import By
from common.Utils import driver
class ForumMainPage():
    url = None
    driver = None
    def __init__(self):
        self.url = 'http://127.0.0.1:58080/index.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_elements(self):
        #检查首页按钮是否正常展示
        text = self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').text
        assert text == '首页'
        #检查Java按钮
        text = self.driver.find_element(By.CSS_SELECTOR, '#topBoardList > li:nth-child(2) > a > span.nav-link-title').text
        assert text == 'Java'
        #检查发布帖子按钮
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-sm-none.btn-icon.article_post').get_attribute('aria-label')
        assert text == '发布帖子'
        #检查搜索框
        text = self.driver.find_element(By.CSS_SELECTOR, 'body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div.nav-item.d-none.d-md-flex.me-3 > div > form > div > input').get_attribute('placeholder')
        assert text == '输入关键字...'

    def check_others(self):
        #测试搜索窗口
        ele = self.driver.find_element(By.CSS_SELECTOR, 'body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div.nav-item.d-none.d-md-flex.me-3 > div > form > div > input')
        ele.clear()
        ele.send_keys('1\n')
        #测试切换主题
        time.sleep(1)
        self.driver.find_element(By.CSS_SELECTOR, 'body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div:nth-child(2) > a.nav-link.px-0.hide-theme-dark > svg').click()
        #测试站内信
        self.driver.find_element(By.CSS_SELECTOR, 'body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div:nth-child(2) > div > a > svg').click()
        self.driver.find_element(By.CSS_SELECTOR, '#index_message_offcanvasEnd > div.offcanvas-header > button').click()


    def check_image(self):
        #检查头像信息
        #检查是否能跳转至我的帖子页面
        self.driver.find_element(By.ID, 'index_nav_avatar').click()
        self.driver.find_element(By.ID, 'index_user_profile').click()
        text = self.driver.find_element(By.ID, 'profile_nickname').text
        print(text)
        ##返回首页
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()

        #检查个人中心页
        self.driver.find_element(By.ID, 'index_nav_avatar').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        ## 检查是否跳转至个人中心页
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-body > div > div > div > div.col-3.d-none.d-md-block.border-end > div > div > a').text
        assert text == '我的账户'
        ## 返回首页
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()


    def check_title(self):
        # 打开Java页面
        self.driver.find_element(By.CSS_SELECTOR, '#topBoardList > li:nth-child(2) > a > span.nav-link-title').click()
        ## 检查是否跳转成功
        text = self.driver.find_element(By.CSS_SELECTOR, '#artical-items-body > div > div > div.col > div.text-truncate > a').text
        assert text == 'Java'


    def check_up_button(self):
        # 点击按钮
        self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post').click()
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div > h2').text
        assert text == '发新贴'
        # 回到首页
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()

论坛编辑页

python 复制代码
# ForumEdit
from common.Utils import driver
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

class ForumEditTest():
    url = None
    driver = None
    def __init__(self):
        self.url = 'http://127.0.0.1:58080/index.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_element(self):
        #确保用户在编辑页面
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post').click()
        #测试分类板块选择框
        select = Select(self.driver.find_element(By.ID, "article_post_borad"))
        select.select_by_visible_text("C++")

        #测试标题框
        text = self.driver.find_element(By.ID, 'article_post_title').get_attribute('placeholder')
        assert text == "请输入标题"

        #测试文本框
        text = self.driver.find_element(By.CSS_SELECTOR, '#edit-article > div.CodeMirror.cm-s-default.CodeMirror-wrap.CodeMirror-empty > div.CodeMirror-scroll > div.CodeMirror-sizer > div > div > div > pre').text
        assert text == "开始创作..."

        #测试发布按钮
        self.driver.find_element(By.ID, 'article_post_submit')

    def post_fail001(self):
        #未输入标题
        #确保用户在编辑页面
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post').click()
        #选择经验分享栏
        select = Select(self.driver.find_element(By.ID, "article_post_borad"))
        select.select_by_visible_text("经验分享")
        #输入文章标题
        title = self.driver.find_element(By.ID, 'article_post_title')
        title.clear()
        #填写文章内容
        ## 通过TAB键跳转至内容框
        title.send_keys(Keys.TAB)
        ele = self.driver.switch_to.active_element
        ele.send_keys("777")
        #点击发布
        self.driver.find_element(By.ID, 'article_post_submit').click()
        #检查是否提示错误信息
        # text = self.driver.find_element(By.CSS_SELECTOR, 'body > div.jq-toast-wrap.bottom-right > div').text
        # assert text == "请输入帖子标题"

    def post_fail002(self):
        #未输入内容
        #确保用户在编辑页面
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post').click()
        ##选择经验分享栏
        select = Select(self.driver.find_element(By.ID, "article_post_borad"))
        select.select_by_visible_text("经验分享")
        #输入文章标题
        title = self.driver.find_element(By.ID, 'article_post_title')
        title.send_keys('经验分享')
        #不填写文章内容
        ## 通过TAB键跳转至内容框
        title.send_keys(Keys.TAB)

        self.driver.find_element(By.ID, 'article_post_submit').click()
        time.sleep(3)
        #检查是否提示错误信息
        # text = self.driver.find_element(By.CSS_SELECTOR, 'body > div.jq-toast-wrap.bottom-right > div').text
        # assert text == "请输入帖子内容"


    def post_success(self):
        #确保用户在编辑页面
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > a.btn.btn-primary.d-none.d-sm-inline-block.article_post').click()
        #选择经验分享栏
        select = Select(self.driver.find_element(By.ID, "article_post_borad"))
        select.select_by_visible_text("经验分享")
        #输入文章标题
        title = self.driver.find_element(By.ID, 'article_post_title')
        title.send_keys('经验分享')
        #填写文章内容
        ## 通过TAB键跳转至内容框
        title.send_keys(Keys.TAB)
        ele = self.driver.switch_to.active_element
        ele.send_keys("777")
        #点击发布
        time.sleep(3)
        self.driver.find_element(By.ID, 'article_post_submit').click()
        time.sleep(3)

论坛详情页

python 复制代码
# ForumDetail
import time

from common.Utils import driver
from selenium.webdriver.common.by import By

class ForumDetail():
    url = None
    driver = None
    def __init__(self):
        self.url = 'http://127.0.0.1:58080/index.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_element(self):
        #进入详情页-Java
        self.driver.find_element(By.CSS_SELECTOR, '#topBoardList > li:nth-child(2) > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#artical-items-body > div > div > div.col > div.text-truncate > a').click()
        self.driver.find_element(By.ID, 'article_details_author_name').text
        #检查元素
        ##标题
        self.driver.find_element(By.ID, 'details_article_title')
        ##头像
        self.driver.find_element(By.ID, 'article_details_author_avatar')
        ##内容
        self.driver.find_element(By.ID, 'details_article_content')

        ##检查点赞按钮
        text = self.driver.find_element(By.ID, 'details_btn_like_count').text
        assert text == '点赞'
        ##检查编辑按钮
        text = self.driver.find_element(By.ID, 'details_artile_edit').text
        assert text == '编辑'

        ##检查删除按钮
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-body > div > div > div:nth-child(1) > div.col-9.card.card-lg > div.card-footer.bg-transparent.mt-auto.justify-content-end > div > div:nth-child(3) > div > a').text
        assert text == '删除'

        text = self.driver.find_element(By.ID, 'details_btn_article_reply').text
        assert text == '回复'

    def detail_test(self):
        #进入详情页-Java
        self.driver.find_element(By.CSS_SELECTOR, '#topBoardList > li:nth-child(2) > a > span.nav-link-title').click()
        time.sleep(1)
        self.driver.find_element(By.CSS_SELECTOR, '#artical-items-body > div > div > div.col > div.text-truncate > a').click()
        self.driver.find_element(By.ID, 'article_details_author_name').text


        #测试点赞功能
        #获取点赞前的点赞数
        prvecnt = self.driver.find_element(By.ID, 'details_article_likeCount').text
        self.driver.find_element(By.ID, 'details_btn_like_count').click()
        aftercnt = self.driver.find_element(By.ID, 'details_article_likeCount').text
        time.sleep(1)
        assert int(aftercnt) == int(prvecnt) + 1

        #测试编辑按钮
        self.driver.find_element(By.ID, 'details_artile_edit').click()
        ##检查是否跳转至编辑页
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-header.d-print-none > div > div > div > h2').text
        assert text == '编辑'

        #重新回到详情页-Java
        self.driver.find_element(By.CSS_SELECTOR, '#topBoardList > li:nth-child(2) > a > span.nav-link-title').click()
        self.driver.find_element(By.CSS_SELECTOR, '#artical-items-body > div > div > div.col > div.text-truncate > a').click()
        self.driver.find_element(By.ID, 'article_details_author_name').text

        #点击删除按钮
        text = self.driver.find_element(By.CSS_SELECTOR, '#bit-forum-content > div.page-body > div > div > div:nth-child(1) > div.col-9.card.card-lg > div.card-footer.bg-transparent.mt-auto.justify-content-end > div > div:nth-child(3) > div > a').text
        print(f'你点击了一下{text}')

        #回复失败
        self.driver.find_element(By.ID, 'details_btn_article_reply').click()

我的帖子页

python 复制代码
# ForumUserProfile.py
from selenium.webdriver.common.by import By
from common.Utils import driver
import time

class ForumUserProfileTest():
    url = None
    driver = None

    def __init__(self):
        self.url = 'http://127.0.0.1:58080/index.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_element(self):
        #进入我的帖子页
        self.driver.find_element(By.CSS_SELECTOR, '#nav_board_index > a > span.nav-link-title').click()
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_profile').click()
        #检查元素信息
        text = self.driver.find_element(By.ID, 'profile_nickname').text
        assert text == 'MuMu'
        text = self.driver.find_element(By.ID, 'profile_articleCount').text
        print(f'发布的帖子总数为{text}')
        text = self.driver.find_element(By.ID, 'profile_createTime').text
        print(f'用户账号的注册日期为{text}')
        text = self.driver.find_element(By.ID, 'profile_remark').text
        print(f'个人介绍:{text}')

        #测试帖子列表页
        ele = self.driver.find_element(By.CSS_SELECTOR,
                                 '#profile_article_body > li:nth-child(1) > div.card.timeline-event-card > div > div > div > div > div.text-truncate > a')
        prevtext = ele.text
        ele.click()

        time.sleep(1)
        aftertext = self.driver.find_element(By.ID, 'details_article_title').text
        assert aftertext == prevtext

个人中心页

python 复制代码
#ForumUserSetting.py
import time

from selenium.webdriver.common.by import By
from common.Utils import driver

class ForumUserSettingTest():
    url = None
    driver = None

    def __init__(self):
        self.url = 'http://127.0.0.1:58080/index.html'
        self.driver = driver.driver
        self.driver.get(self.url)

    def check_elements(self):
        #跳转至个人中心页
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()

        #检查元素
        username = self.driver.find_element(By.ID, 'settings_nickname').text
        print(f'正在检查用户昵称{username}')
        self.driver.find_element(By.ID, 'settings_avatar')
        print('正在检查用户头像')

        self.driver.find_element(By.ID, 'setting_input_nickname')
        print('正在检查地址框')

        self.driver.find_element(By.ID, 'setting_input_phoneNum')
        print('正在检查电话号码框')

        self.driver.find_element(By.ID, 'settings_input_oldPassword')
        print('正在检查旧密码框')

        self.driver.find_element(By.ID, 'settings_input_newPassword')
        print('正在检查新密码框')

        self.driver.find_element(By.ID, 'settings_input_passwordRepeat')
        print('正在检查确认密码框')

        self.driver.find_element(By.ID, 'settings_submit_password')
        print('正在检查提交修改按钮')

        self.driver.find_element(By.ID, 'settings_textarea_remark')
        print('正在检查个人简介')

    def modify_nickname(self):
        #跳转至个人中心页
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        #修改昵称
        ele = self.driver.find_element(By.ID, 'setting_input_nickname')
        #修改失败--新昵称与原昵称相同
        ele.clear()
        ele.send_keys('MuMu')
        self.driver.find_element(By.ID, 'setting_submit_nickname').click()


    def modify_email(self):
        #跳转至个人中心页
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        #修改邮箱--失败:内容为空
        self.driver.find_element(By.ID, 'setting_input_email').clear()
        self.driver.find_element(By.ID, 'setting_submit_email').click()
        self.driver.quit()

    def modify_phone(self):
        #跳转至个人中心页
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        #修改电话号码
        self.driver.find_element(By.ID, 'setting_input_phoneNum').clear()
        self.driver.find_element(By.ID, 'setting_submit_phoneNum').click()

    def modify_password(self):
        #跳转至个人中心页
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        #成功修改密码
        ele = self.driver.find_element(By.ID, 'settings_input_oldPassword')
        ele.clear()
        ele.send_keys('pjx043250...')

        ele = self.driver.find_element(By.ID, 'settings_input_newPassword')
        ele.clear()
        ele.send_keys('pjx043250')

        ele = self.driver.find_element(By.ID, 'settings_input_passwordRepeat')
        ele.clear()
        ele.send_keys('pjx043250')

        self.driver.find_element(By.ID, 'settings_submit_password').click()

    def modify_textarea_remark(self):
        #跳转至个人中心页
        time.sleep(1)
        self.driver.find_element(By.ID, 'index_nav_nickname').click()
        self.driver.find_element(By.ID, 'index_user_settings').click()
        #修改个人简介
        ele = self.driver.find_element(By.ID, 'settings_textarea_remark')
        ele.clear()
        ele.send_keys('这个人很神秘')
        time.sleep(1)
        self.driver.find_element(By.ID, 'settings_submit_remark').click()
        self.driver.quit()

项目Bug

bug描述

  1. 如图所示:点击使用条款未跳转至条款详情页

2.同一篇文章多次点赞可叠加

3.输入的邮箱为非邮箱格式,或者邮箱不存在也能修改成功

4.输入的电话号码带有特殊字符或者不足11位也能修改成功

优化建议

用户在编辑页面撰写文章时,点击其他页面按钮原为直接跳转至对应页面,个人觉得应该先提示用户是否保存当前文章内容后跳转或者提示用户是否跳转至新页面.

项目总结

本次测试主要围绕论坛系统的相关功能进行测试,除此之外还有性能测试、界面测试、安全性测试、易用性测试、兼容性测试等内容。另外,在本次功能测试中主要发现了该系统存在三大问题,一是部分功能缺失,如点击服务条款未能正常跳转至详情页。二是部分功能兼容性不强,影响用户的使用体验,如编辑页跳转至其他页面应提示用户是否跳转。三是数据监测不够严谨,如电话号码存在特殊符号,邮箱格式出错都能操作成功。。。

相关推荐
非小号14 分钟前
PaddleNLP 的文本分类项目
python·机器学习·分类
天才测试猿31 分钟前
自动化测试工具:Selenium详解
自动化测试·软件测试·python·selenium·测试工具·职场和发展·测试用例
怀旧,1 小时前
【Python】2. 基础语法(2)
开发语言·python
小明小茗8861 小时前
DEBUG设置为False 时,django默认的后台样式等静态文件丢失的问题
python·django
安替-AnTi1 小时前
基于python+Django+Mysql的校园二手交易市场
python·mysql·django
wirepuller_king1 小时前
Python安装、pycharm配置和添加库下载
开发语言·python·pycharm
01_1 小时前
无人机仿真环境(3维)附项目git链接
python·无人机·路径规划·三维仿真
雪风飞舞1 小时前
Python解压多种格式压缩包
开发语言·python
赵谨言1 小时前
基于Python爬虫技术的对歌曲评论数据可视化分析系统
经验分享·python·毕业设计
hutaotaotao2 小时前
python处理signal(信号)
linux·python·信号处理·软件中断