Commit 42622572 authored by Cai Wei's avatar Cai Wei

feat(*): 测试脚本兼容

parent f5b3ce1c
Pipeline #1339 failed
......@@ -39,8 +39,15 @@ describe('template spec', () => {
cy.get('[data-testid="suspend-flag-radio-during"] > .el-radio__input > .el-radio__original').check();
cy.get('[data-testid="suspend-flag-radio-all"] > .el-radio__label').click();
cy.get('[data-testid="suspend-flag-radio-all"] > .el-radio__input > .el-radio__original').check();
cy.get('[data-testid="cell-0-operate"] > [data-testid="suspend-action-link"]').click();
cy.get('.el-dialog__headerbtn > .el-icon > svg').click();
// 添加兼容性检查,判断是否存在suspend-action-link元素
cy.get('body').then($body => {
// 检查是否存在suspend-action-link元素
if ($body.find('[data-testid="cell-0-operate"] > [data-testid="suspend-action-link"]').length) {
cy.get('[data-testid="cell-0-operate"] > [data-testid="suspend-action-link"]').click();
cy.get('.el-dialog__headerbtn > .el-icon > svg').click();
}
});
/* ==== End Cypress Studio ==== */
});
})
\ No newline at end of file
......@@ -33,12 +33,27 @@ describe('template spec', () => {
cy.get('#device-type-option-2').click();
cy.get('[data-testid="my-agency-search-button"] > span').click();
cy.get('[data-testid="my-agency-reset-button"]').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-process-button"]').click();
cy.get('.el-dialog__headerbtn > .el-icon > svg').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-dispatch-button"]').click();
cy.get('[data-testid="assign-dialog"] > .el-dialog__header > .el-dialog__headerbtn > .el-icon > svg > path').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-change-bag-button"]').click();
cy.get('[data-testid="bag-dialog"] > .el-dialog__header > .el-dialog__headerbtn > .el-icon > svg').click();
// 添加兼容性检查,判断是否存在操作按钮元素
cy.get('body').then($body => {
// 处理流程按钮
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="my-agency-process-button"]').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-process-button"]').click();
cy.get('.el-dialog__headerbtn > .el-icon > svg').click();
}
// 处理派单按钮
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="my-agency-dispatch-button"]').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-dispatch-button"]').click();
cy.get('[data-testid="assign-dialog"] > .el-dialog__header > .el-dialog__headerbtn > .el-icon > svg > path').click();
}
// 处理换袋按钮
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="my-agency-change-bag-button"]').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="my-agency-change-bag-button"]').click();
cy.get('[data-testid="bag-dialog"] > .el-dialog__header > .el-dialog__headerbtn > .el-icon > svg').click();
}
});
cy.get('[data-testid="menu-item-my-loop/myDone"] > span').click();
cy.get('[data-testid="event-name-input"]').clear('t');
cy.get('[data-testid="event-name-input"]').type('提升阀');
......
......@@ -30,8 +30,15 @@ describe('template spec', () => {
cy.get('#equipment-device-type-option-2').click();
cy.get('[data-testid="equipment-search-button"] > span').click();
cy.get('[data-testid="equipment-reset-button"] > span').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="equipment-params-button"] > span').click();
cy.get('[data-testid="confirm-button"]').click();
// 添加兼容性检查,判断是否存在设备参数按钮
cy.get('body').then($body => {
// 检查原始选择器
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="equipment-params-button"] > span').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="equipment-params-button"] > span').click();
cy.get('[data-testid="confirm-button"]').click();
}
});
cy.get('[data-testid="menu-item-management/suspend-management"] > span').click();
cy.get('[data-testid="project-select"] > .el-select__wrapper > .el-select__selection > .el-select__placeholder').click();
cy.get('#project-option-0').click();
......
......@@ -29,10 +29,18 @@ describe('template spec', () => {
cy.get('[data-testid="save-button"] > span').click();
cy.get('.status-matrix > :nth-child(1) > :nth-child(1)').click();
cy.get('[data-testid="menu-item-dust-overview"] > span').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="dust-view-button"]').click();
cy.get('[data-testid="menu-item-dust-overview"] > span').click();
cy.get('[data-testid="cell-0-operation"] > [data-testid="dust-edit-button"]').click();
cy.get('[data-testid="confirm-button"]').click();
// 添加兼容性检查,判断是否存在操作按钮元素
cy.get('body').then($body => {
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="dust-view-button"]').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="dust-view-button"]').click();
cy.get('[data-testid="menu-item-dust-overview"] > span').click();
}
if ($body.find('[data-testid="cell-0-operation"] > [data-testid="dust-edit-button"]').length) {
cy.get('[data-testid="cell-0-operation"] > [data-testid="dust-edit-button"]').click();
cy.get('[data-testid="confirm-button"]').click();
}
});
/* ==== End Cypress Studio ==== */
});
})
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment