test: E2E-conformance rule Processing time E2E All done.

This commit is contained in:
chiayin
2023-12-07 17:26:44 +08:00
parent 44fe8acc8f
commit 9d52db406d
2 changed files with 63 additions and 19 deletions

View File

@@ -159,7 +159,58 @@ describe('Conformance Save', ()=>{
// cy.contains('#swal2-html-container', 'random-conformance-rule-E2Etesting'); // cy.contains('#swal2-html-container', 'random-conformance-rule-E2Etesting');
// }); // });
it('Activity duration', () => { // it('Activity duration', () => {
// // enter Map
// cy.url().should('include', 'files');
// cy.get('table tr')
// .filter(':contains("Rule")') // 選擇 type Log
// .filter(':contains("random-conformance-rule-E2Etesting")') // 選擇 random log 檔
// .dblclick({ force: true }); // 對選中的 tr 執行雙擊
// cy.contains('h2', 'DISCOVER'); // 斷言在 Discover 頁
// cy.url().should('include', 'rule/log'); // 斷言在 discover/map/log/:id 路徑
// cy.wait(2000)
// // select radio Rule Type
// cy.get('#cyp-conformance-type-radio')
// .find('input[value="Activity duration"]')
// .check({ force: true })
// .should('be.checked');
// // open showbar
// cy.get('#cyp-showbaricon').click();
// // select radio Start
// cy.contains('p', 'Activities')
// .next('div')
// .find('input')
// .first()
// .check({ force: true })
// .should('be.checked');
// cy.contains('button', 'Apply').click();
// // change time to time range Start
// cy.get('#min').click();
// cy.get('input[data-index="2"]').eq(0).type('59', { force: true });
// // change time to time range End
// cy.get('#max').click();
// cy.get('input[data-index="2"]').eq(0).type('0', { force: true });
// // click apply
// cy.contains('button', 'Apply').click();
// cy.contains('.v-toast', 'Rule applied');
// // 是否有顯示選擇項目
// cy.get('#cyp-conformance-result-check')
// .find('li') // 在 ul 中找到所有的 li 元素
// .should('have.length', 1); // 斷言 li 的數量為 2
// // save log
// cy.contains('button', 'Save').click();
// cy.contains('.swal2-title', 'SAVE COMPLETE');
// cy.contains('#swal2-html-container', 'random-conformance-rule-E2Etesting');
// });
it('Processing time, End to end, All', () => {
// enter Map // enter Map
cy.url().should('include', 'files'); cy.url().should('include', 'files');
cy.get('table tr') cy.get('table tr')
@@ -172,21 +223,19 @@ describe('Conformance Save', ()=>{
// select radio Rule Type // select radio Rule Type
cy.get('#cyp-conformance-type-radio') cy.get('#cyp-conformance-type-radio')
.find('input[value="Activity duration"]') .find('input[value="Processing time"]')
.check({ force: true }) .check({ force: true })
.should('be.checked'); .should('be.checked');
// select radio Process Scope
// open showbar cy.get('#cyp-conformance-procss-radio')
cy.get('#cyp-showbaricon').click(); .find('input[value="End to end"]')
.check({ force: true })
// select radio Start .should('be.checked');
cy.contains('p', 'Activities') // select radio Activity Sequence
.next('div') cy.get('#cyp-conformance-actseq-radio')
.find('input') .find('input[value="All"]')
.first()
.check({ force: true }) .check({ force: true })
.should('be.checked'); .should('be.checked');
cy.contains('button', 'Apply').click();
// change time to time range Start // change time to time range Start
cy.get('#min').click(); cy.get('#min').click();
@@ -199,11 +248,6 @@ describe('Conformance Save', ()=>{
cy.contains('button', 'Apply').click(); cy.contains('button', 'Apply').click();
cy.contains('.v-toast', 'Rule applied'); cy.contains('.v-toast', 'Rule applied');
// 是否有顯示選擇項目
cy.get('#cyp-conformance-result-check')
.find('li') // 在 ul 中找到所有的 li 元素
.should('have.length', 1); // 斷言 li 的數量為 2
// save log // save log
cy.contains('button', 'Save').click(); cy.contains('button', 'Save').click();
cy.contains('.swal2-title', 'SAVE COMPLETE'); cy.contains('.swal2-title', 'SAVE COMPLETE');

View File

@@ -25,7 +25,7 @@
</div> </div>
</div> </div>
<!-- Process Scope --> <!-- Process Scope -->
<div v-show="selectedRuleType === 'Processing time' || selectedRuleType === 'Waiting time'"> <div v-show="selectedRuleType === 'Processing time' || selectedRuleType === 'Waiting time'" id="cyp-conformance-procss-radio">
<p class="h2">Process Scope</p> <p class="h2">Process Scope</p>
<div v-for="pro in processScope" :key="pro.id" class="ml-4 mb-2"> <div v-for="pro in processScope" :key="pro.id" class="ml-4 mb-2">
<RadioButton v-model="selectedProcessScope" :inputId="pro.id + pro.name" name="processScope" :value="pro.name" @change="changeRadioProcessScope"/> <RadioButton v-model="selectedProcessScope" :inputId="pro.id + pro.name" name="processScope" :value="pro.name" @change="changeRadioProcessScope"/>
@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<!-- Activity Sequence (4 item) --> <!-- Activity Sequence (4 item) -->
<div v-show="(selectedRuleType === 'Processing time' && selectedProcessScope === 'End to end') || (selectedRuleType === 'Waiting time' && selectedProcessScope === 'End to end') || selectedRuleType === 'Cycle time'"> <div v-show="(selectedRuleType === 'Processing time' && selectedProcessScope === 'End to end') || (selectedRuleType === 'Waiting time' && selectedProcessScope === 'End to end') || selectedRuleType === 'Cycle time'" id="cyp-conformance-actseq-radio">
<p class="h2">Activity Sequence</p> <p class="h2">Activity Sequence</p>
<div v-for="act in actSeqMore" :key="act.id" class="ml-4 mb-2"> <div v-for="act in actSeqMore" :key="act.id" class="ml-4 mb-2">
<RadioButton v-model="selectedActSeqMore" :inputId="act.id + act.name" name="activitySequenceMore" :value="act.name" @change="changeRadioActSeqMore"/> <RadioButton v-model="selectedActSeqMore" :inputId="act.id + act.name" name="activitySequenceMore" :value="act.name" @change="changeRadioActSeqMore"/>