Skip to content
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
Merged
Show file tree
Hide file tree
Changes from 16 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 Jun 4, 2018
76a0bf6
[DDW-298] Adds node update notification feature descriptions
MarcusHurney Jun 4, 2018
2c1681c
[DDW-298] Adds node update notification acceptance tests
MarcusHurney Jun 4, 2018
6a53c07
[DDW-298] Mocks a node update via patchAdaApi.js and updates feature …
MarcusHurney Jun 5, 2018
08e4a46
[DDW-298] Fixes class names for UI element selectors in tests
MarcusHurney Jun 12, 2018
420ec52
[DDW-298] Implements steps and scenarios for node update notification
MarcusHurney Jun 13, 2018
92a95f9
[DDW-298] Adds final step describing window closing
MarcusHurney Jun 13, 2018
209f9a5
[DDW-298] Adds final step testing window is closed after accepting up…
MarcusHurney Jun 13, 2018
ae18fc2
[DDW-298] Removes package-lock.json to pull over develop branch version
MarcusHurney Jun 14, 2018
ac676bd
[DDW-298] Pulls in latest from develop branch
MarcusHurney Jun 14, 2018
bc4b04b
[DDW-298] Updates CHANGELOG.md
MarcusHurney Jun 14, 2018
4fba917
[DDW-298] Removes watch flag from feature file
MarcusHurney Jun 14, 2018
46886f1
[DDW-298] Improve CHANGELOG entry
nikolaglumac Jun 14, 2018
187c2ef
[DDW-298] Improves title of expected update version test
MarcusHurney Jun 14, 2018
34c47f5
[DDW-298] Uses the same constant for both tests involving expected up…
MarcusHurney Jun 14, 2018
21110f4
Merge branch 'chore/ddw-298-add-acceptance-tests-for-update-mechanism…
MarcusHurney Jun 14, 2018
b7a4f3e
[DDW-298] Merged latest develop and fixed conflicts
nikolaglumac Jun 14, 2018
8bf4197
[DDW-298] Implements electron before-quit method in node update accep…
MarcusHurney Jun 15, 2018
d5685b3
Merge branch 'chore/ddw-298-add-acceptance-tests-for-update-mechanism…
MarcusHurney Jun 15, 2018
36721ba
Merge branch 'develop' of github.com:input-output-hk/daedalus into ch…
MarcusHurney Jun 15, 2018
d2af3c2
[DDW-298] Adds preventAppQuit tag and associated After hook callback …
MarcusHurney Jun 15, 2018
3bd01d3
[DDW-298] Uses electron's app.quit method to execute kill-process
MarcusHurney Jun 16, 2018
8e88cd7
[DDW-298] Adds After hook and preventAppQuit tag for use after accept…
MarcusHurney Jun 16, 2018
15d34e5
[DDW-298] Fixes test checking that Daedalus window has closed after a…
MarcusHurney Jun 16, 2018
7494c95
Merge branch 'develop' into chore/ddw-298-add-acceptance-tests-for-up…
DominikGuzei Jun 20, 2018
c2a58e7
Merge branch 'develop' of github.com:input-output-hk/daedalus into ch…
MarcusHurney Jun 21, 2018
13d2089
[DDW-298] Changes app.quit back to process.exit in kill-process callback
MarcusHurney Jun 21, 2018
fa51b35
[DDW-298] Renames @preventAppQuit to @restartApp
MarcusHurney Jun 21, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Changelog
- Log expected errors as debug messages only ([PR 916](https://github.com/input-output-hk/daedalus/pull/916))
- Created hide show used addresses acceptance test ([PR 957](https://github.com/input-output-hk/daedalus/pull/957))
- Improved text display by reducing letter-spacing ([PR 973](https://github.com/input-output-hk/daedalus/pull/973))
- Added acceptance tests for node update notification with apply and postpone update scenarios ([PR 977](https://github.com/input-output-hk/daedalus/pull/977))

## 0.10.0
=======
Expand Down
24 changes: 24 additions & 0 deletions features/node-update-notification.feature
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 expected update 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
69 changes: 69 additions & 0 deletions features/step_definitions/node-update-notification-steps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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';

const UPDATE_VERSION = 50;

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: UPDATE_VERSION });
});

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 expected update version in the notification's title bar$/, async function () {
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: UPDATE_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);
});
Loading