Skip to content

Commit

Permalink
feat: new end to end installation flow, closes #380
Browse files Browse the repository at this point in the history
Merge pull request #466 from vickywane/app-onboarding
  • Loading branch information
Ivelin Ivanov authored Jan 23, 2021
2 parents 042dbe6 + 56d71e9 commit 17175da
Show file tree
Hide file tree
Showing 19 changed files with 17,391 additions and 642 deletions.
17 changes: 4 additions & 13 deletions cypress/integration/ambianic-tests/actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,12 @@ context('Actions', () => {

it('looks inside welcome message', () => {
cy.get('#welcome-text')
.should('contain', 'home timeline')
.should('contain', "Let's setup your system" )
})

it('looks at settings button', () => {
let btn = cy.get('#btn-settings')
btn.should('have.attr', 'href', '/settings')
btn.get('.v-btn__content')
.contains('settings', { matchCase: false })
})

it('looks at timeline button', () => {

it('looks at welcome button', () => {
let btn = cy.get('#btn-timeline')
btn.should('have.attr', 'href', '/timeline')
btn.get('.v-btn__content')
.contains('view timeline', { matchCase: false })
.contains('Continue Setup', { matchCase: false })
})

})
19 changes: 3 additions & 16 deletions cypress/integration/ambianic-tests/home.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,13 @@ context('HomePage', () => {
})

it('Loads title and subtitle', () => {
cy.get('.v-list-item__title')
.should('contain.text', 'Cozy at Home')

cy.get('.v-list-item__subtitle')
.should('contain.text', 'via Ambient Intelligence')
.should('contain.text', 'Cozy at Home - via Ambient Intelligence')
})

it('Loads timeline button', () => {
it('Loads firsttime installation button', () => {
cy.get('#btn-timeline > .v-btn__content')
.should('contain.text', 'View Timeline')
.click()

cy.url().should('include', '/timeline')
})

it('Loads settings button', () => {
cy.get('#btn-settings > .v-btn__content')
.should('contain.text', 'Settings')
.should('contain.text', 'Continue Setup')
.click()

cy.url().should('include', '/settings')
})
})
42 changes: 42 additions & 0 deletions cypress/integration/ambianic-tests/onboarding.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/// <reference types="cypress" />

context("Onboarding", () => {
before(() => {
cy.visit("http://localhost:8080");
cy.get("[data-cy=timeline]").click();
});

it("Should have a splashscreen installation card", () => {
cy.get("[data-cy=installationCard]");
});

it("Should have a messaging option modal", () => {
cy.get("[data-cy=messaging-option-modal]");
});

it("Should have three installation steps", () => {
cy.get("[data-cy=stepper]").should("have.length", 3);
});

it("It executes first installation step and installs App", () => {
cy.get("[data-cy=install-app]").click();

cy.get("[data-cy=continue-installation]").click();
});

it("It confirms remote request message and request grant", () => {
cy.get("[data-cy=continue-step-2]").click();
cy.get("[data-cy=remote-button]").click();
cy.get("[data-cy=request-access]").click();

cy.get("[data-cy=send-message]").click();
cy.get("[data-cy=select-client]").click();
});

it("Should have PeerID input field and enabled Submit button after validation", () => {
cy.get('input[name="peerid-input"]').type(
"917d5f0a-6469-4d33-b5c2-efd858118b74"
);
cy.get("[data-cy=submit-button]").should("be.enabled");
});
});
4 changes: 2 additions & 2 deletions cypress/integration/ambianic-tests/remote-connection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

// NOTE: this test commented out because it depends on an external edge server
Expand All @@ -18,7 +18,7 @@ context('RemoteConnections', () => {
// })

it('Should switch to a remote Edge Peer ID', () => {
cy.get('#btn-settings').click()
// cy.get('#btn-settings').click()
cy.get('#remotePeerID').type('917d5f0a-6469-4d33-b5c2-efd858118b74')
cy.get('#btn-sendRemotePeerID').click()
cy.get('#edgePeerID').contains('917d5f0a-6469-4d33-b5c2-efd858118b74')
Expand Down
4 changes: 2 additions & 2 deletions cypress/integration/ambianic-tests/settings.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

context('Settings', () => {
before(() => {
cy.visit('http://localhost:8080')
cy.get('[data-cy=settings]').click()
cy.visit('http://localhost:8080/settings')
// cy.get('[data-cy=settings]').click()
})

it('Should have a title card', () => {
Expand Down
3 changes: 2 additions & 1 deletion cypress/integration/ambianic-tests/timeline.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
context('Timeline', () => {
before(() => {
cy.visit('http://localhost:8080')
cy.get('[data-cy=timeline]').click()
// cy.get('[data-cy=timeline]').click()
cy.visit("./timeline")
})

it('Should browse to timeline', () => {
Expand Down
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ module.exports = {
'.*\\.vue$': 'vue-jest'
},
collectCoverage: true,
coverageDirectory: "./coverage/jest/",
coverageReporters: ["json"],
coverageDirectory: './coverage/jest/',
coverageReporters: ['json'],
collectCoverageFrom: [
'<rootDir>/**/*.vue',
"../src/"
'../src/'
]
}
Loading

0 comments on commit 17175da

Please sign in to comment.