知名网站有哪些,搜索引擎有哪些技巧,做pc网站如何实时预览,wordpress博客怎么写目录 1. 项目概述 2. 项目技术栈 2.1 后端技术 2.2 前端技术 3. 测试用例 4. 功能测试 4.1 手动测试 4.2自动测试 4.2.1 创建驱动 4.2.2 登录功能测试 4.2.3 聊天功能测试 4.2.4 测试启动类 5. 性能测试 5.1 接口测试 5.1.1 登录接口测试 5.1.2 信息查…目录1. 项目概述2. 项目技术栈2.1 后端技术2.2 前端技术3. 测试用例4. 功能测试4.1 手动测试4.2自动测试4.2.1 创建驱动4.2.2 登录功能测试4.2.3 聊天功能测试4.2.4 测试启动类5. 性能测试5.1 接口测试5.1.1 登录接口测试5.1.2 信息查看接口测试5.1.3 好友列表测试6. 兼容性测试6.1 谷歌浏览器测试6.2 联想浏览器测试7.安全性测试7.1 拦截器拦截未登录8. 易用性测试8.1 操作简单提示易懂9. 界面测试9.1 界面简单布局流畅10. 测试总结10.1 存在缺陷10.21. 项目概述网页聊天项目是一个基于 Spring Boot 的实时网页聊天应用程序支持用户注册登录、好友聊天、会话管理等功能项目采用前后端分离架构完成2. 项目技术栈2.1 后端技术框架Spring BootWeb 层Spring Web, Spring WebSocket持久层MyBatis 3.0.5, MySQL Connector工具Lombok构建工具MavenJDK 版本Java 172.2 前端技术HTML5, CSS3, JavaScriptjQuery 2.0.0WebSocket API3. 测试用例4. 功能测试4.1 手动测试测试场景用户名和密码都为空预期结果弹窗提示“当前输入的用户名或者密码为空!”测试场景用户名为空预期结果弹窗提示“当前输入的用户名或者密码为空!”测试场景密码为空预期结果弹窗提示“当前输入的用户名或者密码为空!”测试场景密码错误预期结果弹窗提示“当前输入的用户名或者密码为空!”测试场景用户名和密码都为正确预期结果弹窗提示“当前输入的用户名或者密码为空!”测试场景点击首个好友查看历史信息预期结果查看信息列表测试场景点击通讯录查看好友列表预期结果查看好友列表测试场景点击对话框输入晚上吃啥并发送预期结果如图测试场景上下切换好友查看历史信息预期结果如图4.2自动测试4.2.1 创建驱动package com.commom; import io.github.bonigarcia.wdm.WebDriverManager; import org.apache.commons.io.FileUtils; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeOptions; import java.io.File; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; import java.util.Set; public class Utils { public static EdgeDriver driver; public static EdgeDriver createDriver() { if (driver null) { //下载浏览器驱动 System.setProperty(wdm.edgeDriverUrl, https://msedgedriver.microsoft.com/); WebDriverManager.edgedriver().setup(); //添加配置 EdgeOptions options new EdgeOptions(); options.addArguments(--remote-allow-origins*); //创建驱动对象 driver new EdgeDriver(options); } return driver; } public Utils(String url) { driver createDriver(); driver.get(url); SetString windowHandles driver.getWindowHandles(); ListString handleList new ArrayList(windowHandles); if (handleList.size() 2) { driver.switchTo().window(handleList.get(0)); driver.close(); driver.switchTo().window(handleList.get(1)); // driver.manage().window().maximize(); } } //屏幕截取 public void screenShot(String str) throws IOException { //格式 //年月日 SimpleDateFormat sim1 new SimpleDateFormat(yyyy-MM-dd); //时分秒 SimpleDateFormat sim2 new SimpleDateFormat(HHmmss); //目录 String dirTime sim1.format(System.currentTimeMillis()); //文件 String fileTime sim2.format(System.currentTimeMillis()); String filename ./src/main/java/com/images/ dirTime / str - fileTime .png; File srcFile ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(srcFile, new File(filename)); } public void quit() { driver.quit(); } }4.2.2 登录功能测试package com.tests; import com.commom.Utils; import org.openqa.selenium.Alert; import org.openqa.selenium.By; import java.io.IOException; public class LoginPage extends Utils { public static String url http://47.97.84.56:8888/login.html; public LoginPage(String url) { super(url); } public void checkUserName() throws IOException, InterruptedException { //用户名正确 UserNameRight(); //用户名错误 //UserNameError(); //用户名空 //UserNameNull(); } private void UserNameNull() throws IOException, InterruptedException { driver.findElement(By.xpath(//*[id\username\])).sendKeys(); driver.findElement(By.xpath(//*[id\password\])).sendKeys(123456); driver.findElement(By.xpath(//*[id\submit\])).click(); Thread.sleep(2000); Alert alert driver.switchTo().alert(); alert.accept(); screenShot(Thread.currentThread().getStackTrace()[1].getMethodName()); } private void UserNameError() throws IOException, InterruptedException { driver.findElement(By.xpath(//*[id\username\])).sendKeys(12); driver.findElement(By.xpath(//*[id\password\])).sendKeys(123456); driver.findElement(By.xpath(//*[id\submit\])).click(); Thread.sleep(2000); Alert alert driver.switchTo().alert(); alert.accept(); screenShot(Thread.currentThread().getStackTrace()[1].getMethodName()); } private void UserNameRight() throws IOException, InterruptedException { driver.findElement(By.xpath(//*[id\username\])).sendKeys(张三); driver.findElement(By.xpath(//*[id\password\])).sendKeys(123456); driver.findElement(By.xpath(//*[id\submit\])).click(); Thread.sleep(2000); Alert alert driver.switchTo().alert(); alert.accept(); screenShot(Thread.currentThread().getStackTrace()[1].getMethodName()); } }4.2.3 聊天功能测试package com.tests; import com.commom.Utils; import org.openqa.selenium.By; public class ChatroomPage extends Utils { public static String url http://47.97.84.56:8888/client.html; public ChatroomPage(String url) { super(url); } public static void sendMessage() throws InterruptedException { driver.findElement(By.xpath(//*[id\session-list\]/li[1])).click(); driver.findElement(By.xpath(/html/body/div[2]/div/div[2]/textarea)).sendKeys(你好); Thread.sleep(2000); driver.findElement(By.xpath(/html/body/div[2]/div/div[2]/div[3]/button)).click(); } }4.2.4 测试启动类package com; import com.tests.ChatroomPage; import com.tests.LoginPage; import java.io.IOException; public class RunTest { public static void main(String[] args) throws IOException, InterruptedException { LoginPage loginPage new LoginPage(LoginPage.url); //检查用户名 loginPage.checkUserName(); ChatroomPage chatroomPage new ChatroomPage(ChatroomPage.url); //发送信息 ChatroomPage.sendMessage(); } }5. 性能测试5.1 接口测试5.1.1 登录接口测试5.1.2 信息查看接口测试5.1.3 好友列表测试6. 兼容性测试6.1 谷歌浏览器测试6.2 联想浏览器测试7.安全性测试7.1 拦截器拦截未登录8. 易用性测试8.1 操作简单提示易懂9. 界面测试9.1 界面简单布局流畅10. 测试总结10.1 存在缺陷功能实现单一功能有待改善10.2该测试总体良好无严重BUG 有少许缺陷