diff --git a/cypress/e2e/100_home.cy.js b/cypress/e2e/100_home.cy.js index 1cd6c48..cb186cc 100644 --- a/cypress/e2e/100_home.cy.js +++ b/cypress/e2e/100_home.cy.js @@ -20,20 +20,12 @@ describe('load homepage', () => { cy.get('a[href*="/gallery"]').should('exist') cy.get('a[href*="/settings"]').should('exist') }) - /* + it('checks home page links', () => { cy.visit('http://localhost:8080') - cy.get('a.v-btn[href*="/program"]').click() - cy.url().should('include', '/program') - cy.visit('http://localhost:8080') - cy.get('a.v-btn[href*="/docs"]').invoke('removeAttr', 'target').click() - cy.url().should('include', '/docs') - cy.visit('http://localhost:8080') - cy.get('a.v-btn[href*="/control"]').click() - cy.url().should('include', '/control') - cy.visit('http://localhost:8080') - cy.get('a.v-btn[href*="/settings"]').click() - cy.url().should('include', '/settings') + cy.get('a.v-btn[href*="/program"]').should('exist') + cy.get('a.v-btn[href*="/docs"]').should('exist') + cy.get('a.v-btn[href*="/control"]').should('exist') + cy.get('a.v-btn[href*="/settings"]').should('exist') }) - */ }) \ No newline at end of file diff --git a/cypress/e2e/500_control.cy.js b/cypress/e2e/500_control.cy.js index 4fe506e..c79b705 100644 --- a/cypress/e2e/500_control.cy.js +++ b/cypress/e2e/500_control.cy.js @@ -1,4 +1,4 @@ -describe('load homepage', () => { +describe('load control page, verify stream is there', () => { it('checks sidebar contents', () => { cy.visit('http://localhost:8080') cy.get('.v-carousel').should('exist') @@ -7,15 +7,55 @@ describe('load homepage', () => { cy.get('img[src*="video/stream"]').should('exist') }) - it('takes picture', () => { + it('move', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.up').click() + cy.get('button.left').click() + cy.get('button.right').click() + cy.get('button.down').click() }) - it('say a phrase', () => { + it('takes a picture', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.photo').click() }) it('record a video', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.video').click() + cy.get('button.video').click() + }) + + it('say a phrase', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.speak').click() + cy.get('#control_text_to_speech').clear().type('hello world!') + cy.get('#dialog_control_speak_title').find('button.ok').click() }) it('opens gallery', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('a.gallery').click() + cy.url().should('include', '/gallery') }) }) \ No newline at end of file diff --git a/cypress/e2e/600_gallery.cy.js b/cypress/e2e/600_gallery.cy.js index d3b828a..b5209f6 100644 --- a/cypress/e2e/600_gallery.cy.js +++ b/cypress/e2e/600_gallery.cy.js @@ -8,15 +8,47 @@ describe('load homepage', () => { cy.get('h3').should('exist') }) - it('checks photo exists, sees details', () => { - }) - - it('checks video exists, plays it', () => { - }) - - it('deletes existing photo', () => { + it('takes a picture, verify gallery and details, delete', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.photo').click() + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="gallery"]').click() + cy.get('#app').click() + cy.get('.gallery').contains('DSC1').should('exist') + cy.get('.v-main').contains('DSC1').click() + cy.get('.v-card-title.details').contains('DSC1').should('exist') + cy.get('.v-card-title.details').contains('DSC1').parents('.v-card').find('button.ok').click() + cy.get('.v-main').contains('DSC1').parents('.v-card').find('.mdi-delete').click() + cy.get('#gallery_photo_confirm_card').find('.ok').click() }) - it('deletes existing vide', () => { + it('takes a video, deletes is', () => { + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="control"]').click() + cy.get('#app').click() + cy.get('button.video').click() + cy.wait(1000) + cy.get('button.video').click() + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="gallery"]').click() + cy.get('#app').click() + /* + cy.get('.gallery').contains('VID1').should('exist') + cy.get('.v-main').contains('VID1').click() + cy.get('.v-card-title.details').contains('VID1').should('exist') + cy.get('.v-card-title.details').contains('VID1').parents('.v-card').find('button.ok').click() + cy.get('.v-main').contains('VID1').parents('.v-card').find('.mdi-delete').click() + cy.get('#gallery_photo_confirm_card').find('.ok').click() + */ }) }) \ No newline at end of file diff --git a/cypress/e2e/700_settings.cy.js b/cypress/e2e/700_settings.cy.js index 3b63e50..aa0bd87 100644 --- a/cypress/e2e/700_settings.cy.js +++ b/cypress/e2e/700_settings.cy.js @@ -50,11 +50,78 @@ describe('load homepage', () => { cy.get('#settings_password').clear() cy.get('#save').click() }) - /* + it('modifies most settings, valid values, save', () => { + cy.intercept('http://localhost:5000/wifi/v1/connection_status', (req) => { + req.reply({"wifi": false, "internet": true}) + }) + cy.intercept('http://localhost:5000/wifi/v1/list_access_points', (req) => { + req.reply({"ssids": [{"ssid": "wifi-home", "conn_type": "WPA2", "strength": 99}]}) + }) + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="/settings"]').click() + cy.get('#app').click() + cy.get('button#1').click() + cy.get('input#settings_movement_control_forward_speed').clear().type('90') + cy.get('input#settings_movement_control_forward_elapse').clear().type('1') + cy.get('input#settings_movement_control_turn_speed').clear().type('90') + cy.get('input#settings_movement_control_turn_elapse').clear().type('1') + cy.get('input#settings_movement_program_forward_speed').clear().type('90') + cy.get('input#settings_movement_program_forward_elapse').clear().type('1') + cy.get('input#settings_movement_program_turn_speed').clear().type('90') + cy.get('input#settings_movement_program_turn_elapse').clear().type('1') + cy.get('#save').click() + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="/settings"]').click() + cy.get('#app').click() + cy.get('button#1').click() + cy.get('input#settings_movement_control_forward_speed').should('have.value', '90') + cy.get('input#settings_movement_control_forward_elapse').should('have.value', '1') + cy.get('input#settings_movement_control_turn_speed').should('have.value', '90') + cy.get('input#settings_movement_control_turn_elapse').should('have.value', '1') + cy.get('input#settings_movement_program_forward_speed').should('have.value', '90') + cy.get('input#settings_movement_program_forward_elapse').should('have.value', '1') + cy.get('input#settings_movement_program_turn_speed').should('have.value', '90') + cy.get('input#settings_movement_program_turn_elapse').should('have.value', '1') }) it('modifies most settings, invalid values, verify error message', () => { + cy.intercept('http://localhost:5000/wifi/v1/connection_status', (req) => { + req.reply({"wifi": false, "internet": true}) + }) + cy.intercept('http://localhost:5000/wifi/v1/list_access_points', (req) => { + req.reply({"ssids": [{"ssid": "wifi-home", "conn_type": "WPA2", "strength": 99}]}) + }) + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="/settings"]').click() + cy.get('#app').click() + cy.get('button#1').click() + cy.get('input#settings_movement_control_forward_speed').clear().type('1000') + cy.get('input#settings_movement_control_forward_speed').parents('.v-input').find('.v-messages') + }) + + it('modifies some settings, leave page whithout saving, verify "dirty" message', () => { + cy.intercept('http://localhost:5000/wifi/v1/connection_status', (req) => { + req.reply({"wifi": false, "internet": true}) + }) + cy.intercept('http://localhost:5000/wifi/v1/list_access_points', (req) => { + req.reply({"ssids": [{"ssid": "wifi-home", "conn_type": "WPA2", "strength": 99}]}) + }) + cy.visit('http://localhost:8080') + cy.get('.v-carousel').should('exist') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="/settings"]').click() + cy.get('#app').click() + cy.get('button#1').click() + cy.get('input#settings_movement_control_forward_speed').clear().type('99') + cy.get('button.v-app-bar-nav-icon').should('exist').click() + cy.get('a.v-list-item[href*="/control"]').click() + cy.get('#confirm_exit_dialog').should('exist') }) - */ }) \ No newline at end of file diff --git a/src/common/coderbot.js b/src/common/coderbot.js index 1e3eaa1..f41ebbe 100644 --- a/src/common/coderbot.js +++ b/src/common/coderbot.js @@ -246,20 +246,24 @@ class CoderBot { return this.$axios.post(`${this.CB}/system/halt`); } - getInfoAndStatus() { + getStatus() { const p1 = this.$axios.get(`${this.CB}/system/status`) .then((response) => { this.$store.commit('setStatus', response.data); }).catch((error) => { this.$store.commit('setStatus', null); }); + return Promise.all([p1]); + } + + getInfo() { const p2 = this.$axios.get(`${this.CB}/system/info`) .then((response) => { this.$store.commit('setInfo', response.data); }).catch(error => { this.$store.commit('setInfo', null); }); - return Promise.all([p1, p2]); + return Promise.all([p2]); } deleteMusicPackage(pkgNameID) { @@ -399,15 +403,15 @@ class CoderBot { return `${this.CB}/video/stream`; } - getPhotos() { + getMediaList() { return this.$axios.get(`${this.CB}/media`); } - deletePhoto(name) { + deleteMedia(name) { return this.$axios.delete(`${this.CB}/media/${name}`); } - getPhotoURL(name) { + getMediaURL(name) { return `${this.CB}/media/${name}`; } diff --git a/src/components/BlocklyWorkspace.vue b/src/components/BlocklyWorkspace.vue index ffe19ca..5fe6684 100644 --- a/src/components/BlocklyWorkspace.vue +++ b/src/components/BlocklyWorkspace.vue @@ -105,10 +105,12 @@ export default { maxBlocks: settings.maxBlocks, zoom: { controls: true, - wheel: false, + wheel: true, startScale: 1.0, - maxScale: 1.5, - minScale: 0.2, + maxScale: 3, + minScale: 0.3, + scaleSpeed: 1.2, + pinch: true }, }, ); diff --git a/src/components/Control.vue b/src/components/Control.vue index b861a65..1592178 100644 --- a/src/components/Control.vue +++ b/src/components/Control.vue @@ -15,7 +15,7 @@ - @@ -23,13 +23,13 @@ - - @@ -37,7 +37,7 @@ - @@ -50,7 +50,7 @@ - {{ $t("message.control_speak") }} @@ -59,7 +59,7 @@ - {{ $t("message.control_photo_take") }} @@ -68,7 +68,7 @@ - {{ videoBtn.text }} mdi-{{ videoBtn.icon }} @@ -77,7 +77,7 @@ - + {{ $t("message.control_photo_gallery") }} @@ -94,18 +94,18 @@ {{ $t("message.close") }} - + - {{ $t("message.gallery_empty") }} + {{ $t("message.control_speak_title") }} - + {{ $t("message.cancel") }} - {{ $t("message.control_speak") }} + {{ $t("message.control_speak") }} diff --git a/src/components/Gallery.vue b/src/components/Gallery.vue index 0a64ba3..d931c12 100644 --- a/src/components/Gallery.vue +++ b/src/components/Gallery.vue @@ -14,7 +14,7 @@

{{ $t("message.gallery_empty") }}