Skip to content

more e2e tests #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 49 commits into from
Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d906d75
e2e tests
previ Oct 31, 2022
3edf508
e2e tests
previ Oct 31, 2022
478d180
e2e tests
previ Oct 31, 2022
67b56c8
e2e tests
previ Oct 31, 2022
38cfac3
e2e tests
previ Oct 31, 2022
530e879
e2e tests
previ Oct 31, 2022
d50b39c
e2e tests
previ Oct 31, 2022
b2b093d
e2e tests
previ Oct 31, 2022
49a9d48
e2e tests
previ Oct 31, 2022
74e1ba3
e2e tests
previ Oct 31, 2022
39d2241
e2e tests
previ Oct 31, 2022
dd16030
e2e tests
previ Oct 31, 2022
f07634b
e2e tests
previ Nov 1, 2022
bc92337
e2e tests
previ Nov 1, 2022
24c93b5
e2e tests
previ Nov 1, 2022
74630af
e2e tests
previ Nov 1, 2022
c17707c
e2e tests
previ Nov 1, 2022
4831dcd
e2e tests
previ Nov 1, 2022
39b19e2
e2e tests
previ Nov 1, 2022
8c00577
disable circleci
previ Nov 1, 2022
7d3e2dd
fix activity loading
previ Nov 3, 2022
9a4be20
fix activity loading
previ Nov 3, 2022
89f1694
e2e tests
previ Nov 3, 2022
0b19e35
e2e tests
previ Nov 8, 2022
d465a06
e2e tests
previ Nov 9, 2022
225ff9d
e2e tests
previ Nov 9, 2022
d6de110
e2e tests
previ Nov 9, 2022
e0c2013
e2e tests
previ Nov 10, 2022
5ddbb37
e2e tests
previ Nov 10, 2022
83b8b16
e2e tests
previ Nov 10, 2022
3ea7517
Update build_frontend.yml
previ Nov 11, 2022
20aeda5
add coverage
previ Nov 11, 2022
b21e5be
add coverage
previ Nov 11, 2022
735d677
add coverage
previ Nov 11, 2022
7957b40
add coverage
previ Nov 11, 2022
e44b77d
add coverage
previ Nov 11, 2022
015954f
add coverage
previ Nov 12, 2022
8ab81b4
add coverage
previ Nov 12, 2022
33cbf34
add coverage
previ Nov 12, 2022
64f9295
add coverage
previ Nov 12, 2022
21cb156
Merge branch 'master' into cypress-e2e
previ Nov 12, 2022
5bf4fc5
Merge branch 'master' into cypress-e2e
previ Nov 12, 2022
d1e382b
e2e tests
previ Nov 12, 2022
6228e33
e2e tsts
previ Nov 12, 2022
7d926c8
e2e tests
previ Nov 12, 2022
5b80003
e2e tests
previ Nov 12, 2022
d15c2c2
e2e tests
previ Nov 13, 2022
df52957
e2e tests
previ Nov 13, 2022
b70158d
Merge branch 'master' into cypress-e2e
previ Nov 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions cypress/e2e/100_home.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
*/
})
46 changes: 43 additions & 3 deletions cypress/e2e/500_control.cy.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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')
})
})
48 changes: 40 additions & 8 deletions cypress/e2e/600_gallery.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
})
})
71 changes: 69 additions & 2 deletions cypress/e2e/700_settings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
*/
})
14 changes: 9 additions & 5 deletions src/common/coderbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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}`;
}

Expand Down
8 changes: 5 additions & 3 deletions src/components/BlocklyWorkspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
},
);
Expand Down
24 changes: 12 additions & 12 deletions src/components/Control.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@
<v-container class="d-flex align-center flex-column">
<v-row>
<v-col class="d-flex align-center flex-column">
<v-btn color="indigo" class="white--text jp-btn" v-on:mousedown="move(0)"
<v-btn color="indigo" class="white--text jp-btn up" v-on:mousedown="move(0)"
v-on:mouseup="stop()">
<v-icon icon="mdi-arrow-up"></v-icon>
</v-btn>
</v-col>
</v-row>
<v-row>
<v-col>
<v-btn color="indigo" class="white--text jp-btn" v-on:mousedown="move(1)"
<v-btn color="indigo" class="white--text jp-btn left" v-on:mousedown="move(1)"
v-on:mouseup="stop()">
<v-icon icon="mdi-arrow-left"></v-icon>
</v-btn>
</v-col>
<v-col>
<v-btn large color="indigo" class="white--text jp-btn" v-on:mousedown="move(2)"
<v-btn large color="indigo" class="white--text jp-btn right" v-on:mousedown="move(2)"
v-on:mouseup="stop()">
<v-icon icon="mdi-arrow-right"></v-icon>
</v-btn>
</v-col>
</v-row>
<v-row>
<v-col>
<v-btn color="indigo" class="white--text jp-btn" v-on:mousedown="move(3)"
<v-btn color="indigo" class="white--text jp-btn down" v-on:mousedown="move(3)"
v-on:mouseup="stop()">
<v-icon icon="mdi-arrow-down"></v-icon>
</v-btn>
Expand All @@ -50,7 +50,7 @@
</v-row>
<v-row>
<v-col>
<v-btn color="indigo" v-on:click="ttsdialog = true" class="controlBtn"
<v-btn color="indigo" v-on:click="ttsdialog = true" class="controlBtn speak"
:disabled="!ttsBtnEnabled">
{{ $t("message.control_speak") }}
<v-icon icon="mdi-bullhorn-variant"></v-icon>
Expand All @@ -59,7 +59,7 @@
</v-row>
<v-row>
<v-col class="d-flex align-center flex-column">
<v-btn color="indigo" class="controlBtn" v-on:click="takePhoto()"
<v-btn color="indigo" class="controlBtn photo" v-on:click="takePhoto()"
:disabled="!photoBtnEnabled">
{{ $t("message.control_photo_take") }}
<v-icon icon="mdi-camera"></v-icon>
Expand All @@ -68,7 +68,7 @@
</v-row>
<v-row>
<v-col class="d-flex align-center flex-column">
<v-btn color="indigo" class="controlBtn" v-on:click="videoHandler()"
<v-btn color="indigo" class="controlBtn video" v-on:click="videoHandler()"
:disabled="!videoBtn.enabled">
{{ videoBtn.text }}
<v-icon dark>mdi-{{ videoBtn.icon }}</v-icon>
Expand All @@ -77,7 +77,7 @@
</v-row>
<v-row>
<v-col class="d-flex align-center flex-column">
<v-btn color="indigo" class="controlBtn" to="/gallery">
<v-btn color="indigo" class="controlBtn gallery" to="/gallery">
{{ $t("message.control_photo_gallery") }}
<v-icon icon="mdi-image-multiple"></v-icon>
</v-btn>
Expand All @@ -94,18 +94,18 @@
{{ $t("message.close") }}
</v-btn>
</v-snackbar>
<v-dialog v-model="ttsdialog" width="600px">
<v-dialog v-model="ttsdialog" width="600px" id="dialog_control_speak_title">
<v-card>
<v-card-title>
<span class="headline">{{ $t("message.gallery_empty") }}</span>
<span class="headline">{{ $t("message.control_speak_title") }}</span>
</v-card-title>
<v-card-text>
<v-text-field v-model="ttstext" v-bind:label="$t('message.control_text_to_speech')" solo></v-text-field>
<v-text-field v-model="ttstext" v-bind:label="$t('message.control_text_to_speech')" solo id="control_text_to_speech"></v-text-field>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="gray darken-1" text="text" @click="ttsdialog=false">{{ $t("message.cancel") }}</v-btn>
<v-btn color="green darken-1" text="text" @click="say()">{{ $t("message.control_speak") }}</v-btn>
<v-btn color="green darken-1 ok" text="text" @click="say()">{{ $t("message.control_speak") }}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down
Loading