-
Notifications
You must be signed in to change notification settings - Fork 296
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
[DDW-298] Add acceptance tests for update mechanism #977
Merged
nikolaglumac
merged 28 commits into
develop
from
chore/ddw-298-add-acceptance-tests-for-update-mechanism
Jun 21, 2018
Merged
Changes from 12 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
d2f222c
[DDW-298] Adds mock for nextAdaUpdate api call
MarcusHurney 76a0bf6
[DDW-298] Adds node update notification feature descriptions
MarcusHurney 2c1681c
[DDW-298] Adds node update notification acceptance tests
MarcusHurney 6a53c07
[DDW-298] Mocks a node update via patchAdaApi.js and updates feature …
MarcusHurney 08e4a46
[DDW-298] Fixes class names for UI element selectors in tests
MarcusHurney 420ec52
[DDW-298] Implements steps and scenarios for node update notification
MarcusHurney 92a95f9
[DDW-298] Adds final step describing window closing
MarcusHurney 209f9a5
[DDW-298] Adds final step testing window is closed after accepting up…
MarcusHurney ae18fc2
[DDW-298] Removes package-lock.json to pull over develop branch version
MarcusHurney ac676bd
[DDW-298] Pulls in latest from develop branch
MarcusHurney bc4b04b
[DDW-298] Updates CHANGELOG.md
MarcusHurney 4fba917
[DDW-298] Removes watch flag from feature file
MarcusHurney 46886f1
[DDW-298] Improve CHANGELOG entry
nikolaglumac 187c2ef
[DDW-298] Improves title of expected update version test
MarcusHurney 34c47f5
[DDW-298] Uses the same constant for both tests involving expected up…
MarcusHurney 21110f4
Merge branch 'chore/ddw-298-add-acceptance-tests-for-update-mechanism…
MarcusHurney b7a4f3e
[DDW-298] Merged latest develop and fixed conflicts
nikolaglumac 8bf4197
[DDW-298] Implements electron before-quit method in node update accep…
MarcusHurney d5685b3
Merge branch 'chore/ddw-298-add-acceptance-tests-for-update-mechanism…
MarcusHurney 36721ba
Merge branch 'develop' of github.com:input-output-hk/daedalus into ch…
MarcusHurney d2af3c2
[DDW-298] Adds preventAppQuit tag and associated After hook callback …
MarcusHurney 3bd01d3
[DDW-298] Uses electron's app.quit method to execute kill-process
MarcusHurney 8e88cd7
[DDW-298] Adds After hook and preventAppQuit tag for use after accept…
MarcusHurney 15d34e5
[DDW-298] Fixes test checking that Daedalus window has closed after a…
MarcusHurney 7494c95
Merge branch 'develop' into chore/ddw-298-add-acceptance-tests-for-up…
DominikGuzei c2a58e7
Merge branch 'develop' of github.com:input-output-hk/daedalus into ch…
MarcusHurney 13d2089
[DDW-298] Changes app.quit back to process.exit in kill-process callback
MarcusHurney fa51b35
[DDW-298] Renames @preventAppQuit to @restartApp
MarcusHurney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,24 @@ | ||
Feature: Node Update Notification | ||
|
||
Background: | ||
Given I have completed the basic setup | ||
And I have the following wallets: | ||
| name | | ||
| Test wallet | | ||
When I am on the "Test wallet" wallet "summary" screen | ||
When I make a node update available | ||
Then I should see the node update notification component | ||
Then I should see the notification's title bar | ||
Then I should see the correct version in the notification's title bar | ||
Then I should see the notification's toggle button | ||
Then I should see the notification's update message | ||
Then I should see the notification's accept button | ||
Then I should see the notification's postpone button | ||
|
||
Scenario: User postpones a node update notification | ||
When I click the notification's postpone button | ||
Then I should not see the notification component anymore | ||
|
||
Scenario: User accepts a node update notification | ||
When I click the notification's accept button | ||
Then I should see the Daedalus window closed |
68 changes: 68 additions & 0 deletions
68
features/step_definitions/node-update-notification-steps.js
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,68 @@ | ||
import { When, Then } from 'cucumber'; | ||
import { expect } from 'chai'; | ||
|
||
const NODE_UPDATE_COMPONENT = '.NodeUpdateNotification_component'; | ||
const TITLE_BAR = '.NodeUpdateNotification_titleBar'; | ||
const TOGGLE_BUTTON = '.NodeUpdateNotification_toggleButton'; | ||
const UPDATE_MESSAGE = '.NodeUpdateNotification_message'; | ||
const ACTIONS = '.NodeUpdateNotification_actions'; | ||
const ACCEPT_BTN = '.NodeUpdateNotification_acceptButton'; | ||
const DENY_BTN = '.NodeUpdateNotification_denyButton'; | ||
|
||
When(/^I make a node update available$/, async function () { | ||
await this.client.executeAsync((nextVersion, done) => { | ||
daedalus.api.ada.setNextUpdate(nextVersion) | ||
.then(() => daedalus.stores.NodeUpdateStore.refreshNextUpdate()) | ||
.then(done) | ||
.catch((error) => done(error)); | ||
}, { version: 50 }); | ||
}); | ||
|
||
Then(/^I should see the node update notification component$/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT}`); | ||
}); | ||
|
||
Then(/^I should see the notification's title bar$/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT} ${TITLE_BAR}`); | ||
}); | ||
|
||
Then(/^I should see the correct version in the notification's title bar$/, async function () { | ||
const version = 50; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MarcusHurney this is actually expected version - please use the constant like described in https://github.com/input-output-hk/daedalus/pull/977/files#r195338177 |
||
const titleBarSelector = `${NODE_UPDATE_COMPONENT} ${TITLE_BAR}`; | ||
await this.client.waitForText(titleBarSelector); | ||
const versionText = await this.client.getText(titleBarSelector); | ||
const expectedVersionText = await this.intl('cardano.node.update.notification.titleWithVersion', { version }); | ||
expect(versionText).to.equal(expectedVersionText); | ||
}); | ||
|
||
Then(/^I should see the notification's toggle button$/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT} ${TITLE_BAR} ${TOGGLE_BUTTON}`); | ||
}); | ||
|
||
Then(/^I should see the notification's update message$/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT} ${UPDATE_MESSAGE}`); | ||
}); | ||
|
||
Then(/^I should see the notification's accept button/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT} ${ACTIONS} ${ACCEPT_BTN}`); | ||
}); | ||
|
||
Then(/^I should see the notification's postpone button$/, async function () { | ||
await this.client.waitForVisible(`${NODE_UPDATE_COMPONENT} ${ACTIONS} ${DENY_BTN}`); | ||
}); | ||
|
||
When(/^I click the notification's postpone button$/, async function () { | ||
await this.waitAndClick(`${NODE_UPDATE_COMPONENT} ${ACTIONS} ${DENY_BTN}`); | ||
}); | ||
|
||
When(/^I click the notification's accept button$/, async function () { | ||
await this.waitAndClick(`${NODE_UPDATE_COMPONENT} ${ACTIONS} ${ACCEPT_BTN}`); | ||
}); | ||
|
||
Then(/^I should not see the notification component anymore$/, async function () { | ||
await this.client.waitForVisible(NODE_UPDATE_COMPONENT, null, true); | ||
}); | ||
|
||
Then(/^I should see the Daedalus window closed$/, () => { | ||
expect(this).to.equal(undefined); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarcusHurney please extract this version value to a constant which we can use in later steps where you check if the version shown in the notification matches this expected one.