diff --git a/cypress.config.js b/cypress.config.js index 02420a0..d5c3e80 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -6,18 +6,3 @@ module.exports = defineConfig({ specPattern: "cypress/e2e/**/*.{cy,spec}.{js,jsx,ts,tsx}", }, }); - -// { -// "video": false, -// "env": { -// "DISPLAY": ":99" -// }, -// "chromeWebSecurity": false, -// "viewportHeight": 1080, -// "viewportWidth": 1920, -// "numTestsKeptInMemory": 10, -// "browser": "chrome", -// "headless": true, -// "includeShadowDom": true, -// "watchForFileChanges": true -// } diff --git a/cypress/e2e/saveLogAndFilter.cy.js b/cypress/e2e/saveLogAndFilter.cy.js index b0677d9..1049068 100644 --- a/cypress/e2e/saveLogAndFilter.cy.js +++ b/cypress/e2e/saveLogAndFilter.cy.js @@ -1,27 +1,36 @@ - // 每一 describe 就是一個測試套件 +// 每一 it 就是一個測試命令 describe('Save Log and Filter', ()=>{ - // 每一 it 就是一個測試命令 - // it('test', () => { - - // cy.visit('http://'); - // cy.get('#id').click(); - // cy.title().shoule('include', 'DISCOVER') // 檢查標題看是否有點擊成功 - // cy.url().should('include', 'discover/logs') // url 需要一個斷言 - // }); - beforeEach(() => { cy.visit('https://REDACTED-HOST/files'); cy.login(); cy.visit('https://REDACTED-HOST/files'); }); - it('log', () => { - cy.visit('https://REDACTED-HOST/files'); - console.log(cy.title()); - console.log(cy.url()); - }) -}) + it('save log', () => { + // enter log + cy.url().should('include', 'files'); + cy.contains('.fileName', 'random').dblclick(); // 選取 'random' log 檔 + cy.contains('h2', 'DISCOVER'); // 斷言在 Discover 頁 + cy.url().should('include', 'discover/logs'); // 斷言在 discover/logs/:id 路徑 + cy.wait(3000) + + // select radio + cy.get('#iconFilter').click(); // 選取 Filter sidebar + 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) + + // select table item + cy.get('.allCheckboxAct') // 選取 all select + .find('input') + .should('not.be.visible').check({ force: true}).should('be.checked'); // 打開隱藏項目並選取 + + }); +}); // cy.visit('https://REDACTED-HOST/files'); // cy.get('.min-w-\[216px\]:nth-child(1) > div > .text-neutral-500').click(); // cy.get('.text-primary').click(); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index eadd062..77deb0c 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -21,8 +21,6 @@ Cypress.Commands.add('login', () => { password: Cypress.env('user').password } }).then(response => { - console.log(response); - cy.log(response) const token = response.body.access_token; cy.setCookie('luciaToken', token); }) diff --git a/src/components/Discover/Filter/ActOccCase.vue b/src/components/Discover/Filter/ActOccCase.vue index e7f18a2..4484fc4 100644 --- a/src/components/Discover/Filter/ActOccCase.vue +++ b/src/components/Discover/Filter/ActOccCase.vue @@ -10,7 +10,7 @@ - + @@ -46,24 +46,6 @@ import Search from '@/components/Search.vue'; export default { props: ['tableTitle', 'tableData', 'tableSelect', 'progressWidth'], - // { - // tableTitle: { - // type: String, - // require: true, - // }, - // tableData: { - // type: Array, - // require: true, - // }, - // tableSelect: { - // type: Array, - // require: true, - // }, - // progressWidth: { - // type: Function, - // require: false, - // } - // }, data() { return { select: this.tableSelect, diff --git a/src/components/Discover/SidebarFilter.vue b/src/components/Discover/SidebarFilter.vue index 686dd46..114d9b8 100644 --- a/src/components/Discover/SidebarFilter.vue +++ b/src/components/Discover/SidebarFilter.vue @@ -2,8 +2,8 @@ diff --git a/src/views/Discover/index.vue b/src/views/Discover/index.vue index 1385cf1..43097d5 100644 --- a/src/views/Discover/index.vue +++ b/src/views/Discover/index.vue @@ -8,7 +8,7 @@
  • - + tornado
  • diff --git a/src/views/Files/index.vue b/src/views/Files/index.vue index 41f14e0..90edc07 100644 --- a/src/views/Files/index.vue +++ b/src/views/Files/index.vue @@ -40,9 +40,9 @@
    - + - +