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: flag Confirmations tests as Smoke tests #7710

Merged
merged 16 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion e2e/fixtures/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import { DEFAULT_GANACHE_PORT } from '../../app/util/test/ganache';
import { DEFAULT_FIXTURE_SERVER_PORT } from './fixture-server';
import { DEFAULT_DAPP_SERVER_PORT } from './fixture-helper';

function transformToValidPort(defaultPort, pid) {
// Improve uniqueness by using a simple transformation
const transformedPort = (parseInt(pid, 10) % 100000) + defaultPort;

// Ensure the transformed port falls within the valid port range (0-65535)
return transformedPort % 65536;
}

function getServerPort(defaultPort) {
if (process.env.CI) {
return defaultPort + (parseInt(process.pid, 10) % 10);
return transformToValidPort(defaultPort, process.pid);
}
return defaultPort;
}
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/approve-default-erc20.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import FixtureBuilder from '../../fixtures/fixture-builder';
Expand All @@ -17,7 +17,7 @@ const HST_CONTRACT = SMART_CONTRACTS.HST;
const WEBVIEW_TEST_DAPP_APPROVE_TOKENS_BUTTON_ID = 'approveTokens';
const EXPECTED_TOKEN_AMOUNT = '7';

describe(Regression('ERC20 tokens'), () => {
describe(Smoke('ERC20 tokens'), () => {
beforeAll(async () => {
jest.setTimeout(170000);
if (device.getPlatform() === 'android') {
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/eth-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Eth Sign'), () => {
describe(Smoke('Eth Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/personal-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Personal Sign'), () => {
describe(Smoke('Personal Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-erc20-with-dapp.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import FixtureBuilder from '../../fixtures/fixture-builder';
Expand All @@ -16,7 +16,7 @@ const HST_CONTRACT = SMART_CONTRACTS.HST;
const SENT_TOKENS_MESSAGE_TEXT = root.transactions.sent_tokens;
const WEBVIEW_TEST_DAPP_TRANSFER_TOKENS_BUTTON_ID = 'transferTokens';

describe(Regression('ERC20 tokens'), () => {
describe(Smoke('ERC20 tokens'), () => {
beforeAll(async () => {
jest.setTimeout(170000);
await TestHelpers.reverseServerPort();
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-erc721.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';
import { loginToApp } from '../../viewHelper';
import TabBarComponent from '../../pages/TabBarComponent';
Expand All @@ -13,7 +13,7 @@ import {
import root from '../../../locales/languages/en.json';
import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';

describe(Regression('ERC721 tokens'), () => {
describe(Smoke('ERC721 tokens'), () => {
const NFT_CONTRACT = SMART_CONTRACTS.NFTS;
const SENT_COLLECTIBLE_MESSAGE_TEXT = root.transactions.sent_collectible;
const WEBVIEW_TEST_DAPP_TRANSFER_FROM_BUTTON_ID = 'transferFromButton';
Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/send-eth.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

import AmountView from '../../pages/AmountView';
Expand All @@ -17,7 +17,7 @@ import {
} from '../../fixtures/fixture-helper';
import { SMART_CONTRACTS } from '../../../app/util/test/smart-contracts';

describe(Regression('Send ETH'), () => {
describe(Smoke('Send ETH'), () => {
const TOKEN_NAME = root.unit.eth;
const AMOUNT = '0.12345';

Expand Down
4 changes: 2 additions & 2 deletions e2e/specs/confirmations/typed-sign.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {
withFixtures,
defaultGanacheOptions,
} from '../../fixtures/fixture-helper';
import { Regression } from '../../tags';
import { Smoke } from '../../tags';
import TestHelpers from '../../helpers';

const MAX_ATTEMPTS = 3;

describe(Regression('Typed Sign'), () => {
describe(Smoke('Typed Sign'), () => {
beforeAll(async () => {
jest.setTimeout(2500000);
await TestHelpers.reverseServerPort();
Expand Down