83 lines
2.8 KiB
JavaScript
83 lines
2.8 KiB
JavaScript
describe('Performance', ()=>{
|
|
beforeEach(() => {
|
|
cy.visit('https://REDACTED-HOST/files');
|
|
cy.login();
|
|
cy.visit('https://REDACTED-HOST/files');
|
|
});
|
|
|
|
// it('Enter Log', () => {
|
|
// // enter Map
|
|
// cy.url().should('include', 'files');
|
|
// cy.get('table tr')
|
|
// .filter(':contains("Log")')
|
|
// .first() // 選擇集合中第一個元素
|
|
// .dblclick();
|
|
// cy.contains('h2', 'DISCOVER');
|
|
// cy.url().should('include', 'discover/map/log');
|
|
// cy.wait(2000);
|
|
// // enter Performance
|
|
// cy.contains('li', 'PERFORMANCE').click();
|
|
// cy.url().should('include', 'discover/performance/log');
|
|
// // 斷言頁面中有八個 canvas 元素
|
|
// cy.get('canvas').should('have.length', 8);
|
|
// });
|
|
|
|
// it('Enter Filter', () => {
|
|
// // enter Map
|
|
// cy.url().should('include', 'files');
|
|
// cy.get('table tr')
|
|
// .filter(':contains("Filter")')
|
|
// .first()
|
|
// .dblclick();
|
|
// cy.contains('h2', 'DISCOVER');
|
|
// cy.url().should('include', 'discover/map/filter');
|
|
// cy.wait(2000);
|
|
// // enter Performance
|
|
// cy.contains('li', 'PERFORMANCE').click();
|
|
// cy.url().should('include', 'discover/performance/filter');
|
|
// // 斷言頁面中有八個 canvas 元素
|
|
// cy.get('canvas').should('have.length', 8);
|
|
// });
|
|
|
|
// 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
|
|
cy.url().should('include', 'files');
|
|
cy.get('table tr')
|
|
.filter(':contains("Log")')
|
|
.first() // 選擇集合中第一個元素
|
|
.dblclick();
|
|
cy.contains('h2', 'DISCOVER');
|
|
cy.url().should('include', 'discover/map/log');
|
|
cy.wait(2000);
|
|
// enter Performance
|
|
cy.contains('li', 'PERFORMANCE').click();
|
|
cy.url().should('include', 'discover/performance/log');
|
|
// Anchor 網頁不會捲動到錨點位置是因為 Cypress 是模擬使用者行為而非準確瀏覽器行為
|
|
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');
|
|
});
|
|
})
|