consignmentOrder.spec.ts
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { test, expect } from '../fixtures';
import { generateOtherName } from '../utils/dataGenerator';
import * as allure from 'allure-js-commons';
/**
* 代销入库测试
*/
test.describe('代销入库', () => {
// 使用已保存的认证状态
test.use({ storageState: 'auth.json' });
test('新增代销入库 - 完整流程', async ({ consignmentPage },testInfo) => {
// 添加allure元素
await allure.epic('代销管理');
await allure.feature('代销入库');
await allure.story('创建代销入库订单');
// 步骤1,生成批次别名
const batchAlias = await allure.step('生成唯一批次别名',async(step)=>{
const alias = generateOtherName('自代卖');
console.log('生成的批次别名:', alias);
return alias;
});
// 生成唯一批次别名
// const batchAlias = generateOtherName('代卖');
// console.log('生成的批次别名:', batchAlias);
// 步骤2.执行代销入库
await allure.step('填写并提交代销入库表单',async()=>{
await consignmentPage.createConsignmentOrder(
batchAlias, // 批次别名
'娃娃菜', // 商品名称
'10', // 数量
'1' // 费用金额
);
await consignmentPage.attachScreenshot(testInfo,'代销入库成功截图');
})
});
});