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

test: Complete missing step for add a contact to the address book in existing E2E test #27959

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
50 changes: 50 additions & 0 deletions test/e2e/tests/settings/address-book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,56 @@ describe('Address Book', function () {
},
);
});

it('Adds a new contact to the address book', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
ganacheOptions: defaultGanacheOptions,
title: this.test.fullTitle(),
},
async ({ driver }) => {
await unlockWallet(driver);
await openMenuSafe(driver);

await driver.clickElement({ text: 'Settings', tag: 'div' });
await driver.clickElement({ text: 'Contacts', tag: 'div' });

await driver.clickElement('.address-book__link');

const inputUsername = await driver.findElement('#nickname');
await inputUsername.fill('Test User');
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved

const inputAddress = await driver.findElement(
'input[placeholder="Enter public address (0x) or domain name"]',
);
await inputAddress.fill('0x56A355d3427bC2B1E22c78197AF091230919Cc2A');
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved

await driver.clickElement('[data-testid="page-container-footer-next"]');

const recipientUsername = await driver.findElement({
text: 'Test User',
css: '.address-list-item__label',
});

assert.equal(
await recipientUsername.getText(),
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved
'Test User',
'Username is not added correctly',
);

const recipientAddress = await driver.findElement(
'[data-testid="address-list-item-address"]',
);
assert.equal(
await recipientAddress.getText(),
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved
benjisclowder marked this conversation as resolved.
Show resolved Hide resolved
shortenAddress('0x56A355d3427bC2B1E22c78197AF091230919Cc2A'),
'Recipient address is not added correctly',
);
},
);
});

it('Edit entry in address book', async function () {
await withFixtures(
{
Expand Down