forked from hiqdev/hipanel-module-stock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpart-replace.spec.ts
37 lines (32 loc) · 1.17 KB
/
part-replace.spec.ts
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
import { test } from "@hipanel-core/fixtures";
import PartIndexView from "@hipanel-module-stock/page/PartIndexView";
import PartReplaceView from "@hipanel-module-stock/page/PartReplaceView";
import UniqueId from "@hipanel-core/helper/UniqueId";
const data = {
filters: [
{
name: "move_descr_ilike",
value: "test description"
},
{
name: "model_types",
value: "cpu"
},
],
replaceData: [
{ serialno: UniqueId.generate(`test`) },
{ serialno: UniqueId.generate(`test`) }
],
};
test.describe("Part Replacement", () => {
test("Ensure parts can be replaced @hipanel-module-stock @manager", async ({ managerPage }) => {
const partIndexView = new PartIndexView(managerPage);
const partReplaceView = new PartReplaceView(managerPage);
await partIndexView.navigate();
await partIndexView.applyFilters(data.filters);
await partIndexView.selectPartsToReplace(data.replaceData.length);
await partReplaceView.fillReplaceForm(data.replaceData);
await partReplaceView.save();
await partIndexView.confirmReplacement();
});
});