From eabbe9f037bf7cbfc84cfe839a2b669b06822eaf Mon Sep 17 00:00:00 2001 From: mirjanaKukic <94608179+mirjanaKukic@users.noreply.github.com> Date: Thu, 25 Aug 2022 16:48:13 +0200 Subject: [PATCH] add e2e test for default icons (#13869) --- test/e2e/tests/settings-general.spec.js | 58 +++++++++++++++++++++++++ test/e2e/tests/threebox.spec.js | 1 + 2 files changed, 59 insertions(+) create mode 100644 test/e2e/tests/settings-general.spec.js diff --git a/test/e2e/tests/settings-general.spec.js b/test/e2e/tests/settings-general.spec.js new file mode 100644 index 000000000..e264f3771 --- /dev/null +++ b/test/e2e/tests/settings-general.spec.js @@ -0,0 +1,58 @@ +const { strict: assert } = require('assert'); +const { convertToHexValue, withFixtures } = require('../helpers'); + +describe('Settings', function () { + const ganacheOptions = { + accounts: [ + { + secretKey: + '0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC', + balance: convertToHexValue(25000000000000000000), + }, + ], + }; + + it('checks jazzicon and blockies icons', async function () { + await withFixtures( + { + fixtures: 'imported-account', + ganacheOptions, + title: this.test.title, + }, + async ({ driver }) => { + await driver.navigate(); + await driver.fill('#password', 'correct horse battery staple'); + await driver.press('#password', driver.Key.ENTER); + + // goes to the settings screen + await driver.clickElement('.account-menu__icon'); + await driver.clickElement({ text: 'Settings', tag: 'div' }); + + // finds the jazzicon toggle turned on + await driver.findElement( + '[data-test-id="jazz_icon"] .settings-page__content-item__identicon__item__icon--active', + ); + + const jazziconText = await driver.findElement({ + tag: 'h6', + text: 'Jazzicons', + }); + assert.equal( + await jazziconText.getText(), + 'Jazzicons', + 'Text for icon should be Jazzicons', + ); + + const blockiesText = await driver.findElement({ + tag: 'h6', + text: 'Blockies', + }); + assert.equal( + await blockiesText.getText(), + 'Blockies', + 'Text for icon should be Blockies', + ); + }, + ); + }); +}); diff --git a/test/e2e/tests/threebox.spec.js b/test/e2e/tests/threebox.spec.js index d2e15ac70..162108e80 100644 --- a/test/e2e/tests/threebox.spec.js +++ b/test/e2e/tests/threebox.spec.js @@ -19,6 +19,7 @@ describe('Threebox', function () { after(async function () { await threeboxServer.stop(); }); + it('Set up data to be restored by 3box', async function () { await withFixtures( {