Cypress: filterFunnel - End testing done.
This commit is contained in:
@@ -15,14 +15,96 @@ describe('Save Log and Filter', ()=>{
|
|||||||
cy.get('#iconFilter').click(); // 選取 Filter sidebar
|
cy.get('#iconFilter').click(); // 選取 Filter sidebar
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Sequence, Have activity(s).', () => {
|
// it('Sequence, Have activity(s).', () => {
|
||||||
|
// // select radio
|
||||||
|
// cy.get('input#Sequence0').should('be.checked'); // 選取 Radio 'Sequence'
|
||||||
|
// cy.contains('label', 'Have activity(s)') // 選取 Radio 'Have activity(s)'
|
||||||
|
// .prev(2)
|
||||||
|
// .find('input')
|
||||||
|
// .should('have.attr', 'type', 'radio') // select the previous element
|
||||||
|
// .should('be.checked'); // confirm it's type radio (optional)
|
||||||
|
|
||||||
|
// // No selected.
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.get('.v-toast__text').should('contain', 'Not selected');
|
||||||
|
// cy.wait(3000);
|
||||||
|
|
||||||
|
// // Clear selected item.
|
||||||
|
// cy.get('.allCheckboxAct') // 選取 all select
|
||||||
|
// .find('input')
|
||||||
|
// .should('not.be.visible').check({ force: true}).should('be.checked'); // 打開隱藏項目並選取
|
||||||
|
// cy.contains('button', 'Clear').click();
|
||||||
|
// cy.get('.allCheckboxAct') // 選取 all select
|
||||||
|
// .find('input')
|
||||||
|
// .should('not.be.visible')
|
||||||
|
// .should('not.be.checked')
|
||||||
|
// cy.wait(3000);
|
||||||
|
|
||||||
|
// // selected item
|
||||||
|
// cy.get('table tr:nth-child(2) input[type="checkbox"]').check({force: true});
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.get('#tabFunnel').click();
|
||||||
|
// cy.contains('p', 'Sequence');
|
||||||
|
// cy.contains('span', 'Include');
|
||||||
|
// 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('Sequence, Start', () => {
|
||||||
|
// // select radio
|
||||||
|
// cy.get('input#Sequence0').should('be.checked'); // 選取 Radio 'Sequence'
|
||||||
|
// cy.contains('label', 'Start activity / End activity') // 選取 Radio 'Have activity(s)'
|
||||||
|
// .prev(2)
|
||||||
|
// .find('input')
|
||||||
|
// .should('have.attr', 'type', 'radio') // select the previous element
|
||||||
|
// .check({ force: true })
|
||||||
|
// .should('be.checked'); // confirm it's type radio (optional)
|
||||||
|
|
||||||
|
// // No selected.
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.get('.v-toast__text').should('contain', 'Not selected');
|
||||||
|
// cy.wait(3000);
|
||||||
|
|
||||||
|
// // Clear selected item.
|
||||||
|
// cy.get('table tr:nth-child(2) input[type="radio"]').check({force: true}); // 選取第二個
|
||||||
|
// cy.contains('button', 'Clear').click();
|
||||||
|
// cy.get('table tr:nth-child(2) input[type="radio"]').should('not.be.checked')
|
||||||
|
// cy.wait(3000);
|
||||||
|
|
||||||
|
// // selected item
|
||||||
|
// cy.get('table tr:nth-child(2) input[type="radio"]').check({force: true});
|
||||||
|
// cy.contains('button', 'Apply').click();
|
||||||
|
// cy.get('#tabFunnel').click();
|
||||||
|
// cy.contains('p', 'Sequence');
|
||||||
|
// cy.contains('span', 'Start');
|
||||||
|
// 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('Sequence, End', () => {
|
||||||
// select radio
|
// select radio
|
||||||
cy.get('input#Sequence0').should('be.checked'); // 選取 Radio 'Sequence'
|
cy.get('input#Sequence0').should('be.checked'); // 選取 Radio 'Sequence'
|
||||||
cy.contains('label', 'Have activity(s)') // 選取 Radio 'Have activity(s)'
|
cy.contains('label', 'Start activity / End activity') // 選取 Radio 'Have activity(s)'
|
||||||
.prev(2)
|
.prev(2)
|
||||||
.find('input')
|
.find('input')
|
||||||
.should('have.attr', 'type', 'radio') // select the previous element
|
.should('have.attr', 'type', 'radio') // select the previous element
|
||||||
|
.check({ force: true })
|
||||||
.should('be.checked'); // confirm it's type radio (optional)
|
.should('be.checked'); // confirm it's type radio (optional)
|
||||||
|
cy.get('input#End1').check({ force: true });
|
||||||
|
|
||||||
// No selected.
|
// No selected.
|
||||||
cy.contains('button', 'Apply').click();
|
cy.contains('button', 'Apply').click();
|
||||||
@@ -30,22 +112,17 @@ describe('Save Log and Filter', ()=>{
|
|||||||
cy.wait(3000);
|
cy.wait(3000);
|
||||||
|
|
||||||
// Clear selected item.
|
// Clear selected item.
|
||||||
cy.get('.allCheckboxAct') // 選取 all select
|
cy.get('table tr:nth-child(1) input[type="radio"]').check({force: true}); // 選取第一個
|
||||||
.find('input')
|
|
||||||
.should('not.be.visible').check({ force: true}).should('be.checked'); // 打開隱藏項目並選取
|
|
||||||
cy.contains('button', 'Clear').click();
|
cy.contains('button', 'Clear').click();
|
||||||
cy.get('.allCheckboxAct') // 選取 all select
|
cy.get('table tr:nth-child(1) input[type="radio"]').should('not.be.checked')
|
||||||
.find('input')
|
|
||||||
.should('not.be.visible')
|
|
||||||
.should('not.be.checked')
|
|
||||||
cy.wait(3000);
|
cy.wait(3000);
|
||||||
|
|
||||||
// selected item
|
// selected item
|
||||||
cy.get('table tr:nth-child(2) input[type="checkbox"]').check({force: true});
|
cy.get('table tr:nth-child(2) input[type="radio"]').check({force: true});
|
||||||
cy.contains('button', 'Apply').click();
|
cy.contains('button', 'Apply').click();
|
||||||
cy.get('#tabFunnel').click();
|
cy.get('#tabFunnel').click();
|
||||||
cy.contains('p', 'Sequence');
|
cy.contains('p', 'Sequence');
|
||||||
cy.contains('span', 'Include');
|
cy.contains('span', 'End');
|
||||||
cy.contains('button', 'Apply All').click();
|
cy.contains('button', 'Apply All').click();
|
||||||
|
|
||||||
// make sure create map again.
|
// make sure create map again.
|
||||||
@@ -57,42 +134,4 @@ describe('Save Log and Filter', ()=>{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Sequence, Start', () => {
|
|
||||||
// select radio
|
|
||||||
cy.get('input#Sequence0').should('be.checked'); // 選取 Radio 'Sequence'
|
|
||||||
cy.contains('label', 'Start activity / End activity') // 選取 Radio 'Have activity(s)'
|
|
||||||
.prev(2)
|
|
||||||
.find('input')
|
|
||||||
.should('have.attr', 'type', 'radio') // select the previous element
|
|
||||||
.check({ force: true })
|
|
||||||
.should('be.checked'); // confirm it's type radio (optional)
|
|
||||||
|
|
||||||
// No selected.
|
|
||||||
cy.contains('button', 'Apply').click();
|
|
||||||
cy.get('.v-toast__text').should('contain', 'Not selected');
|
|
||||||
cy.wait(3000);
|
|
||||||
|
|
||||||
// Clear selected item.
|
|
||||||
cy.get('table tr:nth-child(2) input[type="radio"]').check({force: true}); // 選取第二個
|
|
||||||
cy.contains('button', 'Clear').click();
|
|
||||||
cy.get('table tr:nth-child(2) input[type="radio"]').should('not.be.checked')
|
|
||||||
cy.wait(3000);
|
|
||||||
|
|
||||||
// selected item
|
|
||||||
cy.get('table tr:nth-child(2) input[type="radio"]').check({force: true});
|
|
||||||
cy.contains('button', 'Apply').click();
|
|
||||||
cy.get('#tabFunnel').click();
|
|
||||||
cy.contains('p', 'Sequence');
|
|
||||||
cy.contains('span', 'Start');
|
|
||||||
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% 來判斷數據是否有變化
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user