Skip to content

Commit

Permalink
fix: Added E2E test
Browse files Browse the repository at this point in the history
Added an E2E test for checking current flow on
changing to remote Edge works
  • Loading branch information
BKristenssonAlfsson committed May 26, 2020
1 parent c4d27a0 commit de1d8e3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions cypress/integration/ambianic-tests/remote-connection.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* This test will only work while the EC2 machines are running.
*/

/// <reference types="cypress" />

context('RemoteConnections', () => {
beforeEach(() => {
cy.visit('http://18.219.76.94')
})

it('Should be connected automatically', () => {

cy.get('#btn-settings').click()

cy.wait(6000)

cy.get('#peerID').should('contain-text', '5568ec87-42d8-47b0-aeea-01a125db0623')
})

it('Should switch to a remote Edge', () => {

cy.get('#btn-settings').click()

cy.wait(6000)

cy.get('input[name="remotePeerID"]').invoke('8a9f5dbe-d8ee-4883-8ed6-8067ca2f1f39')

cy.get('#sendRemotePeerID').click()

cy.get('#peerID').should('contain-text', '8a9f5dbe-d8ee-4883-8ed6-8067ca2f1f39')
})
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test": "npx cypress run",
"codecov": "codecov -f coverage/coverage-final.json"
"codecov": "codecov -f coverage/coverage-final.json",
"e2e": "cypress open"
},
"funding": {
"type": "github",
Expand Down
3 changes: 3 additions & 0 deletions src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
:title="edgePeerId"
subtitle="Peer ID"
icon-name="identifier"
id="peerID"
/>
<amb-list-item
:title="version"
Expand Down Expand Up @@ -202,6 +203,7 @@
type="text"
label="Peer ID to Ambianic Network*"
placeholder="Enter Peer ID"
id="remotePeerID"
outlined
dense
class="mt-4"
Expand All @@ -213,6 +215,7 @@
:disabled="!correctEdgeAddress"
@click="sendEdgeAddress"
color="primary"
id="btn-sendRemotePeerID"
>
REMOTE NETWORK
</v-btn>
Expand Down

0 comments on commit de1d8e3

Please sign in to comment.