Cypress: filterFunnel - Sequence Sequence testing done.

This commit is contained in:
chiayin
2023-06-12 09:53:54 +08:00
parent d9b43b9f4e
commit 77d6c6c56b
2 changed files with 23 additions and 41 deletions

View File

@@ -205,49 +205,31 @@ describe('Save Log and Filter', ()=>{
// cy.get('.v-toast__text').should('contain', 'Select two or more'); // cy.get('.v-toast__text').should('contain', 'Select two or more');
// cy.wait(3000); // cy.wait(3000);
// 選擇要拖曳的元素 // 使用 dblclick 選擇要拖曳的元素
// cy.get('tbody tr[data-draggable="true"]') cy.get('tbody tr[data-draggable="true"]').first().dblclick();
cy.get('.listSequence').find('div[data-draggable="true"]').should('exist');
cy.contains('button', 'Clear').click();
cy.get('.listSequence').find('div[data-draggable="true"]').should('not.exist');
cy.get('.v-toast__text').should('contain', 'Reset Success');
cy.wait(3000);
// 選取 "Activity List" 的 <table> // 設定傳給後端的 listSequence
// cy.contains('p', 'Start activity') cy.get('tbody tr[data-draggable="true"]').eq(0).dblclick(); // 第 1 個 tr
// .parents('div') // 回到 p 的父層 div cy.get('tbody tr[data-draggable="true"]').eq(1).dblclick(); // 第 2 個 tr
// .eq(1) // 同階層的第二個 div cy.contains('button', 'Apply').click();
// .find('table') // 向下找 table cy.get('#tabFunnel').click();
// .as('startTable'); // 將選取的元素命名,使用 @startTable 來操作 cy.contains('p', 'Sequence');
// // 選取 "end" 的 <table> cy.contains('span', 'Directly-follows');
// cy.contains('p', 'End activity') cy.contains('button', 'Apply All').click();
// .parents('div')
// .eq(1)
// .find('table')
// .as('endTable'); // 使用 @endTable 來操作
// // Clear selected item. // make sure create map again.
// cy.get('@startTable').find('tr:nth-child(1) input[type="radio"]').check({ force: true }); cy.get('header').click();
// cy.get('@endTable').find('tr:nth-child(1) input[type="radio"]').check({ force: true }); cy.get('#iconState').click();
// cy.contains('button', 'Clear').click(); cy.get('li').first().then($li => { // then() 獲取 <li> 元素的內容
// cy.get('@startTable').find('tr:nth-child(1) input[type="radio"]').should('not.be.checked'); const percentage = $li.find('span').eq(1).text(); // li 底下找到第二個 span
// cy.get('@endTable').find('tr:nth-child(1) input[type="radio"]').should('not.be.checked'); expect(percentage).not.to.equal('100%'); // text !== 100% 來判斷數據是否有變化
// cy.wait(3000); });
// // selected item
// cy.get('@startTable').find('tr:nth-child(1) input[type="radio"]').check({ force: true });
// cy.get('@endTable').find('tr:nth-child(1) input[type="radio"]').check({ force: true });
// cy.contains('button', 'Apply').click();
// cy.get('#tabFunnel').click();
// cy.contains('p', 'Sequence');
// cy.contains('span', 'Start')
// .parent()
// .contains('span', 'End'); // 斷言 text 是否包含 Start 和 End.
// cy.contains('button', 'Apply All').click();
// // make sure create map again.
// cy.get('header').click();
// cy.get('#iconState').click();
// cy.get('li').first().then($li => { // then() 獲取 <li> 元素的內容
// const percentage = $li.find('span').eq(1).text(); // li 底下找到第二個 span
// expect(percentage).not.to.equal('100%'); // text !== 100% 來判斷數據是否有變化
// });
}); });
// it('Trace', () => { // it('Trace', () => {

View File

@@ -39,7 +39,7 @@
</div> </div>
<!-- Have Data --> <!-- Have Data -->
<div class="py-4 m-auto w-full h-[calc(100%_-_56px)]"> <div class="py-4 m-auto w-full h-[calc(100%_-_56px)]">
<div class="w-full h-full overflow-y-auto overflow-x-auto scrollbar px-4 text-center "> <div class="w-full h-full overflow-y-auto overflow-x-auto scrollbar px-4 text-center listSequence">
<draggable class="h-full" :list="listSequence" group="people" itemKey="name" animation="300" @end="onEnd"> <draggable class="h-full" :list="listSequence" group="people" itemKey="name" animation="300" @end="onEnd">
<template #item="{ element, index }"> <template #item="{ element, index }">
<div> <div>