View on GitHub
File Changes

                      
  Background:
    Given I have completed the basic setup
-
    And I have a "Test Wallet" wallet with funds
    And I have the following wallets:
      | name          |
-
      | Target Wallet |
+
      | Test Wallet |

                      
  Scenario: "Loading stake pools" message is shown during initial loading of stake pool data
    Given The sidebar shows "Delegation Center" staking page icon
    Then I should see loading stake pools error message
    And I should not see any stake pools

                      
+
  @watch
  Scenario: Stake pools are correctly ordered by rank
    Given The sidebar shows "Delegation Center" staking page icon
-
    When I click on the "Delegation Center" staking staking page button
+
    When I click on the "Delegation Center" staking page button
    And I see the "Delegation Center" staking page
    And I click on the "Stake Pools" tab
    And I see the "Stake Pools" page
-
    And I see the "Loading stake pools" message
-
    And Loading of stake pools was successful
-
    Then I should see stake pools ordered by rank
+
    #And I see the "Loading stake pools" message
+
    And I should see "3" stake pools loaded
+
    #Then I should see stake pools ordered by rank

                      
  Scenario: Stake pools search works as expected
    Given The sidebar shows "Delegation Center" staking page icon
    And I click on the "Stake Pools" tab
    And I see the "Stake Pools" page
    And I see the stake pools search input field
-
    And I execute search in the stake pool search input field
-
    And There are results of the search
-
    Then I should see filtered stake pools as results
+
    And I execute search in the stake pool search input field //@todo - search for xyz
+
    And There are results of the search //@todo - search for xyz
+
    Then I should see filtered stake pools as results //@todo - search for xyz

                      
  Scenario: Stake pools user is already delegating to are correctly displayed
    Given The sidebar shows "Delegation Center" staking page icon
// @flow
-
import { Given, When, Then } from 'cucumber';
-
import { expect } from 'chai';
-
import type { Daedalus } from '../../../types';
-
import { createWallets, restoreWalletWithFunds, waitUntilWalletIsLoaded, addOrSetWalletsForScenario, addWalletPage } from '../../../wallets/e2e/steps/helpers';
+
import {Given, When, Then} from 'cucumber';
+
import {expect} from 'chai';
+
import type {Daedalus} from '../../../types';

                      
declare var daedalus: Daedalus;

                      
-
Given(/^I have a "([^"]*)" wallet with funds$/, async function (walletName) {
-
  await restoreWalletWithFunds(this.client, {walletName});
-
  const wallet = await waitUntilWalletIsLoaded.call(this, walletName);
-
  addOrSetWalletsForScenario.call(this, wallet);
-
});
-

                      
-
Given(/^I have the following wallets:$/, async function (table) {
-
  await createWallets(table.hashes(), this);
-
});
-

                      
Given(/^The sidebar shows "Delegation Center" staking page icon/, function () {
  return this.client.waitForVisible('.SidebarCategory_stakingIcon');
});

                      
-
When(/^I click on the "Delegation Center" staking page button/, function() {
+
When(/^I click on the "Delegation Center" staking page button/, function () {
  return this.waitAndClick('.SidebarCategory_component.staking');
});

                      
-
Then(/^I see the "Delegation Center" staking page/, function() {
+
Then(/^I see the "Delegation Center" staking page/, function () {
  return this.client.waitForVisible('.StakingWithNavigation_page');
});

                      
-
When(/^I click on the "Stake Pools" tab/, function() {
+
When(/^I click on the "Stake Pools" tab/, function () {
  return this.waitAndClick('.stake-pools.NavButton_component.NavButton_normal');
});

                      
-
Then(/^I see the "Stake Pools" page/, function() {
+
Then(/^I see the "Stake Pools" page/, function () {
  return this.client.waitForVisible('.StakePools_component');
});
+

                      
+
Then(/^I should see "([^"]*)" stake pools loaded$/, async function (numberOfStakePools) {
+
  const stakePools = await this.client.executeAsync((done) => {
+
    daedalus.stores.staking.stakePoolsRequest
+
      .execute()
+
      .then(done)
+
      .catch(error => done(error));
+
  });
+
  // const stakePools2 = await this.client.execute(() => daedalus.stores.staking.stakePoolsRequest);
+
  const result = stakePools && stakePools.result ? stakePools.result : [];
+
  expect(result.length).to.equal(numberOfStakePools);
+
});