test: Performance Anchor done.
This commit is contained in:
@@ -4,7 +4,7 @@ describe('Performance', ()=>{
|
|||||||
cy.login();
|
cy.login();
|
||||||
cy.visit('https://REDACTED-HOST/files');
|
cy.visit('https://REDACTED-HOST/files');
|
||||||
});
|
});
|
||||||
// Anchor
|
|
||||||
// it('Enter Log', () => {
|
// it('Enter Log', () => {
|
||||||
// // enter Map
|
// // enter Map
|
||||||
// cy.url().should('include', 'files');
|
// cy.url().should('include', 'files');
|
||||||
@@ -39,20 +39,44 @@ describe('Performance', ()=>{
|
|||||||
// cy.get('canvas').should('have.length', 8);
|
// cy.get('canvas').should('have.length', 8);
|
||||||
// });
|
// });
|
||||||
|
|
||||||
it('Enter Rule', () => {
|
// it('Enter Rule', () => {
|
||||||
|
// // enter Map
|
||||||
|
// cy.url().should('include', 'files');
|
||||||
|
// cy.get('table tr')
|
||||||
|
// .filter(':contains("Rule")')
|
||||||
|
// .first()
|
||||||
|
// .dblclick();
|
||||||
|
// cy.contains('h2', 'DISCOVER');
|
||||||
|
// cy.url().should('include', 'conformance');
|
||||||
|
// cy.wait(2000);
|
||||||
|
// // enter Performance
|
||||||
|
// cy.contains('li', 'PERFORMANCE').click();
|
||||||
|
// cy.url().should('include', 'discover/performance');
|
||||||
|
// // 斷言頁面中有八個 canvas 元素
|
||||||
|
// cy.get('canvas').should('have.length', 8);
|
||||||
|
// });
|
||||||
|
|
||||||
|
it('Anchor', () => {
|
||||||
// enter Map
|
// enter Map
|
||||||
cy.url().should('include', 'files');
|
cy.url().should('include', 'files');
|
||||||
cy.get('table tr')
|
cy.get('table tr')
|
||||||
.filter(':contains("Rule")')
|
.filter(':contains("Log")')
|
||||||
.first()
|
.first() // 選擇集合中第一個元素
|
||||||
.dblclick();
|
.dblclick();
|
||||||
cy.contains('h2', 'DISCOVER');
|
cy.contains('h2', 'DISCOVER');
|
||||||
cy.url().should('include', 'conformance');
|
cy.url().should('include', 'discover/map/log');
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
// enter Performance
|
// enter Performance
|
||||||
cy.contains('li', 'PERFORMANCE').click();
|
cy.contains('li', 'PERFORMANCE').click();
|
||||||
cy.url().should('include', 'discover/performance');
|
cy.url().should('include', 'discover/performance/log');
|
||||||
// 斷言頁面中有八個 canvas 元素
|
// Anchor 網頁不會捲動到錨點位置是因為 Cypress 是模擬使用者行為而非準確瀏覽器行為
|
||||||
cy.get('canvas').should('have.length', 8);
|
cy.get('aside li a[href="#cycleTime"]').click();
|
||||||
|
cy.url().should('include', '#cycleTime');
|
||||||
|
cy.get('aside li a[href="#processingTime"]').click();
|
||||||
|
cy.url().should('include', '#processingTime');
|
||||||
|
cy.get('aside li a[href="#waitingTime"]').click();
|
||||||
|
cy.url().should('include', '#waitingTime');
|
||||||
|
cy.get('aside li a[href="#cases"]').click();
|
||||||
|
cy.url().should('include', '#cases');
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user