diff --git a/cypress/integration/ambianic-tests/about.spec.js b/cypress/integration/ambianic-tests/about.spec.js index 8b93369c..48218d5d 100644 --- a/cypress/integration/ambianic-tests/about.spec.js +++ b/cypress/integration/ambianic-tests/about.spec.js @@ -5,7 +5,6 @@ context('AboutPage', () => { }) it('Loads title and subtitle', () => { - cy.get('#about-title > .v-list-item__content > .v-list-item__title') .should('contain.text', 'Cozy at Home') @@ -31,5 +30,4 @@ context('AboutPage', () => { cy.get('#version-info > .v-list-item__content > .v-list-item__subtitle') .should('contain.text', 'Release Version') }) - }) diff --git a/cypress/integration/ambianic-tests/home.spec.js b/cypress/integration/ambianic-tests/home.spec.js index 10cd6d46..8c6cac14 100644 --- a/cypress/integration/ambianic-tests/home.spec.js +++ b/cypress/integration/ambianic-tests/home.spec.js @@ -1,17 +1,32 @@ /// +import {CHANGE_REMOTE_PEER_ID} from '../../../src/store/action-types'; + context('HomePage', () => { - beforeEach(() => { - cy.visit('/') - }) + beforeEach(() => { + cy.visit('/') + }) + + it('Loads title and subtitle', () => { + cy.get('.v-list-item__subtitle') + .should('contain.text', 'Cozy at Home - via Ambient Intelligence') + }) + + it('Loads firsttime installation button', () => { + cy.get('#btn-timeline > .v-btn__content') + .should('contain.text', 'Continue Setup') + .click() + }) + + 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 title and subtitle', () => { - cy.get('.v-list-item__subtitle') - .should('contain.text', 'Cozy at Home - via Ambient Intelligence') - }) + // reload to use new values for testing + cy.reload() - it('Loads firsttime installation button', () => { - cy.get('#btn-timeline > .v-btn__content') - .should('contain.text', 'Continue Setup') - .click() - }) + cy.url().should('include', '/timeline') + }) + }) }) diff --git a/cypress/integration/ambianic-tests/onboarding.spec.js b/cypress/integration/ambianic-tests/onboarding.spec.js index 4a69b105..2cc650d5 100644 --- a/cypress/integration/ambianic-tests/onboarding.spec.js +++ b/cypress/integration/ambianic-tests/onboarding.spec.js @@ -30,7 +30,7 @@ context("Onboarding", () => { cy.get("[data-cy=request-access]").click(); cy.get("[data-cy=send-message]").click(); - cy.get("[data-cy=select-client]").click(); + cy.get("[data-cy=select-client]").click(''); }); it("Should have PeerID input field and enabled Submit button after validation", () => { diff --git a/src/main.js b/src/main.js index 54e51ade..9c380f74 100644 --- a/src/main.js +++ b/src/main.js @@ -24,3 +24,7 @@ new Vue({ vuetify, render: h => h(App) }).$mount('#app') + +if (window.Cypress) { + window.__store__ = store +} diff --git a/src/views/Home.vue b/src/views/Home.vue index a15b6306..a04b3239 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -47,24 +47,6 @@ - -