From 2258f0e7b09b0e5e713d2f502de2275a5446ba77 Mon Sep 17 00:00:00 2001 From: chiayin Date: Wed, 7 Feb 2024 11:21:52 +0800 Subject: [PATCH] test: Performance Enter Log and Enter Filter done. --- cypress/downloads/rightFile.csv | 30 ---------- cypress/e2e/performance.cy.js | 58 +++++++++++++++++++ .../doneTesting}/fileUploadEtc.cy.js | 0 src/views/Discover/Performance/index.vue | 2 +- 4 files changed, 59 insertions(+), 31 deletions(-) delete mode 100644 cypress/downloads/rightFile.csv create mode 100644 cypress/e2e/performance.cy.js rename cypress/{e2e => fixtures/doneTesting}/fileUploadEtc.cy.js (100%) diff --git a/cypress/downloads/rightFile.csv b/cypress/downloads/rightFile.csv deleted file mode 100644 index 508d1dd..0000000 --- a/cypress/downloads/rightFile.csv +++ /dev/null @@ -1,30 +0,0 @@ -CaseID,Activity,Timestamp,Status,Activity_Instance -CID_1,檢傷,2023-01-12 15:32:31,start,1 -CID_1,檢傷,2023-01-12 15:32:31,complete,1 -CID_1,第一次醫囑,2023-01-12 15:49:01,start,2 -CID_1,第一次醫囑,2023-01-12 15:49:01,complete,2 -CID_1,出院,2023-01-13 03:32:00,start,3 -CID_1,出院,2023-01-13 03:32:00,complete,3 -CID_5,檢傷,2023-07-13 02:49:36,start,14 -CID_5,檢傷,2023-07-13 02:49:36,complete,14 -CID_5,第一次醫囑,2023-07-13 03:07:01,start,15 -CID_2,檢傷,2023-07-26 08:44:17,start,4 -CID_2,檢傷,2023-07-26 08:44:17,complete,4 -CID_2,第一次醫囑,2023-07-26 08:48:05,start,5 -CID_2,第一次醫囑,2023-07-26 08:48:05,complete,5 -CID_2,出院,2023-07-26 17:00:49,start,6 -CID_2,出院,2023-07-26 17:00:49,complete,6 -CID_4,檢傷,2023-11-01 01:20:19,start,10 -CID_4,檢傷,2023-11-01 01:20:19,complete,10 -CID_4,第一次醫囑,2023-11-01 01:34:54,start,11 -CID_4,第一次醫囑,2023-11-01 01:34:54,complete,11 -CID_4,住院,2023-11-02 06:36:36,start,12 -CID_4,住院,2023-11-10 02:35:39,complete,12 -CID_4,出院,2023-11-10 02:35:39,start,13 -CID_4,出院,2023-11-10 02:35:39,complete,13 -CID_3,檢傷,2023-11-27 06:20:48,start,7 -CID_3,檢傷,2023-11-27 06:20:48,complete,7 -CID_3,第一次醫囑,2023-11-27 06:40:30,start,8 -CID_3,第一次醫囑,2023-11-27 06:40:30,complete,8 -CID_3,出院,2023-11-27 07:21:53,start,9 -CID_3,出院,2023-11-27 07:21:53,complete,9 diff --git a/cypress/e2e/performance.cy.js b/cypress/e2e/performance.cy.js new file mode 100644 index 0000000..c3acf87 --- /dev/null +++ b/cypress/e2e/performance.cy.js @@ -0,0 +1,58 @@ +describe('Performance', ()=>{ + beforeEach(() => { + cy.visit('https://REDACTED-HOST/files'); + cy.login(); + cy.visit('https://REDACTED-HOST/files'); + }); + // Anchor + 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/log'); + // // 斷言頁面中有八個 canvas 元素 + // cy.get('canvas').should('have.length', 8); + // }); +}) diff --git a/cypress/e2e/fileUploadEtc.cy.js b/cypress/fixtures/doneTesting/fileUploadEtc.cy.js similarity index 100% rename from cypress/e2e/fileUploadEtc.cy.js rename to cypress/fixtures/doneTesting/fileUploadEtc.cy.js diff --git a/src/views/Discover/Performance/index.vue b/src/views/Discover/Performance/index.vue index 2f689ce..f8cf5c9 100644 --- a/src/views/Discover/Performance/index.vue +++ b/src/views/Discover/Performance/index.vue @@ -187,7 +187,7 @@ export default { const totalBars = chartData.data.length; let horizontalBar = this.horizontalBarHeight; - if(totalBars > 10) horizontalBar = (totalBars - 10) * 20 + this.horizontalBarHeight; + if(totalBars > 10) horizontalBar = (totalBars - 10) * 16 + this.horizontalBarHeight; return horizontalBar + 'px' },