Skip to content

Commit

Permalink
Merge pull request #221 from multiversx/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
CiprianDraghici committed Apr 24, 2024
2 parents 50f65fc + f6e6594 commit 41a1dee
Show file tree
Hide file tree
Showing 6 changed files with 783 additions and 248 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"@multiversx/sdk-core": "13.0.0-beta.9",
"@multiversx/sdk-dapp": "2.31.0",
"@multiversx/sdk-core": "13.0.1",
"@multiversx/sdk-dapp": "2.31.6",
"@multiversx/sdk-network-providers": "2.2.1",
"axios": "1.6.5",
"classnames": "2.3.2",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/sdkDappCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export { SmartContract } from '@multiversx/sdk-core/out/smartcontracts/smartCont
export { AbiRegistry } from '@multiversx/sdk-core/out/smartcontracts/typesystem/abiRegistry';
export { SignableMessage } from '@multiversx/sdk-core/out/signableMessage';
export { AddressValue } from '@multiversx/sdk-core/out/smartcontracts/typesystem/address';
export { TokenTransfer } from '@multiversx/sdk-core/out/tokenTransfer';
export { TokenTransfer } from '@multiversx/sdk-core/out/tokens';
115 changes: 71 additions & 44 deletions wdio/test/specs/KeystoreScreen/Keystore.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
batchTransactions,
checkOpenTabs,
initTransaction,
login,
validateToast,
validateTransaction
Expand All @@ -12,25 +11,11 @@ import {
TransactionIndexEnum,
WalletAdressEnum
} from '../../utils/enums.ts';
import { pingPongHandler } from '../../utils/actions.ts';
import { pingPongHandler, accesDaap } from '../../utils/actions.ts';

describe('Sign with Keystore', () => {
describe('Ping & Pong ABI test', () => {
beforeEach(async () => {
await browser.url('https://integration.template-dapp.multiversx.com/');
await $(GlobalSelectorEnum.connectBtn).click();
});
afterEach(async () => {
await browser.reloadSession();
});

it('should sign ping&pong manual transaction', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress1
};
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.rawType);
await accesDaap();
});

it('should sign ping&pong ABI', async () => {
Expand All @@ -42,43 +27,64 @@ describe('Sign with Keystore', () => {
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.abiType);
});
});

it('should sign ping&pong Service', async () => {
describe('batch transactions', () => {
beforeEach(async () => {
await browser.url('https://integration.template-dapp.multiversx.com/');
await $(GlobalSelectorEnum.connectBtn).click();
});

it('should sign swap & lock transactions', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.serviceType);
await batchTransactions(GlobalSelectorEnum.swapLockType);
await validateToast(GlobalSelectorEnum.toastSelector);
await browser.pause(4500);
await validateTransaction(TransactionIndexEnum.swapLock);
});
});

it('should sign sign & batch ', async () => {
describe('Ping and Pong manual transaciton', () => {
before(async () => {
await accesDaap();
});

it('should sign ping&pong manual transaction', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
adress: WalletAdressEnum.adress1
};
await login(loginData);
await batchTransactions(GlobalSelectorEnum.signAndBatchType);
await validateToast(GlobalSelectorEnum.toastSelector);
await browser.pause(4500);
await validateTransaction(TransactionIndexEnum.signBatch);
await pingPongHandler(GlobalSelectorEnum.rawType);
});
});

it('should sign sign & batch controlled sending ', async () => {
describe('PEM', () => {
beforeEach(async () => {
await accesDaap();
});

it('should sign transaction with PEM', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
selector: GlobalSelectorEnum.pemBtn,
file: GlobalDataEnum.pemFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await batchTransactions(GlobalSelectorEnum.controlledSendingType);
await validateToast(GlobalSelectorEnum.toastSelector);
await browser.pause(4500);
await validateTransaction(TransactionIndexEnum.signBatch);
await pingPongHandler(GlobalSelectorEnum.abiType);
});
});

describe('Close the wallet test', () => {
beforeEach(async () => {
await accesDaap();
});
it('should close the wallet', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
Expand All @@ -96,34 +102,55 @@ describe('Sign with Keystore', () => {
}
await checkOpenTabs();
});
});

it('should sign transaction with PEM', async () => {
describe('Batch controoled sending', () => {
beforeEach(async () => {
await accesDaap();
});
it('should sign sign & batch controlled sending ', async () => {
const loginData = {
selector: GlobalSelectorEnum.pemBtn,
file: GlobalDataEnum.pemFile,
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.abiType);
await batchTransactions(GlobalSelectorEnum.controlledSendingType);
await validateToast(GlobalSelectorEnum.toastSelector);
await browser.pause(4500);
await validateTransaction(TransactionIndexEnum.signBatch);
});
});

describe('batch transactions', () => {
describe('Sign & Batch', () => {
beforeEach(async () => {
await browser.url('https://integration.template-dapp.multiversx.com/');
await $(GlobalSelectorEnum.connectBtn).click();
await accesDaap();
});

it('should sign swap & lock transactions', async () => {
it('should sign sign & batch ', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await batchTransactions(GlobalSelectorEnum.swapLockType);
await batchTransactions(GlobalSelectorEnum.signAndBatchType);
await validateToast(GlobalSelectorEnum.toastSelector);
await browser.pause(4500);
await validateTransaction(TransactionIndexEnum.swapLock);
await validateTransaction(TransactionIndexEnum.signBatch);
});
});

describe('Ping&Pong Service test', () => {
beforeEach(async () => {
await accesDaap();
});
it('should sign ping&pong Service', async () => {
const loginData = {
selector: GlobalSelectorEnum.keystoreBtn,
file: GlobalDataEnum.keystoreFile,
adress: WalletAdressEnum.adress3
};
await login(loginData);
await pingPongHandler(GlobalSelectorEnum.serviceType);
});
});
8 changes: 7 additions & 1 deletion wdio/test/utils/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function login(payload: {
await browser.pause(4500);
await browser.switchWindow(GlobalDataEnum.walletWindow);
await $(payload.selector).click();
await browser.pause(3500);
await browser.pause(3600);
await uploadFile(payload.file);
if (payload.selector === GlobalSelectorEnum.keystoreBtn) {
await confirmPass();
Expand Down Expand Up @@ -176,3 +176,9 @@ export const pingPongHandler = async (type: string) => {
await scTransaction(`btnPing${type}`);
}
};

export const accesDaap = async () => {
await browser.reloadSession();
await browser.url('https://integration.template-dapp.multiversx.com/');
await $(GlobalSelectorEnum.connectBtn).click();
};
2 changes: 1 addition & 1 deletion wdio/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const config: Options.Testrunner = {
exclude: [],

maxInstances: 4,
specFileRetries: 2,
specFileRetries: 1,
specFileRetriesDeferred: true,

capabilities: [
Expand Down
Loading

0 comments on commit 41a1dee

Please sign in to comment.