Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mirjanaKukic committed Oct 3, 2022
1 parent 135eb20 commit cdb4394
Showing 1 changed file with 7 additions and 24 deletions.
31 changes: 7 additions & 24 deletions test/e2e/tests/address-book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ describe('Address Book', function () {

await driver.clickElement({ text: 'Edit', tag: 'button' });
const inputUsername = await driver.findElement('#nickname');
await inputUsername.clear();
await inputUsername.fill('Test Name Edit');

const inputAddress = await driver.findElement('#address');
await inputAddress.clear();
await inputAddress.fill('0x74cE91B75935D6Bedc27eE002DeFa566c5946f74');

await driver.clickElement('[data-testid="page-container-footer-next"]');
Expand All @@ -170,7 +168,7 @@ describe('Address Book', function () {
},
);
});
it('Adds an entry to address book and deletes it from address book', async function () {
it('Deletes existing entry from address book', async function () {
await withFixtures(
{
fixtures: 'address-entry',
Expand All @@ -186,30 +184,15 @@ describe('Address Book', function () {
await driver.clickElement({ text: 'Settings', tag: 'div' });
await driver.clickElement({ text: 'Contacts', tag: 'div' });

const contacts = await driver.findElements(
'.send__select-recipient-wrapper__group-item',
);
assert.equal(contacts.length, 1);
// adding new account
await driver.clickElement({ text: 'Add contact', tag: 'button' });
const inputUsername = await driver.findElement('#nickname');
await inputUsername.clear();
await inputUsername.fill('Test Name 2');

const inputAddress = await driver.findElement(
'[data-testid="ens-input"]',
);
await inputAddress.clear();
await inputAddress.fill('0x74cE91B75935D6Bedc27eE002DeFa566c5946f74');
// had to put delay since Save button is always enabled and it need some delay to write in address in input field
await driver.delay(500);
await driver.clickElement('[data-testid="page-container-footer-next"]');

await driver.clickElement({ text: 'Test Name 2', tag: 'div' });
await driver.clickElement({ text: 'Test Name 1', tag: 'div' });
await driver.clickElement({ text: 'Edit', tag: 'button' });
await driver.clickElement({ text: 'Delete account', tag: 'a' });
// it checks if account is deleted
assert.equal(contacts.length, 1);
const contact = await driver.findElement(
'.send__select-recipient-wrapper__group-item',
);
const exists = await driver.isElementPresent(contact);
assert.equal(exists, false, 'Contact is not deleted');
},
);
});
Expand Down

0 comments on commit cdb4394

Please sign in to comment.