1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Move nft e2e tests to main e2e test job (#18055)

* NFTs: Remove feature flag for release

* Update security tab jest test

* Fix broken test

* Update snapshot

* Update test

* Fix test

* remove nft build

* move tests to main e2e job

* remove nft scripts

* remove test for nft build

---------

Co-authored-by: David Walsh <davidwalsh83@gmail.com>
This commit is contained in:
Peter 2023-03-14 15:21:24 +00:00 committed by GitHub
parent bfefa35811
commit 7215fc25a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 43 deletions

View File

@ -32,10 +32,8 @@
"test:unit:mocha": "node ./test/run-unit-tests.js --mocha", "test:unit:mocha": "node ./test/run-unit-tests.js --mocha",
"test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js", "test:e2e:chrome": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js",
"test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps", "test:e2e:chrome:snaps": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --snaps",
"test:e2e:chrome:nft": "SELENIUM_BROWSER=chrome node test/e2e/run-all.js --nft",
"test:e2e:firefox": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js", "test:e2e:firefox": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js",
"test:e2e:firefox:snaps": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js --snaps", "test:e2e:firefox:snaps": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js --snaps",
"test:e2e:firefox:nft": "SELENIUM_BROWSER=firefox node test/e2e/run-all.js --nft",
"test:e2e:single": "node test/e2e/run-e2e-test.js", "test:e2e:single": "node test/e2e/run-e2e-test.js",
"test:e2e:report": "node ./test/e2e/e2e-process-report.js && jrm ./test/test-results/e2e.xml \"./test/test-results/e2e/*.xml\"", "test:e2e:report": "node ./test/e2e/e2e-process-report.js && jrm ./test/test-results/e2e.xml \"./test/test-results/e2e/*.xml\"",
"test:coverage:mocha": "node ./test/run-unit-tests.js --mocha --coverage", "test:coverage:mocha": "node ./test/run-unit-tests.js --mocha --coverage",

View File

@ -1,33 +0,0 @@
const { strict: assert } = require('assert');
const { convertToHexValue, withFixtures } = require('../helpers');
const FixtureBuilder = require('../fixture-builder');
describe('NFT Feature Flag', function () {
const ganacheOptions = {
accounts: [
{
secretKey:
'0x7C9529A67102755B7E6102D6D950AC5D5863C98713805CEC576B945B15B71EAC',
balance: convertToHexValue(25000000000000000000),
},
],
};
it('should display the NFT tab', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
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);
const nftTab = await driver.findElement(
'[data-testid="home__nfts-tab"]',
);
assert.equal(await nftTab.isDisplayed(), true);
},
);
});
});

View File

@ -50,10 +50,6 @@ async function main() {
description: `run mv3 specific e2e tests`, description: `run mv3 specific e2e tests`,
type: 'boolean', type: 'boolean',
}) })
.option('nft', {
description: `run nft specific e2e tests`,
type: 'boolean',
})
.option('retries', { .option('retries', {
description: description:
'Set how many times the test should be retried upon failure.', 'Set how many times the test should be retried upon failure.',
@ -63,21 +59,19 @@ async function main() {
.strict() .strict()
.help('help'); .help('help');
const { browser, debug, retries, snaps, mv3, nft } = argv; const { browser, debug, retries, snaps, mv3 } = argv;
let testPaths; let testPaths;
if (snaps) { if (snaps) {
const testDir = path.join(__dirname, 'snaps'); const testDir = path.join(__dirname, 'snaps');
testPaths = await getTestPathsForTestDir(testDir); testPaths = await getTestPathsForTestDir(testDir);
} else if (nft) {
const testDir = path.join(__dirname, 'nft');
testPaths = await getTestPathsForTestDir(testDir);
} else { } else {
const testDir = path.join(__dirname, 'tests'); const testDir = path.join(__dirname, 'tests');
testPaths = [ testPaths = [
...(await getTestPathsForTestDir(testDir)), ...(await getTestPathsForTestDir(testDir)),
...(await getTestPathsForTestDir(path.join(__dirname, 'swaps'))), ...(await getTestPathsForTestDir(path.join(__dirname, 'swaps'))),
...(await getTestPathsForTestDir(path.join(__dirname, 'nft'))),
path.join(__dirname, 'metamask-ui.spec.js'), path.join(__dirname, 'metamask-ui.spec.js'),
]; ];