Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienGllmt committed Jan 21, 2020
1 parent d603372 commit 25ee81c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion app/components/topbar/NavPlate.js
Expand Up @@ -82,13 +82,14 @@ export default class NavPlate extends Component<Props> {
break;
}

const fakeClassnameForTest = `${nameof(NavPlate)}_plate`;
return (
<div className={styles.wrapper}>
{iconComponent}
<div className={styles.content}>
<div className={styles.head}>
<h3 className={styles.name}>{walletName}</h3>
{accountPlateId}
<div className={fakeClassnameForTest}>{accountPlateId}</div>
</div>
<div className={styles.type}>
{TypeIcon !== undefined &&
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/common-steps.js
Expand Up @@ -145,7 +145,7 @@ Given(/^There is a wallet stored named ([^"]*)$/, async function (walletName) {
await this.click('.WalletRestoreDialog .primary');
await assertPlate(this, restoreInfo.plate);
await this.click('.confirmButton');
await this.waitUntilText('.WalletTopbarTitle_walletName', walletName.toUpperCase());
await this.waitUntilText('.NavPlate_name', walletName);
});

Given(/^I have completed the basic setup$/, async function () {
Expand Down
10 changes: 5 additions & 5 deletions features/step_definitions/main-ui-steps.js
Expand Up @@ -5,7 +5,7 @@ import { By } from 'selenium-webdriver';
import { expect } from 'chai';

Then(/^I should see the balance number "([^"]*)"$/, async function (number) {
await this.waitUntilText('.WalletTopbarTitle_walletAmount', number);
await this.waitUntilText('.NavWalletDetails_amount', number);
});

Then(/^I should see send transaction screen$/, async function () {
Expand All @@ -18,7 +18,7 @@ Then(/^I go to the transaction history screen$/, async function () {
});

When(/^I go to the main screen$/, async function () {
await this.click(`//header//button[1]`, By.xpath);
await this.click(`//div[@class='Sidebar_categories']//button[1]`, By.xpath);
});

Then(/^I should see the transactions screen$/, async function () {
Expand Down Expand Up @@ -51,10 +51,10 @@ Then(/^I should see the serverError banner$/, async function () {
});

Then(/^I click on hide balance button$/, async function () {
await this.click('.hideBalanceButton');
await this.click('.NavWalletDetails_toggleButton');
});

Then(/^I should see my balance hidden$/, async function () {
await this.waitForElement('.WalletTopbarTitle_hiddenWalletAmount');
await this.waitUntilContainsText('.WalletTopbarTitle_hiddenWalletAmount', '***');
await this.waitForElement('.NavWalletDetails_amount');
await this.waitUntilContainsText('.NavWalletDetails_amount', '***');
});
2 changes: 1 addition & 1 deletion features/step_definitions/settings-ui-steps.js
Expand Up @@ -76,7 +76,7 @@ Then(/^I should not see the change password dialog anymore$/, async function ()
});

Then(/^I should see new wallet name "([^"]*)"$/, async function (walletName) {
await this.waitUntilText('.WalletTopbarTitle_walletName', walletName.toUpperCase());
await this.waitUntilText('.NavPlate_name', walletName);
});

Then(/^I should see the following error messages:$/, async function (data) {
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/wallet-restoration-steps.js
Expand Up @@ -91,7 +91,7 @@ export async function assertPlate(customWorld: any, plate: string): Promise<void

// this makes this function also work for wallets that already exist
if (plateElement.length === 0) {
plateElement = await customWorld.driver.findElements(By.css('.WalletTopbarTitle_walletPlate'));
plateElement = await customWorld.driver.findElements(By.css('.NavPlate_plate'));
}
const plateText = await plateElement[0].getText();
expect(plateText).to.be.equal(plate);
Expand Down
8 changes: 4 additions & 4 deletions features/step_definitions/wallet-steps.js
@@ -1,6 +1,7 @@
// @flow

import { When, Then } from 'cucumber';
import { By } from 'selenium-webdriver';

When(/^I enter the name "([^"]*)"$/, async function (walletName) {
await this.input("input[name='walletName']", walletName);
Expand All @@ -11,11 +12,10 @@ When(/^I clear the name "([^"]*)"$/, async function (walletName) {
});

When(/^I navigate to wallet transactions screen$/, async function () {
await this.click('.TopBarCategory_component.wallets');
await this.waitForElement('.WalletTopbarTitle_walletName');
await this.click(`//div[@class='Sidebar_categories']//button[1]`, By.xpath);
await this.waitForElement('.NavPlate_name');
});

Then(/^I should see the opened wallet with name "([^"]*)"$/, async function (walletName) {
const walletNameFormatted = walletName.toUpperCase();
await this.waitUntilText('.WalletTopbarTitle_walletName', walletNameFormatted);
await this.waitUntilText('.NavPlate_name', walletName);
});

0 comments on commit 25ee81c

Please sign in to comment.