-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: convenient copy paste button for edge device ID
- Loading branch information
Showing
37 changed files
with
471 additions
and
2,312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"plugin:cypress/recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,34 @@ | ||
/// <reference types="cypress" /> | ||
import {CHANGE_REMOTE_PEER_ID} from '../../../src/store/action-types'; | ||
import { CHANGE_REMOTE_PEER_ID } from '../../../src/store/action-types'; | ||
|
||
context('HomePage', () => { | ||
beforeEach(() => { | ||
cy.visit('/') | ||
}) | ||
|
||
it('Loads title and subtitle', () => { | ||
cy.get('.v-list-item__subtitle') | ||
.should('contain.text', 'Safer Home via Ambient Intelligence') | ||
}) | ||
beforeEach(() => { | ||
cy.visit('/') | ||
}) | ||
|
||
it('Loads firsttime installation button', () => { | ||
cy.get('#btn-setup > .v-btn__content') | ||
.should('contain.text', 'Begin Setup') | ||
.click() | ||
.url().should('include', '/onboarding') | ||
}) | ||
it('Loads title and subtitle', () => { | ||
cy.get('.v-list-item__subtitle') | ||
.should('contain.text', 'Safer Home via Ambient Intelligence') | ||
}) | ||
|
||
it('Ensures returning users are taken directly to timeline', () => { | ||
cy.window().should('have.property', '__store__') | ||
cy.window().then(win => { | ||
win.__store__.dispatch(CHANGE_REMOTE_PEER_ID, '917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
cy.wait(1000) | ||
it('Loads firsttime installation button', () => { | ||
cy.get('#btn-setup > .v-btn__content') | ||
.should('contain.text', 'Begin Setup') | ||
.click() | ||
.url().should('include', '/onboarding') | ||
}) | ||
|
||
// reload to use new values for testing | ||
cy.reload() | ||
cy.get('#btn-dashboard > .v-btn__content') | ||
.should('contain.text', 'View Timeline') | ||
.click() | ||
.url().should('include', '/timeline') | ||
}) | ||
it('Ensures returning users are taken directly to timeline', () => { | ||
cy.window().should('have.property', '__store__') | ||
cy.window().then((win) => { | ||
win.__store__.dispatch(CHANGE_REMOTE_PEER_ID, '917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
// cy.wait(1000) | ||
// reload to use new values for testing | ||
// cy.reload() | ||
cy.get('#btn-dashboard > .v-btn__content') | ||
.should('contain.text', 'View Timeline') | ||
.click() | ||
.url().should('include', '/timeline') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,86 @@ | ||
/// <reference types="cypress" /> | ||
import { NEW_REMOTE_PEER_ID, REMOTE_PEER_ID_REMOVED } from '../../../src/store/mutation-types' | ||
|
||
context('Settings', () => { | ||
before(() => { | ||
cy.visit('http://localhost:8080/settings') | ||
// cy.get('[data-cy=settings]').click() | ||
}) | ||
before(() => { | ||
cy.visit('http://localhost:8080/settings') | ||
// cy.get('[data-cy=settings]').click() | ||
}) | ||
|
||
it('Should have a title card', () => { | ||
cy.get('[data-cy=titlecard]').contains('Ambianic Edge connection details') | ||
afterEach(() => { | ||
cy.window().then(win => { | ||
// restore Vuex store state | ||
win.__store__.commit(REMOTE_PEER_ID_REMOVED) | ||
}) | ||
}) | ||
|
||
it('Should have a local ambianic edge title card', () => { | ||
cy.get('[data-cy=localtitlecard]').contains('Pair with local Ambianic Edge device') | ||
}) | ||
it('Should have a title card', () => { | ||
cy.get('[data-cy=titlecard]').contains('Ambianic Edge connection details') | ||
}) | ||
|
||
it('Should have a remote ambianic edge title card', () => { | ||
cy.get('[data-cy=remotetitlecard]').contains('Pair with remote Ambianic Edge device') | ||
}) | ||
it('Should have a local ambianic edge title card', () => { | ||
cy.get('[data-cy=localtitlecard]').contains('Pair with local Ambianic Edge device') | ||
}) | ||
|
||
it('Should have a remote ambianic edge title card', () => { | ||
cy.get('[data-cy=remotetitlecard]').contains('Pair with remote Ambianic Edge device') | ||
}) | ||
|
||
it('Should have remote connection button disabled', () => { | ||
cy.get('[data-cy=sendRemotePeerID]').should('be.disabled') | ||
}) | ||
|
||
it('Should have remote connection button enabled', () => { | ||
cy.get('[data-cy=remotePeerID]').type('917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
cy.get('[data-cy=sendRemotePeerID]').should('be.enabled') | ||
}) | ||
|
||
it('Should have a row', () => { | ||
cy.get('[data-cy=template-row]').should('exist') | ||
}) | ||
|
||
it('Should have remote connection button disabled', () => { | ||
cy.get('[data-cy=sendRemotePeerID]').should('be.disabled') | ||
it('Should display edge device peer ID', () => { | ||
var edgePeerId = '917d5f0a-6469-4d33-b5c2-efd858118b74' | ||
cy.window().then(win => { | ||
cy.get('[data-cy=list-item-edgePeerID]').should('not.exist') | ||
win.__store__.commit(NEW_REMOTE_PEER_ID, edgePeerId) | ||
cy.get('[data-cy=list-item-edgePeerID]').should('exist').within(($listItem) => { | ||
cy.get('[data-cy=input-title]').get('input').should('have.value', edgePeerId) | ||
}) | ||
}) | ||
}) | ||
|
||
it('Should have remote connection button enabled', () => { | ||
cy.get('[data-cy=remotePeerID]').type('917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
cy.get('[data-cy=sendRemotePeerID]').should('be.enabled') | ||
it('Should display sensitive text eye icon next to peer edge ID', () => { | ||
cy.window().then(win => { | ||
cy.get('[data-cy=icon-sensitive-on]').should('not.exist') | ||
win.__store__.commit(NEW_REMOTE_PEER_ID, '917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
// tooltip should not be shown without focus on the icon | ||
cy.contains('Show/Hide cleartext').should('not.exist') | ||
cy.get('[data-cy=list-item-edgePeerID]').should('exist').within(($listItem) => { | ||
cy.get('[data-cy=icon-sensitive-on]') | ||
.should('exist') | ||
// focus on the icon to check if a tooltip is shown | ||
.focus() | ||
}) | ||
// check if tooltip is shown for the eye icon | ||
cy.contains('Show/Hide cleartext') | ||
}) | ||
}) | ||
|
||
it('Should have a row', () => { | ||
cy.get('[data-cy=template-row]').should('exist') | ||
it('Should display copy paste icon next to peer edge ID', () => { | ||
cy.window().then(win => { | ||
cy.get('[data-cy=icon-copy-on]').should('not.exist') | ||
win.__store__.commit(NEW_REMOTE_PEER_ID, '917d5f0a-6469-4d33-b5c2-efd858118b74') | ||
// tooltip should not be shown without focus on the icon | ||
cy.contains('Copy to clipboard').should('not.exist') | ||
cy.get('[data-cy=list-item-edgePeerID]').should('exist').within(($listItem) => { | ||
cy.get('[data-cy=icon-copy-on]') | ||
.should('exist') | ||
// focus on the icon to check if a tooltip is shown | ||
.focus() | ||
}) | ||
// check if tooltip is shown for the eye icon | ||
cy.contains('Copy to clipboard') | ||
}) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.